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 forThreadFactoryResolverimplementations that handles the case of a nullthreadFactoryNameby installing aThreadFactoryServicewhose service name is the service name of the thread pool withthread-factoryappended.
-
-
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 StringgetThreadGroupName(String threadPoolName)protected voidreleaseNamedThreadFactory(String threadFactoryName, String threadPoolName, org.jboss.msc.service.ServiceName threadPoolServiceName, OperationContext context)Handles the work ofreleaseThreadFactory(String, String, ServiceName, OperationContext)for the case wherethreadFactoryNameis notnull.voidreleaseThreadFactory(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.ServiceNameresolveNamedThreadFactory(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.ServiceNameresolveThreadFactory(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:ThreadFactoryResolverResolves 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:
resolveThreadFactoryin interfaceThreadFactoryResolver- Parameters:
threadFactoryName- the simple name of the thread factory. Typically a reference value from the thread pool resource's configuration. Can benullin which case a default thread factory should be returned.threadPoolName- the name of the thread poolthreadPoolServiceName- the full name of theServicethat provides the thread poolserviceTarget- service target that is installing the thread pool service; can be used to install aThreadFactoryService- Returns:
- the
ServiceNameof theThreadFactoryServicethe 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:ThreadFactoryResolverReleases 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:
releaseThreadFactoryin interfaceThreadFactoryResolver- Parameters:
threadFactoryName- the simple name of the thread factory. Typically a reference value from the thread pool resource's configuration. Can benullin which case a default thread factory should be released.threadPoolName- the name of the thread poolthreadPoolServiceName- the full name of theServicethat 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 benullthreadPoolName- the simple name of the related thread poolthreadPoolServiceName- the full service name of the thread pool- Returns:
- the
ServiceNameof theThreadFactoryServicethe 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 wherethreadFactoryNameis 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 benullthreadPoolName- 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
-
-