Package javax.jbi.servicedesc

Examples of javax.jbi.servicedesc.ServiceEndpoint


    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;
View Full Code Here


    public void testSendingToDynamicEndpointForAnnotatedBeanWithFooOperation() throws Exception {
        // now lets make a request on this endpoint
        DefaultServiceMixClient client = new DefaultServiceMixClient(jbi);

        DocumentFragment epr = URIResolver.createWSAEPR("bean:annotatedBean");
        ServiceEndpoint se = client.getContext().resolveEndpointReference(epr);
        assertNotNull("We should find a service endpoint!", se);

        InOnly exchange = client.createInOnlyExchange();
        exchange.setEndpoint(se);
        exchange.setOperation(new QName("foo"));
View Full Code Here

            // TODO: need to configure mep
            MessageExchange me = factory.createExchange(this.mep);
            me.setInterfaceName(interfaceName);
            me.setService(serviceName);
            if (endpointName != null) {
                ServiceEndpoint ep = component.getComponentContext().getEndpoint(serviceName, endpointName);
                me.setEndpoint(ep);
            }
            // TODO: set endpoint
            me.setOperation(operationName);
            NormalizedMessage nm = me.createMessage();
View Full Code Here

        ReceiverComponent receiver = new ReceiverComponent();
        jbi.activateComponent(receiver, "receiver");

        DefaultServiceMixClient client = new DefaultServiceMixClient(jbi);
        DocumentFragment epr = URIResolver.createWSAEPR("http://localhost:8192/?http.soap=true");
        ServiceEndpoint se = client.getContext().resolveEndpointReference(epr);
        assertNotNull(se);

        InOnly inonly = client.createInOnlyExchange();
        inonly.setEndpoint(se);
        inonly.getInMessage().setContent(new StringSource("<hello>world</hello>"));
View Full Code Here

            logger.debug("Received exchange: status: " + exchange.getStatus() + ", role: "
                            + (exchange.getRole() == Role.CONSUMER ? "consumer" : "provider"));
        }
        if (exchange.getRole() == Role.PROVIDER) {
            boolean dynamic = false;
            ServiceEndpoint endpoint = exchange.getEndpoint();
            String key = EndpointSupport.getKey(exchange.getEndpoint());
            Endpoint ep = (Endpoint) this.component.getRegistry().getEndpoint(key);
            if (ep == null) {
                if (endpoint.getServiceName().equals(getEPRServiceName())) {
                    ep = getResolvedEPR(exchange.getEndpoint());
                    dynamic = true;
                }
                if (ep == null) {
                    throw new IllegalStateException("Endpoint not found: " + key);
View Full Code Here

            throw new Exception("Subscribe request must have exactly one ConsumerReference node");
        }
        Element el = (Element) nl.item(0);
        DocumentFragment epr = doc.createDocumentFragment();
        epr.appendChild(el);
        ServiceEndpoint ep = getContext().resolveEndpointReference(epr);
        if (ep == null) {
            String[] parts = split(subscribeRequest.getConsumerReference().getAddress().getValue().trim());
            ep = getContext().getEndpoint(new QName(parts[0], parts[1]), parts[2]);
        }
        return ep;
View Full Code Here

            ServiceEndpoint[] endpoints = getEndpoints();
            if (endpoints == null || endpoints.length == 0) {
                throw new IllegalStateException("No endpoints found for interface "
                        + interfaceName + ", serviceName " + serviceName + " and endpoint " + endpointName);
            }
            ServiceEndpoint ep = chooseEndpoint(endpoints);
            if (ep == null) {
                throw new IllegalStateException("No suitable endpoint found");
            }
            if (serviceName != null && endpointName != null) {
                this.endpoint = ep;
View Full Code Here

    }
   
    protected ServiceEndpoint[] getEndpoints() throws JBIException {
        ServiceEndpoint[] endpoints;
        if (endpointName != null && serviceName != null) {
            ServiceEndpoint ep = context.getEndpoint(serviceName, endpointName);
            if (ep == null) {
                endpoints = new ServiceEndpoint[0];
            } else {
                this.endpoint = ep;
                endpoints = new ServiceEndpoint[] {ep };
View Full Code Here

public class DynamicEndpointTest extends SpringTestSupport {

    public void testSendingToDynamicEndpoint() throws Exception {
        ServiceMixClient client = new DefaultServiceMixClient(jbi);

        ServiceEndpoint se = client.resolveEndpointReference("ftp://servicemix:rocks@localhost/smx/test");
        assertNotNull("We should find a service endpoint!", se);

        InOnly exchange = client.createInOnlyExchange();
        exchange.setEndpoint(se);
        exchange.getInMessage().setProperty(DefaultFileMarshaler.FILE_NAME_PROPERTY, "test.xml");
View Full Code Here

    }

    protected ListenerBean assertInvokeListenerBean(String uri) throws Exception {
        ServiceMixClient client = new DefaultServiceMixClient(jbi);

        ServiceEndpoint se = client.resolveEndpointReference(uri);
        assertNotNull("We should find a service endpoint!", se);

        InOnly exchange = client.createInOnlyExchange();
        exchange.setEndpoint(se);
        exchange.getInMessage().setContent(new StringSource("<hello>world</hello>"));
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.