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

Field Summary
static String CUSTOM_SECRET_PROVIDER_SYSTEM_PROPERTY
           
 
Constructor Summary
TerracottaClient(CacheManager cacheManager, TerracottaClientConfiguration terracottaClientConfiguration)
          Constructor accepting the CacheManager 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CUSTOM_SECRET_PROVIDER_SYSTEM_PROPERTY

public static final String CUSTOM_SECRET_PROVIDER_SYSTEM_PROPERTY
See Also:
Constant Field Values
Constructor Detail

TerracottaClient

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

Parameters:
cacheManager - the cache manager to be clustered
terracottaClientConfiguration - the configuration for the terracotta client
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 - map of cache names to cache configurations
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


ehcache

Copyright 2001-2014, Terracotta, Inc.