Register external services on Petals binding components
Binding components can register external services to the JBI environment.It is possible by deploying a service assembly on the JBI container. A service assembly is a zip archive which contains one or more service units. The structure of the service assembly is, a META-INF directory holding a "jbi.xml" descriptor. This descriptor describes all the service units to be deployed.Each described service unit has to be placed at the root path of the service assembly archive. Service units must be zip or jar archives. A service unit contains one "*.wsdl" file which is in fact a WSDL file describing the new service to be deployed. It has also a "META-INF" directory holding "jbi.xml" which contains all information concerning the binding component whiwh will hold the new service.| ''ServiceAssembly.zip''
| | META-INF | ''jbi.xml''
| |
| |''ServiceUnit1.zip'' | META-INF | ''jbi.xml''
| | | ''service1.wsdl''
| |''ServiceUnit2.zip'' | META-INF | ''jbi.xml''
| | | ''service2.wsdl''To actually deploy a service assembly, you just copy this zip archive into the PETALS autodeploy directory. Then it will be extracted and for every service units mentionned in the service assembly description file, an deployment procedure will take place.This procedure is:
- The service unit manager of the binding component declared in the service unit jbi.xml description file is called.
- This service unit manager will execute its ''init'' and ''start'' operations on the service unit.
- During the start process, the "jbi.xml" file is read, the service qname, endpoint and interface names are parsed anda new endpoint is then activated according to these values.
- The wsdl file is then stored, as a dom document in a map making correspondance between endpoints and service description files. When the binding component is asked for the service description of one of its activated endpoint, it transmits the document found in the service unit manager map.
Deploy External Services
The way to register an external service with a binding component provided with Petals is always the same.Registering handlers
Details hereService Assembly
You need to deploy a new service unit, and in consequence to deploy a service assembly. A service assembly is a zip archive containing one or more service units and a ''META-INF'' directory containing a ''jbi.xml'' description file.This file specifies all service units to be deployed.<jbi version="1.0" xmlns='http://java.sun.com/xml/ns/jbi' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'> <service-assembly> <identification> <name>serviceAssembly</name> <description>Service Assembly to deploy service unit to my binding component </description> </identification> <service-unit> <identification> <name>newService</name> <description>Deploy new service</description> </identification> <target> <artifacts-zip>serviceUnit.zip</artifacts-zip> <component-name>MyBindingComponent</component-name> </target> </service-unit> </service-assembly> </jbi>
Service Unit
This service unit is contained is the zip file ''serviceUnit.zip'' which contains all needed information and file for the binding component to be able to deploy the new service.Each service unit zip contains:- a ''META-INF'' directory holding a ''jbi.xml'' file
- a ''.wsdl'' file containing the service description
<jbi version="1.0" xmlns='http://java.sun.com/xml/ns/jbi' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:petals-extensions='http://petals.objectweb.org/extensions'> <services binding-component="yes"> <provides interface-name="Foo" service-name="{http://some.name.space.com}FooService" endpoint-name="FooServiceEndpoint" /> <petals-extensions:type>external_service</petals-extensions:type> </services> </jbi>
PDF
History