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#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...