Package org.apache.cxf.interceptor

Examples of org.apache.cxf.interceptor.Interceptor


        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


  }
 
  private void removeMessageLogging(Bus bus) {
    Collection<Feature> features = bus.getFeatures();
    Feature logFeature = null;
    Interceptor inLogInterceptor = null;
    Interceptor outLogInterceptor = null;
    for (Feature feature: features) {
      if (feature instanceof LoggingFeature) {
        logFeature = feature;
        break;
      }
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 (Exception e) {
                LOG.log(Level.WARNING, "Exception in handleFault on interceptor " + currentInterceptor, e);
            }
        }
    }
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 (Exception e) {
                LOG.log(Level.WARNING, "Exception in handleFault on interceptor " + currentInterceptor, e);
            }
        }
    }
View Full Code Here

        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, 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.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, 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

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.