Examples of ServiceEndpoint


Examples of javax.jbi.servicedesc.ServiceEndpoint

            exchange.setOperation(targetOperation);
        }
        if (exchange.getService() == null && targetService != null) {
            exchange.setService(targetService);
            if (targetEndpoint != null) {
                ServiceEndpoint se = getContext().getEndpoint(targetService, targetEndpoint);
                if (se != null) {
                    exchange.setEndpoint(se);
                } else {
                    logger.warn("Target service (" + targetService + ") and endpoint (" + targetEndpoint + ")" +
                            " specified, but no matching endpoint found.  Only the service will be used for routing.");
View Full Code Here

Examples of javax.jbi.servicedesc.ServiceEndpoint

    public void stop() throws Exception {
        if (activated == null) {
            throw new IllegalStateException("Endpoint not activated: " + this);
        }
        ServiceEndpoint ep = activated;
        activated = null;
        ComponentContext ctx = getServiceUnit().getComponent().getComponentContext();
        ctx.deactivateEndpoint(ep);
    }
View Full Code Here

Examples of javax.jbi.servicedesc.ServiceEndpoint

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

        DefaultServiceMixClient client = new DefaultServiceMixClient(container);
        DocumentFragment epr = URIResolver.createWSAEPR("jms://queue/foo.bar.myqueue?jms.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

Examples of javax.jbi.servicedesc.ServiceEndpoint

public class DynamicEndpointTest extends SpringTestSupport {

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

        ServiceEndpoint se = client.resolveEndpointReference("xmpp://im.google.com/room");
        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

Examples of javax.jbi.servicedesc.ServiceEndpoint

        setProperty(message, "interface", exchange.getInterfaceName());
        setProperty(message, "operation", exchange.getOperation());
        setProperty(message, "service", exchange.getService());
        //message.setProperty("pattern", exchange.getPattern());
        //message.setProperty("role", exchange.getRole());
        ServiceEndpoint endpoint = exchange.getEndpoint();
        if (endpoint != null) {
            message.setProperty("endpointName", endpoint.getEndpointName());
        }
    }
View Full Code Here

Examples of javax.jbi.servicedesc.ServiceEndpoint

*/
public class UriConfigurationTest extends TestCase {


    public void testUriConfiguration() throws Exception {
        ServiceEndpoint serviceEndpoint = new ResolvedEndpoint("xmpp://servicemix-user@localhost/test-user@localhost", new QName("test"));

        XMPPComponent component = new XMPPComponent();
        PrivateChatEndpoint endpoint = (PrivateChatEndpoint) component.createEndpoint(serviceEndpoint);
        assertNotNull("Should have created an endpoint", endpoint);

View Full Code Here

Examples of javax.jbi.servicedesc.ServiceEndpoint

            }
        }
    }

    protected void resolveAddress(MessageExchangeImpl exchange) throws JBIException {
        ServiceEndpoint theEndpoint = exchange.getEndpoint();
        if (theEndpoint != null) {
            if (theEndpoint instanceof ExternalEndpoint) {
                throw new JBIException("External endpoints can not be used for routing: should be an internal or dynamic endpoint.");
            }
            if (!(theEndpoint instanceof AbstractServiceEndpoint)) {
                throw new JBIException(
                                "Component-specific endpoints can not be used for routing: should be an internal or dynamic endpoint.");
            }
        }
        // Resolve linked endpoints
        if (theEndpoint instanceof LinkedEndpoint) {
            QName svcName = ((LinkedEndpoint) theEndpoint).getToService();
            String epName = ((LinkedEndpoint) theEndpoint).getToEndpoint();
            ServiceEndpoint ep = registry.getInternalEndpoint(svcName, epName);
            if (ep == null) {
                throw new JBIException("Could not resolve linked endpoint: " + theEndpoint);
            }
            theEndpoint = ep;
        }
View Full Code Here

Examples of javax.jbi.servicedesc.ServiceEndpoint

     * @return the service endpoint corresponding to the given endpoint reference; <code>null</code> if the reference
     * cannot be resolved.
     */
    public ServiceEndpoint resolveEndpointReference(DocumentFragment epr) {
        for (ComponentMBeanImpl connector : getComponents()) {
            ServiceEndpoint se = connector.getComponent().resolveEndpointReference(epr);
            if (se != null) {
                return new DynamicEndpoint(connector.getComponentNameSpace(), se, epr)
            }
        }
        ServiceEndpoint se = resolveInternalEPR(epr);
        if (se != null) {
            return se;
        }
        return resolveStandardEPR(epr);
    }
View Full Code Here

Examples of javax.jbi.servicedesc.ServiceEndpoint

        for (int i = 0; i < messageCount; i++) {
            InOnly exchange = context.getDeliveryChannel().createExchangeFactory().createInOnlyExchange();
            NormalizedMessage msg = 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

Examples of javax.jbi.servicedesc.ServiceEndpoint

    }

    protected boolean isClustered(MessageExchange me) {
        MessageExchangeImpl mei = (MessageExchangeImpl) me;
        if (mei.getDestinationId() == null) {
            ServiceEndpoint se = me.getEndpoint();
            if (se instanceof InternalEndpoint) {
                return ((InternalEndpoint) se).isClustered();
                // Unknown: assume this is not clustered
            } else {
                return false;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.