Package org.glassfish.concurrent.runtime
Class ConcurrentRuntime
- java.lang.Object
-
- org.glassfish.concurrent.runtime.ConcurrentRuntime
-
- All Implemented Interfaces:
org.glassfish.hk2.api.PostConstruct,org.glassfish.hk2.api.PreDestroy
@Service @Singleton public class ConcurrentRuntime extends Object implements org.glassfish.hk2.api.PostConstruct, org.glassfish.hk2.api.PreDestroy
This class provides API to create various Concurrency Utilities objects
-
-
Field Summary
Fields Modifier and Type Field Description static StringCONTEXT_INFO_ALLstatic StringCONTEXT_INFO_CLASSLOADERstatic StringCONTEXT_INFO_JNDIstatic StringCONTEXT_INFO_SECURITYstatic StringCONTEXT_INFO_WORKAREA
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description org.glassfish.enterprise.concurrent.ContextServiceImplcreateContextService(ResourceInfo resource, ContextServiceConfig config)static StringcreateContextServiceName(String configuredContextJndiName, String parentObjectJndiName)Decide JNDI name of context service.org.glassfish.enterprise.concurrent.ManagedExecutorServiceImplcreateManagedExecutorService(ResourceInfo resourceInfo, ManagedExecutorServiceConfig config, org.glassfish.enterprise.concurrent.ContextServiceImpl contextService)org.glassfish.enterprise.concurrent.ManagedScheduledExecutorServiceImplcreateManagedScheduledExecutorService(ResourceInfo resource, ManagedScheduledExecutorServiceConfig config, org.glassfish.enterprise.concurrent.ContextServiceImpl contextService)org.glassfish.enterprise.concurrent.ManagedThreadFactoryImplcreateManagedThreadFactory(ResourceInfo resource, ManagedThreadFactoryConfig config, org.glassfish.enterprise.concurrent.ContextServiceImpl contextService)org.glassfish.enterprise.concurrent.ContextServiceImplfindOrCreateContextService(String configuredContextJndiName, String parentObjectJndiName, String applicationName, String moduleName)ComponentEnvManagergetCompEnvMgr()org.glassfish.enterprise.concurrent.ContextServiceImplgetContextService(ResourceInfo resource, ContextServiceConfig config)org.glassfish.enterprise.concurrent.ManagedExecutorServiceImplgetManagedExecutorService(ResourceInfo resourceInfo, ManagedExecutorServiceConfig config)org.glassfish.enterprise.concurrent.ManagedScheduledExecutorServiceImplgetManagedScheduledExecutorService(ResourceInfo resource, ManagedScheduledExecutorServiceConfig config)org.glassfish.enterprise.concurrent.ManagedThreadFactoryImplgetManagedThreadFactory(ResourceInfo resource, ManagedThreadFactoryConfig config)static ConcurrentRuntimegetRuntime()Returns the ConcurrentRuntime instance.voidpostConstruct()voidpreDestroy()voidshutdownContextService(String jndiName)voidshutdownManagedExecutorService(String jndiName)voidshutdownManagedThreadFactory(String jndiName)voidshutdownScheduledManagedExecutorService(String jndiName)
-
-
-
Field Detail
-
CONTEXT_INFO_CLASSLOADER
public static final String CONTEXT_INFO_CLASSLOADER
- See Also:
- Constant Field Values
-
CONTEXT_INFO_JNDI
public static final String CONTEXT_INFO_JNDI
- See Also:
- Constant Field Values
-
CONTEXT_INFO_SECURITY
public static final String CONTEXT_INFO_SECURITY
- See Also:
- Constant Field Values
-
CONTEXT_INFO_WORKAREA
public static final String CONTEXT_INFO_WORKAREA
- See Also:
- Constant Field Values
-
CONTEXT_INFO_ALL
public static final String CONTEXT_INFO_ALL
- See Also:
- Constant Field Values
-
-
Method Detail
-
getRuntime
public static ConcurrentRuntime getRuntime()
Returns the ConcurrentRuntime instance. It follows singleton pattern and only one instance exists at any point of time. External entities need to call this method to get ConcurrentRuntime instance- Returns:
- ConcurrentRuntime instance
-
getCompEnvMgr
public ComponentEnvManager getCompEnvMgr()
-
getContextService
public org.glassfish.enterprise.concurrent.ContextServiceImpl getContextService(ResourceInfo resource, ContextServiceConfig config)
-
createContextService
public org.glassfish.enterprise.concurrent.ContextServiceImpl createContextService(ResourceInfo resource, ContextServiceConfig config)
-
shutdownContextService
public void shutdownContextService(String jndiName)
-
getManagedExecutorService
public org.glassfish.enterprise.concurrent.ManagedExecutorServiceImpl getManagedExecutorService(ResourceInfo resourceInfo, ManagedExecutorServiceConfig config)
-
createManagedExecutorService
public org.glassfish.enterprise.concurrent.ManagedExecutorServiceImpl createManagedExecutorService(ResourceInfo resourceInfo, ManagedExecutorServiceConfig config, org.glassfish.enterprise.concurrent.ContextServiceImpl contextService)
-
shutdownManagedExecutorService
public void shutdownManagedExecutorService(String jndiName)
-
getManagedScheduledExecutorService
public org.glassfish.enterprise.concurrent.ManagedScheduledExecutorServiceImpl getManagedScheduledExecutorService(ResourceInfo resource, ManagedScheduledExecutorServiceConfig config)
-
createManagedScheduledExecutorService
public org.glassfish.enterprise.concurrent.ManagedScheduledExecutorServiceImpl createManagedScheduledExecutorService(ResourceInfo resource, ManagedScheduledExecutorServiceConfig config, org.glassfish.enterprise.concurrent.ContextServiceImpl contextService)
-
shutdownScheduledManagedExecutorService
public void shutdownScheduledManagedExecutorService(String jndiName)
-
getManagedThreadFactory
public org.glassfish.enterprise.concurrent.ManagedThreadFactoryImpl getManagedThreadFactory(ResourceInfo resource, ManagedThreadFactoryConfig config)
-
createManagedThreadFactory
public org.glassfish.enterprise.concurrent.ManagedThreadFactoryImpl createManagedThreadFactory(ResourceInfo resource, ManagedThreadFactoryConfig config, org.glassfish.enterprise.concurrent.ContextServiceImpl contextService)
-
shutdownManagedThreadFactory
public void shutdownManagedThreadFactory(String jndiName)
-
createContextServiceName
public static String createContextServiceName(String configuredContextJndiName, String parentObjectJndiName)
Decide JNDI name of context service. Either it is specified or it is created from the owning object.- Parameters:
configuredContextJndiName- JNDI name specified (typically context parameter in annotation)parentObjectJndiName- JNDI nam of ManagedExecutorService, ManagedThreadFactory etc. using the context service- Returns:
- JNDI name for the context service to be stored in the JNDI tree.
-
findOrCreateContextService
public org.glassfish.enterprise.concurrent.ContextServiceImpl findOrCreateContextService(String configuredContextJndiName, String parentObjectJndiName, String applicationName, String moduleName)
-
postConstruct
public void postConstruct()
- Specified by:
postConstructin interfaceorg.glassfish.hk2.api.PostConstruct
-
preDestroy
public void preDestroy()
- Specified by:
preDestroyin interfaceorg.glassfish.hk2.api.PreDestroy
-
-