|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsuramadu.util.exec.JavaThreadLauncher
Utility used to launch threads. It requires a Runnable object the type of thread you want to run in and the priority to run at. It will create the Thread, SchedulingParameters, ReleaseParameters MemoryParameters MemoryArea and ProcessingGroupParameters. It will the start and join to the thread.
Constructor Summary | |
JavaThreadLauncher()
Creates a new instance of Launcher |
|
JavaThreadLauncher(java.lang.Runnable runnable)
Creates a new instance of Launcher |
|
JavaThreadLauncher(java.lang.Runnable runnable,
int priority)
Creates a new instance of Launcher |
|
JavaThreadLauncher(java.lang.Runnable runnable,
int priority,
long period)
Creates a new instance of Launcher |
|
JavaThreadLauncher(java.lang.Runnable runnable,
int priority,
long period,
long initialDelay)
Creates a new instance of Launcher |
|
JavaThreadLauncher(ThreadLauncherData data)
Creates a new instance of Launcher |
|
JavaThreadLauncher(ThreadType tt,
MemoryType mt,
java.lang.Runnable runnable)
Creates a new instance of Launcher |
|
JavaThreadLauncher(ThreadType tt,
MemoryType mt,
java.lang.Runnable runnable,
int priority)
Creates a new instance of Launcher |
|
JavaThreadLauncher(ThreadType tt,
MemoryType mt,
java.lang.Runnable runnable,
int priority,
long period)
Creates a new instance of Launcher |
|
JavaThreadLauncher(ThreadType tt,
MemoryType mt,
java.lang.Runnable runnable,
int priority,
long period,
long initialDelay)
Creates a new instance of Launcher |
|
JavaThreadLauncher(ThreadType tt,
java.lang.Runnable runnable)
Creates a new instance of Launcher |
|
JavaThreadLauncher(ThreadType tt,
java.lang.Runnable runnable,
int priority)
Creates a new instance of Launcher |
|
JavaThreadLauncher(ThreadType tt,
java.lang.Runnable runnable,
int priority,
long period)
Creates a new instance of Launcher |
|
JavaThreadLauncher(ThreadType tt,
java.lang.Runnable runnable,
int priority,
long period,
long initialDelay)
Creates a new instance of Launcher |
Method Summary | |
long |
getInitialDelay()
|
int |
getIterations()
|
MemoryType |
getMemoryType()
|
long |
getPeriod()
|
int |
getPriority()
|
java.lang.Runnable |
getRunnable()
|
java.lang.Thread |
getThread()
|
ThreadType |
getThreadType()
|
void |
kill()
Kill the launched thread appropriately for its type. |
java.lang.Thread |
launch()
Launches the test. |
java.lang.Thread |
launchDaemon()
Creates the Thread, SchedulingParameters, ReleaseParameters MemoryParameters MemoryArea and ProcessingGroupParameters. |
void |
setData(ThreadLauncherData data)
|
void |
setInitialDelay(long d)
|
void |
setIterations(int iterations)
|
void |
setMemoryType(MemoryType mt)
|
void |
setPeriod(long p)
|
void |
setPriority(int p)
|
void |
setRunnable(java.lang.Runnable runnable)
Setters and getters for member fields |
void |
setThreadType(ThreadType tt)
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public JavaThreadLauncher()
public JavaThreadLauncher(ThreadLauncherData data)
data
- initialize from data structurepublic JavaThreadLauncher(java.lang.Runnable runnable)
runnable
- the object to run in the created thread. The deafultpublic JavaThreadLauncher(java.lang.Runnable runnable, int priority)
runnable
- the object to run in the created thread.priority
- the priority of the thread in question. the deafult priority is PriorityScheduler.MAX_PRIORITY.public JavaThreadLauncher(java.lang.Runnable runnable, int priority, long period)
runnable
- the object to run in the created thread.priority
- the priority of the thread in question. the deafult priority is PriorityScheduler.MAX_PRIORITY.period
- the period in milliseconds.public JavaThreadLauncher(java.lang.Runnable runnable, int priority, long period, long initialDelay)
runnable
- the object to run in the created thread.priority
- the priority of the thread in question. the deafult priority is PriorityScheduler.MAX_PRIORITY.period
- the period in milliseconds.initialDelay
- the initialDelay in milliseconds.public JavaThreadLauncher(ThreadType tt, java.lang.Runnable runnable)
tt
- the ThreadType of the thread to create.runnable
- Runnable the object to run in the created thread. The deafult Launcher.ThreadType is REALTIMETHREAD the deafault
MemoryArea is Heap and the deafult priority is PriorityScheduler.MAX_PRIORITY.public JavaThreadLauncher(ThreadType tt, java.lang.Runnable runnable, int priority)
tt
- the ThreadType of the thread to create.runnable
- Runnable the object to run in the created thread.priority
- the priority of the thread in question. the deafult priority is PriorityScheduler.MAX_PRIORITY.public JavaThreadLauncher(ThreadType tt, java.lang.Runnable runnable, int priority, long period)
tt
- the ThreadType of the thread to create.runnable
- the object to run in the created thread.priority
- the priority of the thread in question. the deafult priority is PriorityScheduler.MAX_PRIORITY.period
- the period in milliseconds.public JavaThreadLauncher(ThreadType tt, java.lang.Runnable runnable, int priority, long period, long initialDelay)
tt
- the ThreadType of the thread to create.runnable
- the object to run in the created thread.priority
- the priority of the thread in question. the deafult priority is PriorityScheduler.MAX_PRIORITY.period
- the period in milliseconds.initialDelay
- the initialDelay in milliseconds.public JavaThreadLauncher(ThreadType tt, MemoryType mt, java.lang.Runnable runnable)
tt
- the ThreadType of the thread to create.mt
- the MemoryType in which to execute the created thread.runnable
- the object to run in the created thread. The deafult Launcher.ThreadType is REALTIMETHREAD the deafault MemoryArea
is Heap and the deafult priority is PriorityScheduler.MAX_PRIORITY.public JavaThreadLauncher(ThreadType tt, MemoryType mt, java.lang.Runnable runnable, int priority)
tt
- the ThreadType of the thread to create.mt
- the MemoryType in which to execute the created thread.runnable
- the object to run in the created thread.priority
- the priority of the thread in question. the deafult priority is PriorityScheduler.MAX_PRIORITY.public JavaThreadLauncher(ThreadType tt, MemoryType mt, java.lang.Runnable runnable, int priority, long period)
tt
- the ThreadType of the thread to create.mt
- the MemoryType in which to execute the created thread.runnable
- the object to run in the created thread.priority
- the priority of the thread in question. the deafult priority is PriorityScheduler.MAX_PRIORITY.period
- the period in milliseconds.public JavaThreadLauncher(ThreadType tt, MemoryType mt, java.lang.Runnable runnable, int priority, long period, long initialDelay)
tt
- the ThreadType of the thread to create.mt
- the MemoryType in which to execute the created thread.runnable
- the object to run in the created thread.priority
- the priority of the thread in question. the deafult priority is PriorityScheduler.MAX_PRIORITY.period
- the period in milliseconds.initialDelay
- the initialDelay in milliseconds.Method Detail |
public void setRunnable(java.lang.Runnable runnable)
public java.lang.Runnable getRunnable()
public void setIterations(int iterations)
setIterations
in interface ThreadLauncher
public int getIterations()
getIterations
in interface ThreadLauncher
public void setMemoryType(MemoryType mt)
setMemoryType
in interface ThreadLauncher
public MemoryType getMemoryType()
getMemoryType
in interface ThreadLauncher
public java.lang.Thread getThread()
getThread
in interface ThreadLauncher
public void setThreadType(ThreadType tt)
setThreadType
in interface ThreadLauncher
public ThreadType getThreadType()
getThreadType
in interface ThreadLauncher
public void setPriority(int p)
setPriority
in interface ThreadLauncher
public int getPriority()
getPriority
in interface ThreadLauncher
public void setPeriod(long p)
setPeriod
in interface ThreadLauncher
public long getPeriod()
getPeriod
in interface ThreadLauncher
public void setInitialDelay(long d)
setInitialDelay
in interface ThreadLauncher
public long getInitialDelay()
getInitialDelay
in interface ThreadLauncher
public java.lang.Thread launch()
launch
in interface ThreadLauncher
public java.lang.Thread launchDaemon()
launchDaemon
in interface ThreadLauncher
public void kill()
kill
in interface ThreadLauncher
public void setData(ThreadLauncherData data)
setData
in interface ThreadLauncher
ThreadLauncher.setData(suramadu.util.exec.ThreadLauncherData)
public java.lang.String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |