|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.rice.cs.drjava.model.EventNotifier<CompilerListener>
edu.rice.cs.drjava.model.compiler.CompilerEventNotifier
class CompilerEventNotifier
Keeps track of all listeners to a CompilerModel, and has the ability to notify them of some event.
This class has a specific role of managing CompilerListeners. Other classes with similar names use similar code to perform the same function for other interfaces, e.g. InteractionsEventNotifier 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 | |
|---|---|
CompilerEventNotifier()
|
|
| Method Summary | |
|---|---|
void |
activeCompilerChanged()
Called after the active compiler has been changed. |
void |
compileAborted(java.lang.Exception e)
Called if the compile cannot be performed. |
void |
compileEnded(java.io.File workDir,
java.util.List<? extends java.io.File> excludedFiles)
Called when a compile has finished running. |
void |
compileStarted()
Called after a compile is started by the GlobalModel. |
void |
saveBeforeCompile()
Called when files are saved before compiling. |
void |
saveUntitled()
Called when files are saved before compiling. |
| 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 |
|---|
CompilerEventNotifier()
| Method Detail |
|---|
public void compileStarted()
compileStarted in interface CompilerListener
public void compileEnded(java.io.File workDir,
java.util.List<? extends java.io.File> excludedFiles)
compileEnded in interface CompilerListenerpublic void compileAborted(java.lang.Exception e)
compileAborted in interface CompilerListenerpublic void saveBeforeCompile()
saveBeforeCompile in interface CompilerListenerpublic void saveUntitled()
saveUntitled in interface CompilerListenerpublic void activeCompilerChanged()
activeCompilerChanged in interface CompilerListener
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||