Index Changes

Difference between version and version     

Back to Scripting SE, or Scripting SE Info


At line 1 changed 3 lines.
__Some of the key motivations for providing scripting support are
\\
*Leveraging programmer skills and advantages of different scripting languages.
<!-- =========================================================================================== -->
<script src="scripts/landingpage.js"></script>
<!-- =========================================================================================== -->
!!!What is the Scripting SE?
The Scripting SE allows developers to write business logic in the form of scripts and deploy these scripts into the OpenESB runtime. The advantage of using scripts are that programmer skills and the advantages of different scripting languages can be leveraged.
At line 5 changed 1 line.
*Many of the scripting languages are Time Tested technologies. So providing execution support for these technologies within the JBI space helps in integrating\co-working with many components\applications developed in these technologies.
!Using the Scripting SE
The attached demos illustrate the creation of a new Scripting kind of a project and executing some sample scripts in various scripting languages.
At line 7 changed 1 line.
*There are a lot of successful open source projects developed in various scripting languages. So adding scripting support provides a huge value add.
A video demonstrating the Design time of the Scripting SE and the corresponding runtime is present at [Scripting Sample demo-E2E | http://www.glassfishwiki.org/jbiwiki/attach/ScriptingSE/Scripting Sample demo-E2E.wmv].
At line 9 changed 1 line.
*Also there are large numbers of scenarios where java and scripting technologies interact. So providing scripting support provides huge value adds.
The demo shows how to create the Scripting Project, for providing a simple trading service. The Trading Service depicted as the echo.wsdl, takes in a TradePriceRequest xml, which will contain some information like the Trading Symbol, the quantity of stocks required etc. The output is an TradePrice xml which contains the pricing information for the requested quantity of stocks. The Scripting Service Engine would execute the greet.rb file which will actuall calculate the price of the requested stocks.
At line 11 changed 1 line.
Some of the key scenarios are:
A Sample Netbeans Project using Scripting SE: [ScriptingSE_Project.zip | http://www.glassfishwiki.org/jbiwiki/attach/ScriptingSE/ScriptingSE_Project.zip]
At line 13 changed 3 lines.
__A. Scripting of java objects__
\\
The scripting languages are able to create Java objects and call public methods of the objects using the syntax of the scripting languages. In this way, functionality available in Java that does not exist in the scripting languages can be used in scripts.
The sample project leverages jruby scripting engine to execute a jruby script in the server. The HTTP BC receives a soap message which triggers the script to execute and the result of the script is returned to the HTTP client. It also shows how a java object can be manipulated inside the script.
At line 18 added 6 lines.
Steps to Build:
# The project zip file contains a Scripting SE module and a Composite Application project. Extract the zip and extract both the projects in their individual folders.
# Open the both the projects in netbeans.
# Add the Scripting SE module to the Composite Application project.
# Build and deploy.
# Run the TestCase included in the Composite Application project.
At line 18 changed 3 lines.
__B. Java implementation of scripting interpreters__
\\
The java programming language has been used to implement interpreters in many scripting languages. Ex: Mozilla rhino script etc.
!Documentation
[User documentation|ScriptingSE.UserDocumentation]
At line 22 changed 3 lines.
__C. Embedded java interpreters__
\\
Most of the scripting language interpreters have interfaces exposed to the outside world. These interfaces provided a flexibility to use these scripting interpreters as components within an application. So the application can leverage these script engines to execute the scripts provided by their end users and hence control the application behavior as such.
!System requirements and dependencies
No special requirements
At line 26 changed 1 line.
__Scripting Service Engine Design (High level)__
!Trouble?
Please post questions on the [OpenESB mailing list|https://open-esb.dev.java.net/MailingLists.html]. File bugs in the [OpenESB issue tracker|https://open-esb.dev.java.net/IssueTracker.html]; use the Scripting SE category.
At line 28 removed 2 lines.
__Overview
The basic intent is to provide a script executing service engine that can support all the Scripting engines that are complaint to JSR 223, i.e. all implementers of javax.script package. This makes Scripting service engine as a single point script executor for scripts in any language, within the JBI environment further strengthening “One VM, many Language” punch line.
At line 31 changed 4 lines.
__Detailed Description
\\
The block diagram representation of the Scripting SE can be explained as below
[{Image src='SSEHighlevel.JPG' width='' height='' align='left|center|right' }]
<!-- =========================================================================================== -->
<script>endBlock1(); beginBlock2(); </script>
<!-- =========================================================================================== -->
At line 36 removed 10 lines.
*#The Scripting SE provides a service of taking an input xml source containing the input parameters for the script and providing the result of the script execution as an output xml source document.
*#The Scripting SE basically contains 2 high level modules i.e. Input parser and script executor.
*#The main task of the input parser module would be to parse the input document and extract all the relevant details from the input source document and provide the script execution details to the script executor.
*#The script executor would receive the execution context information from the input parser and will load & instantiate the relevant script engine from the library.
*#The communication between the script executor and the script engine would be as per the contract of javax.script package.
*#The inter-working of the Script SE and the various script engines and the intricacies involved in java object to script object bindings etc would have to be taken care of the script executor and would be explained in more detail in the detailed design document.
*#The result object from the delegated script engine would be processed by the script executor and the result from the Script SE would be an output xml source document.
*#The output document will contain the result of the operation, which can be a java object or void or some fault in execution.
*#The structure of the input and output xml sources and the schema’s is given below
*#The services of the Scripting SE would be exposed to the outside world through http-soap binding component.
At line 40 added 3 lines.
!!!Evolution of the Scripting SE
! What is new?
* The scripting engine is currently not under active development.
At line 48 changed 3 lines.
\\
__Demo of Scripting Service Engine__ \\
The attached demos illustrate the creation of a new Scripting kind of a project and executing some sample scripts in various scripting languages.
!Team
* Developers working on the Scripting SE: [Vishnuvardhan Piskalaramesh|mailto:Vishnuvardhan.piskalaramesh@Sun.Com]
At line 52 changed 2 lines.
\\
A video demonstrating the Design time of the Scripting SE and the corresponding runtime is present at __[Scripting Sample demo-E2E | http://www.glassfishwiki.org/jbiwiki/attach/ScriptingSE/Scripting Sample demo-E2E.wmv]__.
<!-- =========================================================================================== -->
<script>endBlock2(); beginBlock3(); </script>
<!-- =========================================================================================== -->
At line 55 changed 4 lines.
* The demo shows how to create the Scripting Project, for providing a simple trading service.
* The Trading Service depicted as the echo.wsdl, takes in a TradePriceRequest xml, which will contain some information like the Trading Symbol, the quantity of stocks required etc.
* The output is an TradePrice xml which contains the pricing information for the requested quantity of stocks.
* The Scripting Service Engine would execute the greet.rb file which will actuall calculate the price of the requested stocks.
!!!Developing the Scripting SE
Not under active development currently
At line 60 changed 85 lines.
\\
__Brief Description of the Script Map__
The ScriptMap basically carries some information which are very much required for the execution of the Script file provided as part of the Service Unit.
* The schema followed for the Script Map is as below
[{Image src='ScriptMap1.JPG' width='' height='' align='left|center|right' }]
* ScrEngineDetails element carries information related to the Script Engine like the name of the ScriptEngine to be used (ex: jruby, groovy etc), the version information of script engine etc.
* Operations element carries information related to the operations\methods exposed by the associated WSDL
** Operation element contains 2 attributes
*** wsdlop --> indicates the name of the operation exposed by the WSDL
*** name --> indicates the operation\method in the script file (like greet.rb file) that needs to be invoked, when the associated wsdl operation name is marked for execution.
** Parameter element carries information on the input parameters, which have to provided as input for the script method.
***It specifies information like,
**** name --> The name by which this parameter can be used in the script file ex: param1, param0 etc.
**** Type --> Whether this parameter is a simple Type or xsdType (user defined structure )
**** xsdName --> If the type is xsdType, then the xsdFile name which has the schema for this user defined structure.
** ReturnType element is same as the Parameter element in its structure and attributes, except that it describes the element returned as a result of script execution.
* RequestReplyService contains
** file --> The name of the script file ex:greet.rb, that would be used for execution.
** MessageType --> referes to the namespace qualified reply message name exposed in the wsdl.
** Operation --> wsdl exposed operation name, that would be used for execution.
** PartnerLink --> referes to the namespace qualified partner link name as entered in wsdl or it is same as the service name entered in the Service unit's jbi.xml.
** PortType --> refers to the interface name used in the Service unit's jbi.xml.
** RoleName --> refers to the endpoint name exposed in the Service unit's jbi.xml.
\\
The script engine runtime reads all the above information while deploying the Service Unit.
The operation name entered in the RequestReply Service should match with the wsdlop name of atleast one of the operations described under Operations element in the ScriptMap.xml. Then the associated name attribute (which referes to the method name in the script file ) of that wsdlop name , would be read and the script file should contain a method matching this name. If the match is found then that method would be executed using the input parameter & return type information.
\\
\\
In order to make the Scripting Service Engine to work with other scripting engines like for ex:jython, ognl etc, we need to \\
1. add the corresponding script libraries in to the src\lib directory\\
2. Modify the jbi.xml under the src\META-INF directory to include the
added libraries (modifications have to be done to the bootstrap and
component classpath elements)\\
3. Re-build the application and redeploy.\\
This should work for other service engines.\\
__A Sample Netbeans Project using Scripting SE__
[ScriptingSE_Project.zip | http://www.glassfishwiki.org/jbiwiki/attach/ScriptingSE/ScriptingSE_Project.zip]
The sample project leverages jruby scripting engine to execute a jruby script in the server. The HTTP BC receives a soap message which triggers the script to execute and the result of the script is returned to the HTTP client. It also shows how a java object can be manipulated inside the script.
Steps to Build:
# The project zip file contains a Scripting SE module and a Composite Application project. Extract the zip and extract both the projects in their individual folders.
# Open the both the projects in netbeans.
# Add the Scripting SE module to the Composite Application project.
# Build and deploy.
# Run the TestCase included in the Composite Application project.
__References__\\
# Java scripting specs - jsr 223.
# JBI Specifications
!! People
*__Contributors__: \\
1. [Vishnuvardhan Piskalaramesh|mailto:Vishnuvardhan.piskalaramesh@Sun.Com]\\
<!-- =========================================================================================== -->
<script>endBlock3(); endBlocks();</script>
<!-- =========================================================================================== -->

JSPWiki v2.4.100
[RSS]
« Home Index Changes Prefs
This page (revision-37) was last changed on 26-Feb-09 17:47 PM, -0800 by FrankKieviet