Region.Status, Region.Type| Constructor and Description |
|---|
RegionImpl(EvictionRegionConfig config,
Fqn fqn,
RegionManager regionManager)
Constructs an eviction region from a policy and configuration, defined by an fqn and region manager.
|
RegionImpl(Fqn fqn,
RegionManager regionManager)
Constructs a marshalling region from an fqn and region manager.
|
| Modifier and Type | Method and Description |
|---|---|
void |
activate()
Activates this region for replication.
|
void |
activateIfEmpty()
Activates this region for replication, but if the
Fqn that represents this region already exists and
either contains data or children, no state transfers take place. |
Region |
clone()
Deprecated.
|
int |
compareTo(Region other) |
Region |
copy(Fqn newRoot)
copies the region - including eviction queue events - to a new Region instance, attached to a new Fqn root.
|
void |
deactivate()
Deactivates this region from being replicated.
|
boolean |
equals(Object o) |
Configuration |
getCacheConfiguration() |
ClassLoader |
getClassLoader()
Returns the configured
ClassLoader for this region. |
BlockingQueue<EvictionEvent> |
getEvictionEventQueue() |
EvictionPolicy |
getEvictionPolicy()
Deprecated.
|
EvictionPolicyConfig |
getEvictionPolicyConfig()
Deprecated.
|
EvictionRegionConfig |
getEvictionRegionConfig() |
Fqn |
getFqn()
Returns the
Fqn of this region. |
Region.Status |
getStatus() |
int |
hashCode() |
boolean |
isActive()
Returns true if this region has been activated.
|
void |
markNodeCurrentlyInUse(Fqn fqn,
long timeout)
Marks a
Node as currently in use, by adding an event to the eviction queue. |
int |
nodeEventQueueSize()
Deprecated.
|
void |
processEvictionQueues()
Processes the eviction queues (primary and recycle queues) associated with this region.
|
void |
putNodeEvent(EvictedEventNode event)
Deprecated.
|
void |
registerContextClassLoader(ClassLoader classLoader)
Registers a specific
ClassLoader for this region,
overridding the default cache class loader. |
EvictionEvent |
registerEvictionEvent(Fqn fqn,
EvictionEvent.Type eventType)
An overloaded version of
Region.registerEvictionEvent(Fqn, org.jboss.cache.eviction.EvictionEvent.Type, int, DataCommand, Transaction) which
uses a default elementDifference value. |
EvictionEvent |
registerEvictionEvent(Fqn fqn,
EvictionEvent.Type eventType,
int elementDifference,
DataCommand command,
Transaction tx)
Registers an eviction event on the region's eviction event queue for later processing by
Region.processEvictionQueues(). |
void |
resetEvictionQueues()
Clears the node event queue used for processing eviction.
|
void |
setActive(boolean b)
Sets this region as active - this only marks a flag
and does not actually activates or
deactivates this region.
|
void |
setEvictionPolicy(EvictionPolicyConfig evictionPolicyConfig)
Deprecated.
|
void |
setEvictionRegionConfig(EvictionRegionConfig evictionRegionConfig)
Configures this region for eviction.
|
void |
setStatus(Region.Status status)
A mechanism to set status of a region, more fine grained control than just setActive();
|
EvictedEventNode |
takeLastEventNode()
Deprecated.
|
String |
toString() |
void |
unmarkNodeCurrentlyInUse(Fqn fqn)
Adds an event to the eviction queue indicating that a node is no longer in use.
|
void |
unregisterContextClassLoader()
Unregisters a registered
ClassLoaders for this region. |
public RegionImpl(Fqn fqn, RegionManager regionManager)
public RegionImpl(EvictionRegionConfig config, Fqn fqn, RegionManager regionManager)
public Configuration getCacheConfiguration()
getCacheConfiguration in interface Regionpublic void registerContextClassLoader(ClassLoader classLoader)
RegionClassLoader for this region,
overridding the default cache class loader.registerContextClassLoader in interface RegionclassLoader - specific class loaderpublic void unregisterContextClassLoader()
RegionClassLoaders for this region.unregisterContextClassLoader in interface Regionpublic void activate()
Regionpublic void activateIfEmpty()
RegionFqn that represents this region already exists and
either contains data or children, no state transfers take place. The region is simply marked as active in this
case.activateIfEmpty in interface Regionpublic void deactivate()
Regiondeactivate in interface Regionpublic boolean isActive()
Regionpublic ClassLoader getClassLoader()
RegionClassLoader for this region.getClassLoader in interface Regionpublic void processEvictionQueues()
RegionprocessEvictionQueues in interface Regionpublic Fqn getFqn()
RegionFqn of this region.public void setStatus(Region.Status status)
Regionpublic Region.Status getStatus()
public void setActive(boolean b)
RegionRegion.activate()
and Region.deactivate() for the full process.public BlockingQueue<EvictionEvent> getEvictionEventQueue()
public void markNodeCurrentlyInUse(Fqn fqn, long timeout)
RegionNode as currently in use, by adding an event to the eviction queue.
If there is an EvictionRegionConfig associated with this region, and
it respects this event (e.g., LRUAlgorithm does), then the Node will not
be evicted until Region.unmarkNodeCurrentlyInUse(Fqn) is invoked.
This mechanism can be used to prevent eviction of data that the application
is currently using, in the absence of any locks on the Node where the
data is stored.markNodeCurrentlyInUse in interface Regionfqn - Fqn of the node.Region.unmarkNodeCurrentlyInUse(Fqn)public void unmarkNodeCurrentlyInUse(Fqn fqn)
RegionunmarkNodeCurrentlyInUse in interface Regionfqn - Fqn of the node.Region.markNodeCurrentlyInUse(Fqn,long)public int compareTo(Region other)
compareTo in interface Comparable<Region>public void resetEvictionQueues()
RegionresetEvictionQueues in interface Regionpublic void setEvictionRegionConfig(EvictionRegionConfig evictionRegionConfig)
RegionsetEvictionRegionConfig in interface RegionevictionRegionConfig - configuration to setpublic EvictionRegionConfig getEvictionRegionConfig()
getEvictionRegionConfig in interface Regionpublic EvictionEvent registerEvictionEvent(Fqn fqn, EvictionEvent.Type eventType)
RegionRegion.registerEvictionEvent(Fqn, org.jboss.cache.eviction.EvictionEvent.Type, int, DataCommand, Transaction) which
uses a default elementDifference value.registerEvictionEvent in interface Regionfqn - passed in to the constructor of EvictionEventeventType - passed in to the constructor of EvictionEventpublic EvictionEvent registerEvictionEvent(Fqn fqn, EvictionEvent.Type eventType, int elementDifference, DataCommand command, Transaction tx)
RegionRegion.processEvictionQueues().registerEvictionEvent in interface Regionfqn - passed in to the constructor of EvictionEventeventType - passed in to the constructor of EvictionEventelementDifference - passed in to the constructor of EvictionEventpublic Region copy(Fqn newRoot)
Region@Deprecated public void setEvictionPolicy(EvictionPolicyConfig evictionPolicyConfig)
RegionsetEvictionPolicy in interface RegionevictionPolicyConfig - configuration to set@Deprecated public EvictionPolicyConfig getEvictionPolicyConfig()
RegiongetEvictionPolicyConfig in interface Region@Deprecated public EvictionPolicy getEvictionPolicy()
RegiongetEvictionPolicy in interface Region@Deprecated public int nodeEventQueueSize()
RegionnodeEventQueueSize in interface Region@Deprecated public EvictedEventNode takeLastEventNode()
RegionEvictedEventNode added to the event queue by
Region.putNodeEvent(org.jboss.cache.eviction.EvictedEventNode).
Note: This is deprecated since this is an internal method and never was
meant to be a part of the public API. Please do not treat this as public API, it may be removed in a future release
and its functionality is not guaranteed.
takeLastEventNode in interface RegionEvictedEventNode, or null if no more events exist@Deprecated public void putNodeEvent(EvictedEventNode event)
RegionEvictedEventNode to the internal queue for processing
by the eviction thread.
Note: This is deprecated since this is an internal method and never was
meant to be a part of the public API. Please do not treat this as public API, it may be removed in a future release
and its functionality is not guaranteed.
putNodeEvent in interface Regionevent - event to add@Deprecated public Region clone() throws CloneNotSupportedException
clone in interface Regionclone in class ObjectCloneNotSupportedExceptionCopyright © 2012 JBoss, a division of Red Hat. All Rights Reserved.