|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jboss.cache.RegionImpl
public class RegionImpl
Default implementation of a Region
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.jboss.cache.Region |
|---|
Region.Status, Region.Type |
| Constructor Summary | |
|---|---|
RegionImpl(EvictionPolicy policy,
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. |
|
| Method Summary | |
|---|---|
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. |
RegionImpl |
clone(Fqn newRoot)
|
int |
compareTo(Region other)
|
void |
deactivate()
Deactivates this region from being replicated. |
boolean |
equals(Object o)
|
Configuration |
getCacheConfiguration()
|
ClassLoader |
getClassLoader()
Returns the configured ClassLoader for this region. |
EvictionPolicy |
getEvictionPolicy()
Returns an eviction policy. |
EvictionPolicyConfig |
getEvictionPolicyConfig()
Returns an eviction policy configuration. |
EvictionRegionConfig |
getEvictionRegionConfig()
Returns an eviction region configuration for this region. |
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()
Returns the size of the node event queue, used by the eviction thread. |
void |
putNodeEvent(EvictedEventNode event)
Adds an EvictedEventNode to the internal queue for processing
by the eviction thread. |
void |
registerContextClassLoader(ClassLoader classLoader)
Registers a specific ClassLoader for this region,
overridding the default cache class loader. |
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)
Configures an eviction policy for this region. |
void |
setStatus(Region.Status status)
A mechanism to set status of a region, more fine grained control than just setActive(); |
EvictedEventNode |
takeLastEventNode()
Returns the most recent EvictedEventNode added to the event queue by
Region.putNodeEvent(EvictedEventNode). |
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public RegionImpl(Fqn fqn,
RegionManager regionManager)
public RegionImpl(EvictionPolicy policy,
EvictionRegionConfig config,
Fqn fqn,
RegionManager regionManager)
| Method Detail |
|---|
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()
Region
activate in interface 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()
Region
deactivate in interface Regionpublic boolean isActive()
Region
isActive in interface Regionpublic ClassLoader getClassLoader()
RegionClassLoader for this region.
getClassLoader in interface Regionpublic Fqn getFqn()
RegionFqn of this region.
getFqn in interface Regionpublic void setStatus(Region.Status status)
Region
setStatus in interface Regionstatus - status of the regionpublic Region.Status getStatus()
getStatus in interface Regionpublic void setActive(boolean b)
RegionRegion.activate()
and Region.deactivate() for the full process.
setActive in interface Region
public void markNodeCurrentlyInUse(Fqn fqn,
long timeout)
RegionNode as currently in use, by adding an event to the eviction queue.
If there is an EvictionPolicy associated with this region, and
it respects this event (e.g., LRUPolicy 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)
Region
unmarkNodeCurrentlyInUse in interface Regionfqn - Fqn of the node.Region.markNodeCurrentlyInUse(Fqn,long)public String toString()
toString in class Objectpublic int compareTo(Region other)
compareTo in interface Comparable<Region>public boolean equals(Object o)
equals in class Objectpublic int hashCode()
hashCode in class Objectpublic void putNodeEvent(EvictedEventNode event)
RegionEvictedEventNode to the internal queue for processing
by the eviction thread.
putNodeEvent in interface Regionevent - event to addpublic EvictedEventNode takeLastEventNode()
RegionEvictedEventNode added to the event queue by
Region.putNodeEvent(EvictedEventNode).
takeLastEventNode in interface RegionEvictedEventNode, or null if no more events existpublic int nodeEventQueueSize()
Region
nodeEventQueueSize in interface Regionpublic void resetEvictionQueues()
Region
resetEvictionQueues in interface RegionRegion.nodeEventQueueSize()public EvictionRegionConfig getEvictionRegionConfig()
Region
getEvictionRegionConfig in interface Regionpublic EvictionPolicyConfig getEvictionPolicyConfig()
Region
getEvictionPolicyConfig in interface Regionpublic EvictionPolicy getEvictionPolicy()
Region
getEvictionPolicy in interface Regionpublic void setEvictionPolicy(EvictionPolicyConfig evictionPolicyConfig)
Region
setEvictionPolicy in interface RegionevictionPolicyConfig - configuration to setpublic RegionImpl clone(Fqn newRoot)
clone in interface Region
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||