You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pubscribe-dev@ws.apache.org by ip...@apache.org on 2005/05/16 19:38:33 UTC

svn commit: r170415 - in /incubator/hermes/trunk/src/java/org/apache/ws/notification/base: faults/PauseFailedFaultException.java faults/ResumeFailedFaultException.java v2004_06/porttype/impl/NotificationProducerPortTypeImpl.java v2004_06/porttype/impl/SubscriptionManagerPortTypeImpl.java

Author: ips
Date: Mon May 16 10:38:32 2005
New Revision: 170415

URL: http://svn.apache.org/viewcvs?rev=170415&view=rev
Log:
consistent use of namespaceSet

Modified:
    incubator/hermes/trunk/src/java/org/apache/ws/notification/base/faults/PauseFailedFaultException.java
    incubator/hermes/trunk/src/java/org/apache/ws/notification/base/faults/ResumeFailedFaultException.java
    incubator/hermes/trunk/src/java/org/apache/ws/notification/base/v2004_06/porttype/impl/NotificationProducerPortTypeImpl.java
    incubator/hermes/trunk/src/java/org/apache/ws/notification/base/v2004_06/porttype/impl/SubscriptionManagerPortTypeImpl.java

Modified: incubator/hermes/trunk/src/java/org/apache/ws/notification/base/faults/PauseFailedFaultException.java
URL: http://svn.apache.org/viewcvs/incubator/hermes/trunk/src/java/org/apache/ws/notification/base/faults/PauseFailedFaultException.java?rev=170415&r1=170414&r2=170415&view=diff
==============================================================================
--- incubator/hermes/trunk/src/java/org/apache/ws/notification/base/faults/PauseFailedFaultException.java (original)
+++ incubator/hermes/trunk/src/java/org/apache/ws/notification/base/faults/PauseFailedFaultException.java Mon May 16 10:38:32 2005
@@ -1,9 +1,8 @@
 package org.apache.ws.notification.base.faults;
 
-import org.apache.ws.resource.faults.AbstractBaseFaultException;
-import org.apache.ws.resource.properties.NamespaceVersionHolder;
-import org.apache.ws.notification.base.v2004_06.BaseNotificationConstants;
 import org.apache.ws.notification.base.WsnNamespaceVersionHolder;
+import org.apache.ws.notification.base.v2004_06.BaseNotificationConstants;
+import org.apache.ws.resource.faults.AbstractBaseFaultException;
 
 import javax.xml.namespace.QName;
 
@@ -14,13 +13,13 @@
 {
     private QName m_name;
 
-    public PauseFailedFaultException(WsnNamespaceVersionHolder namespaceVersionHolder, String faultString)
+    public PauseFailedFaultException( WsnNamespaceVersionHolder namespaceVersionHolder, String faultString )
     {
-        super(namespaceVersionHolder, faultString);
-        m_name = new QName( namespaceVersionHolder.getBaseNotificationXsdNamespace(), "PauseFailedFault", BaseNotificationConstants.NSPREFIX_WSNT_SCHEMA );
-
+        super( namespaceVersionHolder, faultString );
+        m_name =
+                new QName( namespaceVersionHolder.getBaseNotificationXsdNamespace(), "PauseFailedFault",
+                        BaseNotificationConstants.NSPREFIX_WSNT_SCHEMA );
     }
-
 
     public QName getBaseFaultName()
     {

Modified: incubator/hermes/trunk/src/java/org/apache/ws/notification/base/faults/ResumeFailedFaultException.java
URL: http://svn.apache.org/viewcvs/incubator/hermes/trunk/src/java/org/apache/ws/notification/base/faults/ResumeFailedFaultException.java?rev=170415&r1=170414&r2=170415&view=diff
==============================================================================
--- incubator/hermes/trunk/src/java/org/apache/ws/notification/base/faults/ResumeFailedFaultException.java (original)
+++ incubator/hermes/trunk/src/java/org/apache/ws/notification/base/faults/ResumeFailedFaultException.java Mon May 16 10:38:32 2005
@@ -13,12 +13,13 @@
 {
     private QName m_name;
 
-    public ResumeFailedFaultException(WsnNamespaceVersionHolder namespaceVersionHolder, String faultString)
+    public ResumeFailedFaultException( WsnNamespaceVersionHolder namespaceVersionHolder, String faultString )
     {
-        super(namespaceVersionHolder, faultString);
-        m_name = new QName( namespaceVersionHolder.getBaseNotificationXsdNamespace(), "ResumeFailedFault", BaseNotificationConstants.NSPREFIX_WSNT_SCHEMA );
+        super( namespaceVersionHolder, faultString );
+        m_name =
+                new QName( namespaceVersionHolder.getBaseNotificationXsdNamespace(), "ResumeFailedFault",
+                        BaseNotificationConstants.NSPREFIX_WSNT_SCHEMA );
     }
-
 
     public QName getBaseFaultName()
     {

Modified: incubator/hermes/trunk/src/java/org/apache/ws/notification/base/v2004_06/porttype/impl/NotificationProducerPortTypeImpl.java
URL: http://svn.apache.org/viewcvs/incubator/hermes/trunk/src/java/org/apache/ws/notification/base/v2004_06/porttype/impl/NotificationProducerPortTypeImpl.java?rev=170415&r1=170414&r2=170415&view=diff
==============================================================================
--- incubator/hermes/trunk/src/java/org/apache/ws/notification/base/v2004_06/porttype/impl/NotificationProducerPortTypeImpl.java (original)
+++ incubator/hermes/trunk/src/java/org/apache/ws/notification/base/v2004_06/porttype/impl/NotificationProducerPortTypeImpl.java Mon May 16 10:38:32 2005
@@ -68,6 +68,7 @@
 {
 
     private static final Log LOG = LogFactory.getLog(NotificationProducerPortTypeImpl.class.getName());
+    private static final WsnNamespaceVersionHolder NAMESPACE_SET = new WsnNamespaceVersionHolderImpl() ;
 
     public NotificationProducerPortTypeImpl( ResourceContext resourceContext )
     {
@@ -84,7 +85,7 @@
         Topic[] topics = evaluateTopicExpression( topicExpr );
         if ( topics.length == 0 )
         {
-            throw new InvalidTopicExpressionFaultException( new WsnNamespaceVersionHolderImpl(),
+            throw new InvalidTopicExpressionFaultException( NAMESPACE_SET,
                     "Given TopicExpression did not match any Topics supported by this NotificationProducer." );
         }
         Calendar initialTerminationTime = null;
@@ -121,7 +122,7 @@
         catch ( NamingException ne )
         {
             LOG.error( "Subscribe failed due to internal error: " + ne );
-            throw new BaseFaultException( getNamespaceSet(), "Subscribe failed due to internal server error." );
+            throw new BaseFaultException( NAMESPACE_SET, "Subscribe failed due to internal server error." );
         }
         Subscription subscription = null;
         try
@@ -138,7 +139,7 @@
             {
                 e.printStackTrace( );
             }
-            throw new SubscribeCreationFailedFaultException( (WsnNamespaceVersionHolder) getNamespaceSet() );
+            throw new SubscribeCreationFailedFaultException( NAMESPACE_SET );
         }
         SubscriptionTopicListener subscriptionTopicListener = new SubscriptionTopicListener( subscription );
         for ( int i = 0; i < topics.length; i++ )
@@ -163,14 +164,14 @@
         Topic[] topics = evaluateTopicExpression( topicExpr );
         if ( topics.length != 1 )
         {
-            throw new InvalidTopicExpressionFaultException( new WsnNamespaceVersionHolderImpl(),
+            throw new InvalidTopicExpressionFaultException( NAMESPACE_SET,
                     "Given TopicExpression did not match exactly one Topic supported by this NotificationProducer." );
         }
         Topic topic = topics[0];
         XmlObject currentMsg = (XmlObject) topic.getCurrentMessage();
         if ( currentMsg == null )
         {
-            throw new NoCurrentMessageOnTopicFaultException( (WsnNamespaceVersionHolder) getNamespaceSet() );
+            throw new NoCurrentMessageOnTopicFaultException( NAMESPACE_SET );
         }
         GetCurrentMessageResponseDocument responseDoc = GetCurrentMessageResponseDocument.Factory.newInstance();
         GetCurrentMessageResponseDocument.GetCurrentMessageResponse response = responseDoc.addNewGetCurrentMessageResponse();
@@ -188,18 +189,18 @@
         }
         catch ( TopicPathDialectUnknownException tpdue )
         {
-            throw new TopicPathDialectUnknownFaultException( (WsnNamespaceVersionHolder) getNamespaceSet(),
+            throw new TopicPathDialectUnknownFaultException( NAMESPACE_SET,
                     tpdue.getLocalizedMessage() );
         }
         catch ( TopicExpressionException tee )
         {
-            throw new BaseFaultException( getNamespaceSet(), tee.getLocalizedMessage() );
+            throw new BaseFaultException( NAMESPACE_SET, tee.getLocalizedMessage() );
         }
     }
 
     protected NamespaceVersionHolder getNamespaceSet()
     {
-        return new WsnNamespaceVersionHolderImpl();
+        return NAMESPACE_SET;
     }
 
 }

Modified: incubator/hermes/trunk/src/java/org/apache/ws/notification/base/v2004_06/porttype/impl/SubscriptionManagerPortTypeImpl.java
URL: http://svn.apache.org/viewcvs/incubator/hermes/trunk/src/java/org/apache/ws/notification/base/v2004_06/porttype/impl/SubscriptionManagerPortTypeImpl.java?rev=170415&r1=170414&r2=170415&view=diff
==============================================================================
--- incubator/hermes/trunk/src/java/org/apache/ws/notification/base/v2004_06/porttype/impl/SubscriptionManagerPortTypeImpl.java (original)
+++ incubator/hermes/trunk/src/java/org/apache/ws/notification/base/v2004_06/porttype/impl/SubscriptionManagerPortTypeImpl.java Mon May 16 10:38:32 2005
@@ -15,10 +15,12 @@
  *=============================================================================*/
 package org.apache.ws.notification.base.v2004_06.porttype.impl;
 
+import org.apache.ws.notification.base.Subscription;
+import org.apache.ws.notification.base.WsnNamespaceVersionHolder;
 import org.apache.ws.notification.base.faults.PauseFailedFaultException;
 import org.apache.ws.notification.base.faults.ResumeFailedFaultException;
-import org.apache.ws.notification.base.v2004_06.porttype.SubscriptionManagerPortType;
 import org.apache.ws.notification.base.v2004_06.impl.WsnNamespaceVersionHolderImpl;
+import org.apache.ws.notification.base.v2004_06.porttype.SubscriptionManagerPortType;
 import org.apache.ws.resource.ResourceContext;
 import org.apache.ws.resource.properties.NamespaceVersionHolder;
 import org.apache.ws.resource.properties.impl.AbstractResourcePropertiesPortType;
@@ -26,7 +28,6 @@
 import org.oasisOpen.docs.wsn.x2004.x06.wsnWSBaseNotification12Draft01.PauseSubscriptionResponseDocument;
 import org.oasisOpen.docs.wsn.x2004.x06.wsnWSBaseNotification12Draft01.ResumeSubscriptionDocument;
 import org.oasisOpen.docs.wsn.x2004.x06.wsnWSBaseNotification12Draft01.ResumeSubscriptionResponseDocument;
-import org.apache.ws.notification.base.Subscription;
 
 /**
  * An implementation of the WS-BaseNotification SubscriptionManager portType.
@@ -37,6 +38,8 @@
         implements SubscriptionManagerPortType
 {
 
+    private static final WsnNamespaceVersionHolder NAMESPACE_SET = new WsnNamespaceVersionHolderImpl();
+
     public SubscriptionManagerPortTypeImpl( ResourceContext resourceContext )
     {
         super( resourceContext );
@@ -51,7 +54,8 @@
         }
         catch ( Exception e )
         {
-            throw new PauseFailedFaultException(new WsnNamespaceVersionHolderImpl(),"Pause failed on subscription: " + subscription.getID());
+            throw new PauseFailedFaultException( NAMESPACE_SET,
+                    "Pause failed on subscription: " + subscription.getID() );
         }
         return createPauseSubscriptionResponseDocument();
     }
@@ -65,7 +69,8 @@
         }
         catch ( Exception e )
         {
-            throw new ResumeFailedFaultException(new WsnNamespaceVersionHolderImpl(),"Resume failed on subscription: " + subscription.getID());
+            throw new ResumeFailedFaultException( NAMESPACE_SET,
+                    "Resume failed on subscription: " + subscription.getID() );
         }
         return createResumeSubscriptionResponseDocument();
     }
@@ -88,7 +93,7 @@
 
     protected NamespaceVersionHolder getNamespaceSet()
     {
-        return null; // not currently used - will be needed once we need to support multiple spec versions
+        return NAMESPACE_SET;
     }
 
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: hermes-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: hermes-dev-help@ws.apache.org