@Override public String getName() { return (getComponent() != null) ? "Stop " + getComponent().getComponentName() : "Stop"; }
/** * Stop management implementations. * * @param monitor * @throws SiteWhereException */ protected void stopManagementImplementations(ICompositeLifecycleStep stop) throws SiteWhereException { // Stop tenant management implementation. stop.addStep(new StopComponentLifecycleStep(this, getTenantManagement(), "Stopped tenant management")); // Stop user management implementation. stop.addStep(new StopComponentLifecycleStep(this, getUserManagement(), "Stopped user management")); }
/** * Stop tenant services. * * @param stop * @throws SiteWhereException */ protected void stopTenantServices(ICompositeLifecycleStep stop) throws SiteWhereException { // Stop scheduling new jobs. stop.addStep(new StopComponentLifecycleStep(this, getScheduleManager(), "Stopped schedule manager")); // Disable device communications. stop.addStep(new StopComponentLifecycleStep(this, getDeviceCommunication(), "Stopped device communication subsystem")); stop.addStep(new StopComponentLifecycleStep(this, getEventProcessing(), "Stopped event processing subsystem")); // Stop search provider manager. stop.addStep( new StopComponentLifecycleStep(this, getSearchProviderManager(), "Stopped search provider manager")); // Stop asset module manager. stop.addStep(new StopComponentLifecycleStep(this, getAssetModuleManager(), "Stopped asset module manager")); // Stop the Groovy configuration. stop.addStep(new StopComponentLifecycleStep(this, getGroovyConfiguration(), "Stopped Groovy engine")); }
@Override public void addStopStep(ILifecycleComponent owner, ILifecycleComponent component) { if (component != null) { addStep(new StopComponentLifecycleStep(owner, component)); } else { owner.getLogger().warn("Skipping 'stop' step for null component."); } }
@Override public void execute(ILifecycleProgressMonitor monitor) throws SiteWhereException { if (getComponent() != null) { getComponent().lifecycleStop(monitor); } } }
/** * Stop base server services. * * @param stop * @throws SiteWhereException */ protected void stopBaseServices(ICompositeLifecycleStep stop) throws SiteWhereException { // Stop all lifecycle components. for (ILifecycleComponent component : getRegisteredLifecycleComponents()) { stop.addStep(new StopComponentLifecycleStep(this, component, "Stopped " + component.getComponentName())); } // Stop the tenant template manager. stop.addStep( new StopComponentLifecycleStep(this, getTenantTemplateManager(), "Stopped tenant template manager")); // Stop the Groovy configuration. stop.addStep(new StopComponentLifecycleStep(this, getGroovyConfiguration(), "Stopped Groovy script engine")); }
@Override public void execute(ILifecycleProgressMonitor monitor) throws SiteWhereException { if (getComponent() != null) { try { getComponent().lifecycleStop(monitor); } catch (Throwable t) { throw new SiteWhereException("Unhandled exception shutting down component.", t); } } } }
/** * Stop tenant management services. * * @param stop * @throws SiteWhereException */ protected void stopManagementServices(ICompositeLifecycleStep stop) throws SiteWhereException { // Stop schedule management. stop.addStep(new StopComponentLifecycleStep(this, getScheduleManagement(), "Stopped schedule management implementation")); // Stop device event management. stop.addStep(new StopComponentLifecycleStep(this, getDeviceEventManagement(), "Stopped device event management implementation")); // Stop device management. stop.addStep(new StopComponentLifecycleStep(this, getDeviceManagement(), "Stopped device management implementation")); // Stop device management cache provider if configured. stop.addStep(new StopComponentLifecycleStep(this, getDeviceManagementCacheProvider(), "Stopped device management cache provider")); // Stop asset management. stop.addStep( new StopComponentLifecycleStep(this, getAssetManagement(), "Stopped asset management implementation")); // Stop asset management cache provider. stop.addStep(new StopComponentLifecycleStep(this, getAssetManagementCacheProvider(), "Stopped asset management cache provider")); }