@SuppressWarnings("unchecked") private void loadConfiguration() { ObjectReader objReader = new ObjectReader(); metaCache = (Map<String, Map<String, Map<String, Object>>>) objReader.read(this, topologyWebFileName); if (metaCache == null) { metaCache = new HashMap<String, Map<String, Map<String, Object>>>(); } }
public void start() { allocateCache(); retrieveCache(); objReader = new ObjectReader(); objWriter = new ObjectWriter(); }
@Override public List<ConfigurationObject> retrieveConfiguration(IObjectReader reader, String fileName) { if (!clusterServices.amICoordinator()) { return Collections.emptyList(); } String source = String.format("%s%s", ROOT, fileName); Object obj = objReader.read(reader, source); if (obj == null) { return Collections.<ConfigurationObject> emptyList(); } if (obj instanceof ConcurrentMap) { return new ArrayList<ConfigurationObject>(((ConcurrentMap)obj).values()); } return (List<ConfigurationObject>) obj; } }
public void start() { allocateCache(); retrieveCache(); objReader = new ObjectReader(); objWriter = new ObjectWriter(); }
@Override public List<ConfigurationObject> retrieveConfiguration(IObjectReader reader, String fileName) { if (!clusterServices.amICoordinator()) { return Collections.emptyList(); } String source = String.format("%s%s", root, fileName); Object obj = objReader.read(reader, source); if (obj == null) { return Collections.<ConfigurationObject> emptyList(); } if (obj instanceof ConcurrentMap) { return new ArrayList<ConfigurationObject>(((ConcurrentMap)obj).values()); } return (List<ConfigurationObject>) obj; }