Class HandoffExecutorResolver.AbstractThreadFactoryResolver

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

public abstract static class HandoffExecutorResolver.AbstractThreadFactoryResolver extends Object implements HandoffExecutorResolver
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

    • resolveHandoffExecutor

      public org.jboss.msc.service.ServiceName resolveHandoffExecutor(String handoffExecutorName, String threadPoolName, org.jboss.msc.service.ServiceName threadPoolServiceName, org.jboss.msc.service.ServiceTarget serviceTarget)
      Description copied from interface: HandoffExecutorResolver
      Resolves the service name of the handoff executor a thread pool service should use, optionally providing a default executor in case the thread pool does not have a specifically configured handoff executor.
      Specified by:
      resolveHandoffExecutor in interface HandoffExecutorResolver
      Parameters:
      handoffExecutorName - the simple name of the handoff executor. Typically a reference value from the thread pool resource's configuration. Can be null in which case a default handoff executor may 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 executor service the thread pool should use. May be {@link null}
    • releaseHandoffExecutor

      public void releaseHandoffExecutor(String handoffExecutorName, String threadPoolName, org.jboss.msc.service.ServiceName threadPoolServiceName, OperationContext context)
      Description copied from interface: HandoffExecutorResolver
      Releases the handoff executor, doing any necessary cleanup, such as removing a default executor that was installed by HandoffExecutorResolver.resolveHandoffExecutor(String, String, org.jboss.msc.service.ServiceName, org.jboss.msc.service.ServiceTarget).
      Specified by:
      releaseHandoffExecutor in interface HandoffExecutorResolver
      Parameters:
      handoffExecutorName - 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
    • resolveNamedHandoffExecutor

      protected abstract org.jboss.msc.service.ServiceName resolveNamedHandoffExecutor(String handoffExecutorName, 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:
      handoffExecutorName - 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
    • releaseNamedHandoffExecutor

      protected void releaseNamedHandoffExecutor(String handoffExecutorName, String threadPoolName, org.jboss.msc.service.ServiceName threadPoolServiceName, OperationContext context)
      Handles the work of releaseHandoffExecutor(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:
      handoffExecutorName - 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
    • resolveDefaultHandoffExecutor

      protected org.jboss.msc.service.ServiceName resolveDefaultHandoffExecutor(String threadPoolName, org.jboss.msc.service.ServiceName threadPoolServiceName, org.jboss.msc.service.ServiceTarget serviceTarget)
      Optionally provides the service name of a default handoff executor. This implementation simply returns null, meaning there is no default.
      Parameters:
      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. May be null
    • releaseDefaultHandoffExecutor

      protected void releaseDefaultHandoffExecutor(org.jboss.msc.service.ServiceName threadPoolServiceName, OperationContext context)
      Removes any default thread factory installed in resolveDefaultHandoffExecutor(String, org.jboss.msc.service.ServiceName, org.jboss.msc.service.ServiceTarget). This default implementation does nothing, but any subclass that installs a default service should override this method to remove it.
      Parameters:
      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