You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by se...@apache.org on 2009/07/02 13:50:51 UTC

svn commit: r790555 - in /cxf/branches/2.2.x-fixes: ./ api/src/main/java/org/apache/cxf/feature/ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/ rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/client/ systests/src/test/java/org/apache...

Author: sergeyb
Date: Thu Jul  2 11:50:51 2009
New Revision: 790555

URL: http://svn.apache.org/viewvc?rev=790555&view=rev
Log:
Merged revisions 790553 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r790553 | sergeyb | 2009-07-02 12:37:39 +0100 (Thu, 02 Jul 2009) | 1 line
  
  [CXF-2323] : Support for features in JAX-RS clients (patch from Eamonn with minor modifications, thanks)
........

Added:
    cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/ClientConfiguration.java
      - copied unchanged from r790553, cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/ClientConfiguration.java
Modified:
    cxf/branches/2.2.x-fixes/   (props changed)
    cxf/branches/2.2.x-fixes/api/src/main/java/org/apache/cxf/feature/AbstractFeature.java
    cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java
    cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java
    cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/JAXRSClientFactoryBean.java
    cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/WebClient.java
    cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/client/JAXRSClientFactoryBeanTest.java
    cxf/branches/2.2.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSSoapBookTest.java

Propchange: cxf/branches/2.2.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Jul  2 11:50:51 2009
@@ -1 +1 @@
-/cxf/trunk:782728-782730,783097,783294,783396,784059,784181-784184,784893,784895,785279-785282,785468,785621,785624,785651,785734,785866,786142,786271-786272,786395,786512,786514,786582-786583,786638,786647,786850,787200,787269,787277-787279,787290-787291,787305,787323,787366,787849,788030,788060,788187,788444,788451,788703,788752,788774,788819-788820,789013,789371,789387,789420,789527-789530,789704-789705,789788,789811,789896-789901,790074,790094,790134,790188,790294
+/cxf/trunk:782728-782730,783097,783294,783396,784059,784181-784184,784893,784895,785279-785282,785468,785621,785624,785651,785734,785866,786142,786271-786272,786395,786512,786514,786582-786583,786638,786647,786850,787200,787269,787277-787279,787290-787291,787305,787323,787366,787849,788030,788060,788187,788444,788451,788703,788752,788774,788819-788820,789013,789371,789387,789420,789527-789530,789704-789705,789788,789811,789896-789901,790074,790094,790134,790188,790294,790553

Propchange: cxf/branches/2.2.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.2.x-fixes/api/src/main/java/org/apache/cxf/feature/AbstractFeature.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/api/src/main/java/org/apache/cxf/feature/AbstractFeature.java?rev=790555&r1=790554&r2=790555&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/api/src/main/java/org/apache/cxf/feature/AbstractFeature.java (original)
+++ cxf/branches/2.2.x-fixes/api/src/main/java/org/apache/cxf/feature/AbstractFeature.java Thu Jul  2 11:50:51 2009
@@ -43,6 +43,10 @@
         initializeProvider(client, bus);
     }
     
+    public void initialize(InterceptorProvider interceptorProvider, Bus bus) {
+        initializeProvider(interceptorProvider, bus);
+    }
+    
     public void initialize(Bus bus) {
         initializeProvider(bus, bus);
     }
@@ -71,4 +75,4 @@
         }
         return active;
     }
-}
\ No newline at end of file
+}

Modified: cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java?rev=790555&r1=790554&r2=790555&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java (original)
+++ cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java Thu Jul  2 11:50:51 2009
@@ -50,7 +50,6 @@
 import org.apache.cxf.BusFactory;
 import org.apache.cxf.common.i18n.BundleUtils;
 import org.apache.cxf.common.logging.LogUtils;
-import org.apache.cxf.common.util.ModCountCopyOnWriteArrayList;
 import org.apache.cxf.endpoint.ConduitSelector;
 import org.apache.cxf.endpoint.Endpoint;
 import org.apache.cxf.helpers.IOUtils;
