JavaTM Platform, Enterprise Edition (Java EE) 5 Technologies
Project Open ESB Starter Kit

Copyright © 2006 Sun Microsystems, Inc. All rights reserved.


Java EE Service Engine Overview


Contents

The following topics describe the Java EE Service Engine.

About the Java EE Service Engine
Java EE Service Engine Features
Runtime Example of the Java EE Service Engine
Configuring the JEE SE
JEE SE Limitations

About the Java EE Service Engine

The Java EE Service Engine (SE) is a JSR 208-compliant JBI runtime component that connects Java EE web services and Java EE web service clients with the Normalized Message Router (NMR) in the JBI runtime environment. This connection to the NMR means that Java EE web services can be consumed in a JBI environment, and Java EE web services can consume web services that are available in the JBI environment. The Java EE Service Engine (SE) is automatically installed in the JBI runtime in every Java EE SDK installation that contains JBI.

The Java EE SE supports Java EE applications running in the application server and JBI environment. It enables applications that are deployed in the Application Server to use any new protocol plugged into the JBI runtime environment as a Binding Component (BC), and it enables web services deployed on the Application Server to be accessed by these Binding Components. The Java EE Service Engine provides better performance than the default SOAP over HTTP socket connection due to in-process communication between components and additional protocols such as JMS.

JBI uses the abstract service model as the main basis of component interactions. Components play one of two roles in such interactions:

  • Service Provider -- The component that performs the given service (either directly or as a proxy for an external provider)
  • Service Consumer -- The component that invokes a given service (either directly or as a proxy for a remote consumer)

Java EE Service Engine As a Service Provider

The Java EE Service Engine functions as a service provider by enabling an endpoint in NMR.

When a Java EE web service is deployed, the deployment runtime of Application Server notifies the Java EE Service Engine so that an endpoint is enabled in the NMR of the JBI runtime. The notification enables any component deployed in NMR to access the Java EE web service. For example, a BPEL application running inside the BPEL service engine can access the Java EE web service by sending a normalized message to the endpoint enabled by the Java EE Service Engine. This way of accessing Java EE web services is an alternative to the normal web service client access defined by JAX-WS.

Figure 1: Java EE SE as a Service Provider

Java EE Service Engine As a Service Consumer

When a Java EE application needs to access an endpoint of a service provider deployed in the JBI runtime environment, the Java EE Service Engine acts as a bridge between the application server and the NMR in the JBI environment. In this case, the Java EE Service Engine normalizes the SOAP message that otherwise would have been used in the JAX-WS communication and sends it to the NMR. This normalized message is handled by a service that has been enabled by a service provider deployed in the JBI runtime environment.

Figure 2: Java EE SE as a Service Consumer

top

Java EE Service Engine Features

When you install Open ESB Starter Kit, the Java EE Service Engine is automatically installed on the Application Server. Open ESB is essentially the JBI Runtime Environment. The Java EE Service Engine acts as a bridge between the Application Server (Glassfish) and the Open ESB environment for web service providers and web service consumers that are deployed in Application Server. It provides numerous benefits including the following:

  • EJBs/Servlets packaged as web services and deployed on the Glassfish Application Server are transparently exposed as service providers in JBI Environment
  • Java EE Components - EJBs/Servlets can consume services exposed in JBI environment using the Java EE service engine without being aware of the underlying binding/protocol such as SOAP, JMS, and so on, exposing the web service.
  • In-process communication between components of application server and JBI components to increase request processing speed.
  • Any component that is plugged into ESB can directly communicate with Java EE applications. For example, clients of various bindings such as SOAP or JMS can communicate with web services developed using Java EE using Open-ESB because of Java EE Service Engine.

top

 

Runtime Example of the Java EE Service Engine

The minimum user experience in the JBI runtime environment requires a Java EE component, such as a binding component or service engine, and a JBI component. When a JBI component accesses a service within the Java EE, it accesses it through the Java EE SE.

In the runtime example, the client application--acting as a web service--sends a message to a message queue, which is picked up by the message driven bean (MDB). Upon receiving that message, and by using the Java EE Service Engine, the MDB contacts the NMR for the service endpoint exposed by the BPEL process. When MDB executes, the BPEL application (hosted by the BPEL Service Engine) contacts the NMR to find its partner services. In our example, there is only one partner service and it is a stateless session bean (JSR 109 webservice) hosted in the same Application Server JVM. The JSR 109 webservice's endpoint is enabled in the NMR by the Java EE Service Engine when the stateless session bean gets deployed. This stateless session bean then uses Java EE persistence APIs to access the database.

Figure 3: Java EE SE Use Case Example

 

top

Configuring the JEE SE

The Java EE Service Engine is enabled by default. To disable it without uninstalling it, set the com.sun.enterprise.jbi.se.disable JVM option to true using the asadmin create-jvm-options command as follows, then restart the server:

asadmin create-jvm-options --user adminuser
-Dcom.sun.enterprise.jbi.se.disable=true

The JBI framework must also be enabled to deploy a JBI component such as the JEE SE. The following command enables the JBI framework:

asadmin enable --user adminuser JBIFramework

JAX-WS Web Services deployed on Glassfish can be packaged as Servlets or EJBs. The service engine automatically activates web service end points in ESB at the time of loading of the web service. An endpoint can be deactivated from ESB by setting jbi-enabled property of corresponding <web-service-end-point> in the domain.xml file to false by using the following combination of asadmin configure-webservice-management and set CLI commands:

./asadmin configure-webservice-management <appName>#<webservice_name>
./asadmin set server.applications.<web|ejb>-module.<appName>.web-service-endpoint.<webservice_name>.jbi-enabled=false]

To determine whether requests from a web service consumer are routed through the Java EE Service Engine, set a stub-property named jbi-enabled in the consumer’s sun-web.xml or sun-ejb-jar.xml file. This property is set to false (disabled) by default. Here is an example of the sun-web.xml file:

<sun-web-app>
  <service-ref>
    <service-ref-name>sun-web.serviceref/calculator</service-ref-name>
    <port-info>
      <wsdl-port>
        <namespaceURI>http://example.web.service/Calculator</namespaceURI>
        <localpart>CalculatorPort</localpart>
      </wsdl-port>
      <service-endpoint-interface>service.web.example.calculator.Calculator</service-endpoint-interface>
      <stub-property>
        <name>jbi-enabled</name>
        <value>true</value>
      </stub-property>
    </port-info>
  </service-ref>
</sun-web-app>

For more information about the sun-web.xml and sun-ejb-jar.xml deployment descriptor files, see the Sun Java System Application Server Platform Edition 9 Application Deployment Guide.

JEE SE Limitations

The following is a list of limitations for the JEE SE.

  • When JEE SE is a provider, you can use the jbi-enabled flag to stop the JEE SE from enabling endpoints in the NMR. By doing this, all the endpoints exposed in that application are disabled from NMR. There is no way to selectively disable some endpoints of an application.
  • Transaction support is not available.
  • Security support is not available.
  • WSDL 2.0 is not supported
  • The JBI Message Exchange Patterns "Robust InOnly" and "Optional InOut" are not supported.

top