@Override public <K, V> ICache<K, V> getCache(String name) { checkNotNull(name, "Retrieving a cache instance with a null name is not allowed!"); return getCacheByFullName(HazelcastCacheManager.CACHE_MANAGER_PREFIX + name); }
@Override public void writeResponse(ManagementCenterService mcs, JsonObject root) { InternalSerializationService serializationService = mcs.getHazelcastInstance().getSerializationService(); HazelcastInstanceCacheManager cacheManager = mcs.getHazelcastInstance().getCacheManager(); ICache<Object, Object> cache = cacheManager.getCache(cacheName); CacheEntryView cacheEntry = null; if ("string".equals(type)) { cacheEntry = cache.invoke(key, ENTRY_PROCESSOR); } else if ("long".equals(type)) { cacheEntry = cache.invoke(Long.valueOf(key), ENTRY_PROCESSOR); } else if ("integer".equals(type)) { cacheEntry = cache.invoke(Integer.valueOf(key), ENTRY_PROCESSOR); } JsonObject result = new JsonObject(); if (cacheEntry != null) { Object value = serializationService.toObject(cacheEntry.getValue()); result.add("cacheBrowse_value", value != null ? value.toString() : "null"); result.add("cacheBrowse_class", value != null ? value.getClass().getName() : "null"); result.add("date_cache_creation_time", Long.toString(cacheEntry.getCreationTime())); result.add("date_cache_expiration_time", Long.toString(cacheEntry.getExpirationTime())); result.add("cacheBrowse_hits", Long.toString(cacheEntry.getAccessHit())); result.add("date_cache_access_time", Long.toString(cacheEntry.getLastAccessTime())); } root.add("result", result); }
initManagedContext(configuredManagedContext); this.hazelcastCacheManager = new HazelcastInstanceCacheManager(this); ClassLoader classLoader = node.getConfigClassLoader(); if (classLoader instanceof HazelcastInstanceAware) {
@Override public void writeResponse(ManagementCenterService mcs, JsonObject root) { InternalSerializationService serializationService = mcs.getHazelcastInstance().getSerializationService(); HazelcastInstanceCacheManager cacheManager = mcs.getHazelcastInstance().getCacheManager(); ICache<Object, Object> cache = cacheManager.getCache(cacheName); CacheEntryView cacheEntry = null; if ("string".equals(type)) { cacheEntry = cache.invoke(key, ENTRY_PROCESSOR); } else if ("long".equals(type)) { cacheEntry = cache.invoke(Long.valueOf(key), ENTRY_PROCESSOR); } else if ("integer".equals(type)) { cacheEntry = cache.invoke(Integer.valueOf(key), ENTRY_PROCESSOR); } JsonObject result = new JsonObject(); if (cacheEntry != null) { Object value = serializationService.toObject(cacheEntry.getValue()); result.add("cacheBrowse_value", value != null ? value.toString() : "null"); result.add("cacheBrowse_class", value != null ? value.getClass().getName() : "null"); result.add("date_cache_creation_time", Long.toString(cacheEntry.getCreationTime())); result.add("date_cache_expiration_time", Long.toString(cacheEntry.getExpirationTime())); result.add("cacheBrowse_hits", Long.toString(cacheEntry.getAccessHit())); result.add("date_cache_access_time", Long.toString(cacheEntry.getLastAccessTime())); } root.add("result", result); }
initManagedContext(configuredManagedContext); this.hazelcastCacheManager = new HazelcastInstanceCacheManager(this); ClassLoader classLoader = node.getConfigClassLoader(); if (classLoader instanceof HazelcastInstanceAware) {
@Override public <K, V> ICache<K, V> getCache(String name) { checkNotNull(name, "Retrieving a cache instance with a null name is not allowed!"); return getCacheByFullName(HazelcastCacheManager.CACHE_MANAGER_PREFIX + name); }
@Override protected <K, V> ICacheInternal<K, V> createCacheProxy(CacheConfig<K, V> cacheConfig) { HazelcastInstanceCacheManager cacheManager = instance.getCacheManager(); CacheProxy<K, V> cacheProxy = (CacheProxy<K, V>) cacheManager.getCacheByFullName(cacheConfig.getNameWithPrefix()); cacheProxy.setCacheManager(this); return cacheProxy; }
@Override protected <K, V> ICacheInternal<K, V> createCacheProxy(CacheConfig<K, V> cacheConfig) { HazelcastInstanceCacheManager cacheManager = instance.getCacheManager(); CacheProxy<K, V> cacheProxy = (CacheProxy<K, V>) cacheManager.getCacheByFullName(cacheConfig.getNameWithPrefix()); cacheProxy.setCacheManager(this); return cacheProxy; }