Package edu.isi.pegasus.planner.refiner
Class ThreadPool.AuthenticateThread
- java.lang.Object
-
- edu.isi.pegasus.planner.refiner.ThreadPool.AuthenticateThread
-
- All Implemented Interfaces:
java.lang.Runnable
- Enclosing class:
- ThreadPool
class ThreadPool.AuthenticateThread extends java.lang.Object implements java.lang.RunnableA thread as an inner class, that authenticates against one particular pool.
-
-
Field Summary
Fields Modifier and Type Field Description private booleanmAvailableWhether the thread is available to do some work or not.private intmIndexThe unique identifying id of the thread.private java.lang.StringmPoolThe pool against which to authenticate.private booleanmShutdownWhether to shutdown or not.private java.lang.ThreadmThreadThe thread object that is used to launch the thread.
-
Constructor Summary
Constructors Constructor Description AuthenticateThread(int index)The overloaded constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AuthenticateRequestgetAuthenticateRequest()Returns an authentication request to the worker thread.booleanisAvailable()Returns whether a thread is available to do some work or not.voidjoin(long millis)Calls the corresponding join method of the thread associated with this class.voidrun()The runnable method of the thread, that is called when the thread is started.voidshutdown()Sets the shutdown flag to true.voidstart()The start method for the thread.
-
-
-
Field Detail
-
mPool
private java.lang.String mPool
The pool against which to authenticate.
-
mThread
private java.lang.Thread mThread
The thread object that is used to launch the thread.
-
mAvailable
private boolean mAvailable
Whether the thread is available to do some work or not.
-
mShutdown
private boolean mShutdown
Whether to shutdown or not.
-
mIndex
private int mIndex
The unique identifying id of the thread.
-
-
Method Detail
-
start
public void start()
The start method for the thread. It initialises the thread and calls it's start method.
-
isAvailable
public boolean isAvailable()
Returns whether a thread is available to do some work or not.
-
shutdown
public void shutdown()
Sets the shutdown flag to true. This does not make the thread stop. The thread only stops when it's current request is serviced and the queue is empty.
-
join
public void join(long millis) throws java.lang.InterruptedExceptionCalls the corresponding join method of the thread associated with this class.- Parameters:
millis- The time to wait in milliseconds.- Throws:
java.lang.InterruptedException
-
run
public void run()
The runnable method of the thread, that is called when the thread is started.- Specified by:
runin interfacejava.lang.Runnable
-
getAuthenticateRequest
public AuthenticateRequest getAuthenticateRequest()
Returns an authentication request to the worker thread.- Returns:
- the authentication request.
-
-