suramadu.util.exec
Class RTThreadLauncher

java.lang.Object
  extended bysuramadu.util.exec.JavaThreadLauncher
      extended bysuramadu.util.exec.RTThreadLauncher
All Implemented Interfaces:
ThreadLauncher

public class RTThreadLauncher
extends JavaThreadLauncher

Utility used to launch realtime 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 the thread.

Version:
$Id: RTThreadLauncher.html,v 1.1 2004/09/23 15:35:05 mbi Exp $
Author:
mbi,briang

Field Summary
static int DEFAULT_SCOPE_SIZE
           
static int DEFAULT_WRAPPER_SCRATCH_SIZE
           
 
Constructor Summary
RTThreadLauncher()
          Creates a new instance of Launcher
RTThreadLauncher(java.lang.Runnable runnable)
          Creates a new instance of Launcher
RTThreadLauncher(java.lang.Runnable runnable, int priority)
          Creates a new instance of Launcher
RTThreadLauncher(java.lang.Runnable runnable, int priority, long period)
          Creates a new instance of Launcher
RTThreadLauncher(java.lang.Runnable runnable, int priority, long period, long initialDelay)
          Creates a new instance of Launcher
RTThreadLauncher(ThreadLauncherData data)
          Creates a new instance of Launcher
RTThreadLauncher(ThreadType tt, MemoryType mt, java.lang.Runnable runnable)
          Creates a new instance of Launcher
RTThreadLauncher(ThreadType tt, MemoryType mt, java.lang.Runnable runnable, int priority)
          Creates a new instance of Launcher
RTThreadLauncher(ThreadType tt, MemoryType mt, java.lang.Runnable runnable, int priority, long period)
          Creates a new instance of Launcher
RTThreadLauncher(ThreadType tt, MemoryType mt, java.lang.Runnable runnable, int priority, long period, long initialDelay)
          Creates a new instance of Launcher
RTThreadLauncher(ThreadType tt, java.lang.Runnable runnable)
          Creates a new instance of Launcher
RTThreadLauncher(ThreadType tt, java.lang.Runnable runnable, int priority)
          Creates a new instance of Launcher
RTThreadLauncher(ThreadType tt, java.lang.Runnable runnable, int priority, long period)
          Creates a new instance of Launcher
RTThreadLauncher(ThreadType tt, java.lang.Runnable runnable, int priority, long period, long initialDelay)
          Creates a new instance of Launcher
 
Method Summary
 javax.realtime.AsyncEventHandler getMissHandler()
           
 javax.realtime.AsyncEventHandler getOverrunHandler()
           
 javax.realtime.RelativeTime getRTCost()
           
 javax.realtime.RelativeTime getRTDeadline()
           
 int getScopeSize()
           
 int getWrapperScratchSize()
           
 void kill()
          Kill the launched thread appropriately for its type.
 void setInitialDelay(long d)
           
 void setMissHandler(javax.realtime.AsyncEventHandler rtMissHandler)
           
 void setOverrunHandler(javax.realtime.AsyncEventHandler rtOverrunHandler)
           
 void setPeriod(long p)
           
 void setRTCost(javax.realtime.RelativeTime rtCost)
           
 void setRTDeadline(javax.realtime.RelativeTime rtDeadline)
           
 void setScopeSize(int size)
           
 void setThreadType(ThreadType tt)
           
 void setWrapperScratchSize(int size)
           
 java.lang.String toString()
           
 
Methods inherited from class suramadu.util.exec.JavaThreadLauncher
getInitialDelay, getIterations, getMemoryType, getPeriod, getPriority, getRunnable, getThread, getThreadType, launch, launchDaemon, setData, setIterations, setMemoryType, setPriority, setRunnable
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_WRAPPER_SCRATCH_SIZE

public static final int DEFAULT_WRAPPER_SCRATCH_SIZE
See Also:
Constant Field Values

DEFAULT_SCOPE_SIZE

public static final int DEFAULT_SCOPE_SIZE
See Also:
Constant Field Values
Constructor Detail

RTThreadLauncher

public RTThreadLauncher()
Creates a new instance of Launcher


RTThreadLauncher

public RTThreadLauncher(ThreadLauncherData data)
Creates a new instance of Launcher

Parameters:
data - initialize from data structure

RTThreadLauncher

public RTThreadLauncher(java.lang.Runnable runnable)
Creates a new instance of Launcher

Parameters:
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.

RTThreadLauncher

public RTThreadLauncher(java.lang.Runnable runnable,
                        int priority)
Creates a new instance of Launcher

Parameters:
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.
priority - the priority of the thread in question. the deafult priority is PriorityScheduler.MAX_PRIORITY.

RTThreadLauncher

public RTThreadLauncher(java.lang.Runnable runnable,
                        int priority,
                        long period)
Creates a new instance of Launcher

Parameters:
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.
priority - the priority of the thread in question. the deafult priority is PriorityScheduler.MAX_PRIORITY.
period - the period in milliseconds.

RTThreadLauncher

