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 sc...@apache.org on 2005/05/03 22:07:51 UTC

svn commit: r167975 - /incubator/hermes/trunk/src/java/org/apache/ws/notification/tool/WsnWsdl2Java.java

Author: scamp
Date: Tue May  3 13:07:51 2005
New Revision: 167975

URL: http://svn.apache.org/viewcvs?rev=167975&view=rev
Log:
updated to provide info if the resource is a notif producer into the velocity context

Modified:
    incubator/hermes/trunk/src/java/org/apache/ws/notification/tool/WsnWsdl2Java.java

Modified: incubator/hermes/trunk/src/java/org/apache/ws/notification/tool/WsnWsdl2Java.java
URL: http://svn.apache.org/viewcvs/incubator/hermes/trunk/src/java/org/apache/ws/notification/tool/WsnWsdl2Java.java?rev=167975&r1=167974&r2=167975&view=diff
==============================================================================
--- incubator/hermes/trunk/src/java/org/apache/ws/notification/tool/WsnWsdl2Java.java (original)
+++ incubator/hermes/trunk/src/java/org/apache/ws/notification/tool/WsnWsdl2Java.java Tue May  3 13:07:51 2005
@@ -34,6 +34,10 @@
 public class WsnWsdl2Java extends Wsdl2Java
 {
     protected String WEBAPP_NAME = "hermes";
+    private static final String VCTY_CTX_PROP_CHANGE = "propChange";
+    private static final String VCTY_CTX_RESOURCE_TERMINATION = "resourceTermination";
+    private static final String VCTY_CTX_NOTIF_PRODUCER = "notificationProducer";
+
     public WsnWsdl2Java( File[] wsdlFiles, File outputDir, File[] classpath, Wsdl2JavaOptions options )
             throws Exception
     {
@@ -66,15 +70,25 @@
 
         if(hasPropChange(resourceDef))
         {
-           velocityContext.put("propChange","true");
+           velocityContext.put(VCTY_CTX_PROP_CHANGE,"true");
         }
 
         if(hasResourceTermination(resourceDef))
         {
-            velocityContext.put("resourceTermination","true");
+            velocityContext.put(VCTY_CTX_RESOURCE_TERMINATION,"true");
+        }
+
+        if(hasNotificationProducer(resourceDef))
+        {
+            velocityContext.put(VCTY_CTX_NOTIF_PRODUCER,"true");
         }
 
         return velocityContext;
+    }
+
+    private boolean hasNotificationProducer(ResourceDefinition resourceDef)
+    {
+        return resourceDef.implementsResourceCapability(org.apache.ws.notification.base.v2004_6.porttype.NotificationProducerPortType.NAME);
     }
 
     private boolean hasResourceTermination(ResourceDefinition resourceDef)



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