@Override public void start(ILifecycleProgressMonitor monitor) throws SiteWhereException { super.start(monitor); getCacheManager().init(); }
@Override public void start(ILifecycleProgressMonitor monitor) throws SiteWhereException { super.start(monitor); // Copy all scipts from Zk to local. try { if (getMicroservice().getZookeeperManager().getCurator().checkExists() .forPath(getZkScriptRootPath()) != null) { ZkUtils.copyFolderRecursivelyFromZk(getMicroservice().getZookeeperManager().getCurator(), getZkScriptRootPath(), getFileSystemRoot(), getZkScriptRootPath()); } } catch (Exception e) { throw new SiteWhereException("Unable to copy scripts from Zookeeper.", e); } }
@Override public void lifecycleStart(ILifecycleProgressMonitor monitor) { try { // Verify that component can be started. if (!canStart()) { return; } LifecycleStatus old = getLifecycleStatus(); setLifecycleStatus(LifecycleStatus.Starting); getLogger().info(getComponentName() + " state transitioned to STARTING."); if (old != LifecycleStatus.Paused) { start(monitor); } setLifecycleStatus(LifecycleStatus.Started); getLogger().info(getComponentName() + " state transitioned to STARTED."); } catch (SiteWhereException e) { setLifecycleStatus(LifecycleStatus.Error); setLifecycleError(e); getLogger().error(getComponentName() + " state transitioned to ERROR.", e); } catch (Throwable t) { setLifecycleStatus(LifecycleStatus.Error); setLifecycleError(new SiteWhereException(t)); getLogger().error(getComponentName() + " state transitioned to ERROR.", t); } }
start(monitor);