@@ -75,23 +74,17 @@
  *
  */
 public class AbstractClient implements Client, InvocationHandlerAware {
-
     private static final Logger LOG = LogUtils.getL7dLogger(AbstractClient.class);
     private static final ResourceBundle BUNDLE = BundleUtils.getBundle(AbstractClient.class);
-    
-    protected List<Interceptor> inInterceptors = new ModCountCopyOnWriteArrayList<Interceptor>();
-    protected List<Interceptor> outInterceptors = new ModCountCopyOnWriteArrayList<Interceptor>();
-    protected ConduitSelector conduitSelector;
-    protected Bus bus;
 
+    protected ClientConfiguration cfg = new ClientConfiguration();
+    
     private MultivaluedMap<String, String> requestHeaders = new MetadataMap<String, String>();
     private ResponseBuilder responseBuilder;
     
     private URI baseURI;
     private UriBuilder currentBuilder;
 
-    
-    
     protected AbstractClient(URI baseURI, URI currentURI) {
         this.baseURI = baseURI;
         this.currentBuilder = new UriBuilderImpl(currentURI);
@@ -485,31 +478,31 @@
         }
     }
     
-    protected void setConduitSelector(ConduitSelector cs) {
-        this.conduitSelector = cs;
+    protected ClientConfiguration getConfiguration() {
+        return cfg;
     }
     
-    protected void setBus(Bus bus) {
-        this.bus = bus;
+    protected void setConfiguration(ClientConfiguration config) {
+        cfg = config;
     }
     
     protected void prepareConduitSelector(Message message) {
-        conduitSelector.prepare(message);
-        message.getExchange().put(ConduitSelector.class, conduitSelector);
+        cfg.getConduitSelector().prepare(message);
+        message.getExchange().put(ConduitSelector.class, cfg.getConduitSelector());
     }
     
     protected PhaseInterceptorChain setupOutInterceptorChain(Endpoint endpoint) { 
-        PhaseManager pm = bus.getExtension(PhaseManager.class);
-        List<Interceptor> i1 = bus.getOutInterceptors();
-        List<Interceptor> i2 = outInterceptors;
+        PhaseManager pm = cfg.getBus().getExtension(PhaseManager.class);
+        List<Interceptor> i1 = cfg.getBus().getOutInterceptors();
+        List<Interceptor> i2 = cfg.getOutInterceptors();
         List<Interceptor> i3 = endpoint.getOutInterceptors();
         return new PhaseChainCache().get(pm.getOutPhases(), i1, i2, i3);
     }
     
     protected PhaseInterceptorChain setupInInterceptorChain(Endpoint endpoint) { 
-        PhaseManager pm = bus.getExtension(PhaseManager.class);
-        List<Interceptor> i1 = bus.getInInterceptors();
-        List<Interceptor> i2 = inInterceptors;
+        PhaseManager pm = cfg.getBus().getExtension(PhaseManager.class);
+        List<Interceptor> i1 = cfg.getBus().getInInterceptors();
+        List<Interceptor> i2 = cfg.getInInterceptors();
         List<Interceptor> i3 = endpoint.getInInterceptors();
         return new PhaseChainCache().get(pm.getInPhases(), i1, i2, i3);
     }
@@ -523,7 +516,7 @@
     protected Message createMessage(String httpMethod, 
                                     MultivaluedMap<String, String> headers,
                                     URI currentURI) {
-        Message m = conduitSelector.getEndpoint().getBinding().createMessage();
+        Message m = cfg.getConduitSelector().getEndpoint().getBinding().createMessage();
         m.put(Message.REQUESTOR_ROLE, Boolean.TRUE);
         m.put(Message.INBOUND_MESSAGE, Boolean.FALSE);
         
@@ -538,13 +531,13 @@
         Exchange exchange = new ExchangeImpl();
         exchange.setSynchronous(true);
         exchange.setOutMessage(m);
-        exchange.put(Bus.class, bus);
+        exchange.put(Bus.class, cfg.getBus());
         exchange.put(MessageObserver.class, new ClientMessageObserver());
-        exchange.put(Endpoint.class, conduitSelector.getEndpoint());
+        exchange.put(Endpoint.class, cfg.getConduitSelector().getEndpoint());
         exchange.setOneWay(false);
         m.setExchange(exchange);
         
-        PhaseInterceptorChain chain = setupOutInterceptorChain(conduitSelector.getEndpoint());
+        PhaseInterceptorChain chain = setupOutInterceptorChain(cfg.getConduitSelector().getEndpoint());
         m.setInterceptorChain(chain);
         
         //setup conduit selector
@@ -553,26 +546,18 @@
         return m;
     }
 
-    protected void setInInterceptors(List<Interceptor> interceptors) {
-        inInterceptors = interceptors;
-    }
-    
-    protected void setOutInterceptors(List<Interceptor> interceptors) {
-        outInterceptors = interceptors;
-    }
-    
     private class ClientMessageObserver implements MessageObserver {
 
         public void onMessage(Message m) {
             
-            Message message = conduitSelector.getEndpoint().getBinding().createMessage(m);
+            Message message = cfg.getConduitSelector().getEndpoint().getBinding().createMessage(m);
             message.put(Message.REQUESTOR_ROLE, Boolean.FALSE);
             message.put(Message.INBOUND_MESSAGE, Boolean.TRUE);
-            PhaseInterceptorChain chain = setupInInterceptorChain(conduitSelector.getEndpoint());
+            PhaseInterceptorChain chain = setupInInterceptorChain(cfg.getConduitSelector().getEndpoint());
             message.setInterceptorChain(chain);
             message.getExchange().setInMessage(message);
             Bus origBus = BusFactory.getThreadDefaultBus(false);
-            BusFactory.setThreadDefaultBus(bus);
+            BusFactory.setThreadDefaultBus(cfg.getBus());
 
             // execute chain
             try {
@@ -587,4 +572,6 @@
     public Object getInvocationHandler() {
         return this;
     }
+
+
 }

Modified: cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java?rev=790555&r1=790554&r2=790555&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java (original)
+++ cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/ClientProxyImpl.java Thu Jul  2 11:50:51 2009
@@ -145,10 +145,7 @@
                 reportInvalidResourceMethod(m, "INVALID_SUBRESOURCE");
             }
             ClientProxyImpl proxyImpl = new ClientProxyImpl(getBaseURI(), uri, subCri, false, inheritHeaders);
-            proxyImpl.setBus(bus);
-            proxyImpl.setConduitSelector(conduitSelector);
-            proxyImpl.setInInterceptors(inInterceptors);
-            proxyImpl.setOutInterceptors(outInterceptors);
+            proxyImpl.setConfiguration(getConfiguration());
             
             Object proxy = JAXRSClientFactory.create(m.getReturnType(), proxyImpl);
             if (inheritHeaders) {

Modified: cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/JAXRSClientFactoryBean.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/JAXRSClientFactoryBean.java?rev=790555&r1=790554&r2=790555&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/JAXRSClientFactoryBean.java (original)
+++ cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/JAXRSClientFactoryBean.java Thu Jul  2 11:50:51 2009
@@ -29,6 +29,7 @@
 import org.apache.cxf.endpoint.ConduitSelector;
 import org.apache.cxf.endpoint.Endpoint;
 import org.apache.cxf.endpoint.UpfrontConduitSelector;
+import org.apache.cxf.feature.AbstractFeature;
 import org.apache.cxf.jaxrs.AbstractJAXRSFactoryBean;
 import org.apache.cxf.jaxrs.JAXRSServiceFactoryBean;
 import org.apache.cxf.jaxrs.JAXRSServiceImpl;
@@ -167,14 +168,22 @@
             ep.getEndpointInfo().addExtensor(authPolicy);
         }
         
-        
-        client.setConduitSelector(getConduitSelector(ep));
-        client.setBus(getBus());
-        client.setOutInterceptors(getOutInterceptors());
-        client.setInInterceptors(getInInterceptors());
+        applyFeatures(client);
+        client.getConfiguration().setConduitSelector(getConduitSelector(ep));
+        client.getConfiguration().setBus(getBus());
+        client.getConfiguration().getOutInterceptors().addAll(getOutInterceptors());
+        client.getConfiguration().getInInterceptors().addAll(getInInterceptors());
         if (headers != null) {
             client.headers(headers);
         }
         setupFactory(ep);
     }
+    
+    protected void applyFeatures(AbstractClient client) {
+        if (getFeatures() != null) {
+            for (AbstractFeature feature : getFeatures()) {
+                feature.initialize(client.getConfiguration(), getBus());
+            }
+        }
+    }
 } 

Modified: cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/WebClient.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/WebClient.java?rev=790555&r1=790554&r2=790555&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/WebClient.java (original)
+++ cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/WebClient.java Thu Jul  2 11:50:51 2009
@@ -536,10 +536,7 @@
     static void copyProperties(Client toClient, Client fromClient) {
         AbstractClient newClient = toAbstractClient(toClient);
         AbstractClient oldClient = toAbstractClient(fromClient);
-        newClient.bus = oldClient.bus;
-        newClient.conduitSelector = oldClient.conduitSelector;
-        newClient.inInterceptors = oldClient.inInterceptors;
-        newClient.outInterceptors = oldClient.outInterceptors;
+        newClient.setConfiguration(oldClient.getConfiguration());
     }
     
     private static AbstractClient toAbstractClient(Client client) {

Modified: cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/client/JAXRSClientFactoryBeanTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/client/JAXRSClientFactoryBeanTest.java?rev=790555&r1=790554&r2=790555&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/client/JAXRSClientFactoryBeanTest.java (original)
+++ cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/client/JAXRSClientFactoryBeanTest.java Thu Jul  2 11:50:51 2009
@@ -19,8 +19,18 @@
 
 package org.apache.cxf.jaxrs.client;
 
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.feature.AbstractFeature;
+import org.apache.cxf.interceptor.Fault;
+import org.apache.cxf.interceptor.InterceptorProvider;
 import org.apache.cxf.jaxrs.resources.BookStore;
 import org.apache.cxf.jaxrs.resources.BookStoreSubresourcesOnly;
+import org.apache.cxf.message.Message;
+import org.apache.cxf.phase.AbstractPhaseInterceptor;
+import org.apache.cxf.phase.Phase;
 
 import org.junit.Assert;
 import org.junit.Test;
@@ -68,4 +78,57 @@
                      WebClient.client(store2).getCurrentURI().toString());
     }
     
