public void startInternal() throws LifecycleException { super.startInternal(); if (getLogger().isDebugEnabled()) { getLogger().debug(this + ": Starting"); this.lifecycle.fireLifecycleEvent(START_EVENT, null); load(); } catch (ClassNotFoundException e) { throw new LifecycleException("Exception starting manager", e); } catch (IOException e) { throw new LifecycleException("Exception starting manager", e);
/** * Stops the embedded Tomcat server. */ public void stopContainer() { try { if (container != null) { container.stop(); logger.info("Stopped container"); } } catch (LifecycleException exception) { logger.warn("Cannot Stop Tomcat" + exception.getMessage()); } }
/** * Prepare for the beginning of active use of the public methods of this * component. This method should be called after <code>configure()</code>, * and before any of the public methods of the component are utilized. * * @exception LifecycleException if this component detects a fatal error * that prevents this component from being used */ public void start() throws LifecycleException { // Validate and update our current component state if (started) throw new LifecycleException (rb.getString(LogFacade.STORE_BASE_STARTED_EXCEPTION)); lifecycle.fireLifecycleEvent(START_EVENT, null); started = true; }
/** * Gracefully terminate the active use of the public methods of this * component. This method should be the last one called on a given * instance of this component. * * @exception LifecycleException if this component detects a fatal error * that needs to be reported */ @Override public void stop() throws LifecycleException { if (log.isLoggable(Level.FINE)) log.log(Level.FINE, "Stopping embedded server"); // Validate and update our current component state if (!started) throw new LifecycleException (rb.getString(LogFacade.SERVICE_NOT_BEEN_STARTED_EXCEPTION)); lifecycle.fireLifecycleEvent(STOP_EVENT, null); started = false; // Stop our defined Connectors first for (int i = 0; i < connectors.length; i++) { if (connectors[i] instanceof Lifecycle) ((Lifecycle) connectors[i]).stop(); } // Stop our defined Engines second for (int i = 0; i < engines.length; i++) { if (engines[i] instanceof Lifecycle) ((Lifecycle) engines[i]).stop(); } }
throw new LifecycleException (rb.getString(LogFacade.PIPLINE_STARTED)); lifecycle.fireLifecycleEvent(BEFORE_START_EVENT, null); ((Lifecycle) valves[i]).start(); ((Lifecycle) basic).start(); lifecycle.fireLifecycleEvent(START_EVENT, null); lifecycle.fireLifecycleEvent(AFTER_START_EVENT, null);
/** * Gracefully terminate the active use of the public methods of this * component. This method should be the last one called on a given * instance of this component. * * @throws IllegalStateException if this component has not been started * @throws LifecycleException if this component detects a fatal error * that needs to be reported */ public void stop() throws LifecycleException { // Validate and update our current component state if (!_started) { String msg = rb.getString("webcontainer.notStarted"); throw new LifecycleException(msg); } _started = false; // stop the embedded container try { _embedded.stop(); } catch (LifecycleException ex) { if (!ex.getMessage().contains("has not been started")) { throw ex; } } }
/** * Process the START event for an associated Context. * * @param event The lifecycle event that has occurred */ public void lifecycleEvent(LifecycleEvent event) throws LifecycleException { // Identify the context we are associated with try { context = (Context) event.getLifecycle(); } catch (ClassCastException e) { String msg = MessageFormat.format(rb.getString(LogFacade.EVENT_DATA_IS_NOT_CONTEXT_EXCEPTION), event.getLifecycle()); throw new LifecycleException(msg, e); } // Called from ContainerBase.addChild() -> StandardContext.start() // Process the event that has occurred if (event.getType().equals(Lifecycle.START_EVENT)) { start(); } else if (event.getType().equals(Lifecycle.STOP_EVENT)) { stop(); // START GlassFish 2439 } else if (event.getType().equals(Lifecycle.INIT_EVENT)) { init(); // END GlassFish 2439 } }
private void handleSubClassException(Throwable t, String key, Object... args) throws LifecycleException { ExceptionUtils.handleThrowable(t); setStateInternal(LifecycleState.FAILED, null, false); String msg = sm.getString(key, args); if (getThrowOnFailure()) { if (!(t instanceof LifecycleException)) { t = new LifecycleException(msg, t); } throw (LifecycleException) t; } else { log.error(msg, t); } } }
protected void startInternal() throws LifecycleException { if (log.isDebugEnabled()) log.debug(sm.getString("webappLoader.starting")); log.info("No resources for " + context); setState(LifecycleState.STARTING); return; ((Lifecycle) classLoader).start(); ExceptionUtils.handleThrowable(t); log.error( "LifecycleException ", t ); throw new LifecycleException("start: ", t);
private void invalidTransition(String type) throws LifecycleException { String msg = sm.getString("lifecycleBase.invalidTransition", type, toString(), state); throw new LifecycleException(msg); } }
LifecycleState.DESTROYED.equals(state)) { if (log.isDebugEnabled()) { Exception e = new LifecycleException(); log.debug(sm.getString("lifecycleBase.alreadyDestroyed", toString()), e); } else if (log.isInfoEnabled()) { log.info(sm.getString("lifecycleBase.alreadyDestroyed", toString()));
@Override public void stop() throws LifecycleException { try { shutdownRedisson(); } catch (Exception e) { throw new LifecycleException(e); } lifecycle.fireLifecycleEvent(STOP_EVENT, null); }
public void startInternal() throws LifecycleException { super.startInternal(); if (getLogger().isDebugEnabled()) { getLogger().debug(this + ": Starting"); load(); } catch (ClassNotFoundException e) { throw new LifecycleException("Exception starting manager", e); } catch (IOException e) { throw new LifecycleException("Exception starting manager", e);
protected RedissonClient buildClient() throws LifecycleException { Config config = null; try { config = Config.fromJSON(new File(configPath), getClass().getClassLoader()); } catch (IOException e) { // trying next format try { config = Config.fromYAML(new File(configPath), getClass().getClassLoader()); } catch (IOException e1) { log.error("Can't parse json config " + configPath, e); throw new LifecycleException("Can't parse yaml config " + configPath, e1); } } try { return Redisson.create(config); } catch (Exception e) { throw new LifecycleException(e); } }
/** * Start Cluster and implement the requirements * of {@link org.apache.catalina.util.LifecycleBase#startInternal()}. * * @exception LifecycleException if this component detects a fatal error * that prevents this component from being used */ @Override protected void startInternal() throws LifecycleException { if (log.isInfoEnabled()) log.info(sm.getString("simpleTcpCluster.start")); try { checkDefaults(); registerClusterValve(); channel.addMembershipListener(this); channel.addChannelListener(this); channel.setName(getClusterName() + "-Channel"); channel.start(channelStartOptions); if (clusterDeployer != null) clusterDeployer.start(); registerMember(channel.getLocalMember(false)); } catch (Exception x) { log.error(sm.getString("simpleTcpCluster.startUnable"), x); throw new LifecycleException(x); } setState(LifecycleState.STARTING); }
try (InputStream is = ConfigFileLoader.getSource().getResource(pathName).getInputStream()) { if (log.isDebugEnabled()) { log.debug(sm.getString("memoryRealm.loadPath", pathName)); throw new LifecycleException(sm.getString("memoryRealm.readXml"), e); } finally { digester.reset(); throw new LifecycleException(sm.getString("memoryRealm.loadExist", pathName), ioe);
@Override protected synchronized void startInternal() throws LifecycleException { super.startInternal(); try { this._client = buildClient(); } catch (Throwable t) { log.fatal("Unable to load serializer", t); throw new LifecycleException(t); } this.requestValve = new RedisSessionRequestValve(this, ignorePattern); getContext().getParent().getPipeline().addValve(requestValve); this.sessionExpirationTime = getContext().getSessionTimeout(); if (this.sessionExpirationTime < 0) { log.warn("Ignoring negative session expiration time"); this.sessionExpirationTime = 0; } log.info("Will expire sessions after " + sessionExpirationTime + " minutes"); setState(LifecycleState.STARTING); }
@Override public void start() throws LifecycleException { if( log.isInfoEnabled() ) log.info("Starting tomcat server"); // Validate the setup of our required system properties initDirs(); // Initialize some naming specific properties initNaming(); // Validate and update our current component state if (started) throw new LifecycleException (sm.getString("embedded.alreadyStarted")); lifecycle.fireLifecycleEvent(START_EVENT, null); started = true; service.initialize(); // Start our defined Engines first for (int i = 0; i < engines.length; i++) { if (engines[i] instanceof Lifecycle) ((Lifecycle) engines[i]).start(); } // Start our defined Connectors second Connector[] connectors = service.findConnectors(); for (int i = 0; i < connectors.length; i++) { connectors[i].initialize(); if (connectors[i] instanceof Lifecycle) ((Lifecycle) connectors[i]).start(); } }
lifecycle.fireLifecycleEvent(INIT_EVENT, null); throw new LifecycleException (sm.getString("embedded.alreadyStarted")); lifecycle.fireLifecycleEvent(START_EVENT, null); started = true; ((Lifecycle) engines[i]).start(); connectors[i].initialize(); if (connectors[i] instanceof Lifecycle) ((Lifecycle) connectors[i]).start();
/** * Gracefully terminate the active use of the public methods of this * component. This method should be the last one called on a given * instance of this component. * * @exception LifecycleException if this component detects a fatal error * that needs to be reported */ public void stop() throws LifecycleException { if( log.isDebugEnabled() ) log.debug("Stopping embedded server"); // Validate and update our current component state if (!started) throw new LifecycleException (sm.getString("embedded.notStarted")); lifecycle.fireLifecycleEvent(STOP_EVENT, null); started = false; // Stop our defined Connectors first for (int i = 0; i < connectors.length; i++) { if (connectors[i] instanceof Lifecycle) ((Lifecycle) connectors[i]).stop(); } // Stop our defined Engines second for (int i = 0; i < engines.length; i++) { if (engines[i] instanceof Lifecycle) ((Lifecycle) engines[i]).stop(); } }