Package org.apache.servicemix.nmr.api

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


        EasyMock.expect(nmr.createChannel()).andReturn(channel);
        Exchange xchg = control.createMock(Exchange.class);
        EasyMock.expect(channel.createExchange(Pattern.InOut)).andReturn(xchg);
        org.apache.servicemix.nmr.api.Message inMsg = control.createMock(org.apache.servicemix.nmr.api.Message.class);
        EasyMock.expect(xchg.getIn()).andReturn(inMsg);
        EndpointRegistry endpoints = control.createMock(EndpointRegistry.class);
        EasyMock.expect(channel.getNMR()).andReturn(nmr);
        EasyMock.expect(nmr.getEndpointRegistry()).andReturn(endpoints);
        org.apache.servicemix.nmr.api.Message outMsg = control.createMock(org.apache.servicemix.nmr.api.Message.class);
        EasyMock.expect(xchg.getOut()).andReturn(outMsg);
       
View Full Code Here


        EasyMock.expect(xchg.getIn()).andReturn(inMsg);
               
        Source source = new StreamSource(new ByteArrayInputStream(
                            "<message>TestHelloWorld</message>".getBytes()));
        EasyMock.expect(inMsg.getBody(Source.class)).andReturn(source);
        EndpointRegistry endpoints = control.createMock(EndpointRegistry.class);
        EasyMock.expect(nmr.getEndpointRegistry()).andReturn(endpoints);
        EasyMock.expect(nmrTransportFactory.getNmr().getEndpointRegistry()).andReturn(endpoints);
        control.replay();
        observer = new MessageObserver() {
            public void onMessage(Message m) {                   
View Full Code Here

        EasyMock.expect(inMsg.getAttachments()).andReturn(new HashMap<String, Object>());
        EasyMock.expect(inMsg.getHeaders()).andReturn(new HashMap<String, Object>());
        Source source = new StreamSource(new ByteArrayInputStream(
                            "<message>TestHelloWorld</message>".getBytes()));
        EasyMock.expect(inMsg.getBody(Source.class)).andReturn(source);
        EndpointRegistry endpoints = control.createMock(EndpointRegistry.class);
        EasyMock.expect(nmr.getEndpointRegistry()).andReturn(endpoints);
        EasyMock.expect(nmrTransportFactory.getNmr().getEndpointRegistry()).andReturn(endpoints);
        control.replay();
        observer = new MessageObserver() {
            public void onMessage(Message m) {                   
View Full Code Here

        nmrHeaders.put("hello", "world");
        EasyMock.expect(inMsg.getHeaders()).andReturn(nmrHeaders);
        Source source = new StreamSource(new ByteArrayInputStream(
                            "<message>TestHelloWorld</message>".getBytes()));
        EasyMock.expect(inMsg.getBody(Source.class)).andReturn(source);
        EndpointRegistry endpoints = control.createMock(EndpointRegistry.class);
        EasyMock.expect(nmr.getEndpointRegistry()).andReturn(endpoints);
        EasyMock.expect(nmrTransportFactory.getNmr().getEndpointRegistry()).andReturn(endpoints);
        control.replay();
        observer = new MessageObserver() {
            public void onMessage(Message m) {                   
View Full Code Here

        return new ServiceEndpointImpl(serviceName, endpointName);
    }

    protected List<ServiceEndpoint> getAllEndpoints() {
        List<ServiceEndpoint> endpoints = new ArrayList<ServiceEndpoint>();
        EndpointRegistry registry = getChannel().getNMR().getEndpointRegistry();
        for (Endpoint ep : registry.getServices()) {
            Map<String,?> props = registry.getProperties(ep);
            // Check if this endpoint is addressable in the JBI space
            if (props.get(Endpoint.SERVICE_NAME) != null && props.get(Endpoint.ENDPOINT_NAME) != null
                    && !Boolean.valueOf((String) props.get(Endpoint.UNTARGETABLE))) {
                endpoints.add(new ServiceEndpointImpl(props));
            }
View Full Code Here

        org.apache.servicemix.nmr.api.Message inMsg = control.createMock(org.apache.servicemix.nmr.api.Message.class);
        EasyMock.expect(xchg.getIn()).andReturn(inMsg);
        // just need to make sure the customer header is set
        inMsg.setHeader("myHeader", "value");
        EasyMock.expectLastCall();
        EndpointRegistry endpoints = control.createMock(EndpointRegistry.class);
        EasyMock.expect(channel.getNMR()).andReturn(nmr);
        EasyMock.expect(nmr.getEndpointRegistry()).andReturn(endpoints);
        org.apache.servicemix.nmr.api.Message outMsg = control.createMock(org.apache.servicemix.nmr.api.Message.class);
        EasyMock.expect(xchg.getOut()).andReturn(outMsg);
       
View Full Code Here

        nmrHeaders.put("hello", "world");
        EasyMock.expect(inMsg.getHeaders()).andReturn(nmrHeaders);
        Source source = new StreamSource(new ByteArrayInputStream(
                            "<message>TestHelloWorld</message>".getBytes()));
        EasyMock.expect(inMsg.getBody(Source.class)).andReturn(source);
        EndpointRegistry endpoints = control.createMock(EndpointRegistry.class);
        EasyMock.expect(nmr.getEndpointRegistry()).andReturn(endpoints);
        EasyMock.expect(nmrTransportFactory.getNmr().getEndpointRegistry()).andReturn(endpoints);
        control.replay();
        observer = new MessageObserver() {
            public void onMessage(Message m) {                   
View Full Code Here

        EasyMock.expect(nmr.createChannel()).andReturn(channel);
        Exchange xchg = control.createMock(Exchange.class);
        EasyMock.expect(channel.createExchange(Pattern.InOut)).andReturn(xchg);
        org.apache.servicemix.nmr.api.Message inMsg = control.createMock(org.apache.servicemix.nmr.api.Message.class);
        EasyMock.expect(xchg.getIn()).andReturn(inMsg);
        EndpointRegistry endpoints = control.createMock(EndpointRegistry.class);
        EasyMock.expect(channel.getNMR()).andReturn(nmr);
        EasyMock.expect(nmr.getEndpointRegistry()).andReturn(endpoints);
        org.apache.servicemix.nmr.api.Message outMsg = control.createMock(org.apache.servicemix.nmr.api.Message.class);
        EasyMock.expect(xchg.getOut()).andReturn(outMsg);
       
View Full Code Here

        EasyMock.expect(inMsg.getAttachments()).andReturn(new HashMap<String, Object>());
        EasyMock.expect(inMsg.getHeaders()).andReturn(new HashMap<String, Object>());
        Source source = new StreamSource(new ByteArrayInputStream(
                            "<message>TestHelloWorld</message>".getBytes()));
        EasyMock.expect(inMsg.getBody(Source.class)).andReturn(source);
        EndpointRegistry endpoints = control.createMock(EndpointRegistry.class);
        EasyMock.expect(nmr.getEndpointRegistry()).andReturn(endpoints);
        EasyMock.expect(nmrTransportFactory.getNmr().getEndpointRegistry()).andReturn(endpoints);
        control.replay();
        observer = new MessageObserver() {
            public void onMessage(Message m) {                   
View Full Code Here

        return new ServiceEndpointImpl(serviceName, endpointName);
    }

    protected List<ServiceEndpoint> getAllEndpoints() {
        List<ServiceEndpoint> endpoints = new ArrayList<ServiceEndpoint>();
        EndpointRegistry registry = getChannel().getNMR().getEndpointRegistry();
        for (Endpoint ep : registry.getServices()) {
            Map<String,?> props = registry.getProperties(ep);
            // Check if this endpoint is addressable in the JBI space
            if (props.get(Endpoint.SERVICE_NAME) != null && props.get(Endpoint.ENDPOINT_NAME) != null
                    && !Boolean.valueOf((String) props.get(Endpoint.UNTARGETABLE))) {
                endpoints.add(new ServiceEndpointImpl(props));
            }
View Full Code Here

TOP

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

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.