Package org.apache.cxf.endpoint

Examples of org.apache.cxf.endpoint.ConduitSelector


        return null;
    }
   
    protected Client createClient(Bus bus, Endpoint endpoint, final ProtocolVariation protocol,
                                  Conduit conduit, final EndpointReferenceType address) {
        ConduitSelector cs = new DeferredConduitSelector(conduit) {
            @Override
            public synchronized Conduit selectConduit(Message message) {
                Conduit conduit = null;
                EndpointInfo endpointInfo = getEndpoint().getEndpointInfo();
                EndpointReferenceType original =
View Full Code Here


        final String address = to.getValue();
        LOG.fine("Resending to address: " + address);
       
        final Endpoint reliableEndpoint = manager.getReliableEndpoint(message).getEndpoint();

        ConduitSelector cs = new DeferredConduitSelector() {
            @Override
            public synchronized Conduit selectConduit(Message message) {
                Conduit conduit = null;
                EndpointInfo endpointInfo = reliableEndpoint.getEndpointInfo();
                org.apache.cxf.ws.addressing.EndpointReferenceType original =
                    endpointInfo.getTarget();
                try {
                    if (null != address) {
                        endpointInfo.setAddress(address);
                    }
                    conduit = super.selectConduit(message);
                } finally {
                    endpointInfo.setAddress(original);
                }
                return conduit;
            }
        };
       
        cs.setEndpoint(reliableEndpoint);
        Conduit c = cs.selectConduit(message);  
        // REVISIT
        // use application endpoint message observer instead?
        c.setMessageObserver(new MessageObserver() {
            public void onMessage(Message message) {
                LOG.fine("Ignoring response to resent message.");
View Full Code Here

        updateWsdlExtensors("9052", PORT_B);
        updateWsdlExtensors("9053", PORT_C);
    }
       
    protected void verifyStrategy(Object proxy, Class<?> clz) {
        ConduitSelector conduitSelector =
            ClientProxy.getClient(proxy).getConduitSelector();
        if (conduitSelector instanceof FailoverTargetSelector) {
            Object strategy =
                ((FailoverTargetSelector)conduitSelector).getStrategy();
            assertTrue("unexpected strategy", clz.isInstance(strategy));
View Full Code Here

        final String address = to.getValue();
        LOG.fine("Resending to address: " + address);
        final ProtocolVariation protocol = RMContextUtils.getProtocolVariation(message);
        final Endpoint reliableEndpoint = manager.getReliableEndpoint(message).getEndpoint(protocol);

        ConduitSelector cs = new DeferredConduitSelector() {
            @Override
            public synchronized Conduit selectConduit(Message message) {
                Conduit conduit = null;
                EndpointInfo endpointInfo = reliableEndpoint.getEndpointInfo();
                EndpointReferenceType original =  endpointInfo.getTarget();
                try {
                    if (null != address) {
                        endpointInfo.setAddress(address);
                    }
                    conduit = super.selectConduit(message);
                } finally {
                    endpointInfo.setAddress(original);
                }
                return conduit;
            }
        };
       
        cs.setEndpoint(reliableEndpoint);
        Conduit c = cs.selectConduit(message);  
        // REVISIT
        // use application endpoint message observer instead?
        c.setMessageObserver(new MessageObserver() {
            public void onMessage(Message message) {
                LOG.fine("Ignoring response to resent message.");
View Full Code Here

    public void testRMClientGetConduit() {
        Proxy proxy = new Proxy(rme);
        Bus bus = control.createMock(Bus.class);
        Endpoint endpoint = control.createMock(Endpoint.class);
        Conduit conduit = control.createMock(Conduit.class);
        ConduitSelector cs = control.createMock(ConduitSelector.class);
        EasyMock.expect(cs.selectConduit(EasyMock.isA(Message.class))).andReturn(conduit);
        control.replay();
        Proxy.RMClient client = proxy.new RMClient(bus, endpoint, cs);
        assertSame(conduit, client.getConduit());   
    }
View Full Code Here

        return WebClient.client(client).getBaseURI().toString();
    }
   
       
    protected void verifyStrategy(Object proxy, Class clz) {
        ConduitSelector conduitSelector =
            WebClient.getConfig(proxy).getConduitSelector();
        if (conduitSelector instanceof FailoverTargetSelector) {
            Object strategy =
                ((FailoverTargetSelector)conduitSelector).getStrategy();
            assertTrue("unexpected strategy", clz.isInstance(strategy));
View Full Code Here

        return WebClient.getConfig(client).getConduitSelector()
            .getEndpoint().getEndpointInfo().getAddress();
    }
   
    protected void verifyStrategy(Object proxy, Class clz) {
        ConduitSelector conduitSelector =
            WebClient.getConfig(proxy).getConduitSelector();
        if (conduitSelector instanceof FailoverTargetSelector) {
            Object strategy =
                ((FailoverTargetSelector)conduitSelector).getStrategy();
            assertTrue("unexpected strategy", clz.isInstance(strategy));
View Full Code Here

    public void testDistributedSequentialStrategyWithoutFailover() throws Exception {
        startTarget(REPLICA_A);
        startTarget(REPLICA_C);
        setupGreeterA();
        verifyStrategy(greeter, SequentialStrategy.class, 3);
        ConduitSelector conduitSelector =
            ClientProxy.getClient(greeter).getConduitSelector();
        if (conduitSelector instanceof LoadDistributorTargetSelector) {
            ((LoadDistributorTargetSelector)conduitSelector).setFailover(false);
        } else {
            fail("unexpected conduit selector: " + conduitSelector);
View Full Code Here

        updateWsdlExtensors("9052", PORT_B);
        updateWsdlExtensors("9053", PORT_C);
    }
       
    protected void verifyStrategy(Object proxy, Class clz) {
        ConduitSelector conduitSelector =
            ClientProxy.getClient(proxy).getConduitSelector();
        if (conduitSelector instanceof FailoverTargetSelector) {
            Object strategy =
                ((FailoverTargetSelector)conduitSelector).getStrategy();
            assertTrue("unexpected strategy", clz.isInstance(strategy));
View Full Code Here

    private FailoverStrategy failoverStrategy;
   
    @Override
    public void initialize(Client client, Bus bus) {
        ConduitSelector selector = initTargetSelector(client.getConduitSelector().getEndpoint());
        client.setConduitSelector(selector);
    }
View Full Code Here

TOP

Related Classes of org.apache.cxf.endpoint.ConduitSelector

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.