|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.rice.cs.drjava.model.EventNotifier<InteractionsListener>
edu.rice.cs.drjava.model.repl.InteractionsEventNotifier
public class InteractionsEventNotifier
Keeps track of all listeners to an InteractionsModel, and has the ability to notify them of some event.
This class has a specific role of managing InteractionsListeners. Other classes with similar names use similar code to perform the same function for other interfaces, e.g. JavadocEventNotifier and GlobalEventNotifier. These classes implement the appropriate interface definition so that they can be used transparently as composite packaging for a particular listener interface.
Components which might otherwise manage their own list of listeners use EventNotifiers instead to simplify their internal implementation. Notifiers should therefore be considered a private implementation detail of the components, and should not be used directly outside of the "host" component.
All methods in this class must use the synchronization methods provided by ReaderWriterLock. This ensures that multiple notifications (reads) can occur simultaneously, but only one thread can be adding or removing listeners (writing) at a time, and no reads can occur during a write.
No methods on this class should be synchronized using traditional Java synchronization!
Field Summary |
---|
Fields inherited from class edu.rice.cs.drjava.model.EventNotifier |
---|
_listeners, _lock |
Constructor Summary | |
---|---|
InteractionsEventNotifier()
|
Method Summary | |
---|---|
void |
interactionEnded()
Called when an interaction has finished running. |
void |
interactionErrorOccurred(int offset,
int length)
Called when the interactions window generates a syntax error. |
void |
interactionIncomplete()
Notifies the view that the current interaction is incomplete. |
void |
interactionStarted()
Called after an interaction is started by the GlobalModel. |
void |
interpreterChanged(boolean inProgress)
Called when the active interpreter is changed. |
void |
interpreterExited(int status)
Called when the interactions JVM was closed by System.exit or by being aborted. |
void |
interpreterReady(File wd)
Called when the interactions window is reset. |
void |
interpreterResetFailed(Throwable t)
Called if the interpreter reset failed. |
void |
interpreterResetting()
Called when the interactionsJVM has begun resetting. |
void |
slaveJVMUsed()
Notifies listeners that the slaveJVM has been used. |
Methods inherited from class edu.rice.cs.drjava.model.EventNotifier |
---|
addListener, removeAllListeners, removeListener |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public InteractionsEventNotifier()
Method Detail |
---|
public void interactionStarted()
interactionStarted
in interface InteractionsListener
public void interactionEnded()
interactionEnded
in interface InteractionsListener
public void interactionErrorOccurred(int offset, int length)
interactionErrorOccurred
in interface InteractionsListener
offset
- the error's offset into the InteractionsDocumentlength
- the length of the errorpublic void interpreterResetting()
interpreterResetting
in interface InteractionsListener
public void interpreterReady(File wd)
interpreterReady
in interface InteractionsListener
public void interpreterResetFailed(Throwable t)
interpreterResetFailed
in interface InteractionsListener
t
- Throwable explaining why the reset failed. (Subclasses must maintain listeners.)public void interpreterExited(int status)
interpreterExited
in interface InteractionsListener
status
- the exit codepublic void interpreterChanged(boolean inProgress)
interpreterChanged
in interface InteractionsListener
inProgress
- Whether the new interpreter is currently in progress with an interaction (ie. whether an
interactionEnded event will be fired)public void interactionIncomplete()
interactionIncomplete
in interface InteractionsListener
public void slaveJVMUsed()
slaveJVMUsed
in interface InteractionsListener
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |