Package org.apache.servicemix.common

Examples of org.apache.servicemix.common.Endpoint


            su = new ServiceUnit();
            su.setComponent(WSNSpringComponent.this);
            WSNDeployer deployer = new WSNDeployer(WSNSpringComponent.this);
            if (resources != null) {
                for (int i = 0; i < resources.length; i++) {
                    Endpoint ep = deployer.createEndpoint(resources[i].getURL());
                    ep.setServiceUnit(su);
                    su.addEndpoint(ep);
                }
            }
            if (requests != null) {
                for (int i = 0; i < requests.length; i++) {
                    Endpoint ep = deployer.createEndpoint(requests[i]);
                    ep.setServiceUnit(su);
                    su.addEndpoint(ep);
                }
            }
            getRegistry().registerServiceUnit(su);
        }
View Full Code Here


        WSNServiceUnit su = new WSNServiceUnit();
        su.setComponent(component);
        su.setName(serviceUnitName);
        su.setRootPath(serviceUnitRootPath);
        for (int i = 0; i < xmls.length; i++) {
            Endpoint ep;
            URL url;
            try {
                url = xmls[i].toURL();
            } catch (MalformedURLException e) {
                // TODO Auto-generated catch block
                throw new DeploymentException("Error deploying xml file", e);
            }
            ep = createEndpoint(url);
            ep.setServiceUnit(su);
            validate(ep);
            su.addEndpoint(ep);
        }
        if (su.getEndpoints().size() == 0) {
            throw failure("deploy", "Invalid wsdl: no endpoints found", null);
View Full Code Here

    public static class WSNServiceUnit extends ServiceUnit {
        public void start() throws Exception {
            List<Endpoint> activated = new ArrayList<Endpoint>();
            try {
                for (Iterator iter = getEndpoints().iterator(); iter.hasNext();) {
                    Endpoint endpoint = (Endpoint) iter.next();
                    if (endpoint instanceof WSNPullPointEndpoint) {
                        endpoint.activate();
                        activated.add(endpoint);
                    }
                }
                for (Iterator iter = getEndpoints().iterator(); iter.hasNext();) {
                    Endpoint endpoint = (Endpoint) iter.next();
                    if (endpoint instanceof WSNSubscriptionEndpoint) {
                        endpoint.activate();
                        activated.add(endpoint);
                    }
                }
                this.status = LifeCycleMBean.STARTED;
            } catch (Exception e) {
                // Deactivate activated endpoints
                for (Endpoint endpoint : activated) {
                    try {
                        endpoint.deactivate();
                    } catch (Exception e2) {
                        // do nothing
                    }
                }
                throw e;
View Full Code Here

    public Document getServiceDescription(ServiceEndpoint endpoint) {
        if (logger.isDebugEnabled()) {
            logger.debug("Querying service description for " + endpoint);
        }
        String key = EndpointSupport.getKey(endpoint);
        Endpoint ep = this.registry.getEndpoint(key);
        if (ep != null) {
            QName interfaceName = ep.getInterfaceName();
            if (interfaceName == null) {
                if (logger.isDebugEnabled()) {
                    logger.debug("Could not retrieve description for endpoint " + key + " (no interface defined)");
                }
                return null;
View Full Code Here

        prepare(exchange);
        return channel.sendSync(exchange);
    }
   
    protected void prepare(MessageExchange exchange) throws MessagingException {
        Endpoint ep = this.endpoint.get();
        if (ep != null && exchange.getStatus() == ExchangeStatus.ACTIVE && exchange.getRole() == Role.CONSUMER) {
            ServiceMixComponent comp = ep.getServiceUnit().getComponent();
            comp.prepareConsumerExchange(exchange, ep);
        }
    }
View Full Code Here

    for (int i = 0; i < context.getBeanDefinitionNames().length; i++) {
      Object bean = context.getBean(context.getBeanDefinitionNames()[i]);
      if (isValidEndpoint(bean)) {
        // The provides are generic while the consumes need to
        // be handled by the implementation
        Endpoint endpoint = (Endpoint) bean;
        provides.addAll(getProvides(endpoint));
        consumes.addAll(getConsumes(endpoint));
      }
    }
  }
View Full Code Here

            List services = getServices(kernel);
            if (services == null || services.size() == 0) {
                throw failure("deploy", "No endpoints found", null);
            }
            for (Iterator iter = services.iterator(); iter.hasNext();) {
                Endpoint endpoint = (Endpoint) iter.next();
                endpoint.setServiceUnit(su);
                validate(endpoint);
                su.addEndpoint(endpoint);
            }
            if (su.getEndpoints().size() == 0) {
                throw failure("deploy", "No endpoint found", null);
View Full Code Here

                        }
                    }
                    if (bindingElement == null) {
                        throw failure("deploy", "Invalid wsdl " + wsdl + ": no matching binding element found", null);
                    }
                    Endpoint ep = createEndpoint(portElement, bindingElement, jbiEndpoint);
                    if (ep != null) {
                        ep.setServiceUnit(su);
                        ep.setDescription(description);
                        ep.setDefinition(definition);
                        ep.setService(svc.getQName());
                        ep.setEndpoint(port.getName());
                        ep.setInterfaceName(binding.getPortType().getQName());
                        validate(ep);
                        su.addEndpoint(ep);
                    }
                }
            }
View Full Code Here

        WSNServiceUnit su = new WSNServiceUnit();
        su.setComponent(component);
        su.setName(serviceUnitName);
        su.setRootPath(serviceUnitRootPath);
        for (int i = 0; i < xmls.length; i++) {
            Endpoint ep;
            URL url;
            try {
                url = xmls[i].toURL();
            } catch (MalformedURLException e) {
                // TODO Auto-generated catch block
                throw new DeploymentException("Error deploying xml file", e);
            }
            ep = createEndpoint(url);
            ep.setServiceUnit(su);
            su.addEndpoint(ep);
        }
        if (su.getEndpoints().size() == 0) {
            throw failure("deploy", "Invalid wsdl: no endpoints found", null);
        }
View Full Code Here

    public static class WSNServiceUnit extends ServiceUnit {
        public void start() throws Exception {
            List<Endpoint> activated = new ArrayList<Endpoint>();
            try {
                for (Iterator iter = getEndpoints().iterator(); iter.hasNext();) {
                    Endpoint endpoint = (Endpoint) iter.next();
                    if (endpoint instanceof WSNPullPointEndpoint) {
                        endpoint.activate();
                        activated.add(endpoint);
                    }
                }
                for (Iterator iter = getEndpoints().iterator(); iter.hasNext();) {
                    Endpoint endpoint = (Endpoint) iter.next();
                    if (endpoint instanceof WSNSubscriptionEndpoint) {
                        endpoint.activate();
                        activated.add(endpoint);
                    }
                }
                this.status = LifeCycleMBean.STARTED;
            } catch (Exception e) {
                // Deactivate activated endpoints
                for (Endpoint endpoint : activated) {
                    try {
                        endpoint.deactivate();
                    } catch (Exception e2) {
                        // do nothing
                    }
                }
                throw e;
View Full Code Here

TOP

Related Classes of org.apache.servicemix.common.Endpoint

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.