@Test public void testGetCachesJaxb() throws Exception { HttpURLConnection result = HttpUtil.get("http: assertEquals(200, result.getResponseCode()); JAXBContext jaxbContext = new JAXBContextResolver().getContext(Caches.class); Unmarshaller unmarshaller = jaxbContext.createUnmarshaller(); Caches caches = (Caches) unmarshaller.unmarshal(result.getInputStream()); assertTrue(caches.getCaches().size() >= 6); }
@GET public Caches getCaches() { LOG.info("GET Caches"); String[] cacheNames = MANAGER.getCacheNames(); List<Cache> cacheList = new ArrayList<Cache>(); for (String cacheName : cacheNames) { Ehcache ehcache = MANAGER.getCache(cacheName); URI cacheUri = uriInfo.getAbsolutePathBuilder().path(cacheName).build().normalize(); Cache cache = new Cache(cacheName, cacheUri.toString(), ehcache.toString(), new Statistics(ehcache.getStatistics()), ehcache.getCacheConfiguration()); cacheList.add(cache); } return new Caches(cacheList); }
CachesResource { @GET public Caches getCaches() { LOG.info("GET Caches"); String[] cacheNames = MANAGER.getCacheNames(); List<Cache> cacheList = new ArrayList<Cache>(); for (String cacheName : cacheNames) { Ehcache ehcache = MANAGER.getCache(cacheName); URI cacheUri = uriInfo.getAbsolutePathBuilder().path(cacheName).build().normalize(); Cache cache = new Cache(cacheName, cacheUri.toString(), ehcache.toString(), new Statistics(ehcache.getStatistics()), ehcache.getCacheConfiguration()); cacheList.add(cache); } return new Caches(cacheList); } }
CachesResource { @GET public Caches getCaches() { LOG.info("GET Caches"); String[] cacheNames = MANAGER.getCacheNames(); List<Cache> cacheList = new ArrayList<Cache>(); for (String cacheName : cacheNames) { Ehcache ehcache = MANAGER.getCache(cacheName); URI cacheUri = uriInfo.getAbsolutePathBuilder().path(cacheName).build().normalize(); Cache cache = new Cache(cacheName, cacheUri.toString(), ehcache.toString(), new Statistics(ehcache.getStatistics()), ehcache.getCacheConfiguration()); cacheList.add(cache); } return new Caches(cacheList); }  }
CachesResource { @GET public Caches getCaches() { LOG.info("GET Caches"); String[] cacheNames = MANAGER.getCacheNames(); List<Cache> cacheList = new ArrayList<Cache>(); for (String cacheName : cacheNames) { Ehcache ehcache = MANAGER.getCache(cacheName); URI cacheUri = uriInfo.getAbsolutePathBuilder().path(cacheName).build().normalize(); Cache cache = new Cache(cacheName, cacheUri.toString(), ehcache.toString(), new Statistics(ehcache.getStatistics()), ehcache.getCacheConfiguration()); cacheList.add(cache); } return new Caches(cacheList); }  @Path("{cache}") CacheResource getCacheResource(@PathParam("cache") String cache); @GET Caches getCaches(); }
CachesResource { @GET public Caches getCaches() { LOG.info("GET Caches"); String[] cacheNames = MANAGER.getCacheNames(); List<Cache> cacheList = new ArrayList<Cache>(); for (String cacheName : cacheNames) { Ehcache ehcache = MANAGER.getCache(cacheName); URI cacheUri = uriInfo.getAbsolutePathBuilder().path(cacheName).build().normalize(); Cache cache = new Cache(cacheName, cacheUri.toString(), ehcache.toString(), new Statistics(ehcache.getStatistics()), ehcache.getCacheConfiguration()); cacheList.add(cache); } return new Caches(cacheList); }  @Path("{cache}") CacheResource getCacheResource(@PathParam("cache") String cache); @GET Caches getCaches();  }