Class ThreadFactoryResolver.AbstractThreadFactoryResolver

java.lang.Object
org.jboss.as.threads.ThreadFactoryResolver.AbstractThreadFactoryResolver
All Implemented Interfaces:
ThreadFactoryResolver
Direct Known Subclasses:
ThreadFactoryResolver.SimpleResolver
Enclosing interface:
ThreadFactoryResolver

public abstract static class ThreadFactoryResolver.AbstractThreadFactoryResolver extends Object implements ThreadFactoryResolver
Base class for ThreadFactoryResolver implementations that handles the case of a null threadFactoryName by installing a ThreadFactoryService whose service name is the service name of the thread pool with thread-factory appended.
  • Constructor Details

    • AbstractThreadFactoryResolver

      public AbstractThreadFactoryResolver()
  • Method Details

    • resolveThreadFactory

      public org.jboss.msc.service.ServiceName resolveThreadFactory(String threadFactoryName, String threadPoolName, org.jboss.msc.service.ServiceName threadPoolServiceName, org.jboss.msc.service.ServiceTarget serviceTarget)
      Description copied from interface: ThreadFactoryResolver
      Resolves the service name of the thread factory a thread pool service should use, providing a default thread factory in case the thread pool does not have a specifically configured thread factory.
      Specified by:
      resolveThreadFactory in interface ThreadFactoryResolver
      Parameters:
      threadFactoryName - the simple name of the thread factory. Typically a reference value from the thread pool resource's configuration. Can be null in which case a default thread factory should be returned.
      threadPoolName - the name of the thread pool
      threadPoolServiceName - the full name of the Service that provides the thread pool
      serviceTarget - service target that is installing the thread pool service; can be used to install a ThreadFactoryService
      Returns:
      the ServiceName of the ThreadFactoryService the thread pool should use. Cannot be null
    • releaseThreadFactory

      public void releaseThreadFactory(String threadFactoryName, String threadPoolName, org.jboss.msc.service.ServiceName threadPoolServiceName, OperationContext context)
      Description copied from interface: ThreadFactoryResolver
      Releases the thread factory, doing any necessary cleanup, such as removing a default thread factory that was installed by ThreadFactoryResolver.resolveThreadFactory(String, String, org.jboss.msc.service.ServiceName, org.jboss.msc.service.ServiceTarget).
      Specified by:
      releaseThreadFactory in interface ThreadFactoryResolver
      Parameters:
      threadFactoryName - the simple name of the thread factory. Typically a reference value from the thread pool resource's configuration. Can be null in which case a default thread factory should be released.
      threadPoolName - the name of the thread pool
      threadPoolServiceName - the full name of the Service that provides the thread pool
      context - the context of the current operation; can be used to perform any necessary service removals
    • resolveNamedThreadFactory

      protected abstract org.jboss.msc.service.ServiceName resolveNamedThreadFactory(String threadFactoryName, String threadPoolName, org.jboss.msc.service.ServiceName threadPoolServiceName)
      Create a service name to use for the thread factory in the case where a simple name for the factory was provided.
      Parameters:
      threadFactoryName - the simple name of the thread factory. Will not be null
      threadPoolName - the simple name of the related thread pool
      threadPoolServiceName - the full service name of the thread pool
      Returns:
      the ServiceName of the ThreadFactoryService the thread pool should use. Cannot be null
    • releaseNamedThreadFactory

      protected void releaseNamedThreadFactory(String threadFactoryName, String threadPoolName, org.jboss.msc.service.ServiceName threadPoolServiceName, OperationContext context)
      Handles the work of releaseThreadFactory(String, String, ServiceName, OperationContext) for the case where threadFactoryName is not null. This default implementation does nothing, assuming the thread factory is independently managed from the pool.
      Parameters:
      threadFactoryName - the simple name of the thread factory. Will not be null
      threadPoolName - the simple name of the related thread pool
      threadPoolServiceName - the full service name of the thread pool
      context - the context of the current operation; can be used to perform any necessary service removals
    • getThreadGroupName

      protected String getThreadGroupName(String threadPoolName)