+    @Test
+    public void testAddLoggingToClient() throws Exception {
+        JAXRSClientFactoryBean bean = new JAXRSClientFactoryBean();
+        bean.setAddress("http://bar");
+        bean.setResourceClass(BookStoreSubresourcesOnly.class);
+        TestFeature testFeature = new TestFeature();
+        List<AbstractFeature> features = new ArrayList<AbstractFeature>();
+        features.add((AbstractFeature)testFeature);
+        bean.setFeatures(features);
+        
+        BookStoreSubresourcesOnly store = bean.create(BookStoreSubresourcesOnly.class, 1, 2, 3);
+        assertTrue("TestFeature wasn't initialized", testFeature.isInitialized());
+        BookStoreSubresourcesOnly store2 = store.getItself3("id4");
+        assertEquals("http://bar/bookstore/1/2/3/id4/sub3", 
+                     WebClient.client(store2).getCurrentURI().toString());
+    }
+    
+    
+    private class TestFeature extends AbstractFeature {
+        private TestInterceptor testInterceptor;
+
+        @Override
+        protected void initializeProvider(InterceptorProvider provider, Bus bus) {
+            testInterceptor = new TestInterceptor();
+            provider.getOutInterceptors().add(testInterceptor);
+        }
+
+        protected boolean isInitialized() {
+            return testInterceptor.isInitialized();
+        }
+    }
+ 
+    private class TestInterceptor extends AbstractPhaseInterceptor<Message> {
+        private boolean isInitialized;
+
+        public TestInterceptor() {
+            this(Phase.PRE_STREAM);
+        }
+
+        public TestInterceptor(String s) {
+            super(Phase.PRE_STREAM);
+            isInitialized = true;
+        } 
+
+        public void handleMessage(Message message) throws Fault {
+        }
+
+        protected boolean isInitialized() {
+            return isInitialized;
+        }
+
+    }
+    
 }

