|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.cache.RegionManager
@ThreadSafe public class RegionManager
Manages multiple Region
s for a Cache instance.
Field Summary | |
---|---|
protected Set<Fqn> |
activationChangeNodes
|
protected Configuration |
configuration
|
static Fqn<?> |
DEFAULT_REGION
The default region used in XML configuration files when defining eviction policies. |
protected RPCManager |
rpcManager
|
Constructor Summary | |
---|---|
RegionManager()
|
Method Summary | |
---|---|
void |
activate(Fqn fqn)
Activates unmarshalling of replication messages for the region rooted in the given Fqn. |
void |
activateIfEmpty(Fqn fqn)
Attempts to activate a given region rooted at a given Fqn, similar to activate(Fqn) except
that if the fqn is currently already in use (probably already been activated) this method is a no-op. |
void |
deactivate(Fqn fqn)
Disables unmarshalling of replication messages for the region rooted in the given Fqn. |
protected void |
destroy()
|
String |
dumpRegions()
Returns a string containing debug information on every region. |
List<Region> |
getAllRegions(Region.Type type)
Returns an ordered list of all regions. |
CacheSPI |
getCache()
|
protected EvictionTimerTask |
getEvictionTimerTask()
|
Region |
getRegion(Fqn fqn,
boolean createIfAbsent)
Returns a region by Fqn , creating it optionally if absent. |
Region |
getRegion(Fqn fqn,
Region.Type type,
boolean createIfAbsent)
An overloaded form of getRegion(Fqn,boolean) that takes an additional Region.Type
parameter to force regions of a specific type. |
Region |
getRegion(String fqn,
boolean createIfAbsent)
Returns a region using Fqn.fromString(fqn), calling getRegion(Fqn,boolean) |
Region |
getValidMarshallingRegion(Fqn fqn)
Retrieves a valid marshalling Region after taking into account that this may be a Buddy Backup Fqn. |
boolean |
hasRegion(Fqn fqn,
Region.Type type)
Returns true if the region exists |
boolean |
isDefaultInactive()
|
boolean |
isInactive(Fqn fqn)
Convenienve method. |
boolean |
isUsingEvictions()
|
boolean |
removeRegion(Fqn fqn)
Removes a Region identified by the given fqn. |
void |
reset()
Resets the region manager's regions registry |
void |
setContextClassLoaderAsCurrent(Fqn fqn)
Helper utility that checks for a ClassLoader registered for the
given Fqn , and if found sets it as the TCCL. |
void |
setDefaultInactive(boolean defaultInactive)
Sets if replication for new Region s is by default inactive. |
void |
setEvictionConfig(EvictionConfig evictionConfig)
Sets the eviction configuration. |
void |
setUsingEvictions(boolean usingEvictions)
Sets if evictions are processed. |
protected void |
start()
|
void |
startEvictionThread()
Starts the eviction processing thread. |
protected void |
stop()
|
void |
stopEvictionThread()
Stops the eviction processing thread |
String |
toString()
Returns a string containing debug information on every region. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final Fqn<?> DEFAULT_REGION
Fqn.ROOT
internally so
any region that is not explicitly defined comes under the settings defined for this default.
protected final Set<Fqn> activationChangeNodes
protected Configuration configuration
protected RPCManager rpcManager
Constructor Detail |
---|
public RegionManager()
Method Detail |
---|
protected void start()
protected void stop()
protected void destroy()
public boolean isUsingEvictions()
public boolean isDefaultInactive()
Region
s.public void setDefaultInactive(boolean defaultInactive)
Region
s is by default inactive.
public void setContextClassLoaderAsCurrent(Fqn fqn)
ClassLoader
registered for the
given Fqn
, and if found sets it as the TCCL. If the given Fqn is
under the _BUDDY_BACKUP_ region, the equivalent region in the main
cache is used to find the ClassLoader
.
fqn
- Fqn pointing to a region for which a special classloader
may have been registered.public Region getRegion(Fqn fqn, boolean createIfAbsent)
Fqn
, creating it optionally if absent. If the region does not exist and createIfAbsent
is false, a parent region which may apply to the Fqn
is sought.
Note that this takes into account the fact that this may be a Buddy Backup Fqn. If it is, the actual Fqn is calculated
and used instead.
public Region getValidMarshallingRegion(Fqn fqn)
Region
after taking into account that this may be a Buddy Backup Fqn.
If the fqn passed in is null, the region has been deactivated or if a region cannot be found, this method returns a null.
fqn
- of the region to locate
public Region getRegion(Fqn fqn, Region.Type type, boolean createIfAbsent)
getRegion(Fqn,boolean)
that takes an additional Region.Type
parameter to force regions of a specific type.
Note that this takes into account the fact that this may be a Buddy Backup Fqn. If it is, the actual Fqn is calculated
and used instead.
Region.Type
public Region getRegion(String fqn, boolean createIfAbsent)
getRegion(Fqn,boolean)
fqn
- createIfAbsent
- getRegion(Fqn,boolean)
public boolean removeRegion(Fqn fqn)
Region
identified by the given fqn.
fqn
- fqn of the region to remove
protected EvictionTimerTask getEvictionTimerTask()
public void activate(Fqn fqn) throws RegionNotEmptyException
subtreeFqn
whether or not that
node exists anywhere else in the cluster. If the node does not exist
elsewhere, the local node will be empty. The creation of this node will
not be replicated.
fqn
- representing the region to be activated.
RegionNotEmptyException
- if the node fqn
exists and already has either data or childrenpublic void activateIfEmpty(Fqn fqn)
activate(Fqn)
except
that if the fqn is currently already in use (probably already been activated) this method is a no-op.
fqn
- which represents the region to activatepublic boolean isInactive(Fqn fqn)
isDefaultInactive()
is returned, otherwise
!Region.isActive()
is returned.
fqn
- fqn to test
public boolean hasRegion(Fqn fqn, Region.Type type)
fqn
- FQN of the regiontype
- type of region to search for
public void deactivate(Fqn fqn)
fqn
- public void reset()
public List<Region> getAllRegions(Region.Type type)
Comparable
interface, which Region
extends.
type
- Type of region to return
public void setUsingEvictions(boolean usingEvictions)
public void setEvictionConfig(EvictionConfig evictionConfig)
public void startEvictionThread()
public void stopEvictionThread()
public String dumpRegions()
public String toString()
toString
in class Object
public CacheSPI getCache()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |