|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.terracotta.api.TerracottaToolkit
public class TerracottaToolkit
A ClusteringToolkit implementation that accesses the cluster instance
associated with the current context.
| Constructor Summary | |
|---|---|
TerracottaToolkit()
|
|
| Method Summary | ||
|---|---|---|
ClusteredLock |
createLock(Object monitor,
LockType type)
Create a clustered lock around the supplied clustered monitor object. |
|
ClusteredAtomicLong |
getAtomicLong(String name)
Get or create a clustered atomic long value. |
|
Barrier |
getBarrier(String name,
int parties)
Get or create a clustered barrier identified by the given name. |
|
|
getBlockingQueue(String name)
Get or create a clustered blocking queue with no capacity limit |
|
|
getBlockingQueue(String name,
int capacity)
Get or create a clustered blocking queue with a capacity limit. |
|
ClusterInfo |
getClusterInfo()
Retrieve a ClusterInfo object for the cluster this toolkit instance is related to. |
|
|
getList(String name)
Get or create a clustered list. |
|
|
getMap(String name)
Get or create a clustered map. |
|
ReadWriteLock |
getReadWriteLock(String name)
Get or create a clustered read-write lock identified by the given name. |
|
ClusteredTextBucket |
getTextBucket(String name)
Get or create a clustered text bucket identified by the given name. |
|
void |
unregisterAtomicLong(String name)
Unregister a clustered atomic long identified by the given name from the cluster. |
|
void |
unregisterBarrier(String name)
Unregister a clustered barrier identified by the given name from the cluster. |
|
void |
unregisterBlockingQueue(String name)
Unregister a clustered blocking queue identified by the given name from the cluster. |
|
void |
unregisterList(String name)
Unregister a clustered list identified by the given name from the cluster. |
|
void |
unregisterMap(String name)
Unregister a clustered map identified by the given name from the cluster. |
|
void |
unregisterReadWriteLock(String name)
Unregister a clustered read-write lock identified by the given name from the cluster. |
|
void |
unregisterTextBucket(String name)
Unregister a clustered text bucket identified by the given name from the cluster. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TerracottaToolkit()
| Method Detail |
|---|
public Barrier getBarrier(String name,
int parties)
ClusteringToolkit
If the named barrier already exists with the same number of parties
then it is returned. If it doesn't exist it is created and registered.
If the named barrier already exists but has a different number of parties
then IllegalArgumentException is thrown.
getBarrier in interface ClusteringToolkitname - identifier for the barrierparties - number of parties
public void unregisterBarrier(String name)
ClusteringToolkitExtensionIf the named barrier exists it is unregistered from the cluster, otherwise this method does nothing. Further use of a barrier after it has been unregistered leads to undefined results.
unregisterBarrier in interface ClusteringToolkitExtensionname - identifier for the barrierpublic ClusteredTextBucket getTextBucket(String name)
ClusteringToolkitIf the named bucket already exists then it is returned. If it doesn't exist it is created and registered.
getTextBucket in interface ClusteringToolkitname - identifier for the bucket
public void unregisterTextBucket(String name)
ClusteringToolkitExtensionIf the named bucket exists it is unregistered from the cluster, otherwise this method does nothing. Further use of a text bucket after it has been unregistered leads to undefined results.
unregisterTextBucket in interface ClusteringToolkitExtensionname - identifier for the bucketpublic ReadWriteLock getReadWriteLock(String name)
ClusteringToolkitIf the named lock already exists then it is returned. If it doesn't exist it is created and registered.
getReadWriteLock in interface ClusteringToolkitname - identifier for the lock
public void unregisterReadWriteLock(String name)
ClusteringToolkitExtensionIf the named lock exists it is unregistered from the cluster, otherwise this method does nothing. Further use of a read-write lock after it has been unregistered leads to undefined results.
unregisterReadWriteLock in interface ClusteringToolkitExtensionname - identifier for the lockpublic <E> BlockingQueue<E> getBlockingQueue(String name)
ClusteringToolkit
If the named queue already exists and has no capacity limit then it is
returned. If it doesn't exist then it is created and registered. If the
named queue already exists but has a capacity limit then
IllegalArgumentException is thrown.
getBlockingQueue in interface ClusteringToolkitname - identifier for the queue
public <E> BlockingQueue<E> getBlockingQueue(String name,
int capacity)
ClusteringToolkit
If the named queue already exists and it has the same capacity limit then
it is returned. If it doesn't exist then it is created and registered. If
the named queue already exists but has a different capacity limit then
IllegalArgumentException is thrown.
getBlockingQueue in interface ClusteringToolkitname - identifier for the queuecapacity - the capacity limit for the queue
public void unregisterBlockingQueue(String name)
ClusteringToolkitExtensionIf the named queue exists it is unregistered from the cluster, otherwise this method does nothing. Further use of a blocking queue after it has been unregistered leads to undefined results.
unregisterBlockingQueue in interface ClusteringToolkitExtensionname - identifier for the queuepublic <K,V> ClusteredMap<K,V> getMap(String name)
ClusteringToolkitIf the named map already exists then it is returned. If not it is created and registered.
getMap in interface ClusteringToolkitK - key typeV - value typename - identifier for the map
public void unregisterMap(String name)
ClusteringToolkitExtensionIf the named map exists it is unregistered from the cluster, otherwise this method does nothing. Further use of a map after it has been unregistered leads to undefined results.
unregisterMap in interface ClusteringToolkitExtensionname - identifier for the mappublic <E> List<E> getList(String name)
ClusteringToolkitIf the named list already exists then it is returned. If not it is created and registered.
getList in interface ClusteringToolkitE - element typename - identifier for the list
public void unregisterList(String name)
ClusteringToolkitExtensionIf the named list exists it is unregistered from the cluster, otherwise this method does nothing. Further use of a list after it has been unregistered leads to undefined results.
unregisterList in interface ClusteringToolkitExtensionname - identifier for the listpublic ClusteredAtomicLong getAtomicLong(String name)
ClusteringToolkitIf the named atomic long already exists then it is returned. If not it is created and registered.
getAtomicLong in interface ClusteringToolkitname - identifier for the atomic long
public void unregisterAtomicLong(String name)
ClusteringToolkitExtensionIf the named atomic long exists it is unregistered from the cluster, otherwise this method does nothing. Further use of an atomic long after it has been unregistered leads to undefined results.
unregisterAtomicLong in interface ClusteringToolkitExtensionname - identifier for the atomic long
public ClusteredLock createLock(Object monitor,
LockType type)
ClusteringToolkit
The supplied lock type controls the lock hold acquired by the default
Lock inherited methods.
If the supplied monitor object is null then NullPointerException is
thrown. If it is not clustered then IllegalArgumentException is
thrown.
createLock in interface ClusteringToolkitmonitor - clustered objecttype - default lock hold type
public ClusterInfo getClusterInfo()
ClusteringToolkit
getClusterInfo in interface ClusteringToolkit
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||