Modified: cxf/branches/2.2.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSSoapBookTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSSoapBookTest.java?rev=790555&r1=790554&r2=790555&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSSoapBookTest.java (original)
+++ cxf/branches/2.2.x-fixes/systests/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSSoapBookTest.java Thu Jul  2 11:50:51 2009
@@ -24,6 +24,7 @@
 import java.io.InputStream;
 import java.net.URL;
 import java.net.URLConnection;
+import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
 import java.util.Map;
@@ -40,8 +41,11 @@
 import org.apache.commons.httpclient.methods.FileRequestEntity;
 import org.apache.commons.httpclient.methods.PostMethod;
 import org.apache.commons.httpclient.methods.RequestEntity;
+import org.apache.cxf.Bus;
+import org.apache.cxf.feature.AbstractFeature;
 import org.apache.cxf.helpers.IOUtils;
 import org.apache.cxf.interceptor.Fault;
+import org.apache.cxf.interceptor.InterceptorProvider;
 import org.apache.cxf.io.CachedOutputStream;
 import org.apache.cxf.jaxrs.client.JAXRSClientFactory;
 import org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean;
@@ -389,6 +393,23 @@
             getStringFromInputStream(getHttpInputStream("http://localhost:9092/test/services"));
         assertNotNull(listings);
     }
