Package jadex.commons.concurrent
Class ThreadPool.ServiceThread
- java.lang.Object
-
- java.lang.Thread
-
- jadex.commons.concurrent.ThreadPool.ServiceThread
-
- All Implemented Interfaces:
java.lang.Runnable
- Enclosing class:
- ThreadPool
public class ThreadPool.ServiceThread extends java.lang.Thread
A service thread executes tasks.
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
notified
protected java.lang.Runnable
task
The actual task.protected boolean
terminated
-
Constructor Summary
Constructors Constructor Description ServiceThread()
Create a new thread.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Runnable
getTask()
Get the runnable (the task).protected void
markParked()
(method "park" already exists in android - do not overwrite)protected void
markUnpark()
(method "unpark" already exists in android - do not overwrite)protected void
remove()
Remove the service thread from the pool.void
run()
Dequeue an element from the queue and execute it.java.lang.String
toString()
Get the string representation.-
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, yield
-
-
-
-
Method Detail
-
run
public void run()
Dequeue an element from the queue and execute it.- Specified by:
run
in interfacejava.lang.Runnable
- Overrides:
run
in classjava.lang.Thread
-
markParked
protected void markParked()
(method "park" already exists in android - do not overwrite)
-
markUnpark
protected void markUnpark()
(method "unpark" already exists in android - do not overwrite)
-
remove
protected void remove()
Remove the service thread from the pool.
-
getTask
public java.lang.Runnable getTask()
Get the runnable (the task).- Returns:
- The runnable.
-
toString
public java.lang.String toString()
Get the string representation.- Overrides:
toString
in classjava.lang.Thread
-
-