org.jboss.cache.aop
Interface TreeCacheAopIfc

All Known Implementing Classes:
TreeCacheAop

public interface TreeCacheAopIfc

Interface for TreeCacheAop. Will need to consolidate with TreeCache interface in the future.

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.

Author:
Harald Gliebe, Ben Wang

Method Summary
 java.lang.Object getObject(Fqn 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.
 java.lang.Object putObject(Fqn 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 fqn)
          Remove aop-enabled object from the cache.
 java.lang.Object removeObject(java.lang.String fqn)
          Remove aop-enabled object from the cache.
 

Method Detail

getObject

public java.lang.Object getObject(java.lang.String fqn)
                           throws CacheException
Retrieve the aop-enabled object from the cache. Return null if object does not exist in the cache.

Parameters:
fqn - Instance that associates with this node.
Returns:
Current content value. Null if does not exist.
Throws:
CacheException

getObject

public java.lang.Object getObject(Fqn fqn)
                           throws CacheException
Retrieve the aop-enabled object from the cache. Return null if object does not exist in the cache.

Parameters:
fqn - Instance that associates with this node.
Returns:
Current content value. Null if does not exist.
Throws:
CacheException

putObject

public java.lang.Object putObject(java.lang.String fqn,
                                  java.lang.Object obj)
                           throws CacheException
Insert an aop-enabled object into the cache. It will also recursively put the any sub-object that is declared as aop-capable (i.e., in jboss-aop.xml). Note that List, Map, Set attributes are aop-enabled, by default, as well.

Parameters:
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.
Throws:
CacheException

putObject

public java.lang.Object putObject(Fqn fqn,
                                  java.lang.Object obj)
                           throws CacheException
Insert an aop-enabled object into the cache. It will also recursively put the any sub-object that is declared as aop-capable (i.e., in jboss-aop.xml). Note that List, Map, Set attributes are aop-enabled, by default, as well.

Parameters:
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.
Throws:
CacheException

removeObject

public java.lang.Object removeObject(java.lang.String fqn)
                              throws CacheException
Remove aop-enabled object from the cache.

Parameters:
fqn - Instance that associates with this node.
Returns:
Original value object from this node.
Throws:
CacheException

removeObject

public java.lang.Object removeObject(Fqn fqn)
                              throws CacheException
Remove aop-enabled object from the cache.

Parameters:
fqn - Instance that associates with this node.
Returns:
Original value object from this node.
Throws:
CacheException


Copyright © 1998-2005 JBoss Inc . All Rights Reserved.