[jboss-dev-forums] [Design the new POJO MicroContainer] - Re: Concurrent deployments
adrian@jboss.org
do-not-reply at jboss.com
Wed Feb 13 07:58:12 EST 2008
Couldn't you just implement this anyway in your services,
using the 2PC create/start lifecycle?
| private volatile Thread startupThread;
|
| public void create() throws Exception
| {
| startupThread = new Thread(new Runnable()
| {
| // start channel here
| });
| }
|
| public void start() throws Exception
| {
| startThread.join(); // wait for startup to complete before injecting ourselves onto others
| startThread = null;
| }
|
Of course, we could do better (e.g. using thread pools and "optimizing"
related work across threads based on dependencies) if this was a feature of the MC.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4129105#4129105
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4129105
More information about the jboss-dev-forums
mailing list