public static String getKey(Endpoint endpoint) { return endpoint.getKey(); }
public void registerEndpoint(Endpoint ep) { String key = ep.getKey(); if (this.endpoints.put(key, ep) != null) { throw new IllegalStateException("An endpoint is already registered for key: " + key); } }
public void unregisterEndpoint(Endpoint ep) { this.endpoints.remove(ep.getKey()); }
protected Set<String> getKnownExchanges(Endpoint endpoint) { Set<String> exchanges = knownExchanges.get(endpoint.getKey()); if (exchanges == null) { synchronized (knownExchanges) { exchanges = knownExchanges.get(endpoint.getKey()); if (exchanges == null) { exchanges = new HashSet<String>(); knownExchanges.put(endpoint.getKey(), exchanges); } } } return exchanges; }
public OsgiServiceUnit(DefaultComponent component, Endpoint endpoint, ClassLoader classLoader) throws DeploymentException { this.component = component; this.endpoint = endpoint; this.classLoader = classLoader; this.endpoint.setServiceUnit(this); this.endpoint.validate(); this.name = endpoint.getKey(); addEndpoint(this.endpoint); } public Endpoint getEndpoint() {
logger.info("something wrong during register endpoint {}", ep.getKey());
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); } } }
public synchronized void removeEndpoint(Endpoint endpoint) throws DeploymentException { String key = endpoint.getKey(); if (this.endpoints.remove(key) == null) { throw new DeploymentException("Endpoint not found in the SU for key: " + EndpointSupport.getKey(endpoint)); } if (this.status == LifeCycleMBean.STOPPED) { try { component.prepareShutdown(endpoint); endpoint.deactivate(); } catch (Exception e) { throw new DeploymentException(e); } } else if (this.status == LifeCycleMBean.STARTED) { try { endpoint.stop(); component.prepareShutdown(endpoint); endpoint.deactivate(); } catch (Exception e) { throw new DeploymentException(e); } } }
exchange.setProperty(JbiConstants.SENDER_ENDPOINT, endpoint.getKey());