Package org.apache.cxf.interceptor

Examples of org.apache.cxf.interceptor.Interceptor


        control.reset();
        setupMessage(true, true, true, true, true, true);       
        EffectivePolicy effectivePolicy = control.createMock(EffectivePolicy.class);
        EasyMock.expect(pe.getEffectiveClientRequestPolicy(ei, boi, conduit))
            .andReturn(effectivePolicy);
        Interceptor i = control.createMock(Interceptor.class);
        EasyMock.expect(effectivePolicy.getInterceptors())
            .andReturn(CastUtils.cast(Collections.singletonList(i), Interceptor.class));
        InterceptorChain ic = control.createMock(InterceptorChain.class);
        EasyMock.expect(message.getInterceptorChain()).andReturn(ic);
        ic.add(i);
View Full Code Here


        control.reset();
        setupMessage(true, true, true, true, true, true);
        EffectivePolicy effectivePolicy = control.createMock(EffectivePolicy.class);
        EasyMock.expect(pe.getEffectiveClientResponsePolicy(ei, boi)).andReturn(effectivePolicy);
        EasyMock.expect(effectivePolicy.getPolicy()).andReturn(new Policy()).times(2);
        Interceptor i = control.createMock(Interceptor.class);
        EasyMock.expect(effectivePolicy.getInterceptors())
            .andReturn(CastUtils.cast(Collections.singletonList(i), Interceptor.class));
        InterceptorChain ic = control.createMock(InterceptorChain.class);
        EasyMock.expect(message.getInterceptorChain()).andReturn(ic).anyTimes();
        ic.add(i);
View Full Code Here

       
        control.reset();
        setupMessage(true, true, false, false, true, true);
        EndpointPolicy endpointPolicy = control.createMock(EndpointPolicy.class);
        EasyMock.expect(pe.getClientEndpointPolicy(ei, conduit)).andReturn(endpointPolicy);
        Interceptor i = control.createMock(Interceptor.class);
        EasyMock.expect(endpointPolicy.getFaultInterceptors())
            .andReturn(CastUtils.cast(Collections.singletonList(i), Interceptor.class));
        InterceptorChain ic = control.createMock(InterceptorChain.class);
        EasyMock.expect(message.getInterceptorChain()).andReturn(ic);
        ic.add(i);
View Full Code Here

        control.reset();
        setupMessage(false, false, false, false, true, true);
        EndpointPolicy endpointPolicy = control.createMock(EndpointPolicyImpl.class);
        EasyMock.expect(pe.getServerEndpointPolicy(ei, destination)).andReturn(endpointPolicy);
        Interceptor i = control.createMock(Interceptor.class);
        EasyMock.expect(endpointPolicy.getInterceptors())
            .andReturn(CastUtils.cast(Collections.singletonList(i), Interceptor.class));
        InterceptorChain ic = control.createMock(InterceptorChain.class);
        EasyMock.expect(message.getInterceptorChain()).andReturn(ic);
        ic.add(i);
View Full Code Here

        control.reset();
        setupMessage(false, false, true, true, true, true);
        EffectivePolicy effectivePolicy = control.createMock(EffectivePolicy.class);
        EasyMock.expect(pe.getEffectiveServerResponsePolicy(ei, boi, destination))
            .andReturn(effectivePolicy);
        Interceptor i = control.createMock(Interceptor.class);       
        EasyMock.expect(effectivePolicy.getInterceptors())
            .andReturn(CastUtils.cast(Collections.singletonList(i), Interceptor.class));
        InterceptorChain ic = control.createMock(InterceptorChain.class);
        EasyMock.expect(message.getInterceptorChain()).andReturn(ic);
        ic.add(i);
View Full Code Here

        BindingFaultInfo bfi = control.createMock(BindingFaultInfo.class);
        EasyMock.expect(interceptor.getBindingFaultInfo(message, ex, boi)).andReturn(bfi);
        EffectivePolicy effectivePolicy = control.createMock(EffectivePolicyImpl.class);
        EasyMock.expect(pe.getEffectiveServerFaultPolicy(ei, bfi, destination))
            .andReturn(effectivePolicy);
        Interceptor i = control.createMock(Interceptor.class);
        EasyMock.expect(effectivePolicy.getInterceptors())
            .andReturn(CastUtils.cast(Collections.singletonList(i), Interceptor.class));
        InterceptorChain ic = control.createMock(InterceptorChain.class);
        EasyMock.expect(message.getInterceptorChain()).andReturn(ic);
        ic.add(i);
View Full Code Here

        assertNull(effectivePolicy.getInterceptors());
       
        Policy p = control.createMock(Policy.class);
        PolicyAssertion a = control.createMock(PolicyAssertion.class);
        List<PolicyAssertion> la = Collections.singletonList(a);
        Interceptor i = control.createMock(Interceptor.class);
        List<Interceptor> li = Collections.singletonList(i);
        control.replay();
        effectivePolicy.setPolicy(p);
        assertSame(p, effectivePolicy.getPolicy());
        effectivePolicy.setChosenAlternative(la);
View Full Code Here

        control.reset();
        setupPolicyInterceptorProviderRegistry(engine, reg);
        EasyMock.expect(a.getName()).andReturn(qn);       
        PolicyInterceptorProvider pp = control.createMock(PolicyInterceptorProvider.class);              
        EasyMock.expect(reg.get(qn)).andReturn(pp);
        Interceptor pi = control.createMock(Interceptor.class);
        EasyMock.expect(pp.getOutInterceptors()).andReturn(Collections.singletonList(pi));
        control.replay();
        epi.initialiseInterceptors(engine);
        assertEquals(1, epi.getInterceptors().size());
        assertSame(pi, epi.getInterceptors().get(0));
View Full Code Here

        Message oldMessage = CURRENT_MESSAGE.get();
        try {
            CURRENT_MESSAGE.set(message);
            while (state == State.EXECUTING && iterator.hasNext()) {
                try {
                    Interceptor currentInterceptor = iterator.next();
                    if (isFineLogging) {
                        LOG.fine("Invoking handleMessage on interceptor " + currentInterceptor);
                    }
                    //System.out.println("-----------" + currentInterceptor);
                    currentInterceptor.handleMessage(message);
                } catch (SuspendedInvocationException ex) {
                    // we need to resume from the same interceptor the exception got originated from
                    if (iterator.hasPrevious()) {
                        iterator.previous();
                    }
View Full Code Here

   
    @SuppressWarnings("unchecked")
    private void unwind(Message message) {
        boolean isFineLogging = LOG.isLoggable(Level.FINE);
        while (iterator.hasPrevious()) {
            Interceptor currentInterceptor = iterator.previous();
            if (isFineLogging) {
                LOG.fine("Invoking handleFault on interceptor " + currentInterceptor);
            }
            try {
                currentInterceptor.handleFault(message);
            } catch (RuntimeException e) {
                LOG.log(Level.WARNING, "Exception in handleFault on interceptor " + currentInterceptor, e);
                throw e;
            } catch (Exception e) {
                LOG.log(Level.WARNING, "Exception in handleFault on interceptor " + currentInterceptor, e);
View Full Code Here

TOP

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

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.