Package org.apache.servicemix.nmr.api

Examples of org.apache.servicemix.nmr.api.Reference


        Channel client = null;
        try {
            // Create the client channel
            client = nmr.createChannel();
            // Create a reference that will be used as the target for our exchanges
            Reference ref = nmr.getEndpointRegistry().lookup(ServiceHelper.createMap(Endpoint.NAME, "EchoEndpoint"));
            while (run) {
                try {
                    // Create an exchange and send it
                    Exchange e = client.createExchange(Pattern.InOut);
                    e.setTarget(ref);
View Full Code Here


        Channel client = null;
        try {
            // Create the client channel
            client = nmr.createChannel();
            // Create a reference that will be used as the target for our exchanges
            Reference ref = nmr.getEndpointRegistry().lookup(ServiceHelper.createMap(Endpoint.NAME, "EchoEndpoint"));
            while (run) {
                try {
                    // Create an exchange and send it
                    Exchange e = client.createExchange(Pattern.InOut);
                    e.setTarget(ref);
View Full Code Here

    }

    @Test
    public void testRegisterUnregister() throws Exception {
        Endpoint endpoint = new DummyEndpoint();
        Reference ref = registry.lookup(ServiceHelper.createMap(Endpoint.NAME, "id"));
        assertNotNull(ref);
        assertTrue(ref instanceof DynamicReferenceImpl);
        DynamicReferenceImpl r = (DynamicReferenceImpl) ref;
        assertNotNull(r.choose());
        assertFalse(r.choose().iterator().hasNext());
View Full Code Here

    @Test
    public void testLdapFilter() throws Exception {
        System.setProperty("org.osgi.vendor.framework", "org.apache.servicemix.nmr.core");

        Endpoint endpoint = new DummyEndpoint();
        Reference ref = registry.lookup("(NAME=id)");
        assertNotNull(ref);
        assertTrue(ref instanceof DynamicReferenceImpl);
        DynamicReferenceImpl r = (DynamicReferenceImpl) ref;
        assertNotNull(r.choose());
        assertFalse(r.choose().iterator().hasNext());
View Full Code Here

                }
            }
            if (props.isEmpty()) {
                throw new MessagingException("No endpoint, service or interface name specified for routing");
            }
            Reference target = context.getNmr().getEndpointRegistry().lookup(props);
            exchange.setTarget(target);
        }
    }
View Full Code Here

                }
            }
            if (props.isEmpty()) {
                throw new MessagingException("No endpoint, service or interface name specified for routing");
            }
            Reference target = context.getNmr().getEndpointRegistry().lookup(props);
            exchange.setTarget(target);
        }
    }
View Full Code Here

                refProps.put(Endpoint.INTERFACE_NAME, interfaceName.toString());
            }
            if (serviceName != null) {
                refProps.put(Endpoint.SERVICE_NAME, serviceName.toString());
            }
            Reference ref = channel.getNMR().getEndpointRegistry().lookup(refProps);
            xchng.setTarget(ref);
            xchng.setOperation(bop.getName());
            LOG.info("sending message");
            if (!isOneWay) {
                channel.sendSync(xchng);
View Full Code Here

            } else {
                if (portName != null) {
                    refProps.put(Endpoint.NAME, portName);
                }
            }
            Reference ref = channel.getNMR().getEndpointRegistry().lookup(refProps);
            xchng.setTarget(ref);
            xchng.setOperation(bop.getName());
            LOG.info("sending message");
            if (!isOneWay) {
                channel.sendSync(xchng);
View Full Code Here

        reg.init();
    }

    public void testRegisterUnregister() throws Exception {
        Endpoint endpoint = new DummyEndpoint();
        Reference ref = registry.lookup(ServiceHelper.createMap(Endpoint.NAME, "id"));
        assertNotNull(ref);
        assertTrue(ref instanceof InternalReference);
        InternalReference r = (InternalReference) ref;
        assertNotNull(r.choose(registry));
        assertFalse(r.choose(registry).iterator().hasNext());
View Full Code Here

    public void testLdapFilter() throws Exception {
        System.setProperty("org.osgi.vendor.framework", "org.apache.servicemix.nmr.core");

        Endpoint endpoint = new DummyEndpoint();
        Reference ref = registry.lookup("(NAME=id)");
        assertNotNull(ref);
        assertTrue(ref instanceof InternalReference);
        InternalReference r = (InternalReference) ref;
        assertNotNull(r.choose(registry));
        assertFalse(r.choose(registry).iterator().hasNext());
View Full Code Here

TOP

Related Classes of org.apache.servicemix.nmr.api.Reference

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.