[mashup-dev] Annotating JavaScript to make JavaScript Web services
Deployment easy
Sameera Madushan Jayasoma
sameera at wso2.com
Fri Mar 2 03:29:17 PST 2007
Thilina Gunarathne wrote:
> Cool.. Good Stuff.. Patching Rhino would be great for the start for our
> POC as we discussed earlier.. But on the long run I doubt whether Rhino
> people will accept this patch, since this will slow down the performance
> of Rhino and also we are not implementing a defined annotations spec.
> IMHO we might need to come up with a separate JavaScript annotations
> parser, which we can use within the deployer.
Are we agreed to implement our own js annotation processor ?
Sameera
> May be we can reuse the
> rhino parser, but it'll also be quite trivial to write a new parser to
> parse only these specific stuff. We can get some hints from this api.
> http://au3.php.net/language.oop5.reflection
>
> I'm wondering about the possibilities of writing this using javascript
> it self. But the drawback in that case would be that we need to get the
> help from Rhino at the deployment time to run it for us..
>
> To extract the data from the annotation we can follow what is defined in
> the PhP annotations. http://wso2.org/wiki/display/wsfphp/WSDL+Generation+API
>
> Thanks,
> Thilina
>
>
>>>> Object[] ids = engine.getIds();
>>>> for (int i = 0; i < ids.length; i++) {
>>>> String method = (String) ids[i];
>>>> Object object = engine.get(method, engine);
>>>> - if(object instanceof Function){
>>>> + if(object instanceof BaseFunction &&
>>>> ((BaseFunction)object).isWebMethod()){
>>>> AxisOperation axisOp = new InOutAxisOperation(new
>>>> QName(method));
>>>> axisOp.setMessageReceiver(new JavaScriptReceiver());
>>>> axisOp.setStyle(WSDLConstants.STYLE_DOC);
>>>> axisService.addOperation(axisOp);
>>>> }
>>>>
>>>> }
>>>>
>>>> This patch can be extended to support the required annotations
>>>> defined in JSR-181.
>>>> Sameera
>>>>
>>>> _______________________________________________
>>>> Mashup-dev mailing list
>>>> Mashup-dev at wso2.org
>>>> http://www.wso2.org/cgi-bin/mailman/listinfo/mashup-dev
>>>>
>>>>
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.2.2 (GNU/Linux)
>
> iD8DBQFF586rTt0cKycFPQgRAslqAJ409Qlcv64VH0LnzJgxzbTs5eznAACfZzX5
> k9mvpkjG5dS8V0ogRqvWWK8=
> =YLlc
> -----END PGP SIGNATURE-----
>
> _______________________________________________
> Mashup-dev mailing list
> Mashup-dev at wso2.org
> http://www.wso2.org/cgi-bin/mailman/listinfo/mashup-dev
>
>
More information about the Mashup-dev
mailing list