Package org.jppf.execute
Class ThreadManagerForkJoin.FJThreadFactory
java.lang.Object
org.jppf.execute.ThreadManagerForkJoin.FJThreadFactory
- All Implemented Interfaces:
ForkJoinPool.ForkJoinWorkerThreadFactory
- Enclosing class:
- ThreadManagerForkJoin
protected class ThreadManagerForkJoin.FJThreadFactory
extends Object
implements ForkJoinPool.ForkJoinWorkerThreadFactory
-
Constructor Summary
ConstructorsConstructorDescriptionFJThreadFactory(String name) Initialize this thread factory with the specified name.FJThreadFactory(String name, boolean monitoringEnabled) Initialize this thread factory with the specified name.FJThreadFactory(String name, boolean monitoringEnabled, int priority) Initialize this thread factory with the specified name.FJThreadFactory(String name, int priority) Initialize this thread factory with the specified name. -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddispose(org.jppf.execute.ThreadManagerForkJoin.FJUsedClassLoader usedClassLoader) Disposes used class loaderer from this thread factory.intGet the priority assigned to the threads created by this factory.Get the summary information for all terminated threads.long[]Get the ids of the monitored threads.newThread(ForkJoinPool pool) voidsetPriority(int priority) Update the priority of all threads created by this factory.protected voidProcess terminated thread that is no longer used by fork join pool.useClassLoader(ClassLoader classLoader) Use class loader in this thread manager.
-
Constructor Details
-
FJThreadFactory
Initialize this thread factory with the specified name.- Parameters:
name- the name used as prefix for the constructed threads name.
-
FJThreadFactory
Initialize this thread factory with the specified name.- Parameters:
name- the name used as prefix for the constructed threads name.priority- priority assigned to the threads created by this factory.
-
FJThreadFactory
Initialize this thread factory with the specified name.- Parameters:
name- the name used as prefix for the constructed threads name.monitoringEnabled- determines whether the threads created by this factory can be monitored.
-
FJThreadFactory
Initialize this thread factory with the specified name.- Parameters:
name- the name used as prefix for the constructed threads name.monitoringEnabled- determines whether the threads created by this factory can be monitored.priority- priority assigned to the threads created by this factory.
-
-
Method Details
-
newThread
- Specified by:
newThreadin interfaceForkJoinPool.ForkJoinWorkerThreadFactory
-
terminate
Process terminated thread that is no longer used by fork join pool.- Parameters:
thread- the thread instance.exception- the exception of unrecoverable error ornull
-
getThreadIDs
public long[] getThreadIDs()Get the ids of the monitored threads.- Returns:
- a list of long values.
-
setPriority
public void setPriority(int priority) Update the priority of all threads created by this factory.- Parameters:
priority- the new priority to set.
-
getPriority
public int getPriority()Get the priority assigned to the threads created by this factory.- Returns:
- the priority as an int value.
-
getTerminatedInfo
Get the summary information for all terminated threads.- Returns:
- a
NodeExecutionInfoinstance.
-
useClassLoader
Use class loader in this thread manager.- Parameters:
classLoader- aClassLoaderinstance.- Returns:
- a
UsedClassLoaderinstance. Never returnnull.
-
dispose
protected void dispose(org.jppf.execute.ThreadManagerForkJoin.FJUsedClassLoader usedClassLoader) Disposes used class loaderer from this thread factory.- Parameters:
usedClassLoader- aFJUsedClassLoaderinstance.
-