Package org.apache.cxf.interceptor

Examples of org.apache.cxf.interceptor.InterceptorChain


        Exchange ex = control.createMock(Exchange.class);
        message.getExchange();
        EasyMock.expectLastCall().andReturn(ex).anyTimes();
        ex.get("deferred.uncorrelated.message.abort");
        EasyMock.expectLastCall().andReturn(Boolean.TRUE);
        InterceptorChain chain = control.createMock(InterceptorChain.class);
        message.getInterceptorChain();
        EasyMock.expectLastCall().andReturn(chain);
        chain.abort();
        EasyMock.expectLastCall();

        control.replay();
        interceptor.handle(message);
   
View Full Code Here


        EasyMock.expect(message.get(JAXWSAConstants.ADDRESSING_PROPERTIES_OUTBOUND))
            .andReturn(maps).anyTimes();
        RMProperties rmpsOut = new RMProperties();
        EasyMock.expect(message.get(RMMessageConstants.RM_PROPERTIES_OUTBOUND)).
            andReturn(rmpsOut).anyTimes();
        InterceptorChain chain = control.createMock(InterceptorChain.class);
        EasyMock.expect(message.getInterceptorChain()).andReturn(chain).anyTimes();
        EasyMock.expectLastCall();
               
        RMEndpoint rme = control.createMock(RMEndpoint.class);
        RMConfiguration config = new RMConfiguration();
View Full Code Here

        appMessageCount++;
        if (0 != (appMessageCount % 2)) {
            return;
        }
       
        InterceptorChain chain = message.getInterceptorChain();
        ListIterator<Interceptor<? extends Message>> it = chain.getIterator();
        while (it.hasNext()) {
            PhaseInterceptor<?> pi = (PhaseInterceptor)it.next();
            if (MessageSenderInterceptor.class.getName().equals(pi.getId())) {
                chain.remove(pi);
                LOG.fine("Removed MessageSenderInterceptor from interceptor chain.");
                break;
            }
        }
       
