Package jetbrains.mps.classloading
Class ModuleEventsDispatcher
- java.lang.Object
-
- jetbrains.mps.classloading.ModuleEventsDispatcher
-
- All Implemented Interfaces:
WriteActionListener
public class ModuleEventsDispatcher extends Object implements WriteActionListener
The class is responsible for listeningSRepositoryListenerevents like moduleAdded, moduleRemoved, etc., and dispatching batch (group) events to listeners. It listens the start and finish of write action. It starts batching events at the start of write action and yields the result at the end of write action. The class also supports pause/resume scenario to postpone dispatch of collected events to an appropriate moment. In fact, it's rather non-knowingly-inappropriate moment, as any first write action after resume dispatches all collected events.- See Also:
ModelAccess.runWriteAction(Runnable)
-
-
Constructor Summary
Constructors Constructor Description ModuleEventsDispatcher(SRepository repository)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactionFinished()voidactionStarted()voidaddRepositoryBatchEventsListener(SRepositoryBatchListener listener)voiddispose()booleanflush()voidinit()voidpause()voidproceed()voidremoveRepositoryBatchEventsListener(SRepositoryBatchListener listener)
-
-
-
Constructor Detail
-
ModuleEventsDispatcher
public ModuleEventsDispatcher(@NotNull SRepository repository)
-
-
Method Detail
-
init
public void init()
-
dispose
public void dispose()
-
pause
public void pause()
-
proceed
public void proceed()
-
actionStarted
public void actionStarted()
- Specified by:
actionStartedin interfaceWriteActionListener
-
actionFinished
public void actionFinished()
- Specified by:
actionFinishedin interfaceWriteActionListener
-
flush
public boolean flush()
-
addRepositoryBatchEventsListener
public final void addRepositoryBatchEventsListener(SRepositoryBatchListener listener)
-
removeRepositoryBatchEventsListener
public final void removeRepositoryBatchEventsListener(SRepositoryBatchListener listener)
-
-