[jboss-dev-forums] [Design of JBossCache] - Re: JBoss Cache Public API

bstansberry@jboss.com do-not-reply at jboss.com
Mon Jun 16 11:11:23 EDT 2008


Just for some background on my comment on "create" being a legacy of the old JMX microkernel.  Here's the content of the slide on create() from the JBoss Advanced course:

anonymous wrote : Create is called when all bean I depend on are "created"
  | 
  | When a service's create method is called
  | - This gives an MBean an opportunity to check that required MBeans or resources exist.
  | - The service typically cannot utilize other MBean services at this point, as most JBoss MBean services do not become fully functional until they have been started via their start method.
  | - Because of this, service implementations often do not implement create in favor of just the start method because that is the first point at which the service can be fully functional.

The key bit is the "gives an MBean an opportunity to check that required MBeans or resources exist" comment.  The create method was really an added step to get around the lack of dependency injection in early JBoss.  An MBean couldn't have another MBean injected.  Instead it would have an ObjectName or some other handle injected, and in create() would look up the dependency. Proper IOC removes the need for this.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4158383#4158383

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4158383



More information about the jboss-dev-forums mailing list