public class ClusteredEntityManager extends Object
| Constructor and Description |
|---|
ClusteredEntityManager(org.terracotta.toolkit.Toolkit toolkit) |
| Modifier and Type | Method and Description |
|---|---|
<T extends RootEntity> |
addRootEntityIfAbsent(String name,
Class<T> clusteredEntityClass,
T clusteredEntity)
Method for adding a
RootEntity to this ClusteredEntityManager. |
<T extends RootEntity> |
destroyRootEntity(String name,
Class<T> rootEntityClass,
T controlEntity)
Method for destroying a root entity
This method will follow these steps: Put entity in exclusive maintenance mode If this fails, throws IllegalStateException
Verify the entity passed in matches the current known entity
If this fails, throws IllegalArgumentException
Mark the entity with ClusteredEntityState.DESTROY_IN_PROGRESS and save it
If this fails, throws UnsupportedOperationException
Perform the destroy operation
|
void |
dispose() |
org.terracotta.toolkit.concurrent.locks.ToolkitReadWriteLock |
getEntityLock(String lockName) |
<T extends RootEntity> |
getRootEntities(Class<T> entityClass) |
<T extends RootEntity> |
getRootEntity(String name,
Class<T> entityClass) |
public ClusteredEntityManager(org.terracotta.toolkit.Toolkit toolkit)
public <T extends RootEntity> T getRootEntity(String name, Class<T> entityClass)
public <T extends RootEntity> Map<String,T> getRootEntities(Class<T> entityClass)
public <T extends RootEntity> T addRootEntityIfAbsent(String name, Class<T> clusteredEntityClass, T clusteredEntity)
RootEntity to this ClusteredEntityManager.
RootEntity of the same clusteredEntityClass with the same name is already known
to this ClusteredEntityManager, that entity will be returned and the clusteredEntity passed in will not added.name - the name of the entityclusteredEntityClass - the type of the entityclusteredEntity - the clustered entitynull otherwisepublic <T extends RootEntity> boolean destroyRootEntity(String name, Class<T> rootEntityClass, T controlEntity)
IllegalStateExceptionIllegalArgumentExceptionClusteredEntityState.DESTROY_IN_PROGRESS and save it
If this fails, throws UnsupportedOperationExceptionT - The managed entity typename - name of the entity to destroyrootEntityClass - public interface under which this entity is managedcontrolEntity - the entity to destroytrue if entity was effectively destroyed, false if entity does not existpublic org.terracotta.toolkit.concurrent.locks.ToolkitReadWriteLock getEntityLock(String lockName)
public void dispose()
Copyright © 2019 Terracotta, Inc.. All rights reserved.