public Map<String, String> getServiceUnits() { if (endpointRegistrations == null) { throw new IllegalStateException("Service assembly has not been deployed"); } Map<String, String> sus = new HashMap<String, String>(); for (Endpoint ep : getEndpoints()) { if (ep.getServiceUnit() == null) { // This should not happen, as we only register the SA after all endpoints have been deployed throw new IllegalStateException("Endpoint has not been initialized. Check that the component is installed."); } sus.put(ep.getServiceUnit().getName(), ep.getServiceUnit().getComponent().getComponentName()); } return sus; }
public EndpointComponentContext(Endpoint endpoint) { this.endpoint = endpoint; this.context = endpoint.getServiceUnit().getComponent().getComponentContext(); }
public synchronized void removeEndpoint(Endpoint endpoint) throws Exception { registry.unregisterEndpoint(endpoint); endpoint.getServiceUnit().removeEndpoint(endpoint); }
public EndpointDeliveryChannel(Endpoint endpoint) throws MessagingException { this.endpoint = endpoint; this.channel = endpoint.getServiceUnit().getComponent().getComponentContext().getDeliveryChannel(); }
protected void prepareExchange(MessageExchange exchange) throws MessagingException { Endpoint ep = getEndpoint(); ep.getServiceUnit().getComponent().prepareExchange(exchange, ep); }
protected void handleExchange(MessageExchange exchange, boolean add) throws MessagingException { Endpoint ep = getEndpoint(); ep.getServiceUnit().getComponent().handleExchange(ep, exchange, add); }
return; if (ep != null && (ep.getServiceUnit() == null || !ep.getServiceUnit().getComponent().getRegistry().isRegistered(ep.getServiceUnit()))) { logger.info("something wrong during register endpoint {}", ep.getKey()); e.getServiceUnit().getComponent().getRegistry().unregisterServiceUnit(e.getServiceUnit()); boolean initialized = true; for (Endpoint e : endpoints) { if (e.getServiceUnit().getComponent().getComponentContext() == null) { initialized = false; break;
boolean processed = false; try { ClassLoader cl = (ep != null) ? ep.getServiceUnit().getConfigurationClassLoader() : null; if (cl != null) { Thread.currentThread().setContextClassLoader(cl);
private void resumeTx(MessageExchange exchange) throws MessagingException { if (!getEndpoint().getServiceUnit().getComponent().getContainer().handleTransactions()) { Transaction tx = (Transaction) exchange.getProperty(MessageExchange.JTA_TRANSACTION_PROPERTY_NAME); if (tx != null) { TransactionManager txmgr = (TransactionManager) endpoint.getServiceUnit().getComponent().getComponentContext().getTransactionManager(); try { txmgr.resume(tx); } catch (InvalidTransactionException e) { throw new MessagingException(e); } catch (SystemException e) { throw new MessagingException(e); } } } }