JBoss Community

Re: can I avoid a service to block as7 startup ?

created by Jason Greene in JBoss AS7 Development - View the full discussion

Jason Greene wrote:

 



It's not clear to me exactly what you are doing, but you can't call your own start method. Only when your start method is called BY MSC can you call context.asynchronous(). As mentioned above the purpose of this method is to tell MSC that when it is starting a service, that the service did not complete startup. Otherwise, once the start method called by MSC returns, the service is started

 

Put another way this is the chain of events that should happen for it to work

 

MSC Thread X:
 
MSC decides to start a service -> MSC calls your service.start() -> { 
       /* Not done yet! */ ctx.asynchronous(); 
        passToSomeOtherThread(ctx); 
        return;
}
 
SomeOtherThread: {
    doStuff();
    /* Tell MSC I am done */ ctx.complete();
}

Reply to this message by going to Community

Start a new discussion in JBoss AS7 Development at Community