The Server-side management API of the OSGi subsystem will need to provide basic management of the OSGi runtime. This is specifically management that isn't already provided elsewhere (e.g. deploy and undeploy are already covered appserver-wide).
The following is a proposal for how the OSGi runtime management can be exposed in the detyped API. Note that this proposal is not yet super fancy. It provides basic functionality that can be extended in the future when time allows.
Bundles
There will be a bundle resource under the OSGi subsystem. This resource will be a dynamic 'virtual' resource that reflects the state of the OSGi Framework.
{code}] ls /subsystem=osgi
bundle property module configuration
{code}
When listing that resource you will receive all the IDs of bundles in the system:
{code}] ls /subsystem=osgi/bundle
0 1 2 3 4 5 6 7 8 9 10
11 12 13
{code}
Note it returns the bundle IDs which are the guaranteed to be unique by the OSGi specification.
Each bundle resource contains some information about itself:
{code}] cd /subsystem=osgi/bundle=1
] :read-resource
{
"outcome" => "success",
"result" => {
"id" => 1L,
"state" => "active",
"start-level" => 2,
"symbolic-name" => "testbundle",
"version" => "1.0.1.Alpha2"}
}
{code}
Bundle Operations
There will initially be the following bundle operations:
{code}:start
:stop{code}
Operations to install and uninstall bundles are not needed at this level as this can be done through the common AS7 deployment channels.
Start Level
The OSGi subsystem will have a read-write attribute int called start-level. This attribute represents the current start level of the OSGi framework. Changing it will change the framework startlevel to the value specified.
Domain Mode
Because this information is not guaranteed to be the same across all servers in a domain, it should only be represented at the invidual server level when running in domain mode. So the information will appear in:
{code}/host=some_host/server=some_server/subsystem=osgi/bundle{code}
but not in
{code}/profile=some_prof/subsystem=osgi/bundle{code}
Comments