servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r526601 [1/3] - in /incubator/servicemix/trunk/deployables/serviceengines/servicemix-wsn2005/src: main/java/org/apache/servicemix/wsn/ main/java/org/apache/servicemix/wsn/client/ main/java/org/apache/servicemix/wsn/component/ main/java/org/...
Date Sun, 08 Apr 2007 21:19:32 GMT
Author: gnodet
Date: Sun Apr  8 14:19:30 2007
New Revision: 526601

URL: http://svn.apache.org/viewvc?view=rev&rev=526601
Log:
Fix checkstyle and pmd violations

Modified:
    incubator/servicemix/trunk/deployables/serviceengines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/AbstractCreatePullPoint.java
    incubator/servicemix/trunk/deployables/serviceengines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/AbstractEndpoint.java
    incubator/servicemix/trunk/deployables/serviceengines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/AbstractNotificationBroker.java
    incubator/servicemix/trunk/deployables/serviceengines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/AbstractPublisher.java
    incubator/servicemix/trunk/deployables/serviceengines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/AbstractPullPoint.java
    incubator/servicemix/trunk/deployables/serviceengines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/AbstractSubscription.java
    incubator/servicemix/trunk/deployables/serviceengines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/EndpointManager.java
    incubator/servicemix/trunk/deployables/serviceengines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/EndpointRegistrationException.java
    incubator/servicemix/trunk/deployables/serviceengines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/client/AbstractWSAClient.java
    incubator/servicemix/trunk/deployables/serviceengines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/client/CreatePullPoint.java
    incubator/servicemix/trunk/deployables/serviceengines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/client/JAXBMarshaler.java
    incubator/servicemix/trunk/deployables/serviceengines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/client/NotificationBroker.java
    incubator/servicemix/trunk/deployables/serviceengines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/client/Publisher.java
    incubator/servicemix/trunk/deployables/serviceengines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/client/PullPoint.java
    incubator/servicemix/trunk/deployables/serviceengines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/client/Subscription.java
    incubator/servicemix/trunk/deployables/serviceengines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/component/WSNBootstrap.java
    incubator/servicemix/trunk/deployables/serviceengines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/component/WSNComponent.java
    incubator/servicemix/trunk/deployables/serviceengines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/component/WSNConfiguration.java
    incubator/servicemix/trunk/deployables/serviceengines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/component/WSNConfigurationMBean.java
    incubator/servicemix/trunk/deployables/serviceengines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/component/WSNDeployer.java
    incubator/servicemix/trunk/deployables/serviceengines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/component/WSNEndpoint.java
    incubator/servicemix/trunk/deployables/serviceengines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/component/WSNLifeCycle.java
    incubator/servicemix/trunk/deployables/serviceengines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/jbi/JbiNotificationBroker.java
    incubator/servicemix/trunk/deployables/serviceengines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/jbi/JbiPublisher.java
    incubator/servicemix/trunk/deployables/serviceengines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/jbi/JbiSubscription.java
    incubator/servicemix/trunk/deployables/serviceengines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/jms/InvalidTopicException.java
    incubator/servicemix/trunk/deployables/serviceengines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/jms/JmsCreatePullPoint.java
    incubator/servicemix/trunk/deployables/serviceengines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/jms/JmsNotificationBroker.java
    incubator/servicemix/trunk/deployables/serviceengines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/jms/JmsPublisher.java
    incubator/servicemix/trunk/deployables/serviceengines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/jms/JmsPullPoint.java
    incubator/servicemix/trunk/deployables/serviceengines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/jms/JmsSubscription.java
    incubator/servicemix/trunk/deployables/serviceengines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/jms/JmsTopicExpressionConverter.java
    incubator/servicemix/trunk/deployables/serviceengines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/spring/CreatePullPointFactoryBean.java
    incubator/servicemix/trunk/deployables/serviceengines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/spring/PublisherComponent.java
    incubator/servicemix/trunk/deployables/serviceengines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/spring/RegisterPublisherFactoryBean.java
    incubator/servicemix/trunk/deployables/serviceengines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/spring/SubscribeFactoryBean.java
    incubator/servicemix/trunk/deployables/serviceengines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/spring/WSNSpringComponent.java
    incubator/servicemix/trunk/deployables/serviceengines/servicemix-wsn2005/src/test/java/org/apache/servicemix/wsn/DummySubscription.java
    incubator/servicemix/trunk/deployables/serviceengines/servicemix-wsn2005/src/test/java/org/apache/servicemix/wsn/SubscriptionTest.java
    incubator/servicemix/trunk/deployables/serviceengines/servicemix-wsn2005/src/test/java/org/apache/servicemix/wsn/component/WSNComponentTest.java

Modified: incubator/servicemix/trunk/deployables/serviceengines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/AbstractCreatePullPoint.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/serviceengines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/AbstractCreatePullPoint.java?view=diff&rev=526601&r1=526600&r2=526601
==============================================================================
--- incubator/servicemix/trunk/deployables/serviceengines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/AbstractCreatePullPoint.java (original)
+++ incubator/servicemix/trunk/deployables/serviceengines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/AbstractCreatePullPoint.java Sun Apr  8 14:19:30 2007
@@ -25,6 +25,8 @@
 import javax.jws.WebResult;
 import javax.jws.WebService;
 
+import org.w3c.dom.Element;
+
 import org.apache.activemq.util.IdGenerator;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -34,7 +36,6 @@
 import org.apache.servicemix.wsn.jaxws.UnableToDestroyPullPointFault;
 import org.oasis_open.docs.wsn.b_2.CreatePullPointResponse;
 import org.oasis_open.docs.wsn.b_2.UnableToCreatePullPointFaultType;
