TID-JMA4O
Introduction
TID-JMA4O (JMX based
Management
Agent for OSGi) bundle provides a
JMX
server and exposes the
OSGi
framework and several standard services with MBeans. The bundle allow
to register other MBeans through and OSGi service too.
The bundle start a RMI JMXConnector with the configurable parameters
port and jndiPath, through the properties file AgentProperties.txt
inside the bundle.
This bundles has been tested and runs in two OSGi frameworks:
OSCAR and
Knopflerfish
Quick Start
Environment:
- If you use jdk1.5,
you don’t need any more.
- If you use jdk1.4
you need some libraries that can be
downloaded from MX4J
project: mx4j.jar, mx4j-remote.jar, mx4j-tools.jar.
This
libraries must be available in the classpath (for example you can put
them in the $JAVA_HOME/jre/lib/ext directory).
- No other versions of jdk are supported.
Needed bundles:
When all the needed bundles are installed and started, you can start
the tid-jma4o.jar bundle, which start the MBeanServer, the JMXConnector
(with the configured port and jndiPath), and register the JMXAccess
service in the framework.
The available MBeans depends on the standard services that are running
in the framework. When a supported standard service is started, the
agent automatically create an MBean an register it in the MBeanServer.
The supported services are:
- Package Admin
- Start Level
- Log
- Permission Admin
- Configuration Admin
- User Admin
Then you can access to the MBeanServer using the JMX Remote API
(JSR160). As an example of access we are going to see the
MC4J,
a
generic JMX Management Console.
When the tool is installed and running, we can create new connections.
We must choose the JSR160 type, and write some parameters. Only the
parameters in the image are relevant to connect with TID-JMA4O. The
most important parameter, Server URL, must have a similar value as in
the image, with the next format:
service:jmx:rmi://<host>/jndi/rmi://<host>:<port><jndipath>
where <host> is the host name or ip ;
<port> is the port
that we are configured in the properties of the agent (
1099
by default); and for
<jndipath> is the value configured in the agent too (
jmxconnector
by default).
The next image show the MBeans available for this connection. We can
see many MBean related to an OSGi framework.
Available
MBeans
The
MBeans
are registered in a MBeanServer with and ObjectName, which include a
string
with the format “DOMAIN:
property1=value1[,propertyN=valueN]”
that identifies an MBean in the MBean Server.
There
are
four domains in our agent:
- OSGi-Framework:
contains one MBean with attributes and operations related to the
framework.
- OSGi-Bundles:
contains one MBean for each bundle installed in the framework. Each
MBean have
attributes and operations related with bundles.
- OSGi-Services:
contains one MBean for each service registered in the framework. Each
MBean
have attributes and operations related with services.
-
OSGi-Services
Mappings: contains a variable number of bundles depending on the
registered
services. If all the mapped services are running in the framework we
must see
six MBeans, one for each managed service.
Registering
your MBeans
If
you want
to instrument your bundles/services through JMX, you can get the
JMXAccess
service and use his interface for register new MBeans in the
MBeanServer. The
service is registered under the interface
“org.osmose.tid.osgi.mgmt.jmxserver.service.JMXAccess”,
which have two methods,
one to register and other to unregister MBeans.
License
TID-JMA4O is
distributed under the
GNU Lesser General Public License,
LGPL, for detailed information visit
LGPL
Telefónica
I+D
TID-JMA4O has
been developed by
Telefónica
I+D in the context of the
ITEA-OSMOSE
project.