Java EE Service UnitsWith GlassFish V2, a Java EE application can be packaged as part of a JBI service assembly. Such a service assembly can contain one more Java EE applications (ejbs/wars/ears/rars) apart from service units belonging to other JBI components. The only difference between such a Java EE application packaged inside the service assembly will be a jbi.xml file in the META-INF directory of the Java EE archive. Lets call such a Java EE archive as Java EE Service Unit. ExampleAn example of contents such a service assembly is shown below. bash-3.00# jar -tvf TestApp.zip 0 Tue Jan 23 07:08:08 IST 2007 META-INF/ 106 Tue Jan 23 07:08:06 IST 2007 META-INF/MANIFEST.MF 1213 Tue Jan 23 07:08:06 IST 2007 META-INF/jbi.xml 1977 Tue Jan 23 07:08:06 IST 2007 com.sun.httpsoapbc-1.0-2.jar 3957 Tue Jan 23 07:08:06 IST 2007 miscejb.jar The service assembly TestApp.zip contains two service units. miscejb.jar of Java EE Service Engine and com.sun.httpsoapbc-1.0.2.jar of the HTTP/SOAP binding component. The details of these service units are specified in the jbi.xml of the service assembly. The miscejb.jar will contain a jbi.xml in it's META-INF directory, making it a service unit. bash-3.00# jar -tvf miscejb.jar 304 Tue Jan 23 07:08:04 IST 2007 META-INF/jbi.xml 0 Tue Jan 23 07:08:00 IST 2007 META-INF/ 106 Tue Jan 23 07:07:58 IST 2007 META-INF/MANIFEST.MF 0 Tue Jan 23 07:08:00 IST 2007 sqetests/ 0 Tue Jan 23 07:08:00 IST 2007 sqetests/jbi/ 0 Tue Jan 23 07:08:00 IST 2007 sqetests/jbi/ejbws/ 255 Tue Jan 23 07:08:00 IST 2007 META-INF/sun-ejb-jar.xml 603 Tue Jan 23 07:08:00 IST 2007 sqetests/jbi/ejbws/Account.class 1713 Tue Jan 23 07:08:00 IST 2007 sqetests/jbi/ejbws/Misc.class A Java EE Service Unit will declare the services it consumes or provides in its' jbi.xml. For an EJB webservice , to enable it in JBI, a jbi.xml like the following need to be provided. <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <jbi xmlns="http://java.sun.com/xml/ns/jbi" xmlns:ns0="http://ejbws.jbi.sqetests/" version="1.0"> <services binding-component="false"> <provides endpoint-name="MiscPort" interface-name="ns0:Misc" service-name="ns0:MiscService"/> </services> </jbi> It basically specifies the Service Name and Port Name of the EJB webservice. Java EE Service Engine will enable an endpoint in the normalized message router with these details, so that the EJB webservice can be accessed from a JBI application. Similarly, if a Java EE application (Servlet or EJB) need to access a service exposed by a JBI application, it will specify the jbi.xml as follows. <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <jbi xmlns="http://java.sun.com/xml/ns/jbi" xmlns:ns0="http://message.helloca.jbi/" version="1.0"> <services binding-component="false"> <consumes endpoint-name="MessageBPELPort" interface-name="ns0:MessageBPEL" service-name="ns0:MessageBPELService"/> </services> </jbi> Now, a webservice invocation from Java EE application using normal JAXWS client apis will be directed to Deploying a Service Assembly that contains a Java EE Service Unit.asadmin command deploy-jbi-service-assembly (or admin GUI) can be used to deploy the service assembly that contain the Java EE service unit. This is just the same as deploying a normal JBI service assembly. When this happens, the Java EE service unit will be deployed to Java EE containers by the Java EE Service Engine. Note that the Java EE Service unit will not be started until the service assembly is started using start-jbi-service-assembly command or by starting via admin GUI. Netbeans tooling supportNetbeans enterprise pack provide tooling support for Java EE Service Unit. The details are available at |