Package org.apache.cxf.interceptor

Examples of org.apache.cxf.interceptor.Interceptor


        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


        updateIterator();
        boolean isFineLogging = LOG.isLoggable(Level.FINE);
        pausedMessage = 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

        return counters;
    }
   
    @PostConstruct
    void registerInterceptorsToBus() {
        Interceptor in = new ResponseTimeMessageInInterceptor();
        Interceptor invoker = new ResponseTimeMessageInvokerInterceptor();
        Interceptor out = new ResponseTimeMessageOutInterceptor();
       
        bus.getInInterceptors().add(in);
        bus.getInInterceptors().add(invoker);
        bus.getOutInterceptors().add(out);
        bus.setExtension(this, CounterRepository.class);
View Full Code Here

        assertNull(effectivePolicy.getInterceptors());
       
        Policy p = control.createMock(Policy.class);
        Assertion a = control.createMock(Assertion.class);
        List<Assertion> 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

        setupPolicyInterceptorProviderRegistry(engine, reg);
        EasyMock.expect(a.isOptional()).andReturn(false);
        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

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

        PolicyInterceptorProviderRegistry reg = control.createMock(PolicyInterceptorProviderRegistry.class);
        setupPolicyInterceptorProviderRegistry(engine, reg);
       
        PolicyInterceptorProvider app = control.createMock(PolicyInterceptorProvider.class);              
        EasyMock.expect(reg.get(aqn)).andReturn(app).times(requestor ? 2 : 1);
        Interceptor api = control.createMock(Interceptor.class);
        EasyMock.expect(app.getInInterceptors())
            .andReturn(Collections.singletonList(api));
        if (requestor) {
            EasyMock.expect(app.getInFaultInterceptors())
                .andReturn(Collections.singletonList(api));
View Full Code Here

    private RMManager getManager(SoapMessage message) {
        InterceptorChain chain = message.getInterceptorChain();
        ListIterator it = chain.getIterator();
        while (it.hasNext()) {
            Interceptor i = (Interceptor)it.next();
            if (i instanceof AbstractRMInterceptor) {
                return ((AbstractRMInterceptor)i).getManager();
            }
        }
        return null;
View Full Code Here

        mr.awaitMessages(nExpectedOut, nExpectedIn, timeout);
    }

    private void removeRMInterceptors(List<Interceptor> interceptors) {
        for (Iterator<Interceptor> it = interceptors.iterator(); it.hasNext();) {
            Interceptor i = it.next();
            if (i instanceof RMSoapInterceptor
                || i instanceof RMOutInterceptor
                || i instanceof RMInInterceptor) {
                it.remove();
            }
View Full Code Here

            greeterBus = bf.createBus(cfgResource);
            BusFactory.setDefaultBus(greeterBus);
            LOG.info("Initialised bus " + greeterBus + " with cfg file resource: " + cfgResource);
            LOG.fine("greeterBus inInterceptors: " + greeterBus.getInInterceptors());

            Interceptor logIn = new LoggingInInterceptor();
            Interceptor logOut = new LoggingOutInterceptor();
            greeterBus.getInInterceptors().add(logIn);
            greeterBus.getOutInterceptors().add(logOut);
            greeterBus.getOutFaultInterceptors().add(logOut);

            Endpoint.publish(address, implementor);
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.