Package org.jboss.as.threads
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 forThreadFactoryResolver
implementations that handles the case of a nullthreadFactoryName
by installing aThreadFactoryService
whose service name is the service name of the thread pool withthread-factory
appended.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.jboss.as.threads.HandoffExecutorResolver
HandoffExecutorResolver.AbstractThreadFactoryResolver, HandoffExecutorResolver.SimpleResolver
-
-
Field Summary
-
Fields inherited from interface org.jboss.as.threads.HandoffExecutorResolver
STANDARD_RESOLVER
-
-
Constructor Summary
Constructors Constructor Description AbstractThreadFactoryResolver()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
releaseDefaultHandoffExecutor(org.jboss.msc.service.ServiceName threadPoolServiceName, OperationContext context)
Removes any default thread factory installed inresolveDefaultHandoffExecutor(String, org.jboss.msc.service.ServiceName, org.jboss.msc.service.ServiceTarget)
.void
releaseHandoffExecutor(String handoffExecutorName, String threadPoolName, org.jboss.msc.service.ServiceName threadPoolServiceName, OperationContext context)
Releases the handoff executor, doing any necessary cleanup, such as removing a default executor that was installed byHandoffExecutorResolver.resolveHandoffExecutor(String, String, org.jboss.msc.service.ServiceName, org.jboss.msc.service.ServiceTarget)
.protected void
releaseNamedHandoffExecutor(String handoffExecutorName, String threadPoolName, org.jboss.msc.service.ServiceName threadPoolServiceName, OperationContext context)
Handles the work ofreleaseHandoffExecutor(String, String, ServiceName, OperationContext)
for the case wherethreadFactoryName
is notnull
.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.org.jboss.msc.service.ServiceName
resolveHandoffExecutor(String handoffExecutorName, String threadPoolName, org.jboss.msc.service.ServiceName threadPoolServiceName, org.jboss.msc.service.ServiceTarget serviceTarget)
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.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.
-
-
-
Method Detail
-
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 interfaceHandoffExecutorResolver
- Parameters:
handoffExecutorName
- the simple name of the handoff executor. Typically a reference value from the thread pool resource's configuration. Can benull
in which case a default handoff executor may be returned.threadPoolName
- the name of the thread poolthreadPoolServiceName
- the full name of theService
that provides the thread poolserviceTarget
- service target that is installing the thread pool service; can be used to install aThreadFactoryService
- 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 byHandoffExecutorResolver.resolveHandoffExecutor(String, String, org.jboss.msc.service.ServiceName, org.jboss.msc.service.ServiceTarget)
.- Specified by:
releaseHandoffExecutor
in interfaceHandoffExecutorResolver
- Parameters:
handoffExecutorName
- the simple name of the thread factory. Typically a reference value from the thread pool resource's configuration. Can benull
in which case a default thread factory should be released.threadPoolName
- the name of the thread poolthreadPoolServiceName
- the full name of theService
that provides the thread poolcontext
- the context of the current operation; can be used to perform any necessaryservice 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 benull
threadPoolName
- the simple name of the related thread poolthreadPoolServiceName
- the full service name of the thread pool- Returns:
- the
ServiceName
of theThreadFactoryService
the thread pool should use. Cannot benull
-
releaseNamedHandoffExecutor
protected void releaseNamedHandoffExecutor(String handoffExecutorName, String threadPoolName, org.jboss.msc.service.ServiceName threadPoolServiceName, OperationContext context)
Handles the work ofreleaseHandoffExecutor(String, String, ServiceName, OperationContext)
for the case wherethreadFactoryName
is notnull
. 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 benull
threadPoolName
- the simple name of the related thread poolthreadPoolServiceName
- the full service name of the thread poolcontext
- the context of the current operation; can be used to perform any necessaryservice 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 returnsnull
, meaning there is no default.- Parameters:
threadPoolName
- the name of the thread poolthreadPoolServiceName
- the full name of theService
that provides the thread poolserviceTarget
- service target that is installing the thread pool service; can be used to install aThreadFactoryService
- Returns:
- the
ServiceName
of theThreadFactoryService
the thread pool should use. May benull
-
releaseDefaultHandoffExecutor
protected void releaseDefaultHandoffExecutor(org.jboss.msc.service.ServiceName threadPoolServiceName, OperationContext context)
Removes any default thread factory installed inresolveDefaultHandoffExecutor(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 theService
that provides the thread poolcontext
- the context of the current operation; can be used to perform any necessaryservice removals
-
-