Package org.jboss.as.threads
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 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.ThreadFactoryResolver
ThreadFactoryResolver.AbstractThreadFactoryResolver, ThreadFactoryResolver.SimpleResolver
-
-
Constructor Summary
Constructors Constructor Description AbstractThreadFactoryResolver()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected String
getThreadGroupName(String threadPoolName)
protected void
releaseNamedThreadFactory(String threadFactoryName, String threadPoolName, org.jboss.msc.service.ServiceName threadPoolServiceName, OperationContext context)
Handles the work ofreleaseThreadFactory(String, String, ServiceName, OperationContext)
for the case wherethreadFactoryName
is notnull
.void
releaseThreadFactory(String threadFactoryName, String threadPoolName, org.jboss.msc.service.ServiceName threadPoolServiceName, OperationContext context)
Releases the thread factory, doing any necessary cleanup, such as removing a default thread factory that was installed byThreadFactoryResolver.resolveThreadFactory(String, String, org.jboss.msc.service.ServiceName, org.jboss.msc.service.ServiceTarget)
.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.org.jboss.msc.service.ServiceName
resolveThreadFactory(String threadFactoryName, String threadPoolName, org.jboss.msc.service.ServiceName threadPoolServiceName, org.jboss.msc.service.ServiceTarget serviceTarget)
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.
-
-
-
Method Detail
-
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 interfaceThreadFactoryResolver
- Parameters:
threadFactoryName
- 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 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 theThreadFactoryService
the thread pool should use. Cannot benull
-
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 byThreadFactoryResolver.resolveThreadFactory(String, String, org.jboss.msc.service.ServiceName, org.jboss.msc.service.ServiceTarget)
.- Specified by:
releaseThreadFactory
in interfaceThreadFactoryResolver
- Parameters:
threadFactoryName
- 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
-
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 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
-
releaseNamedThreadFactory
protected void releaseNamedThreadFactory(String threadFactoryName, String threadPoolName, org.jboss.msc.service.ServiceName threadPoolServiceName, OperationContext context)
Handles the work ofreleaseThreadFactory(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:
threadFactoryName
- 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
-
-