public class DistributedConnectionMgr extends Object
| Constructor and Description |
|---|
DistributedConnectionMgr() |
| Modifier and Type | Method and Description |
|---|---|
static com.gemstone.gemfire.distributed.DistributedSystem |
connect()
Gets a connection to the distributed system named in the
GemFirePrms.GEMFIRE_NAME_PROPERTY system property. |
static com.gemstone.gemfire.distributed.DistributedSystem |
connect(String cacheXmlFile)
Gets a connection to the distributed system named in the
GemFirePrms.GEMFIRE_NAME_PROPERTY system property. |
static com.gemstone.gemfire.distributed.DistributedSystem |
connect(String name,
Properties props)
This method was added as a workaround for testing locators running in client VM.
|
static void |
disconnect()
Disconnects this VM from the distributed system by closing its connection,
if one exists.
|
static com.gemstone.gemfire.distributed.DistributedSystem |
getConnection()
Gets the current connection to the distributed system, if any.
|
static boolean |
isConnected()
Answers whether this VM is connected.
|
public static com.gemstone.gemfire.distributed.DistributedSystem getConnection()
public static com.gemstone.gemfire.distributed.DistributedSystem connect(String cacheXmlFile)
GemFirePrms.GEMFIRE_NAME_PROPERTY system property.
This comes from ClientPrms.gemfireNames.
This method is thread-safe for clients in each VM. It is not thread-safe
when combined with calls to disconnect().
xmlFileName - The name of a declarative xml file to use at startup, or null.HydraConfigException - if the system property is not set.HydraRuntimeException - if the distributed system node is not local.public static com.gemstone.gemfire.distributed.DistributedSystem connect()
GemFirePrms.GEMFIRE_NAME_PROPERTY system property.
This comes from ClientPrms.gemfireNames.
This method is thread-safe for clients in each VM. It is not thread-safe
when combined with calls to disconnect().
HydraConfigException - if the system property is not set.HydraRuntimeException - if the distributed system node is not local.public static com.gemstone.gemfire.distributed.DistributedSystem connect(String name, Properties props)
This method is thread-safe for clients in each VM. It is not thread-safe
when combined with calls to disconnect().
HydraConfigException - if the system property is not set.HydraRuntimeException - if the distributed system node is not local.public static void disconnect()
CAUTION: If used from a VM that is running concurrent clients, it is up to the clients to handle the fallout.
public static boolean isConnected()
Copyright © 2010-2015 Pivotal Software, Inc. All rights reserved.