Hi community,

I'm feel very proud today because I've just finished implementation of
the new JMX integration module.

To play with the new JMX integration module, please start from the
following example:

http://svn.apache.org/viewvc/mina/trunk/integration-jmx/src/main/java/org/apache/mina/integration/jmx/Foo.java?view=markup

* IoServiceMBean provides additional operations that allows you to
query the list of IoSessions that matches a certain criteria.  The
matcher expression has been implemented using OGNL
(http://www.ognl.org/), which is very similar to Java expression.  You
can also register the match result as MBeans, which means you can
manage individual sessions.

* IoSessionMBean provides additional operations that allows you to
modify the filter chain of the session.  You can add any filter MBeans
registered by IoFilterMBean to the filter chain at runtime, which
means, for example, you can add profiler timer filter and remove it
whenever you want.

* IoFilterMBean provides nothing much but all IoFilters must be
registered via this class so IoSessionMBean can access the filter
instance.

* ObjectMBean is the superclass of the three above, which can turn any
POJO into a ModelMBean.  It's somewhat monolithic, but it seems to
work pretty well for MINA classes.

To access properties, integration-jmx module uses Jakarta Commons
BeanUtils and OGNL.  Unfortunately, Jakarta Commons BeanUtils uses
Jakarta Commons Logging, so you will have to configure SLF4J more
carefully.  I'm looking for a similar library that doesn't depend on
any logging framework.  Please let me know if there's any.

Another module to introduce is integration-ognl, which is depended by
integration-jmx.  It provides:

* OGNL PropertyAccessor implementations for IoService, IoSession and IoFilter
* IoSessionFinder utility class that evaluates a boolean OGNL
expression to filter a set of IoSessions (e.g. search by IP address:
remoteAddress.startsWith('192.168.0.2:'), search by session ID: id ==
0x12345678, all sessions: true)

I thought about using MVEL instead of OGNL, but it seems like MVEL is
not available in the Maven repository and OGNL just works fine in this
case which doesn't require high performance.

I hope all these changes make everyone happy, and please let me know
if there's a room for improvement.  Any suggestion for new features is
appreciated.

Cheers,
Trustin
-- 
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP Key ID: 0x0255ECA6

Reply via email to