Author: keith
Date: Tue Apr 22 19:04:35 2008
New Revision: 15985
Log:
More doc updates
Modified:
trunk/mashup/java/modules/javascriptdeployer/src/org/wso2/mashup/deployer/JavaScriptServiceAnnotationParser.java
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
Tue Apr 22 19:04:35 2008
@@ -37,7 +37,7 @@
* this.schemaTargetNamespace = "http://wso2.org/schema";
* this.serviceName = "reverse";
* this.documentation = "Simple string or html markup";
- * this.serviceScope = "reverse";
+ * this.scope = "reverse";
* this.init=init;
*
* function init() {
@@ -113,6 +113,8 @@
public JavaScriptServiceAnnotationParser(Scriptable service, String
serviceName)
throws DeploymentException {
+ // Check weather the user provided a schemaTargetNamespace. If its not
present use a default
+ // namespace
Object schemaTargetNamespaceObject =
service.get("schemaTargetNamespace", service);
if (schemaTargetNamespaceObject instanceof String) {
schemaTargetNamespace = (String) schemaTargetNamespaceObject;
@@ -120,6 +122,7 @@
schemaTargetNamespace = "http://services.mashup.wso2.org/" +
serviceName + "?xsd";
}
+ // Check weather the user provided a serviceName
Object serviceNameObject = service.get("serviceName", service);
if (serviceNameObject instanceof String) {
String serviceNameString = ((String) serviceNameObject).trim();
@@ -132,6 +135,8 @@
this.serviceName = serviceName;
}
+ // Check weather the user provided a targetNamespace. If its not
present use a default
+ // namespace
Object targetNamespaceObject = service.get("targetNamespace", service);
if (targetNamespaceObject instanceof String) {
targetNamespace = (String) targetNamespaceObject;
@@ -139,11 +144,15 @@
targetNamespace = "http://services.mashup.wso2.org/" +
this.serviceName;
}
+ // Check weather the user provided a scope for the service
Object serviceScopeObject = service.get("scope", service);
if (serviceScopeObject instanceof String) {
this.serviceScope = (String) serviceScopeObject;
}
+ // Check weather the user provided some service level documentation.
If the documentation is
+ // a String we wrap it as a OMText. Else if its an E4X XML object we
get the axiom from it
+ // and set that as the documentation.
Object serviceDocumentationObject = service.get("documentation",
service);
if (serviceDocumentationObject instanceof String) {
this.serviceDocumentation = omFactory.createOMText((String)
serviceDocumentationObject);
@@ -152,16 +161,22 @@
this.serviceDocumentation = xml.getAxiomFromXML();
}
+ // Check weather the user provided a init annotation. If it was
provided this function would
+ // be called on service Deployment
Object initObject = service.get("init", service);
if (initObject instanceof Function) {
this.init = (Function) initObject;
}
+ // Check weather the user provided a destroy annotation. If it was
provided this function
+ // would be called on service undeployment
Object destroyObject = service.get("destroy", service);
if (destroyObject instanceof Function) {
this.destroy = (Function) destroyObject;
}
+ // Check weather the user provided a undispatched annotation. If it
was provided any
+ // undispatched operations will be dispatched to this special function
Object undispatchedOperation = service.get("undispatched", service);
if (undispatchedOperation instanceof Function) {
Scriptable scriptable = (Scriptable) undispatchedOperation;
_______________________________________________
Mashup-dev mailing list
[email protected]
http://www.wso2.org/cgi-bin/mailman/listinfo/mashup-dev