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 String
CONTEXT_INFO_ALL
static String
CONTEXT_INFO_CLASSLOADER
static String
CONTEXT_INFO_JNDI
static String
CONTEXT_INFO_SECURITY
static String
CONTEXT_INFO_WORKAREA
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description org.glassfish.enterprise.concurrent.ContextServiceImpl
createContextService(ResourceInfo resource, ContextServiceConfig config)
static String
createContextServiceName(String configuredContextJndiName, String parentObjectJndiName)
Decide JNDI name of context service.org.glassfish.enterprise.concurrent.ManagedExecutorServiceImpl
createManagedExecutorService(ResourceInfo resourceInfo, ManagedExecutorServiceConfig config, org.glassfish.enterprise.concurrent.ContextServiceImpl contextService)
org.glassfish.enterprise.concurrent.ManagedScheduledExecutorServiceImpl
createManagedScheduledExecutorService(ResourceInfo resource, ManagedScheduledExecutorServiceConfig config, org.glassfish.enterprise.concurrent.ContextServiceImpl contextService)
org.glassfish.enterprise.concurrent.ManagedThreadFactoryImpl
createManagedThreadFactory(ResourceInfo resource, ManagedThreadFactoryConfig config, org.glassfish.enterprise.concurrent.ContextServiceImpl contextService)
org.glassfish.enterprise.concurrent.ContextServiceImpl
findOrCreateContextService(String configuredContextJndiName, String parentObjectJndiName, String applicationName, String moduleName)
ComponentEnvManager
getCompEnvMgr()
org.glassfish.enterprise.concurrent.ContextServiceImpl
getContextService(ResourceInfo resource, ContextServiceConfig config)
org.glassfish.enterprise.concurrent.ManagedExecutorServiceImpl
getManagedExecutorService(ResourceInfo resourceInfo, ManagedExecutorServiceConfig config)
org.glassfish.enterprise.concurrent.ManagedScheduledExecutorServiceImpl
getManagedScheduledExecutorService(ResourceInfo resource, ManagedScheduledExecutorServiceConfig config)
org.glassfish.enterprise.concurrent.ManagedThreadFactoryImpl
getManagedThreadFactory(ResourceInfo resource, ManagedThreadFactoryConfig config)
static ConcurrentRuntime
getRuntime()
Returns the ConcurrentRuntime instance.void
postConstruct()
void
preDestroy()
void
shutdownContextService(String jndiName)
void
shutdownManagedExecutorService(String jndiName)
void
shutdownManagedThreadFactory(String jndiName)
void
shutdownScheduledManagedExecutorService(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:
postConstruct
in interfaceorg.glassfish.hk2.api.PostConstruct
-
preDestroy
public void preDestroy()
- Specified by:
preDestroy
in interfaceorg.glassfish.hk2.api.PreDestroy
-
-