-import org.w3c.dom.Element;
 
 @WebService(endpointInterface = "org.apache.servicemix.wsn.jaxws.CreatePullPoint")
 public abstract class AbstractCreatePullPoint extends AbstractEndpoint implements CreatePullPoint {
@@ -58,25 +59,29 @@
     public void destroy() throws Exception {
         unregister();
     }
-    
+
     @Override
     protected String createAddress() {
         return "http://servicemix.org/wsnotification/CreatePullPoint/" + getName();
     }
 
     @WebMethod(operationName = "CreatePullPoint")
-    @WebResult(name = "CreatePullPointResponse", targetNamespace = "http://docs.oasis-open.org/wsn/b-2", partName = "CreatePullPointResponse")
+    @WebResult(name = "CreatePullPointResponse", 
+               targetNamespace = "http://docs.oasis-open.org/wsn/b-2", 
+               partName = "CreatePullPointResponse")
     public CreatePullPointResponse createPullPoint(
-        @WebParam(name = "CreatePullPoint", targetNamespace = "http://docs.oasis-open.org/wsn/b-2", partName = "CreatePullPointRequest")
-        org.oasis_open.docs.wsn.b_2.CreatePullPoint createPullPointRequest)
-            throws UnableToCreatePullPointFault {
+            @WebParam(name = "CreatePullPoint", 
+                      targetNamespace = "http://docs.oasis-open.org/wsn/b-2", 
+                      partName = "CreatePullPointRequest")
+            org.oasis_open.docs.wsn.b_2.CreatePullPoint createPullPointRequest) throws UnableToCreatePullPointFault {
 
         log.debug("CreatePullEndpoint");
         return handleCreatePullPoint(createPullPointRequest, null);
     }
 
-    public CreatePullPointResponse handleCreatePullPoint(org.oasis_open.docs.wsn.b_2.CreatePullPoint createPullPointRequest, EndpointManager manager)
-            throws UnableToCreatePullPointFault {
+    public CreatePullPointResponse handleCreatePullPoint(
+            org.oasis_open.docs.wsn.b_2.CreatePullPoint createPullPointRequest, 
+            EndpointManager manager) throws UnableToCreatePullPointFault {
         AbstractPullPoint pullPoint = null;
         boolean success = false;
         try {

Modified: incubator/servicemix/trunk/deployables/serviceengines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/AbstractEndpoint.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/serviceengines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/AbstractEndpoint.java?view=diff&rev=526601&r1=526600&r2=526601
==============================================================================
--- incubator/servicemix/trunk/deployables/serviceengines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/AbstractEndpoint.java (original)
+++ incubator/servicemix/trunk/deployables/serviceengines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/AbstractEndpoint.java Sun Apr  8 14:19:30 2007
@@ -21,51 +21,50 @@
 
 public abstract class AbstractEndpoint {
 
-	protected String name;
-	protected String address;
-	protected EndpointManager manager;
-	protected Object endpoint;
-	
-	public AbstractEndpoint(String name) {
-		setName(name);
-	}
-	
-	public String getName() {
-		return name;
-	}
-
-	public void setName(String name) {
-		this.name = name;
-		this.address = createAddress();
-	}
-
-	public String getAddress() {
-		return address;
-	}
-    
+    protected final String name;
+
+    protected String address;
+
+    protected EndpointManager manager;
+
+    protected Object endpoint;
+
+    public AbstractEndpoint(String name) {
+        this.name = name;
+        this.address = createAddress();
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public String getAddress() {
+        return address;
+    }
+
     public void setAddress(String address) {
         this.address = address;
     }
-	
-	public void register() throws EndpointRegistrationException {
-		endpoint = manager.register(getAddress(), this);
-	}
-	
-	public void unregister() throws EndpointRegistrationException {
-		if (endpoint != null) {
-			manager.unregister(endpoint);
-		}
-	}
-
-	public EndpointManager getManager() {
-		return manager;
-	}
-
-	public void setManager(EndpointManager manager) {
-		this.manager = manager;
-	}
-	
-	protected abstract String createAddress();
+
+    public void register() throws EndpointRegistrationException {
+        endpoint = manager.register(getAddress(), this);
+    }
+
+    public void unregister() throws EndpointRegistrationException {
+        if (endpoint != null) {
+            manager.unregister(endpoint);
+        }
+    }
+
+    public EndpointManager getManager() {
+        return manager;
+    }
+
+    public void setManager(EndpointManager manager) {
+        this.manager = manager;
+    }
+
+    protected abstract String createAddress();
 
     public static EndpointReferenceType createEndpointReference(String address) {
         EndpointReferenceType epr = new EndpointReferenceType();

Modified: incubator/servicemix/trunk/deployables/serviceengines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/AbstractNotificationBroker.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/serviceengines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/AbstractNotificationBroker.java?view=diff&rev=526601&r1=526600&r2=526601
==============================================================================
--- incubator/servicemix/trunk/deployables/serviceengines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/AbstractNotificationBroker.java (original)
+++ incubator/servicemix/trunk/deployables/serviceengines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/AbstractNotificationBroker.java Sun Apr  8 14:19:30 2007
@@ -60,19 +60,22 @@
 @WebService(endpointInterface = "org.apache.servicemix.wsn.jaxws.NotificationBroker")
 public abstract class AbstractNotificationBroker extends AbstractEndpoint implements NotificationBroker {
 
-	private static Log log = LogFactory.getLog(AbstractNotificationBroker.class);
-	
+    private static Log log = LogFactory.getLog(AbstractNotificationBroker.class);
+
     private IdGenerator idGenerator;
+
     private AbstractPublisher anonymousPublisher;
-    private Map<String,AbstractPublisher> publishers;
-    private Map<String,AbstractSubscription> subscriptions;
 
-	public AbstractNotificationBroker(String name) {
-		super(name);
+    private Map<String, AbstractPublisher> publishers;
+
+    private Map<String, AbstractSubscription> subscriptions;
+
+    public AbstractNotificationBroker(String name) {
+        super(name);
         idGenerator = new IdGenerator();
-        subscriptions = new ConcurrentHashMap<String,AbstractSubscription>();
+        subscriptions = new ConcurrentHashMap<String, AbstractSubscription>();
         publishers = new ConcurrentHashMap<String, AbstractPublisher>();
-	}
+    }
 
     public void init() throws Exception {
         register();
@@ -86,9 +89,9 @@
     }
 
     protected String createAddress() {
-		return "http://servicemix.org/wsnotification/NotificationBroker/" + getName();
-	}
-	
+        return "http://servicemix.org/wsnotification/NotificationBroker/" + getName();
+    }
+
     /**
      * 
      * @param notify
@@ -96,42 +99,42 @@
     @WebMethod(operationName = "Notify")
     @Oneway
     public void notify(
-        @WebParam(name = "Notify", targetNamespace = "http://docs.oasis-open.org/wsn/b-1", partName = "Notify")
-        Notify notify) {
-    	
-    	log.debug("Notify");
-    	handleNotify(notify);
-    }
-    
-	protected void handleNotify(Notify notify) {
-		for (NotificationMessageHolderType messageHolder : notify.getNotificationMessage()) {
+            @WebParam(name = "Notify", 
+                      targetNamespace = "http://docs.oasis-open.org/wsn/b-1", 
+                      partName = "Notify")
+            Notify notify) {
+
+        log.debug("Notify");
+        handleNotify(notify);
+    }
+
+    protected void handleNotify(Notify notify) {
+        for (NotificationMessageHolderType messageHolder : notify.getNotificationMessage()) {
             EndpointReferenceType producerReference = messageHolder.getProducerReference();
             AbstractPublisher publisher = getPublisher(producerReference);
             if (publisher != null) {
-            	publisher.notify(messageHolder);
+                publisher.notify(messageHolder);
             }
-		}
-	}
+        }
+    }
+
+    protected AbstractPublisher getPublisher(EndpointReferenceType producerReference) {
+        AbstractPublisher publisher = null;
+        if (producerReference != null && producerReference.getAddress() != null
+                && producerReference.getAddress().getValue() != null) {
+            String address = producerReference.getAddress().getValue();
+            publisher = publishers.get(address);
+        }
+        if (publisher == null) {
+            publisher = anonymousPublisher;
+        }
+        return publisher;
+    }
 
-	protected AbstractPublisher getPublisher(EndpointReferenceType producerReference) {
-		AbstractPublisher publisher = null;
-		if (producerReference != null && 
-			producerReference.getAddress() != null &&
-			producerReference.getAddress().getValue() != null) {
-			String address = producerReference.getAddress().getValue();
-			publisher = publishers.get(address);
-		}
-		if (publisher == null) {
-			publisher = anonymousPublisher;
-		}
-		return publisher;
-	}
-	
     /**
      * 
      * @param subscribeRequest
-     * @return
-     *     returns org.oasis_open.docs.wsn.b_1.SubscribeResponse
+     * @return returns org.oasis_open.docs.wsn.b_1.SubscribeResponse
      * @throws SubscribeCreationFailedFault
      * @throws InvalidTopicExpressionFault
      * @throws TopicNotSupportedFault
@@ -144,60 +147,69 @@
      * @throws UnacceptableInitialTerminationTimeFault
      */
     @WebMethod(operationName = "Subscribe")
-    @WebResult(name = "SubscribeResponse", targetNamespace = "http://docs.oasis-open.org/wsn/b-1", partName = "SubscribeResponse")
+    @WebResult(name = "SubscribeResponse", 
+               targetNamespace = "http://docs.oasis-open.org/wsn/b-1", 
+               partName = "SubscribeResponse")
     public SubscribeResponse subscribe(
-        @WebParam(name = "Subscribe", targetNamespace = "http://docs.oasis-open.org/wsn/b-1", partName = "SubscribeRequest")
-        Subscribe subscribeRequest)
-        throws InvalidFilterFault, InvalidMessageContentExpressionFault, InvalidProducerPropertiesExpressionFault, InvalidTopicExpressionFault, ResourceUnknownFault, SubscribeCreationFailedFault, TopicExpressionDialectUnknownFault, TopicNotSupportedFault, UnacceptableInitialTerminationTimeFault {
-    	
-    	log.debug("Subscribe");
-    	return handleSubscribe(subscribeRequest, null);
-    }
-    
-	public SubscribeResponse handleSubscribe(Subscribe subscribeRequest,
-                                             EndpointManager manager) throws InvalidFilterFault, InvalidMessageContentExpressionFault, InvalidProducerPropertiesExpressionFault, InvalidTopicExpressionFault, SubscribeCreationFailedFault, TopicExpressionDialectUnknownFault, TopicNotSupportedFault, UnacceptableInitialTerminationTimeFault {
-		AbstractSubscription subscription = null;
-		boolean success = false;
-		try {
-			subscription = createSubcription(idGenerator.generateSanitizedId());
+            @WebParam(name = "Subscribe", 
+                      targetNamespace = "http://docs.oasis-open.org/wsn/b-1", 
+                      partName = "SubscribeRequest")
+            Subscribe subscribeRequest) throws InvalidFilterFault, InvalidMessageContentExpressionFault,
+            InvalidProducerPropertiesExpressionFault, InvalidTopicExpressionFault, ResourceUnknownFault,
+            SubscribeCreationFailedFault, TopicExpressionDialectUnknownFault, TopicNotSupportedFault,
+            UnacceptableInitialTerminationTimeFault {
+
+        log.debug("Subscribe");
+        return handleSubscribe(subscribeRequest, null);
+    }
+
+    public SubscribeResponse handleSubscribe(
+                Subscribe subscribeRequest, 
+                EndpointManager manager) throws InvalidFilterFault, InvalidMessageContentExpressionFault, 
+                                                InvalidProducerPropertiesExpressionFault, InvalidTopicExpressionFault,
+                                                SubscribeCreationFailedFault, TopicExpressionDialectUnknownFault,
+                                                TopicNotSupportedFault, UnacceptableInitialTerminationTimeFault {
+        AbstractSubscription subscription = null;
+        boolean success = false;
+        try {
+            subscription = createSubcription(idGenerator.generateSanitizedId());
             subscription.setBroker(this);
-			subscriptions.put(subscription.getAddress(), subscription);
-			subscription.create(subscribeRequest);
+            subscriptions.put(subscription.getAddress(), subscription);
+            subscription.create(subscribeRequest);
             if (manager != null) {
                 subscription.setManager(manager);
             }
             subscription.register();
-			SubscribeResponse response = new SubscribeResponse();
-			response.setSubscriptionReference(createEndpointReference(subscription.getAddress()));
-			success = true;
-			return response;
-		} catch (EndpointRegistrationException e) {
-			SubscribeCreationFailedFaultType fault = new SubscribeCreationFailedFaultType();
-			throw new SubscribeCreationFailedFault("Unable to register endpoint", fault, e);
-		} finally {
-			if (!success && subscription != null) {
-				subscriptions.remove(subscription);
-				try {
-					subscription.unsubscribe();
-				} catch (UnableToDestroySubscriptionFault e) {
-					log.info("Error destroying subscription", e);
-				}
-			}
-		}
-	}
-    
+            SubscribeResponse response = new SubscribeResponse();
+            response.setSubscriptionReference(createEndpointReference(subscription.getAddress()));
+            success = true;
+            return response;
+        } catch (EndpointRegistrationException e) {
+            SubscribeCreationFailedFaultType fault = new SubscribeCreationFailedFaultType();
+            throw new SubscribeCreationFailedFault("Unable to register endpoint", fault, e);
+        } finally {
+            if (!success && subscription != null) {
+                subscriptions.remove(subscription);
+                try {
+                    subscription.unsubscribe();
+                } catch (UnableToDestroySubscriptionFault e) {
+                    log.info("Error destroying subscription", e);
+                }
+            }
+        }
+    }
+
     public void unsubscribe(String address) throws UnableToDestroySubscriptionFault {
         AbstractSubscription subscription = (AbstractSubscription) subscriptions.remove(address);
         if (subscription != null) {
             subscription.unsubscribe();
         }
     }
-	
-	/**
+
+    /**
      * 
      * @param getCurrentMessageRequest
-     * @return
-     *     returns org.oasis_open.docs.wsn.b_1.GetCurrentMessageResponse
+     * @return returns org.oasis_open.docs.wsn.b_1.GetCurrentMessageResponse
      * @throws MultipleTopicsSpecifiedFault
      * @throws TopicNotSupportedFault
      * @throws InvalidTopicExpressionFault
@@ -206,22 +218,26 @@
      * @throws NoCurrentMessageOnTopicFault
      */
     @WebMethod(operationName = "GetCurrentMessage")
-    @WebResult(name = "GetCurrentMessageResponse", targetNamespace = "http://docs.oasis-open.org/wsn/b-1", partName = "GetCurrentMessageResponse")
+    @WebResult(name = "GetCurrentMessageResponse", 
+               targetNamespace = "http://docs.oasis-open.org/wsn/b-1", 
+               partName = "GetCurrentMessageResponse")
     public GetCurrentMessageResponse getCurrentMessage(
-        @WebParam(name = "GetCurrentMessage", targetNamespace = "http://docs.oasis-open.org/wsn/b-1", partName = "GetCurrentMessageRequest")
-        GetCurrentMessage getCurrentMessageRequest)
-        throws InvalidTopicExpressionFault, MultipleTopicsSpecifiedFault, NoCurrentMessageOnTopicFault, ResourceUnknownFault, TopicExpressionDialectUnknownFault, TopicNotSupportedFault {
-    	
-    	log.debug("GetCurrentMessage");
-    	NoCurrentMessageOnTopicFaultType fault = new NoCurrentMessageOnTopicFaultType();
-    	throw new NoCurrentMessageOnTopicFault("There is no current message on this topic.", fault);
+            @WebParam(name = "GetCurrentMessage", 
+                      targetNamespace = "http://docs.oasis-open.org/wsn/b-1", 
+                      partName = "GetCurrentMessageRequest")
+            GetCurrentMessage getCurrentMessageRequest) throws InvalidTopicExpressionFault,
+            MultipleTopicsSpecifiedFault, NoCurrentMessageOnTopicFault, ResourceUnknownFault,
+            TopicExpressionDialectUnknownFault, TopicNotSupportedFault {
+
+        log.debug("GetCurrentMessage");
+        NoCurrentMessageOnTopicFaultType fault = new NoCurrentMessageOnTopicFaultType();
+        throw new NoCurrentMessageOnTopicFault("There is no current message on this topic.", fault);
     }
 
     /**
      * 
      * @param registerPublisherRequest
-     * @return
-     *     returns org.oasis_open.docs.wsn.br_1.RegisterPublisherResponse
+     * @return returns org.oasis_open.docs.wsn.br_1.RegisterPublisherResponse
      * @throws PublisherRegistrationRejectedFault
      * @throws InvalidTopicExpressionFault
      * @throws TopicNotSupportedFault
@@ -229,23 +245,24 @@
      * @throws PublisherRegistrationFailedFault
      */
     @WebMethod(operationName = "RegisterPublisher")
-    @WebResult(name = "RegisterPublisherResponse", targetNamespace = "http://docs.oasis-open.org/wsn/br-1", partName = "RegisterPublisherResponse")
+    @WebResult(name = "RegisterPublisherResponse", 
+               targetNamespace = "http://docs.oasis-open.org/wsn/br-1", 
+               partName = "RegisterPublisherResponse")
     public RegisterPublisherResponse registerPublisher(
-        @WebParam(name = "RegisterPublisher", targetNamespace = "http://docs.oasis-open.org/wsn/br-1", partName = "RegisterPublisherRequest")
-        RegisterPublisher registerPublisherRequest)
-        throws InvalidTopicExpressionFault, PublisherRegistrationFailedFault, PublisherRegistrationRejectedFault, ResourceUnknownFault, TopicNotSupportedFault {
-    	
-    	log.debug("RegisterPublisher");
+            @WebParam(name = "RegisterPublisher", 
+                      targetNamespace = "http://docs.oasis-open.org/wsn/br-1", 
+                      partName = "RegisterPublisherRequest")
+            RegisterPublisher registerPublisherRequest) throws InvalidTopicExpressionFault,
+            PublisherRegistrationFailedFault, PublisherRegistrationRejectedFault, ResourceUnknownFault,
+            TopicNotSupportedFault {
+
+        log.debug("RegisterPublisher");
         return handleRegisterPublisher(registerPublisherRequest, null);
     }
-    
-    public RegisterPublisherResponse handleRegisterPublisher(
-                        RegisterPublisher registerPublisherRequest,
-                        EndpointManager manager) throws InvalidTopicExpressionFault, 
-                                                        PublisherRegistrationFailedFault, 
-                                                        PublisherRegistrationRejectedFault, 
-                                                        ResourceUnknownFault, 
-                                                        TopicNotSupportedFault {
+
+    public RegisterPublisherResponse handleRegisterPublisher(RegisterPublisher registerPublisherRequest,
+            EndpointManager manager) throws InvalidTopicExpressionFault, PublisherRegistrationFailedFault,
+            PublisherRegistrationRejectedFault, ResourceUnknownFault, TopicNotSupportedFault {
         AbstractPublisher publisher = null;
         boolean success = false;
         try {
@@ -256,7 +273,7 @@
             }
             publisher.register();
             publisher.create(registerPublisherRequest);
-            RegisterPublisherResponse response = new RegisterPublisherResponse(); 
+            RegisterPublisherResponse response = new RegisterPublisherResponse();
             response.setPublisherRegistrationReference(createEndpointReference(publisher.getAddress()));
             success = true;
             return response;
@@ -275,8 +292,8 @@
         }
     }
 
-	protected abstract AbstractPublisher createPublisher(String name);
-	
-	protected abstract AbstractSubscription createSubcription(String name);
+    protected abstract AbstractPublisher createPublisher(String name);
+
+    protected abstract AbstractSubscription createSubcription(String name);
 
 }

Modified: incubator/servicemix/trunk/deployables/serviceengines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/AbstractPublisher.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/serviceengines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/AbstractPublisher.java?view=diff&rev=526601&r1=526600&r2=526601
==============================================================================
--- incubator/servicemix/trunk/deployables/serviceengines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/AbstractPublisher.java (original)
+++ incubator/servicemix/trunk/deployables/serviceengines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/AbstractPublisher.java Sun Apr  8 14:19:30 2007
@@ -23,6 +23,13 @@
 import javax.jws.WebResult;
 import javax.jws.WebService;
 
+import org.apache.servicemix.wsn.jaxws.InvalidTopicExpressionFault;
+import org.apache.servicemix.wsn.jaxws.PublisherRegistrationFailedFault;
+import org.apache.servicemix.wsn.jaxws.PublisherRegistrationManager;
+import org.apache.servicemix.wsn.jaxws.PublisherRegistrationRejectedFault;
+import org.apache.servicemix.wsn.jaxws.ResourceNotDestroyedFault;
+import org.apache.servicemix.wsn.jaxws.ResourceUnknownFault;
+import org.apache.servicemix.wsn.jaxws.TopicNotSupportedFault;
 import org.oasis_open.docs.wsn.b_2.InvalidTopicExpressionFaultType;
 import org.oasis_open.docs.wsn.b_2.NotificationMessageHolderType;
 import org.oasis_open.docs.wsn.b_2.TopicExpressionType;
@@ -31,85 +38,85 @@
 import org.oasis_open.docs.wsn.br_2.PublisherRegistrationFailedFaultType;
 import org.oasis_open.docs.wsn.br_2.RegisterPublisher;
 import org.oasis_open.docs.wsn.br_2.ResourceNotDestroyedFaultType;
-import org.apache.servicemix.wsn.jaxws.InvalidTopicExpressionFault;
-import org.apache.servicemix.wsn.jaxws.PublisherRegistrationFailedFault;
-import org.apache.servicemix.wsn.jaxws.PublisherRegistrationManager;
-import org.apache.servicemix.wsn.jaxws.PublisherRegistrationRejectedFault;
-import org.apache.servicemix.wsn.jaxws.ResourceNotDestroyedFault;
-import org.apache.servicemix.wsn.jaxws.ResourceUnknownFault;
-import org.apache.servicemix.wsn.jaxws.TopicNotSupportedFault;
 import org.w3._2005._08.addressing.EndpointReferenceType;
 
 @WebService(endpointInterface = "org.apache.servicemix.wsn.jaxws.PublisherRegistrationManager")
-public abstract class AbstractPublisher extends AbstractEndpoint 
-									    implements PublisherRegistrationManager {
+public abstract class AbstractPublisher extends AbstractEndpoint implements PublisherRegistrationManager {
+
+    protected EndpointReferenceType publisherReference;
+
+    protected boolean demand;
+
+    protected List<TopicExpressionType> topic;
+
+    public AbstractPublisher(String name) {
+        super(name);
+    }
 
-	protected EndpointReferenceType publisherReference;
-	protected boolean demand;
-	protected List<TopicExpressionType> topic;
-	
-	public AbstractPublisher(String name) {
-		super(name);
-	}
-	
     /**
      * 
      * @param destroyRequest
-     * @return
-     *     returns org.oasis_open.docs.wsn.br_1.DestroyResponse
+     * @return returns org.oasis_open.docs.wsn.br_1.DestroyResponse
      * @throws ResourceNotDestroyedFault
      * @throws ResourceUnknownFault
      */
     @WebMethod(operationName = "DestroyRegistration")
-    @WebResult(name = "DestroyRegistrationResponse", targetNamespace = "http://docs.oasis-open.org/wsn/br-2", partName = "DestroyRegistrationResponse")
+    @WebResult(name = "DestroyRegistrationResponse", 
+               targetNamespace = "http://docs.oasis-open.org/wsn/br-2", 
+               partName = "DestroyRegistrationResponse")
     public DestroyRegistrationResponse destroyRegistration(
-        @WebParam(name = "DestroyRegistration", targetNamespace = "http://docs.oasis-open.org/wsn/br-2", partName = "DestroyRegistrationRequest")
-        DestroyRegistration destroyRegistrationRequest)
-        throws ResourceNotDestroyedFault, ResourceUnknownFault {
-    	
-    	destroy();
-    	return new DestroyRegistrationResponse();
+            @WebParam(name = "DestroyRegistration", 
+                      targetNamespace = "http://docs.oasis-open.org/wsn/br-2", 
+                      partName = "DestroyRegistrationRequest")
+            DestroyRegistration destroyRegistrationRequest) throws ResourceNotDestroyedFault, ResourceUnknownFault {
+
+        destroy();
+        return new DestroyRegistrationResponse();
     }
-    
+
     public abstract void notify(NotificationMessageHolderType messageHolder);
 
     protected void destroy() throws ResourceNotDestroyedFault {
-    	try {
-    		unregister();
-    	} catch (EndpointRegistrationException e) {
-    		ResourceNotDestroyedFaultType fault = new ResourceNotDestroyedFaultType();
-    		throw new ResourceNotDestroyedFault("Error unregistering endpoint", fault, e);
-    	}
-    }
-
-	protected String createAddress() {
-		return "http://servicemix.org/wsnotification/Publisher/" + getName();
-	}
-
-	public void create(RegisterPublisher registerPublisherRequest) throws InvalidTopicExpressionFault, PublisherRegistrationFailedFault, PublisherRegistrationRejectedFault, ResourceUnknownFault, TopicNotSupportedFault {
-		validatePublisher(registerPublisherRequest);
-		start();
-	}
-	
-	protected void validatePublisher(RegisterPublisher registerPublisherRequest) throws InvalidTopicExpressionFault, PublisherRegistrationFailedFault, PublisherRegistrationRejectedFault, ResourceUnknownFault, TopicNotSupportedFault {
-		// Check consumer reference
-		publisherReference = registerPublisherRequest.getPublisherReference();
-		// Check topic
-		topic = registerPublisherRequest.getTopic();
-		// Check demand based
-		demand = registerPublisherRequest.isDemand() != null ? registerPublisherRequest.isDemand().booleanValue() : false;
-		// Check all parameters
-		if (publisherReference == null) {
-			PublisherRegistrationFailedFaultType fault = new PublisherRegistrationFailedFaultType();
-			throw new PublisherRegistrationFailedFault("Invalid PublisherReference: null", fault);
-		}
-		if (demand) {
-			if (topic == null || topic.size() == 0) {
-				InvalidTopicExpressionFaultType fault = new InvalidTopicExpressionFaultType();
-				throw new InvalidTopicExpressionFault("Must specify at least one topic for demand-based publishing", fault);
-			}
-		}
-	}
-	
-	protected abstract void start() throws PublisherRegistrationFailedFault;
+        try {
+            unregister();
+        } catch (EndpointRegistrationException e) {
+            ResourceNotDestroyedFaultType fault = new ResourceNotDestroyedFaultType();
+            throw new ResourceNotDestroyedFault("Error unregistering endpoint", fault, e);
+        }
+    }
+
+    protected String createAddress() {
+        return "http://servicemix.org/wsnotification/Publisher/" + getName();
+    }
+
+    public void create(RegisterPublisher registerPublisherRequest) throws InvalidTopicExpressionFault,
+            PublisherRegistrationFailedFault, PublisherRegistrationRejectedFault, ResourceUnknownFault,
+            TopicNotSupportedFault {
+        validatePublisher(registerPublisherRequest);
+        start();
+    }
+
+    protected void validatePublisher(RegisterPublisher registerPublisherRequest) throws InvalidTopicExpressionFault,
+            PublisherRegistrationFailedFault, PublisherRegistrationRejectedFault, ResourceUnknownFault,
+            TopicNotSupportedFault {
+        // Check consumer reference
+        publisherReference = registerPublisherRequest.getPublisherReference();
+        // Check topic
+        topic = registerPublisherRequest.getTopic();
+        // Check demand based
+        demand = registerPublisherRequest.isDemand() != null ? registerPublisherRequest.isDemand().booleanValue()
+                : false;
+        // Check all parameters
+        if (publisherReference == null) {
+            PublisherRegistrationFailedFaultType fault = new PublisherRegistrationFailedFaultType();
+            throw new PublisherRegistrationFailedFault("Invalid PublisherReference: null", fault);
+        }
+        if (demand && (topic == null || topic.size() == 0)) {
+            InvalidTopicExpressionFaultType fault = new InvalidTopicExpressionFaultType();
+            throw new InvalidTopicExpressionFault(
+                    "Must specify at least one topic for demand-based publishing", fault);
+        }
+    }
+
+    protected abstract void start() throws PublisherRegistrationFailedFault;
 }

Modified: incubator/servicemix/trunk/deployables/serviceengines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/AbstractPullPoint.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/serviceengines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/AbstractPullPoint.java?view=diff&rev=526601&r1=526600&r2=526601
==============================================================================
--- incubator/servicemix/trunk/deployables/serviceengines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/AbstractPullPoint.java (original)
+++ incubator/servicemix/trunk/deployables/serviceengines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/AbstractPullPoint.java Sun Apr  8 14:19:30 2007
@@ -27,6 +27,12 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.servicemix.wsn.jaxws.NotificationConsumer;
+import org.apache.servicemix.wsn.jaxws.PullPoint;
+import org.apache.servicemix.wsn.jaxws.ResourceUnknownFault;
+import org.apache.servicemix.wsn.jaxws.UnableToCreatePullPointFault;
+import org.apache.servicemix.wsn.jaxws.UnableToDestroyPullPointFault;
+import org.apache.servicemix.wsn.jaxws.UnableToGetMessagesFault;
 import org.oasis_open.docs.wsn.b_2.CreatePullPoint;
 import org.oasis_open.docs.wsn.b_2.DestroyPullPoint;
 import org.oasis_open.docs.wsn.b_2.DestroyPullPointResponse;
@@ -35,25 +41,18 @@
 import org.oasis_open.docs.wsn.b_2.NotificationMessageHolderType;
 import org.oasis_open.docs.wsn.b_2.Notify;
 import org.oasis_open.docs.wsn.b_2.UnableToDestroyPullPointFaultType;
-import org.apache.servicemix.wsn.jaxws.NotificationConsumer;
-import org.apache.servicemix.wsn.jaxws.PullPoint;
-import org.apache.servicemix.wsn.jaxws.ResourceUnknownFault;
-import org.apache.servicemix.wsn.jaxws.UnableToCreatePullPointFault;
-import org.apache.servicemix.wsn.jaxws.UnableToDestroyPullPointFault;
-import org.apache.servicemix.wsn.jaxws.UnableToGetMessagesFault;
 
 @WebService(endpointInterface = "org.apache.servicemix.wsn.PullPointConsumer")
-public abstract class AbstractPullPoint extends AbstractEndpoint 
-										implements PullPoint, NotificationConsumer {
+public abstract class AbstractPullPoint extends AbstractEndpoint implements PullPoint, NotificationConsumer {
+
+    private static Log log = LogFactory.getLog(AbstractPullPoint.class);
 
-	private static Log log = LogFactory.getLog(AbstractPullPoint.class);
-	
     protected AbstractCreatePullPoint createPullPoint;
-    
-	public AbstractPullPoint(String name) {
-		super(name);
-	}
-	
+
+    public AbstractPullPoint(String name) {
+        super(name);
+    }
+
     /**
      * 
      * @param notify
@@ -61,75 +60,82 @@
     @WebMethod(operationName = "Notify")
     @Oneway
     public void notify(
-        @WebParam(name = "Notify", targetNamespace = "http://docs.oasis-open.org/wsn/b-1", partName = "Notify")
-        Notify notify) {
-    
-    	log.debug("Notify");
-    	for (NotificationMessageHolderType messageHolder : notify.getNotificationMessage()) {
-    		store(messageHolder);
-    	}
+            @WebParam(name = "Notify", 
+                      targetNamespace = "http://docs.oasis-open.org/wsn/b-1", 
+                      partName = "Notify")
+            Notify notify) {
+
+        log.debug("Notify");
+        for (NotificationMessageHolderType messageHolder : notify.getNotificationMessage()) {
+            store(messageHolder);
+        }
     }
-    
+
     /**
      * 
      * @param getMessagesRequest
-     * @return
-     *     returns org.oasis_open.docs.wsn.b_1.GetMessagesResponse
+     * @return returns org.oasis_open.docs.wsn.b_1.GetMessagesResponse
      * @throws ResourceUnknownFault
      */
     @WebMethod(operationName = "GetMessages")
-    @WebResult(name = "GetMessagesResponse", targetNamespace = "http://docs.oasis-open.org/wsn/b-1", partName = "GetMessagesResponse")
+    @WebResult(name = "GetMessagesResponse", 
+               targetNamespace = "http://docs.oasis-open.org/wsn/b-1", 
+               partName = "GetMessagesResponse")
     public GetMessagesResponse getMessages(
-        @WebParam(name = "GetMessages", targetNamespace = "http://docs.oasis-open.org/wsn/b-1", partName = "GetMessagesRequest")
-        GetMessages getMessagesRequest)
-        throws ResourceUnknownFault, UnableToGetMessagesFault {
-    	
-    	log.debug("GetMessages");
-    	BigInteger max = getMessagesRequest.getMaximumNumber();
-    	List<NotificationMessageHolderType> messages = getMessages(max != null ? max.intValue() : 0);
-    	GetMessagesResponse response = new GetMessagesResponse();
-    	response.getNotificationMessage().addAll(messages);
-    	return response;
+            @WebParam(name = "GetMessages", 
+                      targetNamespace = "http://docs.oasis-open.org/wsn/b-1", 
+                      partName = "GetMessagesRequest")
+            GetMessages getMessagesRequest) throws ResourceUnknownFault, UnableToGetMessagesFault {
+
+        log.debug("GetMessages");
+        BigInteger max = getMessagesRequest.getMaximumNumber();
+        List<NotificationMessageHolderType> messages = getMessages(max != null ? max.intValue() : 0);
+        GetMessagesResponse response = new GetMessagesResponse();
+        response.getNotificationMessage().addAll(messages);
+        return response;
     }
-    
+
     /**
      * 
      * @param destroyRequest
-     * @return
-     *     returns org.oasis_open.docs.wsn.b_1.DestroyResponse
+     * @return returns org.oasis_open.docs.wsn.b_1.DestroyResponse
      * @throws UnableToDestroyPullPoint
      */
     @WebMethod(operationName = "DestroyPullPoint")
-    @WebResult(name = "DestroyPullPointResponse", targetNamespace = "http://docs.oasis-open.org/wsn/b-2", partName = "DestroyPullPointResponse")
+    @WebResult(name = "DestroyPullPointResponse", 
+               targetNamespace = "http://docs.oasis-open.org/wsn/b-2", 
+               partName = "DestroyPullPointResponse")
     public DestroyPullPointResponse destroyPullPoint(
-        @WebParam(name = "DestroyPullPoint", targetNamespace = "http://docs.oasis-open.org/wsn/b-2", partName = "DestroyPullPointRequest")
-        DestroyPullPoint destroyPullPointRequest)
-        throws ResourceUnknownFault, UnableToDestroyPullPointFault {
-    	
-    	log.debug("Destroy");
+            @WebParam(name = "DestroyPullPoint", 
+                      targetNamespace = "http://docs.oasis-open.org/wsn/b-2", 
+                      partName = "DestroyPullPointRequest")
+            DestroyPullPoint destroyPullPointRequest) throws ResourceUnknownFault, UnableToDestroyPullPointFault {
+
+        log.debug("Destroy");
         createPullPoint.destroyPullPoint(getAddress());
-    	return new DestroyPullPointResponse();
+        return new DestroyPullPointResponse();
     }
-    
+
     public void create(CreatePullPoint createPullPointRequest) throws UnableToCreatePullPointFault {
     }
-    
-	protected abstract void store(NotificationMessageHolderType messageHolder);
 
-    protected abstract List<NotificationMessageHolderType> getMessages(int max) throws ResourceUnknownFault, UnableToGetMessagesFault;
+    protected abstract void store(NotificationMessageHolderType messageHolder);
+
+    protected abstract List<NotificationMessageHolderType> getMessages(int max) throws ResourceUnknownFault,
+            UnableToGetMessagesFault;
 
     protected void destroy() throws UnableToDestroyPullPointFault {
-    	try {
-    		unregister();
-    	} catch (EndpointRegistrationException e) {
-    		UnableToDestroyPullPointFaultType fault = new UnableToDestroyPullPointFaultType();
-    		throw new UnableToDestroyPullPointFault("Error unregistering endpoint", fault, e);
-    	}
+        try {
+            unregister();
+        } catch (EndpointRegistrationException e) {
+            UnableToDestroyPullPointFaultType fault = new UnableToDestroyPullPointFaultType();
+            throw new UnableToDestroyPullPointFault("Error unregistering endpoint", fault, e);
+        }
     }
 
-	protected String createAddress() {
-		return "http://servicemix.org/wsnotification/PullPoint/" + getName();
-	}
+    protected String createAddress() {
+        return "http://servicemix.org/wsnotification/PullPoint/" + getName();
+    }
 
     public AbstractCreatePullPoint getCreatePullPoint() {
         return createPullPoint;

Modified: incubator/servicemix/trunk/deployables/serviceengines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/AbstractSubscription.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/serviceengines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/AbstractSubscription.java?view=diff&rev=526601&r1=526600&r2=526601
==============================================================================
--- incubator/servicemix/trunk/deployables/serviceengines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/AbstractSubscription.java (original)
+++ incubator/servicemix/trunk/deployables/serviceengines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/AbstractSubscription.java Sun Apr  8 14:19:30 2007
@@ -30,6 +30,20 @@
 import javax.xml.datatype.XMLGregorianCalendar;
 import javax.xml.namespace.QName;
 
+import org.apache.servicemix.wsn.jaxws.InvalidFilterFault;
+import org.apache.servicemix.wsn.jaxws.InvalidMessageContentExpressionFault;
+import org.apache.servicemix.wsn.jaxws.InvalidProducerPropertiesExpressionFault;
+import org.apache.servicemix.wsn.jaxws.InvalidTopicExpressionFault;
+import org.apache.servicemix.wsn.jaxws.PausableSubscriptionManager;
+import org.apache.servicemix.wsn.jaxws.PauseFailedFault;
+import org.apache.servicemix.wsn.jaxws.ResourceUnknownFault;
+import org.apache.servicemix.wsn.jaxws.ResumeFailedFault;
+import org.apache.servicemix.wsn.jaxws.SubscribeCreationFailedFault;
+import org.apache.servicemix.wsn.jaxws.TopicExpressionDialectUnknownFault;
+import org.apache.servicemix.wsn.jaxws.TopicNotSupportedFault;
+import org.apache.servicemix.wsn.jaxws.UnableToDestroySubscriptionFault;
+import org.apache.servicemix.wsn.jaxws.UnacceptableInitialTerminationTimeFault;
+import org.apache.servicemix.wsn.jaxws.UnacceptableTerminationTimeFault;
 import org.oasis_open.docs.wsn.b_2.InvalidFilterFaultType;
 import org.oasis_open.docs.wsn.b_2.InvalidMessageContentExpressionFaultType;
 import org.oasis_open.docs.wsn.b_2.InvalidProducerPropertiesExpressionFaultType;
@@ -50,318 +64,332 @@
 import org.oasis_open.docs.wsn.b_2.Unsubscribe;
 import org.oasis_open.docs.wsn.b_2.UnsubscribeResponse;
 import org.oasis_open.docs.wsn.b_2.UseRaw;
-import org.apache.servicemix.wsn.jaxws.InvalidFilterFault;
-import org.apache.servicemix.wsn.jaxws.InvalidMessageContentExpressionFault;
-import org.apache.servicemix.wsn.jaxws.InvalidProducerPropertiesExpressionFault;
-import org.apache.servicemix.wsn.jaxws.InvalidTopicExpressionFault;
-import org.apache.servicemix.wsn.jaxws.PausableSubscriptionManager;
-import org.apache.servicemix.wsn.jaxws.PauseFailedFault;
-import org.apache.servicemix.wsn.jaxws.ResourceUnknownFault;
-import org.apache.servicemix.wsn.jaxws.ResumeFailedFault;
-import org.apache.servicemix.wsn.jaxws.SubscribeCreationFailedFault;
-import org.apache.servicemix.wsn.jaxws.TopicExpressionDialectUnknownFault;
-import org.apache.servicemix.wsn.jaxws.TopicNotSupportedFault;
-import org.apache.servicemix.wsn.jaxws.UnableToDestroySubscriptionFault;
-import org.apache.servicemix.wsn.jaxws.UnacceptableInitialTerminationTimeFault;
-import org.apache.servicemix.wsn.jaxws.UnacceptableTerminationTimeFault;
 import org.w3._2005._08.addressing.EndpointReferenceType;
 
 @WebService(endpointInterface = "org.apache.servicemix.wsn.jaxws.PausableSubscriptionManager")
-public abstract class AbstractSubscription extends AbstractEndpoint 
-										   implements PausableSubscriptionManager {
+public abstract class AbstractSubscription extends AbstractEndpoint implements PausableSubscriptionManager {
+
+    public static final String WSN_URI = "http://docs.oasis-open.org/wsn/b-2";
+
+    public static final String XPATH1_URI = "http://www.w3.org/TR/1999/REC-xpath-19991116";
+
+    public static final QName QNAME_TOPIC_EXPRESSION = new QName(WSN_URI, "TopicExpression");
+
+    public static final QName QNAME_PRODUCER_PROPERTIES = new QName(WSN_URI, "ProducerProperties");
+
+    public static final QName QNAME_MESSAGE_CONTENT = new QName(WSN_URI, "MessageContent");
+
+    public static final QName QNAME_USE_RAW = new QName(WSN_URI, "UseRaw");
+
+    protected DatatypeFactory datatypeFactory;
+
+    protected XMLGregorianCalendar terminationTime;
+
+    protected boolean useRaw;
+
+    protected TopicExpressionType topic;
+
+    protected QueryExpressionType contentFilter;
+
+    protected EndpointReferenceType consumerReference;
 
-	public static final String WSN_URI = "http://docs.oasis-open.org/wsn/b-2";
-	public static final String XPATH1_URI = "http://www.w3.org/TR/1999/REC-xpath-19991116";
-	public static final QName QNAME_TOPIC_EXPRESSION = new QName(WSN_URI, "TopicExpression");
-	public static final QName QNAME_PRODUCER_PROPERTIES = new QName(WSN_URI, "ProducerProperties");
-	public static final QName QNAME_MESSAGE_CONTENT = new QName(WSN_URI, "MessageContent");
-	public static final QName QNAME_USE_RAW = new QName(WSN_URI, "UseRaw");
-	
-	protected DatatypeFactory datatypeFactory;
-	protected XMLGregorianCalendar terminationTime;
-	protected boolean useRaw;
-	protected TopicExpressionType topic;
-	protected QueryExpressionType contentFilter;
-	protected EndpointReferenceType consumerReference;
     protected AbstractNotificationBroker broker;
-	
-	public AbstractSubscription(String name) {
-		super(name);
-		try {
-			this.datatypeFactory = DatatypeFactory.newInstance();
-		} catch (DatatypeConfigurationException e) {
-			throw new RuntimeException("Unable to initialize subscription", e);
-		}
-	}
-	
+
+    public AbstractSubscription(String name) {
+        super(name);
+        try {
+            this.datatypeFactory = DatatypeFactory.newInstance();
+        } catch (DatatypeConfigurationException e) {
+            throw new RuntimeException("Unable to initialize subscription", e);
+        }
+    }
+
     /**
      * 
      * @param renewRequest
-     * @return
-     *     returns org.oasis_open.docs.wsn.b_1.RenewResponse
+     * @return returns org.oasis_open.docs.wsn.b_1.RenewResponse
      * @throws UnacceptableTerminationTimeFault
      * @throws ResourceUnknownFault
      */
     @WebMethod(operationName = "Renew")
-    @WebResult(name = "RenewResponse", targetNamespace = "http://docs.oasis-open.org/wsn/b-2", partName = "RenewResponse")
+    @WebResult(name = "RenewResponse", 
+               targetNamespace = "http://docs.oasis-open.org/wsn/b-2", 
+               partName = "RenewResponse")
     public RenewResponse renew(
-        @WebParam(name = "Renew", targetNamespace = "http://docs.oasis-open.org/wsn/b-2", partName = "RenewRequest")
-        Renew renewRequest)
-        throws ResourceUnknownFault, UnacceptableTerminationTimeFault {
-    	
-    	XMLGregorianCalendar terminationTime = validateTerminationTime(renewRequest.getTerminationTime());
-    	renew(terminationTime);
-    	RenewResponse response = new RenewResponse();
-    	response.setTerminationTime(terminationTime);
-    	response.setCurrentTime(getCurrentTime());
-    	return response;
+            @WebParam(name = "Renew", 
+                      targetNamespace = "http://docs.oasis-open.org/wsn/b-2", 
+                      partName = "RenewRequest")
+            Renew renewRequest) throws ResourceUnknownFault, UnacceptableTerminationTimeFault {
+
+        XMLGregorianCalendar time = validateTerminationTime(renewRequest.getTerminationTime());
+        renew(time);
+        RenewResponse response = new RenewResponse();
+        response.setTerminationTime(time);
+        response.setCurrentTime(getCurrentTime());
+        return response;
     }
-    
+
     /**
      * 
      * @param unsubscribeRequest
-     * @return
-     *     returns org.oasis_open.docs.wsn.b_1.UnsubscribeResponse
+     * @return returns org.oasis_open.docs.wsn.b_1.UnsubscribeResponse
      * @throws UnableToDestroySubscriptionFault
      * @throws ResourceUnknownFault
      */
     @WebMethod(operationName = "Unsubscribe")
-    @WebResult(name = "UnsubscribeResponse", targetNamespace = "http://docs.oasis-open.org/wsn/b-2", partName = "UnsubscribeResponse")
+    @WebResult(name = "UnsubscribeResponse", 
+               targetNamespace = "http://docs.oasis-open.org/wsn/b-2", 
+               partName = "UnsubscribeResponse")
     public UnsubscribeResponse unsubscribe(
-        @WebParam(name = "Unsubscribe", targetNamespace = "http://docs.oasis-open.org/wsn/b-2", partName = "UnsubscribeRequest")
-        Unsubscribe unsubscribeRequest)
-        throws ResourceUnknownFault, UnableToDestroySubscriptionFault {
+            @WebParam(name = "Unsubscribe", 
+                      targetNamespace = "http://docs.oasis-open.org/wsn/b-2", 
+                      partName = "UnsubscribeRequest")
+            Unsubscribe unsubscribeRequest) throws ResourceUnknownFault, UnableToDestroySubscriptionFault {
 
-    	broker.unsubscribe(getAddress());
-    	return new UnsubscribeResponse();
+        broker.unsubscribe(getAddress());
+        return new UnsubscribeResponse();
     }
-    
+
     /**
      * 
      * @param pauseSubscriptionRequest
-     * @return
-     *     returns org.oasis_open.docs.wsn.b_1.PauseSubscriptionResponse
+     * @return returns org.oasis_open.docs.wsn.b_1.PauseSubscriptionResponse
      * @throws PauseFailedFault
      * @throws ResourceUnknownFault
      */
     @WebMethod(operationName = "PauseSubscription")
-    @WebResult(name = "PauseSubscriptionResponse", targetNamespace = "http://docs.oasis-open.org/wsn/b-2", partName = "PauseSubscriptionResponse")
+    @WebResult(name = "PauseSubscriptionResponse", 
+               targetNamespace = "http://docs.oasis-open.org/wsn/b-2", 
+               partName = "PauseSubscriptionResponse")
     public PauseSubscriptionResponse pauseSubscription(
-        @WebParam(name = "PauseSubscription", targetNamespace = "http://docs.oasis-open.org/wsn/b-2", partName = "PauseSubscriptionRequest")
-        PauseSubscription pauseSubscriptionRequest)
-        throws PauseFailedFault, ResourceUnknownFault {
+            @WebParam(name = "PauseSubscription", 
+                      targetNamespace = "http://docs.oasis-open.org/wsn/b-2", 
+                      partName = "PauseSubscriptionRequest")
+            PauseSubscription pauseSubscriptionRequest) throws PauseFailedFault, ResourceUnknownFault {
 
-    	pause();
-    	return new PauseSubscriptionResponse();
+        pause();
+        return new PauseSubscriptionResponse();
     }
 
     /**
      * 
      * @param resumeSubscriptionRequest
-     * @return
-     *     returns org.oasis_open.docs.wsn.b_1.ResumeSubscriptionResponse
+     * @return returns org.oasis_open.docs.wsn.b_1.ResumeSubscriptionResponse
      * @throws ResumeFailedFault
      * @throws ResourceUnknownFault
      */
     @WebMethod(operationName = "ResumeSubscription")
-    @WebResult(name = "ResumeSubscriptionResponse", targetNamespace = "http://docs.oasis-open.org/wsn/b-2", partName = "ResumeSubscriptionResponse")
+    @WebResult(name = "ResumeSubscriptionResponse", 
+               targetNamespace = "http://docs.oasis-open.org/wsn/b-2", 
+               partName = "ResumeSubscriptionResponse")
     public ResumeSubscriptionResponse resumeSubscription(
-        @WebParam(name = "ResumeSubscription", targetNamespace = "http://docs.oasis-open.org/wsn/b-2", partName = "ResumeSubscriptionRequest")
-        ResumeSubscription resumeSubscriptionRequest)
-        throws ResourceUnknownFault, ResumeFailedFault {
-
-    	resume();
-    	return new ResumeSubscriptionResponse();
-    }
-    
-    protected XMLGregorianCalendar validateInitialTerminationTime(String value) throws UnacceptableInitialTerminationTimeFault {
-    	XMLGregorianCalendar tt = parseTerminationTime(value);
-    	if (tt == null) {
-    		UnacceptableInitialTerminationTimeFaultType fault = new UnacceptableInitialTerminationTimeFaultType();
-        	throw new UnacceptableInitialTerminationTimeFault(
-        			"Unable to parse initial termination time: '" + value + "'",
-        			fault);
-    	}
-    	XMLGregorianCalendar ct = getCurrentTime();
-    	int c = tt.compare(ct);
-    	if (c == DatatypeConstants.LESSER || c == DatatypeConstants.EQUAL) {
-    		UnacceptableInitialTerminationTimeFaultType fault = new UnacceptableInitialTerminationTimeFaultType();
-        	fault.setMinimumTime(ct);
-        	throw new UnacceptableInitialTerminationTimeFault(
-        			"Invalid initial termination time",
-        			fault);
-    	}
-    	return tt;
+            @WebParam(name = "ResumeSubscription", 
+                      targetNamespace = "http://docs.oasis-open.org/wsn/b-2", 
+                      partName = "ResumeSubscriptionRequest")
+            ResumeSubscription resumeSubscriptionRequest) throws ResourceUnknownFault, ResumeFailedFault {
+
+        resume();
+        return new ResumeSubscriptionResponse();
+    }
+
+    protected XMLGregorianCalendar validateInitialTerminationTime(String value) 
+        throws UnacceptableInitialTerminationTimeFault {
+        XMLGregorianCalendar tt = parseTerminationTime(value);
+        if (tt == null) {
+            UnacceptableInitialTerminationTimeFaultType fault = new UnacceptableInitialTerminationTimeFaultType();
+            throw new UnacceptableInitialTerminationTimeFault("Unable to parse initial termination time: '" + value
+                    + "'", fault);
+        }
+        XMLGregorianCalendar ct = getCurrentTime();
+        int c = tt.compare(ct);
+        if (c == DatatypeConstants.LESSER || c == DatatypeConstants.EQUAL) {
+            UnacceptableInitialTerminationTimeFaultType fault = new UnacceptableInitialTerminationTimeFaultType();
+            fault.setMinimumTime(ct);
+            throw new UnacceptableInitialTerminationTimeFault("Invalid initial termination time", fault);
+        }
+        return tt;
     }
-    
+
     protected XMLGregorianCalendar validateTerminationTime(String value) throws UnacceptableTerminationTimeFault {
-    	XMLGregorianCalendar tt = parseTerminationTime(value);
-    	if (tt == null) {
-        	UnacceptableTerminationTimeFaultType fault = new UnacceptableTerminationTimeFaultType();
-        	throw new UnacceptableTerminationTimeFault(
-        			"Unable to parse termination time: '" + value + "'",
-        			fault);
-    	}
-    	XMLGregorianCalendar ct = getCurrentTime();
-    	int c = tt.compare(ct);
-    	if (c == DatatypeConstants.LESSER || c == DatatypeConstants.EQUAL) {
-        	UnacceptableTerminationTimeFaultType fault = new UnacceptableTerminationTimeFaultType();
-        	fault.setMinimumTime(ct);
-        	throw new UnacceptableTerminationTimeFault(
-        			"Invalid termination time",
-        			fault);
-    	}
-    	return tt;
+        XMLGregorianCalendar tt = parseTerminationTime(value);
+        if (tt == null) {
+            UnacceptableTerminationTimeFaultType fault = new UnacceptableTerminationTimeFaultType();
+            throw new UnacceptableTerminationTimeFault("Unable to parse termination time: '" + value + "'", fault);
+        }
+        XMLGregorianCalendar ct = getCurrentTime();
+        int c = tt.compare(ct);
+        if (c == DatatypeConstants.LESSER || c == DatatypeConstants.EQUAL) {
+            UnacceptableTerminationTimeFaultType fault = new UnacceptableTerminationTimeFaultType();
+            fault.setMinimumTime(ct);
+            throw new UnacceptableTerminationTimeFault("Invalid termination time", fault);
+        }
+        return tt;
     }
-    
+
     protected XMLGregorianCalendar parseTerminationTime(String value) {
-    	try {
-    		Duration d = datatypeFactory.newDuration(value);
-    		XMLGregorianCalendar c = getCurrentTime();
-    		c.add(d);
-    		return c;
-    	} catch (Exception e) { }
-    	try {
-    		Duration d = datatypeFactory.newDurationDayTime(value);
-    		XMLGregorianCalendar c = getCurrentTime();
-    		c.add(d);
-    		return c;
-    	} catch (Exception e) { }
-    	try {
-    		Duration d = datatypeFactory.newDurationYearMonth(value);
-    		XMLGregorianCalendar c = getCurrentTime();
-    		c.add(d);
-    		return c;
-    	} catch (Exception e) { }
-    	try {
-    		return datatypeFactory.newXMLGregorianCalendar(value);
-    	} catch (Exception e) { }
-    	return null;
+        try {
+            Duration d = datatypeFactory.newDuration(value);
+            XMLGregorianCalendar c = getCurrentTime();
+            c.add(d);
+            return c;
+        } catch (Exception e) {
+            // Ignore
+        }
+        try {
+            Duration d = datatypeFactory.newDurationDayTime(value);
+            XMLGregorianCalendar c = getCurrentTime();
+            c.add(d);
+            return c;
+        } catch (Exception e) {
+            // Ignore
+        }
+        try {
+            Duration d = datatypeFactory.newDurationYearMonth(value);
+            XMLGregorianCalendar c = getCurrentTime();
+            c.add(d);
+            return c;
+        } catch (Exception e) {
+            // Ignore
+        }
+        try {
+            return datatypeFactory.newXMLGregorianCalendar(value);
+        } catch (Exception e) {
+            // Ignore
+        }
+        return null;
     }
-    
+
     protected XMLGregorianCalendar getCurrentTime() {
-    	return datatypeFactory.newXMLGregorianCalendar(new GregorianCalendar());
+        return datatypeFactory.newXMLGregorianCalendar(new GregorianCalendar());
+    }
+
+    public XMLGregorianCalendar getTerminationTime() {
+        return terminationTime;
+    }
+
+    public void setTerminationTime(XMLGregorianCalendar terminationTime) {
+        this.terminationTime = terminationTime;
+    }
+
+    public void create(Subscribe subscribeRequest) throws InvalidFilterFault, InvalidMessageContentExpressionFault,
+            InvalidProducerPropertiesExpressionFault, InvalidTopicExpressionFault, SubscribeCreationFailedFault,
+            TopicExpressionDialectUnknownFault, TopicNotSupportedFault, UnacceptableInitialTerminationTimeFault {
+        validateSubscription(subscribeRequest);
+        start();
     }
 
-	public XMLGregorianCalendar getTerminationTime() {
-		return terminationTime;
-	}
-
-	public void setTerminationTime(XMLGregorianCalendar terminationTime) {
-		this.terminationTime = terminationTime;
-	}
-	
-	public void create(Subscribe subscribeRequest) throws InvalidFilterFault, InvalidMessageContentExpressionFault, InvalidProducerPropertiesExpressionFault, InvalidTopicExpressionFault, SubscribeCreationFailedFault, TopicExpressionDialectUnknownFault, TopicNotSupportedFault, UnacceptableInitialTerminationTimeFault {
-		validateSubscription(subscribeRequest);
-		start();
-	}
-	
-	protected abstract void start() throws SubscribeCreationFailedFault;
-	
-	protected abstract void pause() throws PauseFailedFault;
-	
+    protected abstract void start() throws SubscribeCreationFailedFault;
+
+    protected abstract void pause() throws PauseFailedFault;
+
     protected abstract void resume() throws ResumeFailedFault;
 
-    protected abstract void renew(XMLGregorianCalendar terminationTime) throws UnacceptableTerminationTimeFault;
+    protected abstract void renew(XMLGregorianCalendar time) throws UnacceptableTerminationTimeFault;
 
     protected void unsubscribe() throws UnableToDestroySubscriptionFault {
-    	try {
-    		unregister();
-    	} catch (EndpointRegistrationException e) {
-    		UnableToDestroySubscriptionFaultType fault = new UnableToDestroySubscriptionFaultType();
-    		throw new UnableToDestroySubscriptionFault("Error unregistering endpoint", fault, e);
-    	}
-    }
-
-	protected String createAddress() {
-		return "http://servicemix.org/wsnotification/Subscription/" + getName();
-	}
-
-	protected void validateSubscription(Subscribe subscribeRequest) throws InvalidFilterFault, InvalidMessageContentExpressionFault, InvalidProducerPropertiesExpressionFault, InvalidTopicExpressionFault, SubscribeCreationFailedFault, TopicExpressionDialectUnknownFault, TopicNotSupportedFault, UnacceptableInitialTerminationTimeFault {
-		// Check consumer reference
-		consumerReference = subscribeRequest.getConsumerReference();
-		// Check terminationTime
-		if (subscribeRequest.getInitialTerminationTime() != null &&
-			subscribeRequest.getInitialTerminationTime().isNil() == false &&
-			subscribeRequest.getInitialTerminationTime().getValue() != null) {
-			String strTerminationTime = subscribeRequest.getInitialTerminationTime().getValue();
-			terminationTime = validateInitialTerminationTime(strTerminationTime.trim());
-		}
-		// Check filter
-		if (subscribeRequest.getFilter() != null) {
-			for (Object f : subscribeRequest.getFilter().getAny()) {
-				JAXBElement e = null;
-				if (f instanceof JAXBElement) {
-					e = (JAXBElement) f;
-					f = e.getValue();
-				}
-				if (f instanceof TopicExpressionType) {
-					if (!e.getName().equals(QNAME_TOPIC_EXPRESSION)) {
-						InvalidTopicExpressionFaultType fault = new InvalidTopicExpressionFaultType();
-						throw new InvalidTopicExpressionFault("Unrecognized TopicExpression: " + e, fault);
-					}
-					topic = (TopicExpressionType) f;
-				} else if (f instanceof QueryExpressionType) {
-					if (e != null && e.getName().equals(QNAME_PRODUCER_PROPERTIES)) {
-						InvalidProducerPropertiesExpressionFaultType fault = new InvalidProducerPropertiesExpressionFaultType();
-						throw new InvalidProducerPropertiesExpressionFault("ProducerProperties are not supported", fault);
-					} else if (e != null && e.getName().equals(QNAME_MESSAGE_CONTENT)) {
-						if (contentFilter != null) {
-							InvalidMessageContentExpressionFaultType fault = new InvalidMessageContentExpressionFaultType();
-							throw new InvalidMessageContentExpressionFault("Only one MessageContent filter can be specified", fault);
-						}
-						contentFilter = (QueryExpressionType) f;
-						// Defaults to XPath 1.0
-						if (contentFilter.getDialect() == null) {
-							contentFilter.setDialect(XPATH1_URI);
-						}
-					} else {
-						InvalidFilterFaultType fault = new InvalidFilterFaultType();
-						throw new InvalidFilterFault("Unrecognized filter: " + (e != null ? e.getName() : f), fault);
-					}
-				} else {
-					InvalidFilterFaultType fault = new InvalidFilterFaultType();
-					throw new InvalidFilterFault("Unrecognized filter: " + (e != null ? e.getName() : f), fault);
-				}
-			}
-		}
-		// Check policy
-		if (subscribeRequest.getSubscriptionPolicy() != null) {
-			for (Object p : subscribeRequest.getSubscriptionPolicy().getAny()) {
-				JAXBElement e = null;
-				if (p instanceof JAXBElement) {
-					e = (JAXBElement) p;
-					p = e.getValue();
-				}
-				if (p instanceof UseRaw) {
-					useRaw = true;
-				} else {
-					InvalidFilterFaultType fault = new InvalidFilterFaultType();
-					throw new InvalidFilterFault("Unrecognized policy: " + p, fault);
-				}
-			}
-		}
-		// Check all parameters
-		if (consumerReference == null) {
-			SubscribeCreationFailedFaultType fault = new SubscribeCreationFailedFaultType();
-			throw new SubscribeCreationFailedFault("Invalid ConsumerReference: null", fault);
-		}
-		// TODO check we can resolve endpoint
-		if (topic == null) {
-			InvalidFilterFaultType fault = new InvalidFilterFaultType();
-			throw new InvalidFilterFault("Must specify a topic to subscribe on", fault);
-		}
-		if (contentFilter != null && !contentFilter.getDialect().equals(XPATH1_URI)) {
-			InvalidMessageContentExpressionFaultType fault = new InvalidMessageContentExpressionFaultType();
-			throw new InvalidMessageContentExpressionFault("Unsupported MessageContent dialect: '" + contentFilter.getDialect() + "'", fault);
-		}
-		if (terminationTime != null) {
-			UnacceptableInitialTerminationTimeFaultType fault = new UnacceptableInitialTerminationTimeFaultType();
-	    	throw new UnacceptableInitialTerminationTimeFault(
-	    			"InitialTerminationTime is not supported",
-	    			fault);
-		}
-	}
+        try {
+            unregister();
+        } catch (EndpointRegistrationException e) {
+            UnableToDestroySubscriptionFaultType fault = new UnableToDestroySubscriptionFaultType();
+            throw new UnableToDestroySubscriptionFault("Error unregistering endpoint", fault, e);
+        }
+    }
+
+    protected String createAddress() {
+        return "http://servicemix.org/wsnotification/Subscription/" + getName();
+    }
+
+    protected void validateSubscription(Subscribe subscribeRequest) throws InvalidFilterFault,
+            InvalidMessageContentExpressionFault, InvalidProducerPropertiesExpressionFault,
+            InvalidTopicExpressionFault, SubscribeCreationFailedFault, TopicExpressionDialectUnknownFault,
+            TopicNotSupportedFault, UnacceptableInitialTerminationTimeFault {
+        // Check consumer reference
+        consumerReference = subscribeRequest.getConsumerReference();
+        // Check terminationTime
+        if (subscribeRequest.getInitialTerminationTime() != null
+                && !subscribeRequest.getInitialTerminationTime().isNil()
+                && subscribeRequest.getInitialTerminationTime().getValue() != null) {
+            String strTerminationTime = subscribeRequest.getInitialTerminationTime().getValue();
+            terminationTime = validateInitialTerminationTime(strTerminationTime.trim());
+        }
+        // Check filter
+        if (subscribeRequest.getFilter() != null) {
+            for (Object f : subscribeRequest.getFilter().getAny()) {
+                JAXBElement e = null;
+                if (f instanceof JAXBElement) {
+                    e = (JAXBElement) f;
+                    f = e.getValue();
+                }
+                if (f instanceof TopicExpressionType) {
+                    if (!e.getName().equals(QNAME_TOPIC_EXPRESSION)) {
+                        InvalidTopicExpressionFaultType fault = new InvalidTopicExpressionFaultType();
+                        throw new InvalidTopicExpressionFault("Unrecognized TopicExpression: " + e, fault);
+                    }
+                    topic = (TopicExpressionType) f;
+                } else if (f instanceof QueryExpressionType) {
+                    if (e != null && e.getName().equals(QNAME_PRODUCER_PROPERTIES)) {
+                        InvalidProducerPropertiesExpressionFaultType fault = 
+                            new InvalidProducerPropertiesExpressionFaultType();
+                        throw new InvalidProducerPropertiesExpressionFault("ProducerProperties are not supported",
+                                fault);
+                    } else if (e != null && e.getName().equals(QNAME_MESSAGE_CONTENT)) {
+                        if (contentFilter != null) {
+                            InvalidMessageContentExpressionFaultType fault = 
+                                new InvalidMessageContentExpressionFaultType();
+                            throw new InvalidMessageContentExpressionFault(
+                                    "Only one MessageContent filter can be specified", fault);
+                        }
+                        contentFilter = (QueryExpressionType) f;
+                        // Defaults to XPath 1.0
+                        if (contentFilter.getDialect() == null) {
+                            contentFilter.setDialect(XPATH1_URI);
+                        }
+                    } else {
+                        InvalidFilterFaultType fault = new InvalidFilterFaultType();
+                        throw new InvalidFilterFault("Unrecognized filter: " + (e != null ? e.getName() : f), fault);
+                    }
+                } else {
+                    InvalidFilterFaultType fault = new InvalidFilterFaultType();
+                    throw new InvalidFilterFault("Unrecognized filter: " + (e != null ? e.getName() : f), fault);
+                }
+            }
+        }
+        // Check policy
+        if (subscribeRequest.getSubscriptionPolicy() != null) {
+            for (Object p : subscribeRequest.getSubscriptionPolicy().getAny()) {
+                JAXBElement e = null;
+                if (p instanceof JAXBElement) {
+                    e = (JAXBElement) p;
+                    p = e.getValue();
+                }
+                if (p instanceof UseRaw) {
+                    useRaw = true;
+                } else {
+                    InvalidFilterFaultType fault = new InvalidFilterFaultType();
+                    throw new InvalidFilterFault("Unrecognized policy: " + p, fault);
+                }
+            }
+        }
+        // Check all parameters
+        if (consumerReference == null) {
+            SubscribeCreationFailedFaultType fault = new SubscribeCreationFailedFaultType();
+            throw new SubscribeCreationFailedFault("Invalid ConsumerReference: null", fault);
+        }
+        // TODO check we can resolve endpoint
+        if (topic == null) {
+            InvalidFilterFaultType fault = new InvalidFilterFaultType();
+            throw new InvalidFilterFault("Must specify a topic to subscribe on", fault);
+        }
+        if (contentFilter != null && !contentFilter.getDialect().equals(XPATH1_URI)) {
+            InvalidMessageContentExpressionFaultType fault = new InvalidMessageContentExpressionFaultType();
+            throw new InvalidMessageContentExpressionFault("Unsupported MessageContent dialect: '"
+                    + contentFilter.getDialect() + "'", fault);
+        }
+        if (terminationTime != null) {
+            UnacceptableInitialTerminationTimeFaultType fault = new UnacceptableInitialTerminationTimeFaultType();
+            throw new UnacceptableInitialTerminationTimeFault("InitialTerminationTime is not supported", fault);
+        }
+    }
 
     public AbstractNotificationBroker getBroker() {
         return broker;

Modified: incubator/servicemix/trunk/deployables/serviceengines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/EndpointManager.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/serviceengines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/EndpointManager.java?view=diff&rev=526601&r1=526600&r2=526601
==============================================================================
--- incubator/servicemix/trunk/deployables/serviceengines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/EndpointManager.java (original)
+++ incubator/servicemix/trunk/deployables/serviceengines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/EndpointManager.java Sun Apr  8 14:19:30 2007
@@ -17,10 +17,9 @@
 package org.apache.servicemix.wsn;
 
 public interface EndpointManager {
-	
-    Object register(String address, 
-                    Object service) throws EndpointRegistrationException;
-	
-	void unregister(Object endpoint) throws EndpointRegistrationException;
+
+    Object register(String address, Object service) throws EndpointRegistrationException;
+
+    void unregister(Object endpoint) throws EndpointRegistrationException;
 
 }

Modified: incubator/servicemix/trunk/deployables/serviceengines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/EndpointRegistrationException.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/serviceengines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/EndpointRegistrationException.java?view=diff&rev=526601&r1=526600&r2=526601
==============================================================================
--- incubator/servicemix/trunk/deployables/serviceengines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/EndpointRegistrationException.java (original)
+++ incubator/servicemix/trunk/deployables/serviceengines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/EndpointRegistrationException.java Sun Apr  8 14:19:30 2007
@@ -18,25 +18,25 @@
 
 public class EndpointRegistrationException extends Exception {
 
-	/**
-	 * Generated serial version UID
-	 */
-	private static final long serialVersionUID = 6365080415473176527L;
+    /**
+     * Generated serial version UID
+     */
+    private static final long serialVersionUID = 6365080415473176527L;
 
-	public EndpointRegistrationException() {
-		super();
-	}
+    public EndpointRegistrationException() {
+        super();
+    }
 
-	public EndpointRegistrationException(String message, Throwable cause) {
-		super(message, cause);
-	}
+    public EndpointRegistrationException(String message, Throwable cause) {
+        super(message, cause);
+    }
 
-	public EndpointRegistrationException(String message) {
-		super(message);
-	}
+    public EndpointRegistrationException(String message) {
+        super(message);
+    }
 
-	public EndpointRegistrationException(Throwable cause) {
-		super(cause);
-	}
+    public EndpointRegistrationException(Throwable cause) {
+        super(cause);
+    }
 
 }

Modified: incubator/servicemix/trunk/deployables/serviceengines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/client/AbstractWSAClient.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/serviceengines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/client/AbstractWSAClient.java?view=diff&rev=526601&r1=526600&r2=526601
==============================================================================
--- incubator/servicemix/trunk/deployables/serviceengines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/client/AbstractWSAClient.java (original)
+++ incubator/servicemix/trunk/deployables/serviceengines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/client/AbstractWSAClient.java Sun Apr  8 14:19:30 2007
@@ -28,6 +28,7 @@
 import org.apache.servicemix.jbi.container.JBIContainer;
 import org.apache.servicemix.jbi.resolver.EndpointResolver;
 import org.apache.servicemix.jbi.resolver.ServiceAndEndpointNameResolver;
+import org.apache.servicemix.jbi.resolver.URIResolver;
 import org.oasis_open.docs.wsn.b_2.Subscribe;
 import org.oasis_open.docs.wsn.br_2.RegisterPublisher;
 import org.w3._2005._08.addressing.AttributedURIType;
@@ -35,89 +36,76 @@
 
 public abstract class AbstractWSAClient {
 
-	private EndpointReferenceType endpoint;
-	private EndpointResolver resolver;
-	private ServiceMixClient client;
-	
-	public AbstractWSAClient() {
-	}
-    
-	public AbstractWSAClient(EndpointReferenceType endpoint, ServiceMixClient client) {
-		this.endpoint = endpoint;
-		this.resolver = resolveWSA(endpoint);
-		this.client = client;
-	}
-
-	public static EndpointReferenceType createWSA(String address) {
-		EndpointReferenceType epr = new EndpointReferenceType();
-		AttributedURIType attUri = new AttributedURIType();
-		attUri.setValue(address);
-		epr.setAddress(attUri);
-		return epr;
-	}
-    
+    private EndpointReferenceType endpoint;
+
+    private EndpointResolver resolver;
+
+    private ServiceMixClient client;
+
+    public AbstractWSAClient() {
+    }
+
+    public AbstractWSAClient(EndpointReferenceType endpoint, ServiceMixClient client) {
+        this.endpoint = endpoint;
+        this.resolver = resolveWSA(endpoint);
+        this.client = client;
+    }
+
+    public static EndpointReferenceType createWSA(String address) {
+        EndpointReferenceType epr = new EndpointReferenceType();
+        AttributedURIType attUri = new AttributedURIType();
+        attUri.setValue(address);
+        epr.setAddress(attUri);
+        return epr;
+    }
+
     public static ServiceMixClient createJaxbClient(JBIContainer container) throws JBIException, JAXBException {
         DefaultServiceMixClient client = new DefaultServiceMixClient(container);
         client.setMarshaler(new JAXBMarshaler(JAXBContext.newInstance(Subscribe.class, RegisterPublisher.class)));
         return client;
     }
-    
+
     public static ServiceMixClient createJaxbClient(ComponentContext context) throws JAXBException {
-        ServiceMixClientFacade client = new ServiceMixClientFacade(context); 
+        ServiceMixClientFacade client = new ServiceMixClientFacade(context);
         client.setMarshaler(new JAXBMarshaler(JAXBContext.newInstance(Subscribe.class, RegisterPublisher.class)));
         return client;
     }
-	
-	public static EndpointResolver resolveWSA(EndpointReferenceType ref) {
-		String[] parts = splitUri(ref.getAddress().getValue());
-		return new ServiceAndEndpointNameResolver(new QName(parts[0], parts[1]), parts[2]);
-	}
-
-	public static String[] splitUri(String uri) {
-		char sep;
-		if (uri.indexOf('/') > 0) {
-			sep = '/';
-		} else {
-			sep = ':';
-		}
-		int idx1 = uri.lastIndexOf(sep);
-		int idx2 = uri.lastIndexOf(sep, idx1 - 1);
-		String epName = uri.substring(idx1 + 1);
-		String svcName = uri.substring(idx2 + 1, idx1);
-		String nsUri   = uri.substring(0, idx2);
-    	return new String[] { nsUri, svcName, epName };
-    }
-
-	public EndpointReferenceType getEndpoint() {
-		return endpoint;
-	}
-
-	public void setEndpoint(EndpointReferenceType endpoint) {
-		this.endpoint = endpoint;
-	}
-
-	public EndpointResolver getResolver() {
-		return resolver;
-	}
-
-	public void setResolver(EndpointResolver resolver) {
-		this.resolver = resolver;
-	}
-	
-	public ServiceMixClient getClient() {
-		return client;
-	}
-
-	public void setClient(ServiceMixClient client) {
-		this.client = client;
-	}
-	
-	protected Object request(Object request) throws JBIException {
-		return client.request(resolver, null, null, request);
-	}
-	
-	protected void send(Object request) throws JBIException {
-		client.sendSync(resolver, null, null, request);
-	}
+
+    public static EndpointResolver resolveWSA(EndpointReferenceType ref) {
+        String[] parts = URIResolver.split3(ref.getAddress().getValue());
+        return new ServiceAndEndpointNameResolver(new QName(parts[0], parts[1]), parts[2]);
+    }
+
+    public EndpointReferenceType getEndpoint() {
+        return endpoint;
+    }
+
+    public void setEndpoint(EndpointReferenceType endpoint) {
+        this.endpoint = endpoint;
+    }
+
+    public EndpointResolver getResolver() {
+        return resolver;
+    }
+
+    public void setResolver(EndpointResolver resolver) {
+        this.resolver = resolver;
+    }
+
+    public ServiceMixClient getClient() {
+        return client;
+    }
+
+    public void setClient(ServiceMixClient client) {
+        this.client = client;
+    }
+
+    protected Object request(Object request) throws JBIException {
+        return client.request(resolver, null, null, request);
+    }
+
+    protected void send(Object request) throws JBIException {
+        client.sendSync(resolver, null, null, request);
+    }
 
 }

Modified: incubator/servicemix/trunk/deployables/serviceengines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/client/CreatePullPoint.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/serviceengines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/client/CreatePullPoint.java?view=diff&rev=526601&r1=526600&r2=526601
==============================================================================
--- incubator/servicemix/trunk/deployables/serviceengines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/client/CreatePullPoint.java (original)
+++ incubator/servicemix/trunk/deployables/serviceengines/servicemix-wsn2005/src/main/java/org/apache/servicemix/wsn/client/CreatePullPoint.java Sun Apr  8 14:19:30 2007
@@ -32,49 +32,51 @@
 
 public class CreatePullPoint extends AbstractWSAClient {
 
-	public static String WSN_URI = "http://servicemix.org/wsnotification";
-	public static String WSN_SERVICE = "CreatePullPoint";
-	
-	public static QName NOTIFICATION_BROKER = new QName(WSN_URI, WSN_SERVICE); 
-	
-	public CreatePullPoint(ComponentContext context) throws JAXBException {
-		ServiceMixClientFacade client = new ServiceMixClientFacade(context); 
-		client.setMarshaler(new JAXBMarshaler(JAXBContext.newInstance(Subscribe.class, RegisterPublisher.class)));
-		setClient(client);
-		setResolver(new ServiceNameEndpointResolver(NOTIFICATION_BROKER));
-	}
-	
-	public CreatePullPoint(ComponentContext context, String brokerName) throws JAXBException {
+    public static final String WSN_URI = "http://servicemix.org/wsnotification";
+
+    public static final String WSN_SERVICE = "CreatePullPoint";
+
+    public static final QName NOTIFICATION_BROKER = new QName(WSN_URI, WSN_SERVICE);
+
+    public CreatePullPoint(ComponentContext context) throws JAXBException {
+        ServiceMixClientFacade client = new ServiceMixClientFacade(context);
+        client.setMarshaler(new JAXBMarshaler(JAXBContext.newInstance(Subscribe.class, RegisterPublisher.class)));
+        setClient(client);
+        setResolver(new ServiceNameEndpointResolver(NOTIFICATION_BROKER));
+    }
+
+    public CreatePullPoint(ComponentContext context, String brokerName) throws JAXBException {
         setClient(createJaxbClient(context));
-		setEndpoint(createWSA(WSN_URI + "/" + WSN_SERVICE + "/" + brokerName));
-		setResolver(resolveWSA(getEndpoint()));
-	}
-	
-	public CreatePullPoint(JBIContainer container) throws JBIException, JAXBException {
-		setClient(createJaxbClient(container));
-		setResolver(new ServiceNameEndpointResolver(NOTIFICATION_BROKER));
-	}
-	
-	public CreatePullPoint(JBIContainer container, String brokerName) throws JBIException, JAXBException {
+        setEndpoint(createWSA(WSN_URI + "/" + WSN_SERVICE + "/" + brokerName));
+        setResolver(resolveWSA(getEndpoint()));
+    }
+
+    public CreatePullPoint(JBIContainer container) throws JBIException, JAXBException {
         setClient(createJaxbClient(container));
-		setEndpoint(createWSA(WSN_URI + "/" + WSN_SERVICE + "/" + brokerName));
-		setResolver(resolveWSA(getEndpoint()));
-	}
-	
-	public CreatePullPoint(ServiceMixClient client) {
-		setClient(client);
-		setResolver(new ServiceNameEndpointResolver(NOTIFICATION_BROKER));
-	}
-
-	public CreatePullPoint(ServiceMixClient client, String brokerName) {
-		setClient(client);
-		setEndpoint(createWSA(WSN_URI + "/" + WSN_SERVICE + "/" + brokerName));
-		setResolver(resolveWSA(getEndpoint()));
-	}
-
-	public PullPoint createPullPoint() throws JBIException {
-		CreatePullPointResponse response = (CreatePullPointResponse) request(new org.oasis_open.docs.wsn.b_2.CreatePullPoint());
-		return new PullPoint(response.getPullPoint(), getClient());
-	}
+        setResolver(new ServiceNameEndpointResolver(NOTIFICATION_BROKER));
+    }
+
+    public CreatePullPoint(JBIContainer container, String brokerName) throws JBIException, JAXBException {
+        setClient(createJaxbClient(container));
+        setEndpoint(createWSA(WSN_URI + "/" + WSN_SERVICE + "/" + brokerName));
+        setResolver(resolveWSA(getEndpoint()));
+    }
+
+    public CreatePullPoint(ServiceMixClient client) {
+        setClient(client);
+        setResolver(new ServiceNameEndpointResolver(NOTIFICATION_BROKER));
+    }
+
+    public CreatePullPoint(ServiceMixClient client, String brokerName) {
+        setClient(client);
+        setEndpoint(createWSA(WSN_URI + "/" + WSN_SERVICE + "/" + brokerName));
+        setResolver(resolveWSA(getEndpoint()));
+    }
+
+    public PullPoint createPullPoint() throws JBIException {
+        CreatePullPointResponse response = (CreatePullPointResponse) request(
+                new org.oasis_open.docs.wsn.b_2.CreatePullPoint());
+        return new PullPoint(response.getPullPoint(), getClient());
+    }
 
 }



Mime
View raw message