|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
org.openbandy.event.EventSource
public abstract class EventSource
An EventSource is a thread that must eventually dispatch an event of the type it
provides.
Since Java does not allow to restart a terminated thread, an EventSource must
be able to re-instantiate itself. For this purpose, it provides the newlyInstantiate()
method, which will create a new instance object and subsequently advise its owning
object to reset the reference.
(c) Copyright Philipp Bolliger 2007, ALL RIGHTS RESERVED.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary |
---|
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
EventSource(java.lang.String name,
EventSourceOwner owner)
|
Method Summary | |
---|---|
abstract java.util.Vector |
getProvidedEventTypes()
While registering at the EventService, the latter will request the EventSource to state the types of Events it will delegate. |
boolean |
isRunning()
|
abstract EventSource |
newlyInstantiate()
As the EventService must eventually create new instances of an EventSource in order to restart it, an EventSource must provide this method which must create (and return) a new instance and subsequently reset its reference in the class owning it. |
abstract void |
run()
Starts the EventSource. |
void |
startEventSource(java.lang.String eventShortClassName)
|
abstract void |
stopEventSource()
Stops the source. |
abstract void |
stopEventSource(java.lang.String eventShortClassName)
Advises the EventSource, that events of type eventShortClassName will no longer
be conumsed. |
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public EventSource(java.lang.String name, EventSourceOwner owner)
Method Detail |
---|
public boolean isRunning()
public void startEventSource(java.lang.String eventShortClassName)
public abstract void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
public abstract java.util.Vector getProvidedEventTypes()
public abstract EventSource newlyInstantiate()
public abstract void stopEventSource(java.lang.String eventShortClassName)
eventShortClassName
will no longer
be conumsed.
If non of the provided event types is consumed,
stop the event source thread.
eventShortClassName
- public abstract void stopEventSource()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |