/** * Dynamically adds a new endpoint */ public synchronized void addEndpoint(Endpoint endpoint) throws Exception { endpoint.setServiceUnit(serviceUnit); validateEndpoint(endpoint); endpoint.validate(); registry.registerEndpoint(endpoint); serviceUnit.addEndpoint(endpoint); }
protected void doUndeploy(ServiceUnit su) throws Exception { for (int i = 0; i < deployers.length; i++) { if (deployers[i].canDeploy(su.getName(), su.getRootPath())) { deployers[i].undeploy(su); return; } } throw failure("undeploy", "Unable to find suitable deployer for Service Unit '" + su.getName() + "'", null); }
protected void handleExchange(MessageExchange exchange, boolean add) throws MessagingException { Endpoint ep = getEndpoint(); ep.getServiceUnit().getComponent().handleExchange(ep, exchange, add); }
protected DeploymentException failure(String task, String info, Exception e) throws DeploymentException { ManagementSupport.Message msg = new ManagementSupport.Message(); msg.setComponent(component.getComponentName()); msg.setTask(task); msg.setResult("FAILED"); msg.setType("ERROR"); msg.setException(e); msg.setMessage(info); return new DeploymentException(ManagementSupport.createComponentMessage(msg)); }
public EndpointComponentContext(Endpoint endpoint) { this.endpoint = endpoint; this.context = endpoint.getServiceUnit().getComponent().getComponentContext(); }
protected String createSuccessMessage(String task) { ManagementSupport.Message msg = new ManagementSupport.Message(); msg.setComponent(component.getComponentName()); msg.setTask(task); msg.setResult("SUCCESS"); return ManagementSupport.createComponentMessage(msg); }
protected void prepareExchange(MessageExchange exchange) throws MessagingException { Endpoint ep = getEndpoint(); ep.getServiceUnit().getComponent().prepareExchange(exchange, ep); }
/** * <p> * Associates an endpoint with a service unit. The service unit is used by the container to manage the endpoint's lifecycle. * </p> * * @param serviceUnit a <code>ServiceUnit</code> to which the endpoint will be associated * @org.apache.xbean.Property description="the service unit responsible for the endpoint" hidden="true */ public void setServiceUnit(ServiceUnit serviceUnit) { this.serviceUnit = serviceUnit; this.logger = serviceUnit.getComponent().getLogger(); }
protected DeploymentException failure(String task, String info, Throwable e) { return ManagementSupport.failure(task, component.getComponentName(), info, e); }
public ServiceEndpoint resolveEndpointReference(DocumentFragment epr) { String[] protocols = getEPRProtocols(); QName elementName = getEPRElementName(); QName serviceName = getEPRServiceName(); for (int i = 0; i < protocols.length; i++) { ServiceEndpoint ep = ResolvedEndpoint.resolveEndpoint(epr, elementName, serviceName, protocols[i]); if (ep != null) { return ep; } } return null; }
public synchronized void removeEndpoint(Endpoint endpoint) throws Exception { registry.unregisterEndpoint(endpoint); endpoint.getServiceUnit().removeEndpoint(endpoint); }
@Override protected void doShutDown() throws Exception { serviceUnit.shutDown(); super.doShutDown(); }
/** * Shortcut to retrieve this component's executor. * * @return the executor for this component */ public Executor getExecutor(Role role) { return lifeCycle.getExecutor(role); }
public ClassLoader getConfigurationClassLoader() { if (classLoader != null) { return classLoader; } else { return super.getConfigurationClassLoader(); } } }
protected Endpoint getResolvedEPR(ServiceEndpoint ep) throws Exception { // TODO: handle EPR return super.getResolvedEPR(ep); } }
protected DeploymentException failure(String task, String info, Throwable e) { ManagementSupport.Message msg = new ManagementSupport.Message(); msg.setComponent(serviceUnit.getComponent().getComponentName()); msg.setTask(task); msg.setResult("FAILED"); msg.setType("ERROR"); msg.setMessage(info); msg.setException(e); return new DeploymentException(ManagementSupport.createComponentMessage(msg)); }
public AbstractEndpoint(ServiceUnit serviceUnit, QName service, String endpoint) { this.serviceUnit = serviceUnit; this.logger = serviceUnit.getComponent().getLogger(); this.service = service; this.endpoint = endpoint; }