I think that the JBoss inspired life-cycle is too restrictive, I'd
like to be able to define life-cycle schemas in the XMLet resource
file, or in another XML file. An XMLet version might look something
like:
<xmlets>
<xmlet code="com.sun.jdmk.comm.HtmlAdaptorServer"
archive="jmxtools.jar"
name="DefaultDomain:name=HtmlAdaptorServer">
<meta-data>
<life-cycle>
<start>
<method name="init"/>
<method name="start"/>
</start>
<stop>
<method name="stop"/>
<method name="destroy"/>
</stop>
<ping>
<method name="ping">
<input>
<!-- timeout -->
<param class="long">500</param>
</input>
<desired-output>
<param class="boolean">true</param>
</desired-output>
</method>
</ping>
</life-cycle>
</meta-data>
<arg type="int" value="8082"/>
</xmlet>
</xmlets>
Of course that was horribly verbose so we could just use an XML entity
<xmlet code="com.sun.jdmk.comm.HtmlAdaptorServer"
archive="jmxtools.jar"
name="DefaultDomain:name=HtmlAdaptorServer">
<meta-data>
&standardLifeCycle;
</meta-data>
<arg type="int" value="8082"/>
</xmlet>
So far I've created an MetaDataMBean which associates a ObjectNameMetaData
object with ObjectNames, ObjectNameMetaData contains a simple HashMap. I've
built a 'xmlet' node processor that adds generic meta data. xml looks like
this:
<xmlet code="com.sun.jdmk.comm.HtmlAdaptorServer"
archive="jmxtools.jar"
name="DefaultDomain:name=HtmlAdaptorServer">
<meta-data>
<!-- Life Cycle-->
<!-- Start -->
<entry>
<key>
<param class="java.lang.String">life-cycle-start</param>
</key>
<value>
<param class="MethodSignature[]">
<param class="MethodSignature">
<param class="java.lang.String">init</param>
</param>
<param class="MethodSignature">
<param class="java.lang.String">start</param>
</param>
</param>
</value>
</entry>
<!-- Stop, really awkward method, just for demo -->
<entry>
<key>
<param class="java.lang.String">life-cycle-stop</param>
</key>
<value>
<param class="MethodSignature[]">
<param class="MethodSignature">
<param class="java.lang.String">stop</param>
<param class="java.lang.Object[]>
<param class="Whatever">whateverStringConstructorArg</param>
</param>
</param>
<param class="MethodSignature">
<param class="java.lang.String">destroy</param>
</param>
</param>
</value>
</entry>
</meta-data>
<arg type="int" value="8082"/>
</xmlet>
This sample only shows generic binding of meta data, and thus is not
structured semantically, hence it's crap! but it's a start. The
methodSignature
class would look something like:
public class MethodSignature
{
public MethodSignature(String methodName)
{
this(methodName, null, null);
}
public MethodSignature(String methodName, Object[] parameters)
{
this(methodName, params);
}
public MethodSignature(String methodName, Object[] parameters, Object
desiredResult)
{
// ...
}
// ...
}
The ConfigurationService MBean could then aquire the MethodSignatures for
starting and run them.
Alternatively the method signatures for starting could be placed into the
.jcml file.
Regardless of the original problem of custom startup, the
MetaDataServiceMBean should be useful
elsewhere, likewise with the capability to create arbitrary Java Objects
from 'serialized' constructor
parameters.
-----Original Message-----
From: Julian Gosnell [mailto:[EMAIL PROTECTED]]
Sent: 10 April 2001 16:09
To: [EMAIL PROTECTED]
Subject: [JBoss-dev] Nested JMX Service Groups...??!
Greg has released JettyJMX, a packaged which
integrates with Jetty in order that all major
components of Jetty become MBeans.
I have been integrating this into jboss_jetty, so that
Jetty is now listed by the JMX agent as a collection
of services, all with published interfaces, instead of
one megalithic service.
I have a problem !
JBoss seems to expect MBeans registered with it's JMX
Server to support a JBoss-inspired life-cycle
init()/start()/stop()/destroy().
Jetty MBeans support a different lifecycle which has
no init() method.
Every time a Jetty MBean is registered, JBoss tries to
call it's init() method, resulting in an exception
being thrown from within JMX.
Maybe I am taking the wrong approach.
I would like internal Jetty services to be available
to JBoss users via JMX. However these internal
services should be managed by Jetty, not JBoss (I
don't expect someone else to come in and call
lifecycle methods on objects I own...)
Can this be done ?
Do I register Jetty MBeans against another JMX Server
? If so can I hook this into the main JBoss one ?
Should JBoss-Jetty actually be this JMX Server ?
How should we scope groups of nested services within
JBoss ?
That should do it !
Jules
__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.
http://personal.mail.yahoo.com/
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development