Package javax.jbi.servicedesc

Examples of javax.jbi.servicedesc.ServiceEndpoint


        }
        return endpoint;
    }

    public ServiceEndpoint[] resolveAvailableEndpoints(ComponentContext context, MessageExchange exchange) throws JBIException {
        ServiceEndpoint endpoint = context.getEndpoint(serviceName, endpointName);
        if (endpoint != null) {
            return new ServiceEndpoint[]{endpoint};
        }
        else {
            return new ServiceEndpoint[0];
View Full Code Here


    public void onMessageExchange(ComponentContext context, MessageExchange exchange) throws JBIException {
        if (predicate.evaluate(context, exchange)) {

            // lets forward the message on to the endpoint
            ServiceEndpoint endpoint = resolver.resolveEndpoint(context, exchange, filter);
            exchange.setEndpoint(endpoint);
        }
    }
View Full Code Here

        return session.createTextMessage(text);
    }

    protected InvokerSupport createDispatcher(SubscribeDocument.Subscribe subscribe) {
        try {
            ServiceEndpoint endpoint = findSubscriberEndpoint(subscribe);
            if (endpoint == null) {
                throw new NotificationException("Could not find a suitable JBI ServiceEndpoint reference for the consumerReference: " + subscribe.getConsumerReference());
            }
            JBIInvoker invoker = new JBIInvoker(context.getDeliveryChannel(), endpoint, subscribe);
            return invoker;
View Full Code Here

      return null;
    }
   
    protected InvokerSupport createDispatcher(ActiveMQSubscription subscribe) {
        try {
            ServiceEndpoint endpoint = findSubscriberEndpoint(subscribe);
            if (endpoint == null) {
                throw new NotificationException(
                        "Could not find a suitable JBI ServiceEndpoint reference for the consumerReference: "
                                + subscribe.getConsumerReference());
            }
View Full Code Here

        if (me.getStatus() == ExchangeStatus.ERROR) {
            me.setStatus(ExchangeStatus.DONE);
            getContext().getDeliveryChannel().send(me);
        }
        try {
            ServiceEndpoint se = me.getEndpoint();
            RuntimeEndpointInfo rtEndpointInfo = null;
            for (Iterator it = serviceUnits.values().iterator(); it.hasNext();) {
                JAXWSServiceUnit su = (JAXWSServiceUnit) it.next();
                RuntimeEndpointInfo rei = su.getRuntimeEndpointInfo(se.getServiceName(), se.getEndpointName());
                if (rei != null) {
                    rtEndpointInfo = rei;
                    break;
                }
            }
View Full Code Here

        // Provider role
        if (exchange.getRole() == Role.PROVIDER) {
            processInputRequest(exchange);
        // Consumer role
        } else {
            ServiceEndpoint ep = exchange.getEndpoint();
            // Credit agency response
            if (ep.getServiceName().getLocalPart().equals(Constants.CREDITAGENCY_SERVICE)) {
                processCreditAgencyResponse(exchange);
            } else if (ep.getServiceName().getLocalPart().equals(Constants.LENDERGATEWAY_SERVICE)) {
                processLenderGatewayResponse(exchange);
            } else {
                processLoanQuote(exchange);
            }
        }
View Full Code Here

        for (int i = 0; i < messageCount; i++) {
            InOnly exchange = context.getDeliveryChannel().createExchangeFactory().createInOnlyExchange();
            NormalizedMessage message = exchange.createMessage();

            ServiceEndpoint destination = null;
            if (resolver != null) {
                destination = resolver.resolveEndpoint(getContext(), exchange, NullEndpointFilter.getInstance());
            }
            if (destination != null) {
                // lets explicitly specify the destination - otherwise
View Full Code Here

    public void sendMessages(int messageCount, boolean sync) throws MessagingException {
        System.out.println("Looking for services for interface: " + interfaceName);

        ServiceEndpoint[] endpoints = context.getEndpointsForService(interfaceName);
        if (endpoints.length > 0) {
            ServiceEndpoint endpoint = endpoints[0];
            System.out.println("Sending to endpoint: " + endpoint);
           
            for (int i = 0; i < messageCount; i++) {
                InOnly exchange = context.getDeliveryChannel().createExchangeFactory().createInOnlyExchange();
                NormalizedMessage message = exchange.createMessage();
View Full Code Here

        JBIContainer container = new JBIContainer();
        container.init();
        container.start();
        ReceiverComponent receiver = new ReceiverComponent() {
            protected void init() throws JBIException {
                ServiceEndpoint ep = new ExternalEndpoint(getService(), getEndpoint());
                getContext().registerExternalEndpoint(ep);
                setService(null);
                setEndpoint(null);
            }

            public ServiceEndpoint resolveEndpointReference(DocumentFragment fragment) {
                try {
                    SourceTransformer st = new SourceTransformer();
                    String xml = st.toString(fragment);
                    return (ServiceEndpoint) new XStream(new DomDriver()).fromXML(xml);
                } catch (Exception e) {
                    throw new RuntimeException(e);
                }
            }
        };
        container.activateComponent(new ActivationSpec("receiver", receiver));
        ServiceMixClient client = new DefaultServiceMixClient(container);
        ServiceEndpoint[] endpoints = client.getContext().getExternalEndpoints(null);
        assertNotNull(endpoints);
        assertEquals(1, endpoints.length);
        assertNull(client.getContext().getEndpointDescriptor(endpoints[0]));
        ServiceEndpoint se = client.getContext().resolveEndpointReference(endpoints[0].getAsReference(null));
        assertNull(client.getContext().getEndpointDescriptor(se));
        InOnly me = client.createInOnlyExchange();
        me.setEndpoint(se);
        client.send(me);
        receiver.getMessageList().assertMessagesReceived(1);
View Full Code Here

    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);
  }
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.