|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Region
Defines characteristics such as class loading and eviction of Node
s belonging to a Region in a Cache
.
A Region is described by an Fqn
relative to the root of the cache.
All nodes and child nodes of this Fqn belong to this region.
Region.Type.EVICTION
then
it must have an EvictionPolicyConfig
set using setEvictionPolicy(org.jboss.cache.config.EvictionPolicyConfig)
.
Similarly, to be recognised as a marshalling region (region of type Region.Type.MARSHALLING
then it must have a
ClassLoader
registered using registerContextClassLoader(ClassLoader)
.
Note that a single region can be both an eviction and marshalling region at the same time.
RegionManager
Nested Class Summary | |
---|---|
static class |
Region.Status
Region status |
static class |
Region.Type
Types of regions. |
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. |
void |
deactivate()
Deactivates this region from being replicated. |
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()
|
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
putNodeEvent(EvictedEventNode) . |
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 ClassLoader s for this region. |
Methods inherited from interface java.lang.Comparable |
---|
compareTo |
Method Detail |
---|
void registerContextClassLoader(ClassLoader classLoader)
ClassLoader
for this region,
overridding the default cache class loader.
classLoader
- specific class loaderConfiguration getCacheConfiguration()
void unregisterContextClassLoader()
ClassLoader
s for this region.
void activate() throws RegionNotEmptyException
RegionNotEmptyException
- if the Fqn
that represents this region already exists and contains data or children.void activateIfEmpty()
Fqn
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.
void deactivate()
void setActive(boolean b)
activate()
and deactivate()
for the full process.
b
- boolean isActive()
ClassLoader getClassLoader()
ClassLoader
for this region.
void setEvictionPolicy(EvictionPolicyConfig evictionPolicyConfig)
evictionPolicyConfig
- configuration to setEvictionPolicyConfig getEvictionPolicyConfig()
EvictionPolicy getEvictionPolicy()
EvictionRegionConfig getEvictionRegionConfig()
void resetEvictionQueues()
nodeEventQueueSize()
int nodeEventQueueSize()
EvictedEventNode takeLastEventNode()
EvictedEventNode
added to the event queue by
putNodeEvent(EvictedEventNode)
.
EvictedEventNode
, or null if no more events existvoid putNodeEvent(EvictedEventNode event)
EvictedEventNode
to the internal queue for processing
by the eviction thread.
event
- event to addvoid markNodeCurrentlyInUse(Fqn fqn, long timeout)
Node
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 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.
fqn
- Fqn of the node.unmarkNodeCurrentlyInUse(Fqn)
void unmarkNodeCurrentlyInUse(Fqn fqn)
fqn
- Fqn of the node.markNodeCurrentlyInUse(Fqn,long)
Fqn getFqn()
Fqn
of this region.
void setStatus(Region.Status status)
status
- status of the regionRegion.Status getStatus()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |