@Override public void initialize(ILifecycleProgressMonitor monitor) throws SiteWhereException { // Composite step for initializing processing strategy. ICompositeLifecycleStep init = new CompositeLifecycleStep("Initialize " + getComponentName()); // Initialize command execution builder. init.addInitializeStep(this, getCommandExecutionBuilder(), true); // Initialize command target resolver. init.addInitializeStep(this, getCommandTargetResolver(), true); // Execute initialization steps. init.execute(monitor); }
@Override public void microserviceStart(ILifecycleProgressMonitor monitor) throws SiteWhereException { // Composite step for starting microservice. ICompositeLifecycleStep start = new CompositeLifecycleStep("Start " + getName()); // Start GRPC server. start.addStartStep(this, getUserManagementGrpcServer(), true); // Start tenant management API demux. start.addStartStep(this, getTenantManagementApiDemux(), true); // Execute initialization steps. start.execute(monitor); }
@Override public void microserviceStop(ILifecycleProgressMonitor monitor) throws SiteWhereException { // Create step that will stop components. ICompositeLifecycleStep stop = new CompositeLifecycleStep("Stop " + getName()); // Stop event management GRPC server. stop.addStopStep(this, getEventManagementGrpcServer()); // Stop device mangement API demux. stop.addStopStep(this, getDeviceManagementApiDemux()); // Execute shutdown steps. stop.execute(monitor); }
@Override public void tenantStart(ILifecycleProgressMonitor monitor) throws SiteWhereException { // Create step that will start components. ICompositeLifecycleStep start = new CompositeLifecycleStep("Start " + getComponentName()); // Start discoverable lifecycle components. start.addStep(startDiscoverableBeans(getModuleContext())); // Start device state management persistence. start.addStartStep(this, getDeviceStateManagement(), true); // Start device state enriched events consumer. start.addStartStep(this, getDeviceStateEnrichedEventsConsumer(), true); // Start device presence manager. start.addStartStep(this, getDevicePresenceManager(), true); // Execute startup steps. start.execute(monitor); }
@Override public void tenantStop(ILifecycleProgressMonitor monitor) throws SiteWhereException { // Create step that will stop components. ICompositeLifecycleStep stop = new CompositeLifecycleStep("Stop " + getComponentName()); // Stop schedule management persistence. stop.addStopStep(this, getScheduleManagement()); // Stop discoverable lifecycle components. stop.addStep(stopDiscoverableBeans(getModuleContext())); // Execute shutdown steps. stop.execute(monitor); }
@Override public void tenantInitialize(ILifecycleProgressMonitor monitor) throws SiteWhereException { // Load event management implementation. initializeManagementImplementations(); // Create step that will initialize components. ICompositeLifecycleStep init = new CompositeLifecycleStep("Initialize " + getComponentName()); // Initialize discoverable lifecycle components. init.addStep(initializeDiscoverableBeans(getModuleContext())); // Initialize event management persistence. init.addInitializeStep(this, getEventManagement(), true); // Initialize inbound persisted events producer. init.addInitializeStep(this, getInboundPersistedEventsProducer(), true); // Execute initialization steps. init.execute(monitor); }
@Override public void microserviceStart(ILifecycleProgressMonitor monitor) throws SiteWhereException { // Create step that will start components. ICompositeLifecycleStep start = new CompositeLifecycleStep("Start " + getName()); // Verify or create Zk node for instance information. start.addStep(verifyOrCreateInstanceNode()); // Start instance template manager. start.addStartStep(this, getInstanceTemplateManager(), true); // Start instance script synchronizer. start.addStartStep(this, getInstanceScriptSynchronizer(), true); // Initialize user management API channel. start.addInitializeStep(this, getUserManagementApiDemux(), true); // Start user mangement API channel. start.addStartStep(this, getUserManagementApiDemux(), true); // Initialize tenant management API channel. start.addInitializeStep(this, getTenantManagementApiDemux(), true); // Start tenant mangement API channel. start.addStartStep(this, getTenantManagementApiDemux(), true); // Verify Zk node for instance configuration or bootstrap instance. start.addStep(verifyOrBootstrapConfiguration()); // Execute initialization steps. start.execute(monitor); }
/** * 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")); }
@Override public void tenantStart(ILifecycleProgressMonitor monitor) throws SiteWhereException { // Create step that will start components. ICompositeLifecycleStep start = new CompositeLifecycleStep("Start " + getComponentName()); // Start discoverable lifecycle components. start.addStep(startDiscoverableBeans(getModuleContext())); // Start event management persistence. start.addStartStep(this, getEventManagement(), true); // Start inbound persisted events producer. start.addStartStep(this, getInboundPersistedEventsProducer(), true); // Execute startup steps. start.execute(monitor); }
@Override public void tenantStop(ILifecycleProgressMonitor monitor) throws SiteWhereException { // Create step that will stop components. ICompositeLifecycleStep stop = new CompositeLifecycleStep("Stop " + getComponentName()); // Stop event management persistence. stop.addStopStep(this, getEventManagement()); // Stop inbound persisted events producer. stop.addStopStep(this, getInboundPersistedEventsProducer()); // Stop discoverable lifecycle components. stop.addStep(stopDiscoverableBeans(getModuleContext())); // Execute shutdown steps. stop.execute(monitor); }
@Override public void tenantInitialize(ILifecycleProgressMonitor monitor) throws SiteWhereException { // Initialize underlying APIs. initializeAssetManagementApis(); // Create step that will initialize components. ICompositeLifecycleStep init = new CompositeLifecycleStep("Initialize " + getComponentName()); // Initialize discoverable lifecycle components. init.addStep(initializeDiscoverableBeans(getModuleContext())); // Initialize asset management persistence. init.addInitializeStep(this, getAssetManagement(), true); // Execute initialization steps. init.execute(monitor); }
/** * 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 initialize(ILifecycleProgressMonitor monitor) throws SiteWhereException { // Composite step for initializing processing strategy. ICompositeLifecycleStep init = new CompositeLifecycleStep("Initialize " + getComponentName()); // Initialize execution encoder. init.addInitializeStep(this, getCommandExecutionEncoder(), true); // Initialize parameter extractor. init.addInitializeStep(this, getCommandDeliveryParameterExtractor(), true); // Initialize delivery provider. init.addInitializeStep(this, getCommandDeliveryProvider(), true); // Execute initialization steps. init.execute(monitor); }
@Override public void microserviceStart(ILifecycleProgressMonitor monitor) throws SiteWhereException { // Create step that will start components. ICompositeLifecycleStep start = new CompositeLifecycleStep("Start " + getName()); // Start event management GRPC server. start.addStartStep(this, getEventManagementGrpcServer(), true); // Start device mangement API demux. start.addStartStep(this, getDeviceManagementApiDemux(), true); // Execute startup steps. start.execute(monitor); }
@Override public void microserviceStop(ILifecycleProgressMonitor monitor) throws SiteWhereException { // Composite step for stopping microservice. ICompositeLifecycleStep stop = new CompositeLifecycleStep("Stop " + getName()); // Stop batch management GRPC server. stop.addStopStep(this, getBatchManagementGrpcServer()); // Stop device mangement API demux. stop.addStopStep(this, getDeviceManagementApiDemux()); // Stop device event mangement API demux. stop.addStopStep(this, getDeviceEventManagementApiDemux()); // Execute shutdown steps. stop.execute(monitor); }
@Override public void tenantStart(ILifecycleProgressMonitor monitor) throws SiteWhereException { // Create step that will start components. ICompositeLifecycleStep start = new CompositeLifecycleStep("Start " + getComponentName()); // Start discoverable lifecycle components. start.addStep(startDiscoverableBeans(getModuleContext())); // Start label generator manager. start.addStartStep(this, getLabelGeneratorManager(), true); // Execute startup steps. start.execute(monitor); }
@Override public void tenantStop(ILifecycleProgressMonitor monitor) throws SiteWhereException { // Create step that will stop components. ICompositeLifecycleStep stop = new CompositeLifecycleStep("Stop " + getComponentName()); // Stop asset management persistence. stop.addStopStep(this, getAssetManagement()); // Stop discoverable lifecycle components. stop.addStep(stopDiscoverableBeans(getModuleContext())); // Execute shutdown steps. stop.execute(monitor); }
@Override public void initialize(ILifecycleProgressMonitor monitor) throws SiteWhereException { this.unprocessedBatchOperationsConsumer = new UnprocessedBatchOperationsConsumer(); this.unprocessedBatchElementsConsumer = new UnprocessedBatchElementsConsumer(); // Create step that will initialize components. ICompositeLifecycleStep init = new CompositeLifecycleStep("Initialize " + getComponentName()); // Initialize unprocessed batch operations consumer. init.addInitializeStep(this, getUnprocessedBatchOperationsConsumer(), true); // Initialize unprocessed batch elements consumer. init.addInitializeStep(this, getUnprocessedBatchElementsConsumer(), true); // Initialize handlers. init.addStep(new SimpleLifecycleStep("Initialize Handlers") { @Override public void execute(ILifecycleProgressMonitor monitor) throws SiteWhereException { for (String key : getHandlersByOperationType().keySet()) { IBatchOperationHandler handler = getHandlersByOperationType().get(key); initializeNestedComponent(handler, monitor, true); } } }); // Execute initialization steps. init.execute(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 microserviceInitialize(ILifecycleProgressMonitor monitor) throws SiteWhereException { // Create GRPC components. createGrpcComponents(); // Create step that will start components. ICompositeLifecycleStep init = new CompositeLifecycleStep("Initialize " + getName()); // Initialize device management GRPC server. init.addInitializeStep(this, getAssetManagementGrpcServer(), true); // Initialize device management API demux. init.addInitializeStep(this, getDeviceManagementApiDemux(), true); // Execute initialization steps. init.execute(monitor); }