public boolean start(ApplicationContext context, ProgressTracker tracker) throws Exception { if (appCtr==null) { // the container does not care to be started or stopped return true; } if (!appCtr.start(context)) { return false; } tracker.add("started", EngineRef.class, this); return true; }
/** * Stops a module, meaning that components implemented by this module should not be accessed * by external modules * * @param context stopping context * @return */ public boolean stop(ApplicationContext context) { return appCtr.stop(context); }
public boolean resume(Logger logger) { boolean isSuccess = true; for (EngineRef module : _getEngineRefs()) { try { module.getApplicationContainer().resume(); } catch(Exception e) { isSuccess = false; logger.log(Level.SEVERE, "Error resuming module " + module.getContainerInfo().getSniffer().getModuleType(),e ); } } return isSuccess; }
public boolean suspend(Logger logger) { boolean isSuccess = true; for (EngineRef engine : reversedEngines) { try { engine.getApplicationContainer().suspend(); } catch(Exception e) { isSuccess = false; logger.log(Level.SEVERE, "Error suspending module " + engine.getContainerInfo().getSniffer().getModuleType(),e ); } } return isSuccess; }
public void unload(ExtendedDeploymentContext context) { Logger logger = context.getLogger(); ClassLoader currentClassLoader = Thread.currentThread().getContextClassLoader(); try { Thread.currentThread().setContextClassLoader(moduleClassLoader); for (EngineRef engine : reversedEngines) { if (engine.getApplicationContainer()!=null && engine.getApplicationContainer().getClassLoader()!=null) { classLoaders.add(engine.getApplicationContainer().getClassLoader()); try { context.setClassLoader(moduleClassLoader); engine.unload(context); } catch(Throwable e) { logger.log(Level.SEVERE, "Failed to unload from container type : " + engine.getContainerInfo().getSniffer().getModuleType(), e); } } } // add the module classloader to the predestroy list if it's not // already there if (classLoaders != null && moduleClassLoader != null) { classLoaders.add(moduleClassLoader); } if (events!=null) { events.send(new Event<ModuleInfo>(Deployment.MODULE_UNLOADED, this), false); } } finally { Thread.currentThread().setContextClassLoader(currentClassLoader); context.setClassLoader(null); } }
public boolean resume(Logger logger) { boolean isSuccess = true; for (EngineRef module : _getEngineRefs()) { try { module.getApplicationContainer().resume(); } catch(Exception e) { isSuccess = false; logger.log(Level.SEVERE, "Error resuming module " + module.getContainerInfo().getSniffer().getModuleType(),e ); } } return isSuccess; }
public boolean suspend(Logger logger) { boolean isSuccess = true; for (EngineRef engine : _getEngineRefs()) { try { engine.getApplicationContainer().suspend(); } catch(Exception e) { isSuccess = false; logger.log(Level.SEVERE, "Error suspending module " + engine.getContainerInfo().getSniffer().getModuleType(),e ); } } return isSuccess; }
public void unload(ExtendedDeploymentContext context) { Logger logger = context.getLogger(); ClassLoader currentClassLoader = Thread.currentThread().getContextClassLoader(); try { Thread.currentThread().setContextClassLoader(moduleClassLoader); for (EngineRef engine : _getEngineRefs()) { if (engine.getApplicationContainer()!=null && engine.getApplicationContainer().getClassLoader()!=null) { classLoaders.add(engine.getApplicationContainer().getClassLoader()); try { context.setClassLoader(moduleClassLoader); engine.unload(context); } catch(Throwable e) { logger.log(Level.SEVERE, "Failed to unload from container type : " + engine.getContainerInfo().getSniffer().getModuleType(), e); } } } // add the module classloader to the predestroy list if it's not // already there if (classLoaders != null && moduleClassLoader != null) { classLoaders.add(moduleClassLoader); } if (events!=null) { events.send(new Event<ModuleInfo>(Deployment.MODULE_UNLOADED, this), false); } } finally { Thread.currentThread().setContextClassLoader(currentClassLoader); context.setClassLoader(null); } }
/** * Stops a module, meaning that components implemented by this module should not be accessed * by external modules * * @param context stopping context * @return */ public boolean stop(ApplicationContext context) { return appCtr.stop(context); }
public boolean start(ApplicationContext context, ProgressTracker tracker) throws Exception { if (appCtr==null) { // the container does not care to be started or stopped return true; } if (!appCtr.start(context)) { return false; } tracker.add("started", EngineRef.class, this); return true; }