|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectse.lth.cs.realtime.ActivityImpl
Let a java.lang.Thread
object be treated as an Activity
,
which it (almost) is even if that interface (in se.lth.cs.realtime
)is
not implemented (in java.lang
). Also threads that already implements
Activity
(instances of JThread
and RTThread
)
can be wrapped, thereby ensuring that the constructor always returns a valid activity.
License
Constructor Summary | |
ActivityImpl()
Create an activity representing the currently executing thread. |
|
ActivityImpl(RTThread thread)
Create an activity object, that we already have, for completeness. |
|
ActivityImpl(java.lang.Thread thread)
Make an activity out of a Java thread. |
Method Summary | |
Environment |
getEnv()
|
java.lang.Object |
getThread()
Not part of the Activity interface, obtain the represented
Thread or |
Timebase |
getTimebase()
|
boolean |
isAlive()
Calls isAlive for the represented thread. |
void |
join()
Calls isAlive for the represented thread. |
void |
start()
Calls isAlive for the represented thread. |
void |
terminate()
Interrupt and join the represented thread. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ActivityImpl()
public ActivityImpl(java.lang.Thread thread)
thread
- the Java thread to represent.public ActivityImpl(RTThread thread)
thread
- the RTThread to be wrapped.Method Detail |
public java.lang.Object getThread()
Activity
interface, obtain the represented
Thread or RTThread. The intended use of this
class is only for ActivityEvent
s and configuration of activities.
For example, to support obtaining the actual thread in RTEvent
,
to have the source and owner attributes referring to the actual thread objects,
the RTEvent
base class will use this method. Similar need might
appear outside this package, hence the protected visibility.
- Returns:
- the (real-time or Java) tread object.
public Environment getEnv()
getEnv
in interface Activity
Activity.getEnv()
public Timebase getTimebase()
getTimebase
in interface Activity
Activity.getTimebase()
public boolean isAlive()
isAlive
for the represented thread.
isAlive
in interface Activity
Activity.isAlive()
,
Thread.isAlive()
public void join() throws java.lang.InterruptedException
isAlive
for the represented thread.
join
in interface Activity
java.lang.InterruptedException
Activity.isAlive()
,
Thread.isAlive()
public void start()
isAlive
for the represented thread.
start
in interface Activity
Thread.isAlive()
,
Thread.isAlive()
public void terminate()
terminate
in interface Activity
Activity.terminate()
,
JThread.terminate()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |