public class SetupHazelCastInstance<V extends VMConnectInfo> extends Object implements Supplier<com.hazelcast.core.HazelcastInstance>, org.apache.commons.collections.Transformer
groupName
derived from VMConnectInfo.getVmId()
decides the cluster.
VMConnectInfo vm = new VMConnectInfo();
SetupHazelCastInstance hz = (new SetupHazelCastInstance(vm)).init();
HazelcastInstance hcInstance = hz.getInstance(); //Ref to native hazelcast Instance that can be used for adapters
SetupHazelCastInstances
Constructor and Description |
---|
SetupHazelCastInstance() |
SetupHazelCastInstance(String groupName) |
SetupHazelCastInstance(String groupName,
Integer thisInstancePort)
Deprecated.
Use
SetupHazelCastInstance(VMConnectInfo) instead |
SetupHazelCastInstance(VMConnectInfo vminfo) |
Modifier and Type | Method and Description |
---|---|
SetupHazelCastInstance |
addVM(VMConnectInfo vmInfo)
Add a VM to an
init() ialized HazelcastInstance |
com.hazelcast.core.HazelcastInstance |
get()
Creates a new instance if none exists or existing is not running
else return existing.
|
com.hazelcast.core.HazelcastInstance |
getInstance() |
static String |
getInstanceName(String groupName,
Integer thisPort)
Generate a handle from
VMConnectInfo so that if one wants to retrieve the actual Hazelcast.getHazelcastInstanceByName(String) ,
then they both agree and a raw instance can be fetched from the native HazelCast API. |
static String |
getInstanceName(VMConnectInfo vmInfo)
Generate a handle from
VMConnectInfo so that if one wants to retrieve the actual Hazelcast.getHazelcastInstanceByName(String) ,
then they both agree and a raw instance can be fetched from the native HazelCast API. |
Integer |
getThisInstancePort()
What is the port# of this VM instance
|
VMConnectInfo |
getVMInfo() |
SetupHazelCastInstance |
init()
Create instance
|
boolean |
isMultiCastConfigEnabled() |
boolean |
isPortIncrement() |
void |
setMultiCastConfigEnabled(boolean multiCastConfigEnabled) |
void |
setPortIncrement(boolean portIncrement) |
void |
setThisInstancePort(Integer thisInstancePort)
What is the port# of this VM instance
|
void |
shutDown() |
Object |
transform(Object input) |
public SetupHazelCastInstance()
public SetupHazelCastInstance(String groupName)
@Deprecated public SetupHazelCastInstance(String groupName, Integer thisInstancePort)
SetupHazelCastInstance(VMConnectInfo)
insteadpublic SetupHazelCastInstance(VMConnectInfo vminfo)
public SetupHazelCastInstance init()
SetupHazelCastInstance
public Object transform(Object input)
transform
in interface org.apache.commons.collections.Transformer
public static String getInstanceName(VMConnectInfo vmInfo)
VMConnectInfo
so that if one wants to retrieve the actual Hazelcast.getHazelcastInstanceByName(String)
,
then they both agree and a raw instance can be fetched from the native HazelCast API.vmInfo
- as VMConnectInfo
public static String getInstanceName(String groupName, Integer thisPort)
VMConnectInfo
so that if one wants to retrieve the actual Hazelcast.getHazelcastInstanceByName(String)
,
then they both agree and a raw instance can be fetched from the native HazelCast API.groupName
- as StringthisPort
- as port same as thisInstancePort
public com.hazelcast.core.HazelcastInstance get()
get
in interface Supplier<com.hazelcast.core.HazelcastInstance>
to get a ready made instance. This one created it if {@link #instance} is null.
public SetupHazelCastInstance addVM(VMConnectInfo vmInfo)
init()
ialized HazelcastInstance
vmInfo
- public void shutDown()
public Integer getThisInstancePort()
public void setThisInstancePort(Integer thisInstancePort)
public boolean isMultiCastConfigEnabled()
JoinConfig#getMulticastConfig().setEnabled
public void setMultiCastConfigEnabled(boolean multiCastConfigEnabled)
JoinConfig#getMulticastConfig().setEnabled
public boolean isPortIncrement()
NetworkConfig.setPortAutoIncrement(boolean)
public void setPortIncrement(boolean portIncrement)
NetworkConfig.setPortAutoIncrement(boolean)
public com.hazelcast.core.HazelcastInstance getInstance()
public VMConnectInfo getVMInfo()
Copyright © 2018. All rights reserved.