private StubModelsResolver() { GlobalSModelEventsManager.getInstance() .addGlobalCommandListener( new SModelCommandListener() { @Override public void eventsHappenedInCommand(List<SModelEvent> events) { // make it more optimal myStubModulesCache.clear(); } }); }
@Override public void init() { if (INSTANCE != null) { throw new IllegalStateException("double initialization"); } INSTANCE = this; myRepositoryListener.subscribeTo(MPSModuleRepository.getInstance()); GlobalSModelEventsManager.getInstance() .addGlobalCommandListener( new SModelCommandListener() { @Override public void eventsHappenedInCommand(List<SModelEvent> events) { for (SModelEvent e : events) { if (!LanguageAspect.STRUCTURE.is(e.getModelDescriptor())) continue; invalidateCache(); } } }); }
public void dispose() { GlobalSModelEventsManager.getInstance().removeGlobalCommandListener(myListener); }
protected DependencyAwareCache() { GlobalSModelEventsManager.getInstance().addGlobalCommandListener(myListener); }