mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Messaging facade: finished changing jgroups heartbeating over to facade.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@33886 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -21,6 +21,10 @@ package org.alfresco.repo.cluster;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import com.hazelcast.config.Config;
|
||||
import com.hazelcast.config.GroupConfig;
|
||||
import com.hazelcast.core.HazelcastInstance;
|
||||
import com.hazelcast.core.ITopic;
|
||||
|
||||
@@ -39,7 +43,8 @@ public class HazelcastMessengerFactory implements MessengerFactory
|
||||
public <T extends Serializable> Messenger<T> createMessenger(String appRegion)
|
||||
{
|
||||
ITopic<T> topic = hazelcast.getTopic(appRegion);
|
||||
return new HazelcastMessenger<T>(topic);
|
||||
String address = hazelcast.getCluster().getLocalMember().getInetSocketAddress().toString();
|
||||
return new HazelcastMessenger<T>(topic, address);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -49,4 +54,16 @@ public class HazelcastMessengerFactory implements MessengerFactory
|
||||
{
|
||||
this.hazelcast = hazelcast;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isClusterActive()
|
||||
{
|
||||
Config config = hazelcast.getConfig();
|
||||
if (config == null || config.getGroupConfig() == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
GroupConfig groupConfig = config.getGroupConfig();
|
||||
return StringUtils.hasText(groupConfig.getName());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user