|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.ispheres.server.core.ThreadPool
public final class ThreadPool
Thread Pool is responsible for managing all the processes that the ISphere is currently performing. The Thread Pool is a Singleton. ThreadPool is final so that nothing can extend it. About the concurrent programming, please refer to http:// gee.cs.oswego.edu/dl/classes/EDU/oswego/cs/dl/util/concurrent/intro.html
| Method Summary | |
|---|---|
void |
addProcessHandle(int index,
ProcessHandle handle)
Add the ProcessHandle to the Thread Pool. |
java.util.concurrent.Future<?> |
getFuture(int index)
This function fetches a Future to a process that iSphere is currently performing. |
int |
getNextProcessHandleIndex()
This function generates an index for the next available process handle. |
ProcessHandle |
getProcessHandle(int index)
This function fetches a handle to a process that iSphere is currently performing. |
java.util.Set<java.lang.Integer> |
getProcessHandleListing()
This function returns the unique id's of all the process handles currently being tracked by this iSphere. |
static ThreadPool |
instance()
Get the single instance of ThreadPool. |
void |
restart(long newRunningPeriod,
long idlePeriod)
Restart Thread Pool. |
void |
start(long newRunningPeriod,
long idlePeriod)
Start Thread Pool. |
void |
stop()
Stop the Thread Pool. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static ThreadPool instance()
public void start(long newRunningPeriod,
long idlePeriod)
newRunningPeriod - The maximum time a process is permitted to be
executed on iSpheresidlePeriod - The maximum time a process is permitted to exist within
the manager, without being accessed
public void restart(long newRunningPeriod,
long idlePeriod)
newRunningPeriod - The maximum time a process is permitted to be
executed on iSpheresidlePeriod - The maximum time a process is permitted to exist within
the manager, without being accessedpublic void stop()
public void addProcessHandle(int index,
ProcessHandle handle)
throws ProcessException
index - The index to use for the processHandle (this should be
generated by getNextProcessHandleIndex)handle - The ProcessHandle to add to the Thread Pool
ProcessException - When unable to add the ProcessHandle to the
Thread Pool.public int getNextProcessHandleIndex()
public ProcessHandle getProcessHandle(int index)
throws ProcessException
index - The index of the handler within the Thread Pool.
ProcessException - when unable to getProcessHandle.
public java.util.concurrent.Future<?> getFuture(int index)
throws ProcessException
index - The index of the Future within the Thread Pool.
ProcessException - when unable to getProcessHandle.public java.util.Set<java.lang.Integer> getProcessHandleListing()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||