+    
+    @Test
+    public void testAddFeatureToClient() throws Exception {
+        String baseAddress = "http://localhost:9092/test/services/rest";
+        JAXRSClientFactoryBean bean = new JAXRSClientFactoryBean();
+        bean.setAddress(baseAddress);
+        bean.setResourceClass(BookStoreJaxrsJaxws.class);
+        TestFeature testFeature = new TestFeature();
+        List<AbstractFeature> features = new ArrayList<AbstractFeature>();
+        features.add((AbstractFeature)testFeature);
+        bean.setFeatures(features);
+        BookStoreJaxrsJaxws proxy = (BookStoreJaxrsJaxws)bean.create();
+        Book b = proxy.getBook(new Long("123"));
+        assertTrue("Interceptor not invoked", testFeature.handleMessageCalled());
+        assertEquals(123, b.getId());
+        assertEquals("CXF in Action", b.getName());
+    }
 
     private String getStringFromInputStream(InputStream in) throws Exception {        
         CachedOutputStream bos = new CachedOutputStream();
@@ -427,7 +448,7 @@
         }
         
     }
-    
+
     @Ignore 
     public class TestStreamDrainInterptor extends AbstractPhaseInterceptor<Message> {
         public TestStreamDrainInterptor() {
@@ -444,7 +465,7 @@
                 // input stream will be closed by readBytesFromStream()
                 payload = IOUtils.readBytesFromStream(is);
                 assertTrue("payload was null", payload != null);
-                assertTrue("payload was EMPTYR", payload.length > 0);
+                assertTrue("payload was EMPTY", payload.length > 0);
                 message.setContent(InputStream.class, new ByteArrayInputStream(payload));
             } catch (Exception e) {
                 String error = "Failed to read the stream properly due to " + e.getMessage();
@@ -453,4 +474,41 @@
         }
 
     }
+    
+    @Ignore
+    private class TestFeature extends AbstractFeature {
+        private TestInterceptor testInterceptor;
+
+        @Override
+        protected void initializeProvider(InterceptorProvider provider, Bus bus) {
+            testInterceptor = new TestInterceptor();
+            provider.getOutInterceptors().add(testInterceptor);
+        }
+
+        protected boolean handleMessageCalled() {
+            return testInterceptor.handleMessageCalled();
+        }
+    }
+ 
+    @Ignore
+    private class TestInterceptor extends AbstractPhaseInterceptor<Message> {
+        private boolean handleMessageCalled;
+        public TestInterceptor() {
+            this(Phase.PRE_STREAM);
+        }
+
+        public TestInterceptor(String s) {
+            super(Phase.PRE_STREAM);
+            
+        } 
+
+        public void handleMessage(Message message) throws Fault {
+            handleMessageCalled = true;
+        }
+
+        protected boolean handleMessageCalled() {
+            return handleMessageCalled;
+        }
+
+    }
 }