ehcache

net.sf.ehcache.terracotta
Class TerracottaClient

java.lang.Object
  extended by net.sf.ehcache.terracotta.TerracottaClient

public class TerracottaClient
extends Object

Class encapsulating the idea of a Terracotta client. Provides access to the ClusteredInstanceFactory for the cluster

Author:
Abhishek Sanoujam

Constructor Summary
TerracottaClient(CacheManager cacheManager, TerracottaClientRejoinListener rejoinAction, TerracottaClientConfiguration terracottaClientConfiguration)
          Constructor accepting the TerracottaClientRejoinListener and the TerracottaClientConfiguration
 
Method Summary
 boolean createClusteredInstanceFactory(Map<String,CacheConfiguration> cacheConfigs)
          Returns true if the clusteredInstanceFactory was created, otherwise returns false.
 TerracottaCacheCluster getCacheCluster()
          Get the CacheCluster associated with this client
 ClusteredInstanceFactory getClusteredInstanceFactory()
          Returns the ClusteredInstanceFactory associated with this client
 void shutdown()
          Shuts down the client
protected  void waitUntilRejoinComplete()
          Block thread until rejoin is complete
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TerracottaClient

public TerracottaClient(CacheManager cacheManager,
                        TerracottaClientRejoinListener rejoinAction,
                        TerracottaClientConfiguration terracottaClientConfiguration)
Constructor accepting the TerracottaClientRejoinListener and the TerracottaClientConfiguration

Parameters:
cacheManager -
rejoinAction -
terracottaClientConfiguration -
Method Detail

getClusteredInstanceFactory

public ClusteredInstanceFactory getClusteredInstanceFactory()
Returns the ClusteredInstanceFactory associated with this client

Returns:
The ClusteredInstanceFactory

createClusteredInstanceFactory

public boolean createClusteredInstanceFactory(Map<String,CacheConfiguration> cacheConfigs)
Returns true if the clusteredInstanceFactory was created, otherwise returns false. Multiple threads calling this method block and only one of them creates the factory.

Parameters:
cacheConfigs -
Returns:
true if the clusteredInstanceFactory was created, otherwise returns false

getCacheCluster

public TerracottaCacheCluster getCacheCluster()
Get the CacheCluster associated with this client

Returns:
the CacheCluster associated with this client

shutdown

public void shutdown()
Shuts down the client


waitUntilRejoinComplete

protected void waitUntilRejoinComplete()
Block thread until rejoin is complete


ehcache

Copyright © 2003-2014 Terracotta, Inc.. All Rights Reserved.