Author: keith
Date: Wed Apr  2 07:58:30 2008
New Revision: 15495

Log:

Fixing Mashup-637



Modified:
   
trunk/mashup/java/modules/javascriptdeployer/src/org/wso2/mashup/deployer/JSDeployer.java
   
trunk/mashup/java/modules/javascriptdeployer/src/org/wso2/mashup/deployer/JavaScriptServiceAnnotationParser.java

Modified: 
trunk/mashup/java/modules/javascriptdeployer/src/org/wso2/mashup/deployer/JSDeployer.java
==============================================================================
--- 
trunk/mashup/java/modules/javascriptdeployer/src/org/wso2/mashup/deployer/JSDeployer.java
   (original)
+++ 
trunk/mashup/java/modules/javascriptdeployer/src/org/wso2/mashup/deployer/JSDeployer.java
   Wed Apr  2 07:58:30 2008
@@ -371,9 +371,6 @@
                     new JavaScriptServiceAnnotationParser(
                             engine, shortFileName);
 
-            Function init = serviceAnnotationParser.getInit();
-            Function destroy = serviceAnnotationParser.getDestroy();
-
             axisService.setParent(axisServiceGroup);
             axisService.setClassLoader(currentFile.getClassLoader());
             String name = serviceAnnotationParser.getServiceName();
@@ -512,14 +509,22 @@
             Parameter myRegistryPath = new 
Parameter(MashupConstants.REGISTRY_MASHUP_PATH, path);
             axisService.addParameter(myRegistryPath);
 
+            Function init = serviceAnnotationParser.getInit();
+            Function destroy = serviceAnnotationParser.getDestroy();
+            String undispatched = serviceAnnotationParser.getUndispatched();
+
             ArrayList serviceList = new ArrayList();
             serviceList.add(axisService);
+
             if (init != null) {
                 init.call(engine.getCx(), engine, engine, new Object[0]);
             }
             if (destroy != null) {
                 
axisService.addParameter(MashupConstants.MASHUP_DESTROY_FUNCTION, destroy);
             }
+            if (undispatched != null) {
+                
axisService.addParameter(MashupConstants.UNDISPATCHED_OPERATION, undispatched);
+            }
             return serviceList;
         } catch (FileNotFoundException e) {
             throw new DeploymentException("JS Service File Not Found", e);

Modified: 
trunk/mashup/java/modules/javascriptdeployer/src/org/wso2/mashup/deployer/JavaScriptServiceAnnotationParser.java
==============================================================================
--- 
trunk/mashup/java/modules/javascriptdeployer/src/org/wso2/mashup/deployer/JavaScriptServiceAnnotationParser.java
    (original)
+++ 
trunk/mashup/java/modules/javascriptdeployer/src/org/wso2/mashup/deployer/JavaScriptServiceAnnotationParser.java
    Wed Apr  2 07:58:30 2008
@@ -59,6 +59,8 @@
 
     private Function destroy = null;
 
+    private String undispatched;
+
     private OMFactory omFactory = OMAbstractFactory.getOMFactory();
 
     public JavaScriptServiceAnnotationParser(Scriptable service, String 
serviceName)
@@ -112,6 +114,14 @@
         if (destroyObject instanceof Function) {
             this.destroy = (Function) destroyObject;
         }
+
+        Object undispatchedOperation = service.get("undispatched", service);
+        if (undispatchedOperation instanceof Function) {
+            Scriptable scriptable = (Scriptable) undispatchedOperation;
+            undispatched = (String) scriptable.get("name", scriptable);
+        } else if (undispatchedOperation instanceof String) {
+            undispatched = (String) undispatchedOperation;
+        }
     }
 
     public String getSchemaTargetNamespace() {
@@ -141,4 +151,8 @@
     public Function getDestroy() {
         return destroy;
     }
+
+    public String getUndispatched() {
+        return undispatched;
+    }
 }

_______________________________________________
Mashup-dev mailing list
[email protected]
http://www.wso2.org/cgi-bin/mailman/listinfo/mashup-dev

Reply via email to