This article describes the synergy between the Sun Java EE Engine (formerly Java EE Service Engine) and Java EE in the Java Business Integration (JBI) environment. The article covers the concepts and features of the Sun Java EE Engine and, through examples, illustrates how to use it in a JBI composite application. Contents
The Sun Java EE Engine is a JSR 208 compliant Java Business Integration
(JBI) runtime component that connects Java EE web services to JBI
components. It is essentially designed to act as a bridge between the
application server and the JBI runtime environment, facilitating
interaction between Java EE components and JBI components. The Sun Java EE Engine
has been developed as part of Project GlassFish. So, when
the GlassFish application server is installed, the Sun Java EE Engine
is also installed with the component named Without the Sun Java EE Engine, a Java EE component that is deployed as a servlet or EJB web service cannot be accessed from another JBI component without incurring the overhead of network layer communication. When the application server and JBI runtime environment work together in the same JVM instance, Java EE components can more readily access binding components and service engines. Binding components are used for transport, and service engines are used for business logic, processing, transformation, and routing services. EJB beans and servlets that are packaged as web services and deployed in the application server are transparently exposed as service providers in the JBI environment. Consequently, Java EE components can consume services exposed in the JBI environment when using the Sun Java EE Engine without being aware of the underlying binding or protocol. This in-process communication between components of the application server and JBI runtime components results in increased request processing speed because all component interactions occur within the JVM instance of the application server. Figure 1 illustrates the relationship between the GlassFish application server, the JBI runtime environment, and the Sun Java EE Engine. Acting either as a service provider or as a service consumer, the Sun Java EE Engine communicates directly with the Normalized Message Router (NMR) and the EJB web services through the Java API for XML Web Services (JAX-WS). The power and versatility of the Java EE web service communication continues to expand when additional JBI components are added to the runtime environment.
In addition to providing in-process bidirectional communication between the Java EE and JBI environments, the Sun Java EE Engine provides the following features:
The following sections discuss these features in more detail. As shown in Figure 1, your composite application could contain various pieces, with each piece needing to be deployed into the proper component of the JBI environment. For example, if the application needs to read input from a file and execute a BPEL process, then your composite business application contains at least two pieces: one piece is deployed into the File binding component (BC), and another piece is deployed into the BPEL service engine (SE). To make the deployment process easier, the JBI specification defines a service assembly, which is a single archive that bundles various pieces of a business application. In JBI terminology, the individual pieces in the service assembly are referred as service units. Using this JBI service assembly, all the pieces of your composite business application can be deployed at once, and you don't need to deploy the individual pieces of your application separately. A composite business application can contain Java EE applications. Users prefer to deploy and manage composite applications as a single entity and would prefer not to deploy the Java EE applications separately from the JBI service assembly. Java EE service units can make Java EE applications part of the JBI service assembly, enabling them to be deployed and managed as one entity. By definition, a Java EE service unit is a Java EE application that can be bundled as part of the JBI service assembly. So, when the JBI service assembly is deployed, the Sun Java EE Engine takes care of deploying any Java EE applications that are bundled in the service assembly. In addition, any life cycle operation that is applied to the JBI service assembly (start, stop, undeploy, and so on) results in the same life cycle operation being applied to the bundled Java EE applications.
The difference between a normal Java EE application and the Java EE Service
unit is that the latter contains an additional descriptor file named
Java EE service units can be of two types, as shown in Figure 2:
The following examples should help you understand the different types of Java EE service units. Example: Service Unit Containing a Java EE Application Archive That Provides Services to the JBI Environment When a Java EE service unit contains a Java EE application archive that provides services to the JBI environment, the Java EE application archive contains one or more Java EE web services.
The Sun Java EE Engine deploys the archive to the application server
during the deployment of the service assembly. The deployment of the
archive is no different from the normal deployment accomplished through the
Note that custom deployment configuration properties can also be specified
in vendor-specific deployment descriptors. For example, if database tables
need to be created during the deployment, the requirement can be specified
in the Code Example 1
Consider the following web service example. It is a skeleton of a simple web service that retrieves employee information from a Human Resources database. Code Example 2
The Web Services Definition Language (WSDL) file for the above web service is shown in the following code example. Code Example 3
To make this web service accessible to the various JBI components, you need
to enable it in the JBI environment with a description in the descriptor
file Code Example 4
Note that you typically don't need to code descriptor files by hand because they are easily generated by tools such as the NetBeans IDE Enterprise Pack. The Java EE application and the JBI descriptor file can now be bundled inside the JBI service assembly. When you deploy and start the service assembly in the application server, the Java EE application is also deployed and started. At the same time, the endpoints specified in the JBI descriptor file are also enabled in the NMR, and the web service becomes available to all the JBI components. Example: Service Unit Containing a Java EE Application Archive That Consumes Services Exposed by Other JBI Components In this situation the Java EE application archive contains one or more Java EE web service clients. The Java EE application is deployed in the same way as in the previous case.
The Code Example 5
Example: Dummy Service Unit That Provides Services to JBI
If a web service is already running inside the application server, and it
needs to be made available to the JBI environment, then you can create a
dummy service unit composed of only the
For example, if the HumanResourceEJB bean in Code Example
4 is already deployed in the application, then it can be enabled in the NMR simply by placing the Example: Dummy Service Unit That Consumes the Services Exposed by Other JBI Components
If there is already a web service client running inside the application
server and it needs to access the JBI service, then you can create a dummy
service unit with only a
The contents of the All these types of Java EE service units can be created and added to the JBI service assembly easily with the NetBeans IDE Enterprise Pack. Transactions are an important part of the business logic for any enterprise application. With the transaction support in the Sun Java EE Engine, Java EE web services and JBI services can participate in a single transaction. For example, a BPEL process can call an EJB bean that updates the database, all in the same transaction.
The propagation of a transaction across JBI components is defined in the
JBI specification. A standard message exchange property
( Java EE web service invoking a JBI service (refer to Figure 3):
JBI service invoking a Java EE web service (refer to Figure 4):
As with transactions, the JBI specification also defines a way by which different JBI components can make use of a single authentication mechanism. As a result, a user need only sign on once, and the JBI system propagates the security credentials to various JBI components for authorization.
To achieve this single-sign-on capability, the JBI specification defines a
property Security propagation when a Java EE application invokes a JBI service (refer to Figure 5):
Security propagation when a JBI service invokes Java EE web service (refer to Figure 6):
Cluster Support The Sun Java EE Engine is cluster aware, enabling you to deploy a Java EE service unit to an application server cluster. When a JBI service assembly is deployed to a cluster, the Java EE service units are also deployed to the cluster. The Sun Java EE Engine has been developed as part of Project GlassFish. When the GlassFish application server is installed, the Sun Java EE Engine is also installed. You can view and administer the Sun Java EE Engine through the application server's GUI (graphical user interface) and CLI (command-line interface). Here are some of the interfaces that are often used. To View the Sun Java EE Engine: GUI:
CLI:
Type the following command:
To Administer the Sun Java EE Engine: GUI :
CLI :
To Install the Sun Java EE Engine Manually: The Sun Java EE Engine comes installed and configured when the GlassFish application server is installed. If you uninstall the Sun Java EE Engine accidentally, you can use either the GUI or the CLI to install it again manually. GUI:
CLI:
Type the following commands:
This section explains one business integration scenario in which the Sun Java EE Engine can be used. In the example shown in Figure 7, the client application, acting as a web service, sends a message to a message queue. The message is picked up by a message-driven bean (MDB). Upon receiving the message, and by using the Sun Java EE Engine, the MDB contacts the NMR for the service endpoint that is exposed by the BPEL process.
When the MDB executes, the BPEL application, hosted by the BPEL service engine, contacts the NMR to find its partner services. In the example, there is only one partner service: a stateless session bean (JSR 109 web service) that is hosted in the same Application Server JVM instance. The JSR 109 web service's endpoint is enabled in the NMR by the Sun Java EE Engine when the stateless session bean is deployed. The stateless session bean then uses Java EE persistence APIs (JPA) to access the database. A known limitation of the Sun Java EE Engine is that it supports only InOut and InOnly message exchange patterns of JBI. This limitation is not a disadvantage in normal use because you can implement almost any composite application using only these two patterns.
|
| |||||||||||||||||||||||||||||||||||||||||||
Oracle is reviewing the Sun product roadmap and will provide guidance to customers in accordance with Oracle's standard product communication policies. Any resulting features and timing of release of such features as determined by Oracle's review of roadmaps, are at the sole discretion of Oracle. All product roadmap information, whether communicated by Sun Microsystems or by Oracle, does not represent a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. It is intended for information purposes only, and may not be incorporated into any contract.
|
| ||||||||||||