Wednesday 16 May 2007

More on WAS

You can learn a lot about how things work by really delving into the documentation for WAS. How to use the Eclipse Extension support is all documented, i.e. use JNDI to get access to the EclipseRegistry.

However, looking at the XML, config and manifest files is also telling. There is also a reason why an OSGIConsole script is supplied with WAS now. If you jar xvf some of the plugins, like the main com.ibm.ws.runtime_6.1.0.jar you can learn a lot by looking at the MANIFEST.MF file that follows an Eclipse/OSGI pattern, i.e.

Bundle-Activator: com.ibm.ws.runtime.component.RuntimeBundleActivator
Bundle-Localization: plugin
Bundle-ManifestVersion: 2
Bundle-Name: WS_Server
Bundle-SymbolicName: com.ibm.ws.runtime; singleton:=true
Bundle-Vendor: IBM
Bundle-Version: 6.1.0
Eclipse-AutoStart: false
J2EE-DeploymentFactory-Implementation-Class: com.ibm.ws.management.app
lication.j2ee.deploy.spi.factories.DeploymentFactoryImpl
Manifest-Version: 1.0
Require-Bundle: com.ibm.ws.bootstrap; visibility:=reexport,
org.eclipse.jdt.core
DynamicImport-Package: com.ibm.etools.application,
com.ibm.etools.application.impl,
com.ibm.etools.application.util,
com.ibm.etools.client,
com.ibm.etools.client.impl,
com.ibm.etools.client.util,
...
Import-Package: com.ibm.ejs.models.base.bindings,
com.ibm.ejs.models.base.bindings.applicationbnd,
com.ibm.ejs.models.base.bindings.applicationbnd.impl,
com.ibm.ejs.models.base.bindings.applicationbnd.util,
com.ibm.ejs.models.base.bindings.clientbnd,
com.ibm.ejs.models.base.bindings.clientbnd.impl,
com.ibm.ejs.models.base.bindings.clientbnd.util,
...
org.eclipse.xsd.util,
org.osgi.framework,
org.osgi.service.condpermadmin,
org.osgi.service.packageadmin,
org.osgi.service.permissionadmin,
org.osgi.service.startlevel,
org.osgi.service.url,
org.osgi.util.tracker
Export-Package: com.ibm.CBUtils; x-internal:=true,
com.ibm.CORBA.services.redirector; x-internal:=true,
com.ibm.CORBA.services; x-internal:=true,
com.ibm.CSIv2Security; x-internal:=true,
...

Note that BundleActivator. Note also that the bootstrap is re-exported, most other underlying library services are also re-exported, and that the main underlying runtime is a singleton. I believe it works like this....

The Eclipse 3.1.2 runtime starts up and loads com.ibm.ws.runtime plugin after the updater has been loaded. This runtime provides the base services used by the rest of the app server, and is monolithic but well architected to provide true runtime services for use of the web container, ejb container, etc. Each of the rest of functional components and containers then sit on top of this runtime.

Containers such as the SIP container are true plugins that make use of the com.ibm.ws.runtime extension points and services. This container even has an OSGI Activator of its own that subclasses the WsBundleActivator.

All of this would make sense in allowing the feature packs and future extensions to be just added on top of the original code. This is really extensible.

Still, I will continue digging and add to this blog....

No comments: