@Test public void testResourcePoolUtils() { Gson gson = new Gson(); InterpreterResult ret; intp1.interpret("put note1:paragraph1:key1 value1", context); intp1.interpret("put note1:paragraph2:key1 value2", context); intp2.interpret("put note2:paragraph1:key1 value1", context); intp2.interpret("put note2:paragraph2:key2 value2", context); assertEquals(4, ResourcePoolUtils.getAllResources().size()); ResourcePoolUtils.removeResourcesBelongsToNote("note1"); assertEquals(2, ResourcePoolUtils.getAllResources().size()); assertEquals("", gson.fromJson( intp1.interpret("get note1:paragraph1:key1", context).message().get(0).getData(), String.class)); assertEquals("", gson.fromJson( intp1.interpret("get note1:paragraph2:key1", context).message().get(0).getData(), String.class)); ResourcePoolUtils.removeResourcesBelongsToParagraph("note2", "paragraph1"); assertEquals(1, ResourcePoolUtils.getAllResources().size()); assertEquals("value2", gson.fromJson( intp1.interpret("get note2:paragraph2:key2", context).message().get(0).getData(), String.class)); }
@Override public Resource get(String name) { return get(name, true); }
DistributedResourcePool extends LocalResourcePool { @Override public Resource get(String name) { return get(name, true); } }
DistributedResourcePool extends LocalResourcePool { @Override public Resource get(String name) { return get(name, true); } DistributedResourcePool(String id, ResourcePoolConnector connector); }
DistributedResourcePool extends LocalResourcePool { @Override public Resource get(String name) { return get(name, true); } DistributedResourcePool(String id, ResourcePoolConnector connector); @Override Resource get(String name); @Override Resource get(String noteId, String paragraphId, String name); Resource get(String name, boolean remote); Resource get(String noteId, String paragraphId, String name, boolean remote); @Override ResourceSet getAll(); ResourceSet getAll(boolean remote); }
DistributedResourcePool extends LocalResourcePool { @Override public Resource get(String name) { return get(name, true); } DistributedResourcePool(String id, ResourcePoolConnector connector); @Override Resource get(String name); @Override Resource get(String noteId, String paragraphId, String name); Resource get(String name, boolean remote); Resource get(String noteId, String paragraphId, String name, boolean remote); @Override ResourceSet getAll(); ResourceSet getAll(boolean remote);  }