Package org.apache.servicemix.nmr.api

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


        ServiceMix smx = new ServiceMix();
        smx.init();
        ComponentRegistryImpl reg = new ComponentRegistryImpl();
        reg.setNmr(smx);

        Endpoint tep = new Endpoint() {
            private Channel channel;
            public void setChannel(Channel channel) {
                this.channel = channel;
            }
            public void process(Exchange exchange) {
View Full Code Here


        assertNotNull(reg.getNmr());
        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));
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));
View Full Code Here

    }

    public void testEndpointListener() throws Exception {
        final CountDownLatch regLatch = new CountDownLatch(1);
        final CountDownLatch unregLatch = new CountDownLatch(1);
        Endpoint endpoint = new DummyEndpoint();
        nmr.getListenerRegistry().register(new EndpointListener() {
            public void endpointRegistered(InternalEndpoint endpoint) {
                regLatch.countDown();
            }
            public void endpointUnregistered(InternalEndpoint endpoint) {
View Full Code Here

    }
       
    public void testEndpointWiringOnQuery() throws Exception {
        final Map<String, Object> from = ServiceHelper.createMap(Endpoint.SERVICE_NAME, "test:wired-service",
                                                                 Endpoint.ENDPOINT_NAME, "endpoint");
        final Endpoint endpoint = createWiredEndpoint(from);
       
        // make sure that the query for the wire's from returns the target endpoint
        List<Endpoint> result = registry.query(from);
        assertEquals(1, result.size());
        assertEquals(endpoint, ((InternalEndpoint) result.get(0)).getEndpoint());
View Full Code Here

    }
   
    public void testEndpointWiringOnLookup() throws Exception {
        final Map<String, Object> from = ServiceHelper.createMap(Endpoint.SERVICE_NAME, "test:wired-service",
                                                                 Endpoint.ENDPOINT_NAME, "endpoint");
        final Endpoint endpoint = createWiredEndpoint(from);
       
        // make sure that the query for the wire's from returns the target endpoint
        Reference ref = registry.lookup(from);
        assertNotNull(ref);
        assertTrue(ref instanceof InternalReference);
View Full Code Here

        return createWiredEndpoint(from, ServiceHelper.createMap(Endpoint.SERVICE_NAME, "test:service",
                                                                 Endpoint.ENDPOINT_NAME, "endpoint"));
    }

    private Endpoint createWiredEndpoint(Map<String, Object> from, Map<String, Object> to) {
        final Endpoint endpoint = new DummyEndpoint();
        registry.register(endpoint, to);
        nmr.getWireRegistry().register(ServiceHelper.createWire(from, to));
        return endpoint;
    }
View Full Code Here

TOP

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

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.