[jboss-dev] Further profling: Where should I focus?

Kabir Khan kabir.khan at jboss.com
Fri Dec 25 06:43:37 EST 2009

>> For @JMX just write another deployer and do it
>> regularly.  Similarly with lifecycle and other features.
> Regularly?
> If you mean to register an mbean, that is actually not what we/users want.
> See my response to Dimitris this morning.
> While this could be a deployer feature, I think it's far more complex to 
> do it than tie it into the bean's lifecycle.
> e.g. scan for @JMX, remembering the handle, checking if it's overridden 
> for an instance, ... while we already have all this implemented in 
> bean's lifecycle handling, it's just not optimized yet.
> What do you mean by "similarly with lifecycle and other features"?
> @JMX, @JNDI, @Password, ... is the lifecycle callback.

Yeah, the way I envisage the new lifecycle stuff is to do this instead of pointcut matching for each bean:

for (Annotation lifecycle : lifecycleCallbackRegistry) //@JMX, @Jndi etc.
   Object callback = lifecycleCallbackRegistry.get(lifecycle);
   if (callback == null)
      registerCallback(bean, callback);

It could maybe even be done as part of the annotation plugins, I'll check after the holidays.

More information about the jboss-development mailing list