Search in sources :

Example 1 with CoordinatorManager

use of org.olat.core.util.coordinate.CoordinatorManager in project OpenOLAT by OpenOLAT.

the class AllCachesController method loadModel.

private void loadModel() {
    Set<String> names = new HashSet<>();
    List<CacheInfos> infos = new ArrayList<>();
    // our cache first
    try {
        CoordinatorManager coordinator = CoreSpringFactory.getImpl(CoordinatorManager.class);
        Cacher cacher = coordinator.getCoordinator().getCacher();
        loadModel(infos, names, cacher.getCacheContainer());
    } catch (Exception e) {
        log.error("", e);
    }
    try {
        loadModel(infos, names, ((DBImpl) DBFactory.getInstance()).getCacheContainer());
    } catch (Exception e) {
        log.error("", e);
    }
    tdm = new AllCachesTableDataModel(infos);
    tableCtr.setTableDataModel(tdm);
}
Also used : ArrayList(java.util.ArrayList) Cacher(org.olat.core.util.coordinate.Cacher) HashSet(java.util.HashSet) CoordinatorManager(org.olat.core.util.coordinate.CoordinatorManager)

Example 2 with CoordinatorManager

use of org.olat.core.util.coordinate.CoordinatorManager in project openolat by klemens.

the class AllCachesController method loadModel.

private void loadModel() {
    Set<String> names = new HashSet<>();
    List<CacheInfos> infos = new ArrayList<>();
    // our cache first
    try {
        CoordinatorManager coordinator = CoreSpringFactory.getImpl(CoordinatorManager.class);
        Cacher cacher = coordinator.getCoordinator().getCacher();
        loadModel(infos, names, cacher.getCacheContainer());
    } catch (Exception e) {
        log.error("", e);
    }
    try {
        loadModel(infos, names, ((DBImpl) DBFactory.getInstance()).getCacheContainer());
    } catch (Exception e) {
        log.error("", e);
    }
    tdm = new AllCachesTableDataModel(infos);
    tableCtr.setTableDataModel(tdm);
}
Also used : ArrayList(java.util.ArrayList) Cacher(org.olat.core.util.coordinate.Cacher) HashSet(java.util.HashSet) CoordinatorManager(org.olat.core.util.coordinate.CoordinatorManager)

Example 3 with CoordinatorManager

use of org.olat.core.util.coordinate.CoordinatorManager in project OpenOLAT by OpenOLAT.

the class ICalFileCalendarManagerTest method emptyCalendarCache.

private final void emptyCalendarCache() {
    CoordinatorManager coordinator = CoreSpringFactory.getImpl(CoordinatorManager.class);
    Cacher cacher = coordinator.getCoordinator().getCacher();
    EmbeddedCacheManager cm = cacher.getCacheContainer();
    cm.getCache("CalendarManager@calendar").clear();
}
Also used : Cacher(org.olat.core.util.coordinate.Cacher) EmbeddedCacheManager(org.infinispan.manager.EmbeddedCacheManager) CoordinatorManager(org.olat.core.util.coordinate.CoordinatorManager)

Example 4 with CoordinatorManager

use of org.olat.core.util.coordinate.CoordinatorManager in project openolat by klemens.

the class ICalFileCalendarManagerTest method emptyCalendarCache.

private final void emptyCalendarCache() {
    CoordinatorManager coordinator = CoreSpringFactory.getImpl(CoordinatorManager.class);
    Cacher cacher = coordinator.getCoordinator().getCacher();
    EmbeddedCacheManager cm = cacher.getCacheContainer();
    cm.getCache("CalendarManager@calendar").clear();
}
Also used : Cacher(org.olat.core.util.coordinate.Cacher) EmbeddedCacheManager(org.infinispan.manager.EmbeddedCacheManager) CoordinatorManager(org.olat.core.util.coordinate.CoordinatorManager)

Aggregations

Cacher (org.olat.core.util.coordinate.Cacher)4 CoordinatorManager (org.olat.core.util.coordinate.CoordinatorManager)4 ArrayList (java.util.ArrayList)2 HashSet (java.util.HashSet)2 EmbeddedCacheManager (org.infinispan.manager.EmbeddedCacheManager)2