public class TerracottaClient
extends java.lang.Object
ClusteredInstanceFactory
for the clusterModifier and Type | Class and Description |
---|---|
private static class |
TerracottaClient.FireRejoinEventListener
Event listener that counts down on receiving node join and online event
|
private static class |
TerracottaClient.NodeLeftListener
A
ClusterTopologyListener that listens for node left event for a node |
private static class |
TerracottaClient.RejoinRequest
Private class - Rejoin request bean
|
private static class |
TerracottaClient.RejoinRequestHolder
Private class maintaining rejoin requests
|
private static class |
TerracottaClient.RejoinStatus
Private class maintaining the rejoin state of the client
|
private class |
TerracottaClient.RejoinWorker
Private class responsible for carrying out rejoin
|
Modifier and Type | Field and Description |
---|---|
private TerracottaCacheCluster |
cacheCluster |
private CacheManager |
cacheManager |
private ClusteredInstanceFactoryWrapper |
clusteredInstanceFactory |
private java.util.concurrent.ExecutorService |
l1TerminatorThreadPool |
private static org.slf4j.Logger |
LOGGER |
private static int |
REJOIN_SLEEP_MILLIS_ON_EXCEPTION |
private TerracottaClientRejoinListener |
rejoinListener |
private TerracottaClient.RejoinWorker |
rejoinWorker |
private TerracottaClientConfiguration |
terracottaClientConfiguration |
Constructor and Description |
---|
TerracottaClient(CacheManager cacheManager,
TerracottaClientRejoinListener rejoinAction,
TerracottaClientConfiguration terracottaClientConfiguration)
Constructor accepting the
TerracottaClientRejoinListener and the TerracottaClientConfiguration |
Modifier and Type | Method and Description |
---|---|
boolean |
createClusteredInstanceFactory(java.util.Map<java.lang.String,CacheConfiguration> cacheConfigs)
Returns true if the clusteredInstanceFactory was created, otherwise returns false.
|
private ClusteredInstanceFactoryWrapper |
createNewClusteredInstanceFactory(java.util.Map<java.lang.String,CacheConfiguration> cacheConfigs) |
private void |
debug(java.lang.String msg) |
TerracottaCacheCluster |
getCacheCluster()
Get the
CacheCluster associated with this client |
private java.lang.String |
getCacheManagerName() |
ClusteredInstanceFactory |
getClusteredInstanceFactory()
Returns the
ClusteredInstanceFactory associated with this client |
private java.util.concurrent.ExecutorService |
getL1TerminatorThreadPool() |
private java.lang.String |
getLogPrefix() |
private void |
info(java.lang.String msg) |
private void |
info(java.lang.String msg,
java.lang.Throwable t) |
private boolean |
isRejoinEnabled() |
private void |
rejoinCluster(ClusterNode oldNode)
Rejoins the cluster
|
private static void |
setTestMode(TerracottaClusteredInstanceHelper testHelper) |
void |
shutdown()
Shuts down the client
|
private void |
shutdownClusteredInstanceFactoryWrapper(ClusteredInstanceFactoryWrapper clusteredInstanceFactory) |
protected void |
waitUntilRejoinComplete()
Block thread until rejoin is complete
|
private void |
warn(java.lang.String msg) |
private static final org.slf4j.Logger LOGGER
private static final int REJOIN_SLEEP_MILLIS_ON_EXCEPTION
private final TerracottaClientConfiguration terracottaClientConfiguration
private volatile ClusteredInstanceFactoryWrapper clusteredInstanceFactory
private final TerracottaCacheCluster cacheCluster
private final TerracottaClient.RejoinWorker rejoinWorker
private final TerracottaClientRejoinListener rejoinListener
private final CacheManager cacheManager
private java.util.concurrent.ExecutorService l1TerminatorThreadPool
public TerracottaClient(CacheManager cacheManager, TerracottaClientRejoinListener rejoinAction, TerracottaClientConfiguration terracottaClientConfiguration)
TerracottaClientRejoinListener
and the TerracottaClientConfiguration
cacheManager
- rejoinAction
- terracottaClientConfiguration
- private static void setTestMode(TerracottaClusteredInstanceHelper testHelper)
public ClusteredInstanceFactory getClusteredInstanceFactory()
ClusteredInstanceFactory
associated with this clientpublic boolean createClusteredInstanceFactory(java.util.Map<java.lang.String,CacheConfiguration> cacheConfigs)
cacheConfigs
- public TerracottaCacheCluster getCacheCluster()
CacheCluster
associated with this clientCacheCluster
associated with this clientpublic void shutdown()
private void shutdownClusteredInstanceFactoryWrapper(ClusteredInstanceFactoryWrapper clusteredInstanceFactory)
private ClusteredInstanceFactoryWrapper createNewClusteredInstanceFactory(java.util.Map<java.lang.String,CacheConfiguration> cacheConfigs)
protected void waitUntilRejoinComplete()
private java.util.concurrent.ExecutorService getL1TerminatorThreadPool()
private void rejoinCluster(ClusterNode oldNode)
private boolean isRejoinEnabled()
private void info(java.lang.String msg)
private void info(java.lang.String msg, java.lang.Throwable t)
private java.lang.String getLogPrefix()
private void debug(java.lang.String msg)
private void warn(java.lang.String msg)
private java.lang.String getCacheManagerName()