Package javax.jbi.servicedesc

Examples of javax.jbi.servicedesc.ServiceEndpoint


      Document doc = DOMUtils.newDocument();
      DocumentFragment fragment = doc.createDocumentFragment();
      NodeList children = epr.getChildNodes();
      for (int i = 0 ; i < children.getLength(); ++i)
        fragment.appendChild(doc.importNode(children.item(i), true));
      ServiceEndpoint se = _ode.getContext().resolveEndpointReference(fragment);
      if (se == null)
          return null;
     
      return new JbiEndpointReference(se, eprType);
View Full Code Here


            __log.error(errmsg);
            odeMex.replyWithFailure(FailureType.INVALID_ENDPOINT, errmsg, null);
            return;
        }

        ServiceEndpoint se = targetEndpoint.getServiceEndpoint();

        boolean isTwoWay = odeMex.getMessageExchangePattern() == org.apache.ode.bpel.iapi.MessageExchange.MessageExchangePattern.REQUEST_RESPONSE;

        QName opname = new QName(se.getServiceName().getNamespaceURI(), odeMex.getOperation().getName());

        MessageExchangeFactory mexf = _ode.getChannel().createExchangeFactory(se);
        final MessageExchange jbiMex;
        try {
            jbiMex = mexf.createExchange(isTwoWay ? MessageExchangePattern.IN_OUT : MessageExchangePattern.IN_ONLY);
            jbiMex.setEndpoint(se);
            jbiMex.setService(se.getServiceName());
            jbiMex.setOperation(opname);
        } catch (MessagingException e) {
            String errmsg = "Unable to create JBI message exchange for ODE message exchange " + odeMex;
            __log.error(errmsg, e);
            odeMex.replyWithFailure(FailureType.COMMUNICATION_ERROR, errmsg, null);
View Full Code Here

        super.tearDown();
    }

    public void testQueryEndpoint() throws Exception {
        ComponentContext context = componentRegistry.createComponentContext();
        ServiceEndpoint ep = context.getEndpoint(new QName("urn:test", "service"), "provider");
        assertNotNull(ep);
    }
View Full Code Here

        componentRegistry.getNmr().getEndpointRegistry().unregister(componentEndpoint, properties);
    }

    public synchronized ServiceEndpoint activateEndpoint(QName serviceName, String endpointName) throws JBIException {
        try {
            ServiceEndpoint se = new ServiceEndpointImpl(serviceName, endpointName);
            Map<String, Object> props = new HashMap<String, Object>();
            props.put(Endpoint.NAME, serviceName.toString() + ":" + endpointName);
            props.put(Endpoint.SERVICE_NAME, serviceName.toString());
            props.put(Endpoint.ENDPOINT_NAME, endpointName);
            props.put(INTERNAL_ENDPOINT, Boolean.TRUE.toString());
View Full Code Here

    protected ServiceEndpoint[] doQueryServiceEndpoints(Map<String, Object> props, boolean external) {
        List<Endpoint> endpoints = doQueryEndpoints(props, external);
        List<ServiceEndpoint> ses = new ArrayList<ServiceEndpoint>();
        for (Endpoint endpoint : endpoints) {
            ServiceEndpoint se = getServiceEndpoint(endpoint);
            if (se != null) {
                ses.add(se);
            }
        }
        return ses.toArray(new ServiceEndpoint[ses.size()]);
View Full Code Here

    protected ServiceEndpoint getServiceEndpoint(Endpoint endpoint) {
        if (endpoint instanceof InternalEndpoint) {
            endpoint = ((InternalEndpoint) endpoint).getEndpoint();
        }
        if (endpoint instanceof ServiceEndpoint) {
            ServiceEndpoint se = (ServiceEndpoint) endpoint;
            if (se.getServiceName() != null && se.getEndpointName() != null) {
                return se;
            }
        } else {
            Map<String, ?> epProps = getNmr().getEndpointRegistry().getProperties(endpoint);
            QName serviceName = getServiceQNameFromProperties(epProps);
View Full Code Here

        return null;
    }

    public ServiceEndpoint resolveEndpointReference(DocumentFragment epr) {
        for (ComponentWrapper component : componentRegistry.getServices()) {
            ServiceEndpoint se = component.getComponent().resolveEndpointReference(epr);
            if (se != null) {
                return se;
            }
        }
        ServiceEndpoint se = resolveInternalEPR(epr);
        if (se != null) {
            return se;
        }
        return resolveStandardEPR(epr);
    }
View Full Code Here

    }

    public static void createTarget(NMR nmr, Exchange exchange) {
        if (exchange.getTarget() == null) {
            Map<String, Object> props = new HashMap<String, Object>();
            ServiceEndpoint ep = MessageExchangeImpl.getEndpoint(exchange);
            if (ep != null) {
                props.put(Endpoint.SERVICE_NAME, ep.getServiceName().toString());
                props.put(Endpoint.ENDPOINT_NAME, ep.getEndpointName());
            } else {
                QName serviceName = MessageExchangeImpl.getService(exchange);
                if (serviceName != null) {
                    props.put(Endpoint.SERVICE_NAME, serviceName.toString());
                } else {
View Full Code Here

                }
                if (message.propertyExists(JBI_ENDPOINT)) {
                    QName q = QName.valueOf(message.getStringProperty(JBI_ENDPOINT));
                    String e = q.getLocalPart();
                    q = QName.valueOf(q.getNamespaceURI());
                    ServiceEndpoint se = getEndpoint(q, e);
                    // TODO: check that endpoint exists
                    exchange.setProperty(MessageExchangeImpl.SERVICE_ENDPOINT_PROP, se);
                }
                // Re-process JBI addressing
                DeliveryChannelImpl.createTarget(getChannel().getNMR(), exchange);
View Full Code Here

                    }
                    if (exchange.getProperty(MessageExchangeImpl.SERVICE_NAME_PROP) != null) {
                        message.setStringProperty(JBI_SERVICE, exchange.getProperty(MessageExchangeImpl.SERVICE_NAME_PROP).toString());
                    }
                    if (exchange.getProperty(MessageExchangeImpl.SERVICE_ENDPOINT_PROP) != null) {
                        ServiceEndpoint se = (ServiceEndpoint) exchange.getProperty(MessageExchangeImpl.SERVICE_ENDPOINT_PROP);
                        message.setStringProperty(JBI_ENDPOINT, "{" + se.getServiceName().toString() + "}" + se.getEndpointName());
                    }
                    // TODO: write exchange properties
                }
                message.setBooleanProperty(PROPERTY_ROLLBACK_ON_ERRORS, rollbackOnErrors);
                boolean expectResponse;
View Full Code Here

TOP

Related Classes of javax.jbi.servicedesc.ServiceEndpoint

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.