@Test public void testGetTrackerForCore() { assertEquals(aclTracker, reg.getTrackerForCore(CORE_NAME, AclTracker.class)); assertEquals(contentTracker, reg.getTrackerForCore(CORE_NAME, ContentTracker.class)); assertEquals(metadataTracker, reg.getTrackerForCore(CORE_NAME, MetadataTracker.class)); assertEquals(modelTracker, reg.getTrackerForCore(CORE_NAME, ModelTracker.class)); }
@SuppressWarnings("unchecked") public <T extends Tracker> T getTrackerForCore(String coreName, Class<T> trackerClass) { Map<Class<? extends Tracker>, Tracker> coreTrackers = this.trackers.get(coreName); return null == coreTrackers ? null : (T) coreTrackers.get(trackerClass); }
TrackerRegistry { @SuppressWarnings("unchecked") public <T extends Tracker> T getTrackerForCore(String coreName, Class<T> trackerClass) { Map<Class<? extends Tracker>, Tracker> coreTrackers = this.trackers.get(coreName); return null == coreTrackers ? null : (T) coreTrackers.get(trackerClass); } }
TrackerRegistry { @SuppressWarnings("unchecked") public <T extends Tracker> T getTrackerForCore(String coreName, Class<T> trackerClass) { Map<Class<? extends Tracker>, Tracker> coreTrackers = this.trackers.get(coreName); return null == coreTrackers ? null : (T) coreTrackers.get(trackerClass); }  }
TrackerRegistry { @SuppressWarnings("unchecked") public <T extends Tracker> T getTrackerForCore(String coreName, Class<T> trackerClass) { Map<Class<? extends Tracker>, Tracker> coreTrackers = this.trackers.get(coreName); return null == coreTrackers ? null : (T) coreTrackers.get(trackerClass); }  Set<String> getCoreNames(); Collection<Tracker> getTrackersForCore(String coreName); boolean hasTrackersForCore(String coreName); @SuppressWarnings("unchecked") T getTrackerForCore(String coreName, Class<T> trackerClass); synchronized void register(String coreName, Tracker tracker); boolean removeTrackersForCore(String coreName); ModelTracker getModelTracker(); void setModelTracker(ModelTracker modelTracker); }
TrackerRegistry { @SuppressWarnings("unchecked") public <T extends Tracker> T getTrackerForCore(String coreName, Class<T> trackerClass) { Map<Class<? extends Tracker>, Tracker> coreTrackers = this.trackers.get(coreName); return null == coreTrackers ? null : (T) coreTrackers.get(trackerClass); }  Set<String> getCoreNames(); Collection<Tracker> getTrackersForCore(String coreName); boolean hasTrackersForCore(String coreName); @SuppressWarnings("unchecked") T getTrackerForCore(String coreName, Class<T> trackerClass); synchronized void register(String coreName, Tracker tracker); boolean removeTrackersForCore(String coreName); ModelTracker getModelTracker(); void setModelTracker(ModelTracker modelTracker);  }