Hi Senaka, On Tue, Aug 21, 2012 at 12:50 AM, Senaka Fernando <[email protected]> wrote:
> Hi Anjana, > > I'm not surprised that the same functionality is required by many other > aspects, and this is really useful. However, what is considered as the > point at which the server is fully started? Is it when the started log is > written, or is it when all OSGi services are fully initialized? > This is just before the server started log is written, that is, the last two steps are saving the final timestamp for server startup time and then printing the server started log, and the listeners are called just before saving the timestamp. At this point, all the OSGi service will be fully initialized, the transport manager is created and started etc.. Cheers, Anjana. > > Thanks, > Senaka. > > On Tue, Aug 21, 2012 at 12:41 AM, Anjana Fernando <[email protected]> wrote: > >> Hi, >> >> I've added a new interface >> "org.wso2.carbon.core.init.CarbonStartupListener", and a static method >> "CarbonServerManager#addCarbonStartupListener(CarbonStartupListener >> listener)", to get notifications when the Carbon server is fully >> initialized. This is done from the class >> "StartupFinalizerServiceComponent", where it keeps the list of registered >> CarbonStartupListener objects, and at the end of the Carbon server init, >> all the CarbonStartupListeners are notified. And, if the server is already >> initialized when a addCarbonStartupListener is called, it will be >> immediately called back, without it being stored. >> >> This functionality was basically required for the ntask implementation, >> where the server has to be fully initialized before the scheduled tasks are >> run, for example, this is a required by BAM tasks and also data services >> scheduled tasks, where the fully required resources are only available >> after the Carbon server is fully initialized. >> >> The changed code can be found in the following locations: >> >> * >> https://svn.wso2.org/repos/wso2/carbon/kernel/branches/4.0.0/core/org.wso2.carbon.core/4.0.1/src/main/java/org/wso2/carbon/core/init/CarbonServerManager.java >> * >> https://svn.wso2.org/repos/wso2/carbon/kernel/branches/4.0.0/core/org.wso2.carbon.core/4.0.1/src/main/java/org/wso2/carbon/core/init/CarbonStartupListener.java >> * >> https://svn.wso2.org/repos/wso2/carbon/kernel/branches/4.0.0/core/org.wso2.carbon.core/4.0.1/src/main/java/org/wso2/carbon/core/internal/StartupFinalizerServiceComponent.java >> >> And the usage of the above functionality in ntask can be found at: >> >> * >> https://svn.wso2.org/repos/wso2/carbon/platform/branches/4.0.0/components/ntask/org.wso2.carbon.ntask.core/4.0.1/src/main/java/org/wso2/carbon/ntask/core/service/impl/TaskServiceImpl.java >> >> Cheers, >> Anjana. >> -- >> *Anjana Fernando* >> Associate Technical Lead >> WSO2 Inc. | http://wso2.com >> lean . enterprise . middleware >> >> _______________________________________________ >> Dev mailing list >> [email protected] >> http://wso2.org/cgi-bin/mailman/listinfo/dev >> >> > > > -- > *Senaka Fernando* > Member - Integration Technologies Management Committee; > Technical Lead; WSO2 Inc.; http://wso2.com > * > Member; Apache Software Foundation; http://apache.org > > E-mail: senaka AT wso2.com > **P: +1 408 754 7388; ext: 51736*; *M: +94 77 322 1818 > Linked-In: http://linkedin.com/in/senakafernando > > *Lean . Enterprise . Middleware > > -- *Anjana Fernando* Associate Technical Lead WSO2 Inc. | http://wso2.com lean . enterprise . middleware
_______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev
