Changeset 2534


Ignore:
Timestamp:
Jun 30, 2014, 9:07:21 AM (7 years ago)
Author:
Nicklas Nordborg
Message:

References #533 and BASE ticket http://base.thep.lu.se/ticket/1824. Call Services.restart() so that the BASE core can catch any exceptions.

Location:
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/grid
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/grid/OpenGridService.java

    r2359 r2534  
    1515import org.slf4j.LoggerFactory;
    1616
     17import net.sf.basedb.clients.web.extensions.service.Services;
    1718import net.sf.basedb.core.Application;
    1819import net.sf.basedb.core.ConfigurationException;
     
    2223import net.sf.basedb.core.User;
    2324import net.sf.basedb.util.XMLUtil;
     25import net.sf.basedb.util.extensions.Extension;
    2426
    2527/**
     
    6567  }
    6668
    67   static final OpenGridService getInstance(SessionControl sc)
     69  static final OpenGridService getInstance(SessionControl sc, Extension ext)
    6870  {
    6971    OpenGridService srv = getInstance();
    7072    srv.sc = sc;
     73    srv.ext = ext;
    7174    return srv;
    7275  }
     
    7477  private volatile boolean isRunning;
    7578  private SessionControl sc;
     79  private Extension ext;
    7680  private Map<String, OpenGridCluster> clusters;
    7781  private TimerTask jobStatusTimer;
     
    137141  public synchronized void restart()
    138142  {
    139     stop();
    140     start();
     143    Services.restart(ext);
    141144  }
    142145 
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/grid/OpenGridServiceFactory.java

    r2309 r2534  
    44import net.sf.basedb.core.SessionControl;
    55import net.sf.basedb.util.extensions.ActionFactory;
     6import net.sf.basedb.util.extensions.Extension;
    67import net.sf.basedb.util.extensions.InvokationContext;
    78
     
    3637  {
    3738    SessionControl sc = context.getClientContext().getSessionControl();
    38     return new ServiceControllerAction[] { new OpenGridServiceControllerAction(sc) };
     39    return new ServiceControllerAction[] { new OpenGridServiceControllerAction(sc, context.getExtension()) };
    3940  }
    4041  // ---------------------------------------------
     
    4445  {
    4546    private final SessionControl sc;
     47    private final Extension ext;
    4648   
    47     OpenGridServiceControllerAction(SessionControl sc)
     49    OpenGridServiceControllerAction(SessionControl sc, Extension ext)
    4850    {
    4951      this.sc = sc;
     52      this.ext = ext;
    5053    }
    5154   
     
    6366    public void start()
    6467    {
    65       OpenGridService.getInstance(sc).start();
     68      OpenGridService.getInstance(sc, ext).start();
    6669    }
    6770 
Note: See TracChangeset for help on using the changeset viewer.