@Test public void testDoService() throws Exception { AdaptrisMessage msg = AdaptrisMessageFactory.getDefaultInstance().newMessage("Hello World"); Cache cache = createCacheInstanceForTests(); RemoveKeyFromCache service = new RemoveKeyFromCache().withKey("%message{%uniqueId}").withConnection(new CacheConnection().withCacheInstance(cache)); try { start(service); cache.put(msg.getUniqueId(), msg.getContent()); assertNotNull(cache.get(msg.getUniqueId())); service.doService(msg); assertNull(cache.get(msg.getUniqueId())); } finally { stop(service); } }
@Override public void doService(AdaptrisMessage msg) throws ServiceException { try { Cache cache = retrieveCache(); cache.remove(msg.resolve(getKey())); } catch (Exception e) { throw ExceptionHelper.wrapServiceException(e); } }
RemoveKeyFromCache extends SingleKeyCacheService { @Override public void doService(AdaptrisMessage msg) throws ServiceException { try { Cache cache = retrieveCache(); cache.remove(msg.resolve(getKey())); } catch (Exception e) { throw ExceptionHelper.wrapServiceException(e); } } }
RemoveKeyFromCache extends SingleKeyCacheService { @Override public void doService(AdaptrisMessage msg) throws ServiceException { try { Cache cache = retrieveCache(); cache.remove(msg.resolve(getKey())); } catch (Exception e) { throw ExceptionHelper.wrapServiceException(e); } }  }
RemoveKeyFromCache extends SingleKeyCacheService { @Override public void doService(AdaptrisMessage msg) throws ServiceException { try { Cache cache = retrieveCache(); cache.remove(msg.resolve(getKey())); } catch (Exception e) { throw ExceptionHelper.wrapServiceException(e); } }  @Override void doService(AdaptrisMessage msg); }
RemoveKeyFromCache extends SingleKeyCacheService { @Override public void doService(AdaptrisMessage msg) throws ServiceException { try { Cache cache = retrieveCache(); cache.remove(msg.resolve(getKey())); } catch (Exception e) { throw ExceptionHelper.wrapServiceException(e); } }  @Override void doService(AdaptrisMessage msg);  }