@Test public void testAdd() throws Exception { IOEntryCacheManager manager = IOEntryCacheManager.INSTANCE; ObjectMapper mapper = JacksonUtils.MAPPER; MessageEntry entry = new MessageEntry(1l, "test"); IOEntrySerializable serializable = new IOEntrySerializable(); serializable.setClassType(MessageEntry.class.getName()); serializable.setDate(new Date()); serializable.setEntryValue(mapper.writeValueAsString(entry)); serializable.setId(entry.getRequestId()); serializable.setRowNum(1l); manager.add("a", 1, serializable); IOEntrySerializable actual = manager.get("a", 1, 1); assertNotNull(actual); }
public void add(String id, long requestId, IOEntrySerializable entry) throws IOException { IOEntryCacheKey key = new IOEntryCacheKey(id, requestId, entry.getRowNum()); cache.put(new Element(key, mapper.writeValueAsString(entry))); }
IOEntryCacheManager { public void add(String id, long requestId, IOEntrySerializable entry) throws IOException { IOEntryCacheKey key = new IOEntryCacheKey(id, requestId, entry.getRowNum()); cache.put(new Element(key, mapper.writeValueAsString(entry))); } }
IOEntryCacheManager { public void add(String id, long requestId, IOEntrySerializable entry) throws IOException { IOEntryCacheKey key = new IOEntryCacheKey(id, requestId, entry.getRowNum()); cache.put(new Element(key, mapper.writeValueAsString(entry))); } private  IOEntryCacheManager(); }
IOEntryCacheManager { public void add(String id, long requestId, IOEntrySerializable entry) throws IOException { IOEntryCacheKey key = new IOEntryCacheKey(id, requestId, entry.getRowNum()); cache.put(new Element(key, mapper.writeValueAsString(entry))); } private  IOEntryCacheManager(); void add(String id, long requestId, IOEntrySerializable entry); IOEntrySerializable get(String id, long requestId, long rowNum); }
IOEntryCacheManager { public void add(String id, long requestId, IOEntrySerializable entry) throws IOException { IOEntryCacheKey key = new IOEntryCacheKey(id, requestId, entry.getRowNum()); cache.put(new Element(key, mapper.writeValueAsString(entry))); } private  IOEntryCacheManager(); void add(String id, long requestId, IOEntrySerializable entry); IOEntrySerializable get(String id, long requestId, long rowNum); static final IOEntryCacheManager INSTANCE; }