[Design of POJO Server] - JBAS-5578 ServiceMBeanSupport as MC bean
by bstansberry@jboss.com
Discussion of http://jira.jboss.com/jira/browse/JBAS-5578
Kind of an odd issue as it relates to doing something strange -- deploying a ServiceMBeanSupport subclass via a beans.xml, and then annotating it as @JMX. The create/start/stop/destroyService methods don't get invoked.
This comes up because I tend to try to deploy things as MC beans, but for backwards compatibility reasons things like HASingletonController are still ServiceMBeanSupport subclasses. So I hit weird issues. I can work around them, so not critical. But want to bring it up in case it suggests some more fundamental problem.
Anyway, here's what I think is going on:
I think this has to do with ServiceControllerLifecycleCallback. The @JMX annotation means this class handles starting the service. Leads to this:
ServiceControllerLifecycleCallback.install --> ServiceController.start(ObjectName) --> ServiceController.doChange(controller, context, ControllerState.INSTALLED, "start")
does some stuff... and then calls into ServiceMBeanSupport.start() which has this:
| if (serviceName != null && isJBossInternalLifecycleExposed)
| server.invoke(ServiceController.OBJECT_NAME, "start", new Object[] { serviceName }, SERVICE_CONTROLLER_SIG);
| else
| jbossInternalStart();
|
The first branch of the if test is taken and that calls ServiceController.start(ObjectName) again (i.e. a recursive call). That call hits this and returns:
| // If we are already started (can happen in dependencies) just return
| if (ctx.state == ServiceContext.RUNNING || ctx.state == ServiceContext.FAILED)
| {
| log.debug("Ignoring start request for service: " + ctx.objectName + " at state " + ctx.getStateString());
| return;
| }
|
Effect of all this is the startService() method never gets invoked.
One possible solution to this is to add a way to configure the bean (a setter) such that isJBossInternalLifecycleExposed returns false. Avoid the recursive call.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4155445#4155445
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4155445
17 years, 10 months
[Design of JBossCache] - JBoss Cache Public API
by manik.surtani@jboss.com
So I've started on work on JBC 3.0.0. I don't intend to make any public API changes, the main new features are internal, but significant enough to warrant a major version update.
But, if anyone can convince me of any reasons why the public API does need to change, now would be a good time to do it.
Specifically, genericisation of the Cache interface - which happened in 2.0.0 - is not something I'm overly pleased with as I find it clunky. What do people think, should it stay or go?
Ah, there is one public API that is due for a change though. Fqn. No more public constructors, all Fqn construction needs to go through factory methods (which have been in existence for some time now). This will help us optimise Fqns later as needed. Also, Fqn generics are going away. This has been more than just clunky, in fact downright error-prone. And without much value-add.
Thoughts, comments?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4155390#4155390
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4155390
17 years, 10 months
[Design the new POJO MicroContainer] - Re: Annotation Tests in deployers-vfs
by alesj
I've simplified things a bit.
"adrian(a)jboss.org" wrote :
| i.e. one deployer knows how to scan for bean annotations
|
That's already GenericAnnotationDeployer.
It creates lazy metadata about classes and its annotations.
"adrian(a)jboss.org" wrote :
| one knows how to create components from a set of such annotations
| (mod those that already have metadata).
I'm creating metadata from annotations directly, leaving component creation to existing component deployers.
| public void deploy(DeploymentUnit unit, AnnotationEnvironment deployment) throws DeploymentException
| {
| for (AnnotationProcessor processor : processors)
| {
| String attachmentName = processor.getAnnotation().getName();
| Object annotationAttachment = unit.getAttachment(attachmentName);
| Object metadata = processor.createMetaData(annotationAttachment);
| if (metadata != null)
| unit.addAttachment(attachmentName, metadata);
|
| Set<Class<?>> classes = deployment.classIsAnnotatedWith(processor.getAnnotation());
| for (Class<?> clazz : classes)
| {
| metadata = processor.createMetaDataFromClass(clazz);
| if (metadata != null)
| unit.addAttachment(attachmentName + "#" + clazz.getName(), metadata);
| }
| }
| }
|
And in case you want to stick your deployer in between (the one that modifies all metadata created from annotations), you can easily iterate over attachments picking only those which name starts with your annotation name.
To handle (merging wise) just metadata that comes from annotations doesn't make sense.
Since duplicate metadata can pop-up from anywhere - via getAllMetaData(getOutput()) - so it's should be component deployers that know how to handle it.
And this must be addressed in general or not addressed at all - leading to failure on duplicate name.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4155341#4155341
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4155341
17 years, 10 months