Hi,
I'm working on a layer to provide invocation and asynchronous
messaging support for EJBs in our project. This includes EJB
module discovery, registration and some initial bootstrapping. I was able to do
it by implementing a MBean and register it to JMX server to
receive MBean registration notification and then look up
the deployment descripter attribute in EJBModule through MEJB. This
worked before. But after I resynced with the latest CVS
code, I realized some changes:
After a hot re-deploy an EJB module, there is only one
J2EEApplication MBean under SingleJBoss management domain registered for the
re-deployed module.
My problem with that is only EJBModule MBean contains the
deployment descriptor and now the EJBModule is gone :( (I found
out if you restart JBoss server, it will come back: there
will be 3 MBeans(one J2EEApplication, one EJBModule and one EJB) for each EJB
deployed). The base class J2EEDeployedObject for J2EEApplication and
J2EEModule/EJBModule in JSR 77 has defined a deploymentDescriptor attribute that
should be available for a attribute lookup or method invocation through MEJB.
The current implementation in JBoss provides DD only in EJBModule as an
attribute.
I understand JSR 77 is only a information model and it
came out late. Also it has left many spaces for developers to decide how to
implement it, for example, like the one I have mentioned, how a
deployed EJB module should be managed. The current implementation is very
nice and after a bit hack I was able to get it work in my
project. Some suggestions:
1. In ListenerRegistration.java,
the mEventType is hardcoded to be RMI although there are other 2
types(JMS and Polling) available. If a constructor that accepts a
type param could be added would be nice.
2. In JMS client listener code, only remote listener is
removed after calling removeNotificationListener, the local JMS listener is
left running. This will cause JBossMQ complains client reset the queue
connection when client stopped. This can be easily fixed by adding a
call to stop the queue when client stops.
3. As JSR88 has come out, I think maybe now it is a good time
to consolidate all the deployment descriptors and configuration information
and provide them through MEJB and/or DeploymentManager/Factory/whatever as
ConfigBean at run time for hot deployment, all the DDs and
configurations could be maintained in a central place as live
java objects, with a good deployment front end, maybe we don't need
to manually deal with all the DDs
anymore...
Regards,
mlu
|