Class 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
    • 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
      • createContextService

        public org.glassfish.enterprise.concurrent.ContextServiceImpl createContextService​(ResourceInfo resource,
                                                                                           ContextServiceConfig config)
      • shutdownContextService

        public void shutdownContextService​(String jndiName)
      • createManagedExecutorService

        public org.glassfish.enterprise.concurrent.ManagedExecutorServiceImpl createManagedExecutorService​(ResourceInfo resourceInfo,
                                                                                                           ManagedExecutorServiceConfig config,
                                                                                                           org.glassfish.enterprise.concurrent.ContextServiceImpl contextService)
      • shutdownManagedExecutorService

        public void shutdownManagedExecutorService​(String jndiName)
      • createManagedScheduledExecutorService

        public org.glassfish.enterprise.concurrent.ManagedScheduledExecutorServiceImpl createManagedScheduledExecutorService​(ResourceInfo resource,
                                                                                                                             ManagedScheduledExecutorServiceConfig config,
                                                                                                                             org.glassfish.enterprise.concurrent.ContextServiceImpl contextService)
      • shutdownScheduledManagedExecutorService

        public void shutdownScheduledManagedExecutorService​(String jndiName)
      • 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 interface org.glassfish.hk2.api.PostConstruct
      • preDestroy

        public void preDestroy()
        Specified by:
        preDestroy in interface org.glassfish.hk2.api.PreDestroy