public RTThreadLauncher(java.lang.Runnable runnable,
                        int priority,
                        long period,
                        long initialDelay)
Creates a new instance of Launcher

Parameters:
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.
priority - the priority of the thread in question. the deafult priority is PriorityScheduler.MAX_PRIORITY.
period - the period in milliseconds.
initialDelay - the initial delay before beginning periodic execution in milliseconds.

RTThreadLauncher

public RTThreadLauncher(ThreadType tt,
                        java.lang.Runnable runnable)
Creates a new instance of Launcher

Parameters:
tt - the ThreadType to use for this launcher
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.

RTThreadLauncher

public RTThreadLauncher(ThreadType tt,
                        java.lang.Runnable runnable,
                        int priority)
Creates a new instance of Launcher

Parameters:
tt - the ThreadType to use for this launcher
runnable - the object to run in the created thread.
priority - the priority of the thread in question. the deafult priority is PriorityScheduler.MAX_PRIORITY.

RTThreadLauncher

public RTThreadLauncher(ThreadType tt,
                        java.lang.Runnable runnable,
                        int priority,
                        long period)
Creates a new instance of Launcher

Parameters:
tt - the ThreadType to use for this launcher
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.

RTThreadLauncher

public RTThreadLauncher(ThreadType tt,
                        java.lang.Runnable runnable,
                        int priority,
                        long period,
                        long initialDelay)
Creates a new instance of Launcher

Parameters:
tt - the ThreadType to use for this launcher
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 initial delay before beginning periodic execution in milliseconds.

RTThreadLauncher

public RTThreadLauncher(ThreadType tt,
                        MemoryType mt,
                        java.lang.Runnable runnable)
Creates a new instance of Launcher

Parameters:
tt - the ThreadType to use for this launcher
mt - the MemoryType to use for this launcher
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.

RTThreadLauncher

public RTThreadLauncher(ThreadType tt,
                        MemoryType mt,
                        java.lang.Runnable runnable,
                        int priority)
Creates a new instance of Launcher

Parameters:
tt - the ThreadType to use for this launcher
mt - the MemoryType to use for this launcher
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.
priority - the priority of the thread in question. the deafult priority is PriorityScheduler.MAX_PRIORITY.

RTThreadLauncher

public RTThreadLauncher(ThreadType tt,
                        MemoryType mt,
                        java.lang.Runnable runnable,
                        int priority,
                        long period)
Creates a new instance of Launcher

Parameters:
tt - the ThreadType to use for this launcher
mt - the MemoryType to use for this launcher
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.
priority - the priority of the thread in question. the deafult priority is PriorityScheduler.MAX_PRIORITY.
period - the period in milliseconds.

RTThreadLauncher

public RTThreadLauncher(ThreadType tt,
                        MemoryType mt,
                        java.lang.Runnable runnable,
                        int priority,
                        long period,
                        long initialDelay)
Creates a new instance of Launcher

Parameters:
tt - the ThreadType to use for this launcher
mt - the MemoryType to use for this launcher
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.
priority - the priority of the thread in question. the deafult priority is PriorityScheduler.MAX_PRIORITY.
period - the period in milliseconds.
initialDelay - the initial delay before beginning periodic execution in milliseconds.
Method Detail

kill

public void kill()
Kill the launched thread appropriately for its type.

Specified by:
kill in interface ThreadLauncher
Overrides:
kill in class JavaThreadLauncher

setThreadType

public void setThreadType(ThreadType tt)
Specified by:
setThreadType in interface ThreadLauncher
Overrides:
setThreadType in class JavaThreadLauncher

setWrapperScratchSize

public void setWrapperScratchSize(int size)

setScopeSize

public void setScopeSize(int size)

setPeriod

public void setPeriod(long p)
Specified by:
setPeriod in interface ThreadLauncher
Overrides:
setPeriod in class JavaThreadLauncher

setInitialDelay

public void setInitialDelay(long d)
Specified by:
setInitialDelay in interface ThreadLauncher
Overrides:
setInitialDelay in class JavaThreadLauncher

setOverrunHandler

public void setOverrunHandler(javax.realtime.AsyncEventHandler rtOverrunHandler)

getOverrunHandler

public javax.realtime.AsyncEventHandler getOverrunHandler()

setMissHandler

public void setMissHandler(javax.realtime.AsyncEventHandler rtMissHandler)

getWrapperScratchSize

public int getWrapperScratchSize()

getScopeSize

public int getScopeSize()

getMissHandler

public javax.realtime.AsyncEventHandler getMissHandler()

setRTCost

public void setRTCost(javax.realtime.RelativeTime rtCost)

getRTCost

public javax.realtime.RelativeTime getRTCost()

setRTDeadline

public void setRTDeadline(javax.realtime.RelativeTime rtDeadline)

getRTDeadline

public javax.realtime.RelativeTime getRTDeadline()

toString

public java.lang.String toString()
Overrides:
toString in class JavaThreadLauncher
Returns:
a string representing the contents of this class.