public void shutDown() throws JBIException { try { logger.debug("Shutting down component"); Thread.currentThread().setContextClassLoader(component.getClass().getClassLoader()); doShutDown(); setCurrentState(LifeCycleMBean.SHUTDOWN); this.context = null; logger.debug("Component shut down"); } catch (JBIException e) { throw e; } catch (Exception e) { throw new JBIException("Error calling shutdown", e); } }
public void start() throws JBIException { try { logger.debug("Starting component"); Thread.currentThread().setContextClassLoader(component.getClass().getClassLoader()); if (this.running.compareAndSet(false, true)) { doStart(); setCurrentState(LifeCycleMBean.STARTED); } logger.debug("Component started"); } catch (JBIException e) { throw e; } catch (Exception e) { throw new JBIException("Error calling start", e); } }
public void stop() throws JBIException { try { logger.debug("Stopping component"); Thread.currentThread().setContextClassLoader(component.getClass().getClassLoader()); if (this.running.compareAndSet(true, false)) { doStop(); setCurrentState(LifeCycleMBean.STOPPED); } logger.debug("Component stopped"); } catch (JBIException e) { throw e; } catch (Exception e) { throw new JBIException("Error calling stop", e); } }
public void init(ComponentContext context) throws JBIException { try { logger.debug("Initializing component"); Thread.currentThread().setContextClassLoader(component.getClass().getClassLoader()); this.context = context; this.channel = context.getDeliveryChannel(); try { this.transactionManager = (TransactionManager) context.getTransactionManager(); } catch (Throwable e) { // Ignore, this is just a safeguard against non compliant // JBI implementation which throws an exception instead of // return null } container = Container.detect(context); doInit(); setCurrentState(INITIALIZED); logger.debug("Component initialized"); } catch (JBIException e) { throw e; } catch (Exception e) { throw new JBIException("Error calling init", e); } }