View Full Code Here

                                                            partialResponse,
                                                            reference);

                if (backChannel != null) {
                    // set up interceptor chains and send message
                    InterceptorChain chain =
                        fullResponse != null
                        ? fullResponse.getInterceptorChain()
                        : OutgoingChainInterceptor.getOutInterceptorChain(exchange);
                    partialResponse.setInterceptorChain(chain);
                    exchange.put(ConduitSelector.class,
                                 new PreexistingConduitSelector(backChannel,
                                                                exchange.get(Endpoint.class)));

                    if (chain != null && !chain.doIntercept(partialResponse)
                        && partialResponse.getContent(Exception.class) != null) {
                        if (partialResponse.getContent(Exception.class) instanceof Fault) {
                            throw (Fault)partialResponse.getContent(Exception.class);
                        } else {
                            throw new Fault(partialResponse.getContent(Exception.class));
                        }
                    }
                    if (chain != null) {
                        chain.reset();                       
                    }
                    exchange.put(ConduitSelector.class, new NullConduitSelector());
                   
                    if (fullResponse == null) {
                        fullResponse = createMessage(exchange);
View Full Code Here

        EasyMock.expect(pe.getEffectiveClientRequestPolicy(ei, boi, conduit))
            .andReturn(effectivePolicy);
        List<Interceptor<? extends Message>> li = createMockInterceptorList();
        EasyMock.expect(effectivePolicy.getInterceptors())
            .andReturn(li);
        InterceptorChain ic = control.createMock(InterceptorChain.class);
        EasyMock.expect(message.getInterceptorChain()).andReturn(ic);
        ic.add(li.get(0));
        EasyMock.expectLastCall();
        Collection<Assertion> assertions =
            CastUtils.cast(Collections.EMPTY_LIST, Assertion.class);
        EasyMock.expect(effectivePolicy.getChosenAlternative()).andReturn(assertions);
        control.replay();
View Full Code Here

        EasyMock.expect(effectivePolicy.getPolicy()).andReturn(new Policy()).times(2);
        Interceptor<? extends Message> i = control.createMock(Interceptor.class);
        List<Interceptor<? extends Message>> lst = new ArrayList<Interceptor<? extends Message>>();
        lst.add(i);
        EasyMock.expect(effectivePolicy.getInterceptors()).andReturn(lst);
        InterceptorChain ic = control.createMock(InterceptorChain.class);
        EasyMock.expect(message.getInterceptorChain()).andReturn(ic).anyTimes();
        ic.add(i);
        EasyMock.expectLastCall();
        message.put(EasyMock.eq(AssertionInfoMap.class), EasyMock.isA(AssertionInfoMap.class));
        EasyMock.expectLastCall();
        ic.add(PolicyVerificationInInterceptor.INSTANCE);
        control.replay();
        interceptor.handleMessage(message);
        control.verify();       
    }
View Full Code Here

        EndpointPolicy endpointPolicy = control.createMock(EndpointPolicy.class);
        EasyMock.expect(pe.getClientEndpointPolicy(ei, conduit)).andReturn(endpointPolicy);
        List<Interceptor<? extends Message>> li = createMockInterceptorList();
        EasyMock.expect(endpointPolicy.getFaultInterceptors())
            .andReturn(li);
        InterceptorChain ic = control.createMock(InterceptorChain.class);
        EasyMock.expect(message.getInterceptorChain()).andReturn(ic);
        ic.add(li.get(0));
        EasyMock.expectLastCall();
        Collection<Assertion> assertions =
            CastUtils.cast(Collections.EMPTY_LIST, Assertion.class);
        EasyMock.expect(endpointPolicy.getFaultVocabulary()).andReturn(assertions);
        control.replay();
View Full Code Here

        EndpointPolicy endpointPolicy = control.createMock(EndpointPolicyImpl.class);
        EasyMock.expect(pe.getServerEndpointPolicy(ei, destination)).andReturn(endpointPolicy);
        List<Interceptor<? extends Message>> li = createMockInterceptorList();
        EasyMock.expect(endpointPolicy.getInterceptors())
            .andReturn(li);
        InterceptorChain ic = control.createMock(InterceptorChain.class);
        EasyMock.expect(message.getInterceptorChain()).andReturn(ic);
        ic.add(li.get(0));
        EasyMock.expectLastCall();
        Collection<Assertion> assertions =
            CastUtils.cast(Collections.EMPTY_LIST, Assertion.class);
        EasyMock.expect(endpointPolicy.getVocabulary()).andReturn(assertions);
        control.replay();
View Full Code Here

        EasyMock.expect(pe.getEffectiveServerResponsePolicy(ei, boi, destination, null))
            .andReturn(effectivePolicy);
        List<Interceptor<? extends Message>> li = createMockInterceptorList();
        EasyMock.expect(effectivePolicy.getInterceptors())
            .andReturn(li);
        InterceptorChain ic = control.createMock(InterceptorChain.class);
        EasyMock.expect(message.getInterceptorChain()).andReturn(ic);
        ic.add(li.get(0));
        EasyMock.expectLastCall();
        Collection<Assertion> assertions =
            CastUtils.cast(Collections.EMPTY_LIST, Assertion.class);
        EasyMock.expect(effectivePolicy.getChosenAlternative()).andReturn(assertions);
        control.replay();
View Full Code Here

        EasyMock.expect(pe.getEffectiveServerFaultPolicy(ei, boi, bfi, destination))
            .andReturn(effectivePolicy);
        List<Interceptor<? extends Message>> li = createMockInterceptorList();
        EasyMock.expect(effectivePolicy.getInterceptors())
            .andReturn(li);
        InterceptorChain ic = control.createMock(InterceptorChain.class);
        EasyMock.expect(message.getInterceptorChain()).andReturn(ic);
        ic.add(li.get(0));
        EasyMock.expectLastCall();
        Collection<Assertion> assertions =
            CastUtils.cast(Collections.EMPTY_LIST, Assertion.class);
        EasyMock.expect(effectivePolicy.getChosenAlternative()).andReturn(assertions);
        control.replay();
View Full Code Here

TOP

Related Classes of org.apache.cxf.interceptor.InterceptorChain

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.