@Override public String addDistributedObjectListener(DistributedObjectListener distributedObjectListener) { return getOriginal().addDistributedObjectListener(distributedObjectListener); }
@Override public <T> T executeTransaction(TransactionalTask<T> task) throws TransactionException { return executeTransaction(TransactionOptions.getDefault(), task); }
@Override public IAtomicLong getAtomicLong(String name) { return getOriginal().getAtomicLong(name); }
public ManagementService(HazelcastInstanceImpl instance) { this.instance = instance; this.logger = instance.getLoggingService().getLogger(getClass()); this.enabled = instance.node.getProperties().getBoolean(GroupProperty.ENABLE_JMX); if (!enabled) { this.instanceMBean = null; this.registrationId = null; return; } logger.info("Hazelcast JMX agent enabled."); MBeanServer mbs = ManagementFactory.getPlatformMBeanServer(); InstanceMBean instanceMBean; try { instanceMBean = createInstanceMBean(instance); mbs.registerMBean(instanceMBean, instanceMBean.objectName); } catch (Exception e) { instanceMBean = null; logger.warning("Unable to start JMX service", e); } this.instanceMBean = instanceMBean; this.registrationId = instance.addDistributedObjectListener(this); for (final DistributedObject distributedObject : instance.getDistributedObjects()) { registerDistributedObject(distributedObject); } }
@Override public Cluster getCluster() { return getOriginal().getCluster(); }
protected InstanceMBean(HazelcastInstanceImpl hazelcastInstance, ManagementService managementService) { super(hazelcastInstance, managementService); createProperties(hazelcastInstance); this.config = hazelcastInstance.getConfig(); this.cluster = hazelcastInstance.getCluster(); Node node = hazelcastInstance.node; ExecutionService executionService = node.nodeEngine.getExecutionService(); InternalOperationService operationService = node.nodeEngine.getOperationService(); createMBeans(hazelcastInstance, managementService, node, executionService, operationService); registerMBeans(); registerWanPublisherMBeans(node.nodeEngine.getWanReplicationService()); }
@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); }
this.node = createNode(config, nodeContext); initManagedContext(configuredManagedContext);
@Override public ICacheManager getCacheManager() { return getOriginal().getCacheManager(); }
@Override public <E> IAtomicReference<E> getAtomicReference(String name) { return getOriginal().getAtomicReference(name); }
@Override public ClientService getClientService() { return getOriginal().getClientService(); }
@Override public CardinalityEstimator getCardinalityEstimator(String name) { return getOriginal().getCardinalityEstimator(name); }
Thread.currentThread().setContextClassLoader(HazelcastInstanceFactory.class.getClassLoader()); HazelcastInstanceImpl hazelcastInstance = new HazelcastInstanceImpl(instanceName, config, nodeContext); OutOfMemoryErrorDispatcher.registerServer(hazelcastInstance);
public ManagementService(HazelcastInstanceImpl instance) { this.instance = instance; this.logger = instance.getLoggingService().getLogger(getClass()); this.enabled = instance.node.getProperties().getBoolean(GroupProperty.ENABLE_JMX); if (!enabled) { this.instanceMBean = null; this.registrationId = null; return; } logger.info("Hazelcast JMX agent enabled."); MBeanServer mbs = ManagementFactory.getPlatformMBeanServer(); InstanceMBean instanceMBean; try { instanceMBean = createInstanceMBean(instance); mbs.registerMBean(instanceMBean, instanceMBean.objectName); } catch (Exception e) { instanceMBean = null; logger.warning("Unable to start JMX service", e); } this.instanceMBean = instanceMBean; this.registrationId = instance.addDistributedObjectListener(this); for (final DistributedObject distributedObject : instance.getDistributedObjects()) { registerDistributedObject(distributedObject); } }
@Override public Cluster getCluster() { return getOriginal().getCluster(); }
protected InstanceMBean(HazelcastInstanceImpl hazelcastInstance, ManagementService managementService) { super(hazelcastInstance, managementService); createProperties(hazelcastInstance); this.config = hazelcastInstance.getConfig(); this.cluster = hazelcastInstance.getCluster(); Node node = hazelcastInstance.node; ExecutionService executionService = node.nodeEngine.getExecutionService(); InternalOperationService operationService = node.nodeEngine.getOperationService(); createMBeans(hazelcastInstance, managementService, node, executionService, operationService); registerMBeans(); registerWanPublisherMBeans(node.nodeEngine.getWanReplicationService()); }
@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); }
this.node = createNode(config, nodeContext); initManagedContext(configuredManagedContext);
@Override public ICacheManager getCacheManager() { return getOriginal().getCacheManager(); }
@Override public <E> IAtomicReference<E> getAtomicReference(String name) { return getOriginal().getAtomicReference(name); }