public synchronized void start() throws Exception { if (this.status == LifeCycleMBean.STOPPED) { // Activate endpoints List<Endpoint> activated = new ArrayList<Endpoint>(); try { for (Endpoint endpoint : getEndpoints()) { endpoint.start(); } this.status = LifeCycleMBean.STARTED; } catch (Exception e) { // Deactivate activated endpoints for (Endpoint endpoint : activated) { try { endpoint.stop(); } catch (Exception e2) { // do nothing } } throw e; } } }
public synchronized void addEndpoint(Endpoint endpoint) throws DeploymentException { String key = endpoint.getKey(); if (this.endpoints.put(key, endpoint) != null) { throw new DeploymentException( "More than one endpoint found in the SU for key: " + key); } if (this.status == LifeCycleMBean.STOPPED) { try { endpoint.activate(); } catch (Exception e) { throw new DeploymentException(e); } } else if (this.status == LifeCycleMBean.STARTED) { try { endpoint.activate(); endpoint.start(); } catch (Exception e) { throw new DeploymentException(e); } } }
ep = getResolvedEPR(exchange.getEndpoint()); ep.activate(); ep.start(); dynamic = true;