Package org.apache.servicemix.nmr.api

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


                exchange.setProperty(MessageExchange.class, me);
            }
        }
        // Translate the destination endpoint
        if (((InternalExchange) exchange).getDestination() != null && me.getEndpoint() == null) {
            Endpoint ep = ((InternalExchange) exchange).getDestination();
            Map<String, ?> props = context.getNmr().getEndpointRegistry().getProperties(ep);
            String strSvcName = (String) props.get(Endpoint.SERVICE_NAME);
            QName serviceName = (strSvcName != null && strSvcName.length() > 0) ? QName.valueOf(strSvcName) : DEFAULT_SERVICE_NAME;
            String endpointName = (String) props.get(Endpoint.ENDPOINT_NAME);
            if (endpointName == null) {
View Full Code Here


                                                                      endpoint.getServiceName().toString(),
                                                                      Endpoint.ENDPOINT_NAME,
                                                                      endpoint.getEndpointName()),
                                              false);
        if (eps != null && eps.size() == 1) {
            Endpoint ep = eps.get(0);
            componentRegistry.getNmr().getEndpointRegistry().unregister(ep, null);
        }
    }
View Full Code Here

                                                                      externalEndpoint.getServiceName().toString(),
                                                                      Endpoint.ENDPOINT_NAME,
                                                                      externalEndpoint.getEndpointName()),
                                                 true);
        if (eps != null && eps.size() == 1) {
            Endpoint ep = eps.get(0);
            componentRegistry.getNmr().getEndpointRegistry().unregister(ep, null);
        }
    }
View Full Code Here

        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

                exchange.setProperty(MessageExchange.class, me);
            }
        }
        // Translate the destination endpoint
        if (((InternalExchange) exchange).getDestination() != null && me.getEndpoint() == null) {
            Endpoint ep = ((InternalExchange) exchange).getDestination();
            Map<String, ?> props = context.getNmr().getEndpointRegistry().getProperties(ep);
            QName serviceName = (QName) props.get(Endpoint.SERVICE_NAME);
            if (serviceName == null) {
                serviceName = DEFAULT_SERVICE_NAME;
            }
View Full Code Here

        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

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.