}
private void createMemState(MemberStateImpl memberState,
Collection<DistributedObject> distributedObjects) {
int count = 0;
final Config config = instance.getConfig();
for (DistributedObject distributedObject : distributedObjects) {
if (count < maxVisibleInstanceCount) {
if (distributedObject instanceof IMap) {
IMap map = (IMap) distributedObject;
if (config.findMapConfig(map.getName()).isStatisticsEnabled()) {
memberState.putLocalMapStats(map.getName(), (LocalMapStatsImpl) map.getLocalMapStats());
count++;
}
} else if (distributedObject instanceof IQueue) {
IQueue queue = (IQueue) distributedObject;
if (config.findQueueConfig(queue.getName()).isStatisticsEnabled()) {
LocalQueueStatsImpl stats = (LocalQueueStatsImpl) queue.getLocalQueueStats();
memberState.putLocalQueueStats(queue.getName(), stats);
count++;
}
} else if (distributedObject instanceof ITopic) {
ITopic topic = (ITopic) distributedObject;
if (config.findTopicConfig(topic.getName()).isStatisticsEnabled()) {
LocalTopicStatsImpl stats = (LocalTopicStatsImpl) topic.getLocalTopicStats();
memberState.putLocalTopicStats(topic.getName(), stats);
count++;
}
} else if (distributedObject instanceof MultiMap) {
MultiMap multiMap = (MultiMap) distributedObject;
if (config.findMultiMapConfig(multiMap.getName()).isStatisticsEnabled()) {
LocalMultiMapStatsImpl stats = (LocalMultiMapStatsImpl) multiMap.getLocalMultiMapStats();
memberState.putLocalMultiMapStats(multiMap.getName(), stats);
count++;
}
} else if (distributedObject instanceof IExecutorService) {
IExecutorService executorService = (IExecutorService) distributedObject;
if (config.findExecutorConfig(executorService.getName()).isStatisticsEnabled()) {
LocalExecutorStatsImpl stats = (LocalExecutorStatsImpl) executorService.getLocalExecutorStats();
memberState.putLocalExecutorStats(executorService.getName(), stats);
count++;
}
}