DevPortal

How do I Register Singleton Services With Pramati Server?


Singleton Services can be registered from an application or a non-application context. They should be registered from an application context (Bean, Application Hook, any Java class packaged within the application etc.) if they access application components. They can be registered outside the application context (that is from a Server startup hook, custom service etc.) when they do not access any application components.

The Singleton Service Manager is not exposed to the client VM through the JNDI lookup mechanism. Hence, registering or configuring Singleton Services can be done within the Server VM only.

InitialContext ic = new InitialContext();
SingletonServiceManager ssm = SingletonServiceManager)
ic.lookup(BindNamesAndDefaultParamValues.SINGLETON_SERVICE_MANAGER);
ssm.registerSingletonService(new AppSingleton());


Related Topics:

© Pramati Technologies 2007 Runs on Pramati Server | Feedback | Legal