@Override public void initializeNestedComponent(ILifecycleComponent component, ILifecycleProgressMonitor monitor) throws SiteWhereException { if (component instanceof ITenantLifecycleComponent) { ((ITenantLifecycleComponent) component).setTenant(getTenant()); } super.initializeNestedComponent(component, monitor); }
@Override public void lifecycleStart(ILifecycleProgressMonitor monitor) { super.lifecycleStart(monitor); try { updatePersistentState(null, getLifecycleStatus()); } catch (SiteWhereException e) { LOGGER.warn("Unable to update tenant persistent state."); } }
@Override public void lifecycleStop(ILifecycleProgressMonitor monitor, ILifecycleConstraints constraints) { super.lifecycleStop(monitor, constraints); try { updatePersistentState(null, getLifecycleStatus()); } catch (SiteWhereException e) { LOGGER.warn("Unable to update tenant persistent state."); } }
@Override public void setTenant(ITenant tenant) { super.setTenant(tenant); try { DirectSchedulerFactory.getInstance().createScheduler(getTenant().getId(), INSTANCE_ID, new SimpleThreadPool(getNumProcessingThreads(), Thread.NORM_PRIORITY), new RAMJobStore()); } catch (SchedulerException e) { throw new RuntimeException("Unable to create Quartz scheduler for schedule manager.", e); } }
@Override public void startNestedComponent(ILifecycleComponent component, ILifecycleProgressMonitor monitor, String errorMessage, boolean require) throws SiteWhereException { if (component instanceof ITenantLifecycleComponent) { ((ITenantLifecycleComponent) component).setTenant(getTenant()); } super.startNestedComponent(component, monitor, errorMessage, require); }