|
||||||||||
PREV CLASS (src) NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.mx.util.JBossNotificationBroadcasterSupport (src)
org.jboss.system.ServiceMBeanSupport (src)
org.jboss.cache.TreeCache (src)
org.jboss.cache.aop.TreeCacheAop
Implementation of the cache using dyanmic aop interceptors. The basic idea is that the caller only
uses the putObject(String,Object)
, getObject(String)
and
removeObject(String)
methods.
When putting an object into the cache, the cache essentially takes care of how the object
will be replicated. It 'breaks' the object apart to map it onto the tree, and adds an
interceptor recursively for each object reachable from the root object. Those interceptor
'know' to which part of the tree they are mapped. Whenever there is state change
("set*" interceptors), the tree is modified using the superclass. All "get*" operations
to the object are intercepted and redirected to the tree.
Bottom line is that a user simply puts any object into the cache, and the object
will be replicated to all caches in the cluster. The only requirement on cachable objects
is that they access all state through getters and setters.
Field Summary | |
protected java.util.Map |
cachedTypes
|
static java.lang.String |
CLASS_INTERNAL
|
static java.lang.String |
DUMMY
|
static Fqn (src) |
JBOSS_INTERNAL
|
Fields inherited from class org.jboss.system.ServiceMBeanSupport (src) |
log, server, SERVICE_CONTROLLER_SIG, serviceName |
Fields inherited from interface org.jboss.system.ServiceMBean (src) |
CREATE_EVENT, CREATED, DESTROY_EVENT, DESTROYED, FAILED, REGISTERED, START_EVENT, STARTED, STARTING, states, STOP_EVENT, STOPPED, STOPPING, UNREGISTERED |
Constructor Summary | |
TreeCacheAop()
|
|
TreeCacheAop(JChannel channel)
|
|
TreeCacheAop(java.lang.String cluster_name,
java.lang.String props,
long state_fetch_timeout)
|
Method Summary | |
java.lang.Object |
_put(GlobalTransaction (src) tx,
Fqn (src) fqn,
java.lang.Object key,
java.lang.Object value,
boolean create_undo_ops)
Override the base class to provide some aop specific behaviors. |
java.lang.Object |
_putObject(Fqn (src) fqn,
java.lang.Object obj)
|
protected java.lang.Object |
_removeObject(Fqn (src) fqn,
boolean removeCacheInterceptor)
|
protected Fqn (src) |
checkCircularReference(Fqn (src) fqn,
InstanceAdvisor advisor,
java.lang.Object obj)
|
protected void |
checkObjectType(java.lang.Object obj)
Check whether the object type is valid. |
protected Fqn (src) |
createInternalNode(Fqn (src) storedFqn)
|
protected void |
endTransaction()
|
void |
evict(Fqn (src) fqn)
Override to provide aop specific eviction. |
protected Interceptor |
findCacheInterceptor(InstanceAdvisor advisor)
Find existing cache interceptor. |
protected Interceptor |
findCacheInterceptor(InstanceAdvisor advisor,
Fqn (src) fqn)
Find cache interceptor with exact fqn. |
CachedType (src) |
getCachedType(java.lang.Class clazz)
Obtain a cache aop type for user to traverse the defined "primitive" types in aop. |
java.lang.Object |
getObject(Fqn (src) fqn)
Retrieve the aop-enabled object from the cache. |
java.lang.Object |
getObject(java.lang.String fqn)
Retrieve the aop-enabled object from the cache. |
protected Fqn (src) |
handleObjectGraph(Fqn (src) fqn,
InstanceAdvisor advisor,
CachedType (src) type,
java.lang.Object obj)
Handle cases where there is circular, e.g., parent refers to child and child to parent, or multiple references, e.g., two objects reference the same sub-object. |
protected boolean |
hasCurrentTransaction()
|
java.lang.Object |
putObject(Fqn (src) fqn,
java.lang.Object obj)
Insert an aop-enabled object into the cache. |
java.lang.Object |
putObject(java.lang.String fqn,
java.lang.Object obj)
Insert an aop-enabled object into the cache. |
java.lang.Object |
removeObject(Fqn (src) fqn)
Remove aop-enabled object from the cache. |
java.lang.Object |
removeObject(java.lang.String fqn)
Remove aop-enabled object from the cache. |
void |
setEvictionPolicyClass(java.lang.String eviction_policy_class)
Over-ride to make sure we are using an eviction policy specific to aop. |
Methods inherited from class org.jboss.system.ServiceMBeanSupport (src) |
create, destroy, getLog, getName, getNextNotificationSequenceNumber, getObjectName, getServer, getServiceName, getState, getStateString, jbossInternalCreate, jbossInternalDescription, jbossInternalDestroy, jbossInternalLifecycle, jbossInternalStart, jbossInternalStop, postDeregister, postRegister, preDeregister, preRegister, start, stop |
Methods inherited from class org.jboss.mx.util.JBossNotificationBroadcasterSupport (src) |
addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected java.util.Map cachedTypes
public static final java.lang.String CLASS_INTERNAL
public static final Fqn (src) JBOSS_INTERNAL
public static final java.lang.String DUMMY
Constructor Detail |
public TreeCacheAop(java.lang.String cluster_name, java.lang.String props, long state_fetch_timeout) throws java.lang.Exception
public TreeCacheAop() throws java.lang.Exception
public TreeCacheAop(JChannel channel) throws java.lang.Exception
Method Detail |
public void setEvictionPolicyClass(java.lang.String eviction_policy_class)
setEvictionPolicyClass
in class TreeCache (src)
public java.lang.Object putObject(java.lang.String fqn, java.lang.Object obj) throws CacheException (src)
jboss-aop.xml
).
Note that List
, Map
, Set
attributes are aop-enabled, by default, as well.
fqn
- The fqn string name to associate with the object in the cache.obj
- aop-enabled object to be inerted into the cache. If null,
it will nullify the fqn node.
CacheException (src)
public java.lang.Object putObject(Fqn (src) fqn, java.lang.Object obj) throws CacheException (src)
jboss-aop.xml
).
Note that List
, Map
, Set
attributes are aop-enabled, by default, as well.
fqn
- The fqn instance to associate with the object in the cache.obj
- aop-enabled object to be inerted into the cache. If null,
it will nullify the fqn node.
CacheException (src)
protected void endTransaction()
public java.lang.Object _putObject(Fqn (src) fqn, java.lang.Object obj) throws CacheException (src)
fqn
- obj
-
CacheException (src)
protected void checkObjectType(java.lang.Object obj)
obj
- protected Fqn (src) checkCircularReference(Fqn (src) fqn, InstanceAdvisor advisor, java.lang.Object obj)
protected Fqn (src) handleObjectGraph(Fqn (src) fqn, InstanceAdvisor advisor, CachedType (src) type, java.lang.Object obj) throws CacheException (src)
fqn
- Current fqn to store this sub-objectadvisor
- The associated Advisor instance
CacheException (src)
protected Interceptor findCacheInterceptor(InstanceAdvisor advisor, Fqn (src) fqn)
advisor
- fqn
-
protected Interceptor findCacheInterceptor(InstanceAdvisor advisor)
advisor
-
protected Fqn (src) createInternalNode(Fqn (src) storedFqn)
public java.lang.Object getObject(java.lang.String fqn) throws CacheException (src)
fqn
- String name that associates with this node.
CacheException (src)
protected boolean hasCurrentTransaction()
public java.lang.Object getObject(Fqn (src) fqn) throws CacheException (src)
fqn
- Instance that associates with this node.
CacheException (src)
public java.lang.Object removeObject(java.lang.String fqn) throws CacheException (src)
fqn
- String name that associates with this node.
CacheException (src)
public java.lang.Object removeObject(Fqn (src) fqn) throws CacheException (src)
fqn
- Instance that associates with this node.
CacheException (src)
protected java.lang.Object _removeObject(Fqn (src) fqn, boolean removeCacheInterceptor) throws CacheException (src)
CacheException (src)
public CachedType (src) getCachedType(java.lang.Class clazz)
clazz
- The original pojo class
public java.lang.Object _put(GlobalTransaction (src) tx, Fqn (src) fqn, java.lang.Object key, java.lang.Object value, boolean create_undo_ops) throws CacheException (src)
_put
in class TreeCache (src)
fqn
- key
- value
-
CacheException (src)
public void evict(Fqn (src) fqn) throws CacheException (src)
Called by eviction policy provider. Note that eviction is done only in local mode, that is, it doesn't replicate the node removal. This is will cause the replcation nodes not synchronizing, but it is ok since user is supposed to add the node again when get is null. After that, the contents will be in sync.
evict
in class TreeCache (src)
fqn
- Will remove everythign assoicated with this fqn.
CacheException (src)
|
||||||||||
PREV CLASS (src) NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |