/** * Stop the internal HTTP server * * @throws StopException when stopping fails */ public void stop() throws StopException { try { server.stop(); } catch (Exception e) { throw new StopException(e, parent); } }
/** * Startup the HTTP server * * @throws StartException if starting fails */ public void start() throws StartException { try { server.start(); } catch (Exception e) { throw new StartException(e, parent); } }
@Override public void dispose() { if (!onUnacceptedFlowConstruct && unacceptedMessageProcessor instanceof Disposable) { ((Disposable) unacceptedMessageProcessor).dispose(); } LifecycleUtils.disposeIfNeeded(filter, LOGGER); } }
@Override public void initialise() throws InitialisationException { if (!onUnacceptedFlowConstruct && unacceptedMessageProcessor instanceof Initialisable) { ((Initialisable) unacceptedMessageProcessor).initialise(); } LifecycleUtils.initialiseIfNeeded(filter); }
@Override public void dispose() { if (this.delegate instanceof Disposable) { ((Disposable) this.delegate).dispose(); } }
@Override public void initialise() throws InitialisationException { for (MessageProcessor processor : processors) { // MULE-5002 TODO review MP Lifecycle if (processor instanceof Initialisable /* && !(processor instanceof Transformer) */) { ((Initialisable) processor).initialise(); } } }
@Override public void start() throws MuleException { if (delegate instanceof Startable) { ((Startable) delegate).start(); } }
/** * Invokes {@link Initialisable#initialise()} on {@code object} * if it implements the {@link Initialisable} interface. * * @param object the object you're trying to initialise * @throws InitialisationException */ public static void initialiseIfNeeded(Object object) throws InitialisationException { initialiseIfNeeded(object, null); }
@Override protected void applyLifecycle(LifecycleManager lifecycleManager) throws Exception { // If the MuleContext is started, start all objects in the new Registry. if (lifecycleManager.isPhaseComplete(Startable.PHASE_NAME)) { lifecycleManager.fireLifecycle(Startable.PHASE_NAME); } }
@Override public void dispose() { LifecycleUtils.disposeIfNeeded(store, LOGGER); }
@Override public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException { if (bean instanceof LifecycleStateAware) { ((LifecycleStateAware) bean).setLifecycleState(state); } return bean; }
public boolean isValidTransition(String phase) { return lifecycleManager.isDirectTransition(phase); } }
protected void fireInitialisationCallbacks(Object component) throws InitialisationException { for (InitialisationCallback callback : initialisationCallbacks) { callback.initialise(component); } }
public void destroyObject(Object obj) throws Exception { if (obj instanceof Disposable) { ((Disposable) obj).dispose(); } }
protected void startIfStartable(Object candidate) throws MuleException { if (candidate instanceof Startable) { ((Startable) candidate).start(); } }
@Override public void initialise() throws InitialisationException { LifecycleUtils.initialiseIfNeeded(filter, muleContext); }
/** * Stop the internal HTTP server * * @throws StopException when stopping fails */ public void stop() throws StopException { try { server.stop(); } catch (Exception e) { throw new StopException(e, parent); } }
/** * Startup the HTTP server * * @throws StartException if starting fails */ public void start() throws StartException { try { server.start(); } catch (Exception e) { throw new StartException(e, parent); } }
/** * Lifecycle hook called by Mule while shuttding down the agent * * @throws MuleException if something fails */ public void stop() throws MuleException { if (server == null) { throw new StopException( new IllegalStateException("Cannot stop the HTTP server since this context is not initialized"), this); } server.stop(); }
/** * Lifecycle method called by mule during startup * * @throws MuleException if something fails */ public void start() throws MuleException { if (server == null) { throw new StartException( new IllegalStateException("Cannot start the HTTP server since this context is not initialized"), this); } server.start(); }