1 /* 2 * JBoss, the OpenSource J2EE webOS 3 * 4 * Distributable under LGPL license. 5 * See terms of license at gnu.org. 6 */ 7 package org.jboss.cache.aop; 8 9 /** 10 * MBean interface. 11 * @author Harald Gliebe 12 * @author Ben Wang 13 */ 14 public interface TreeCacheAopMBean extends org.jboss.cache.TreeCacheMBean 15 { 16 17 /** 18 * Over-ride to make sure we are using an eviction policy specific to aop. 19 */ 20 void setEvictionPolicyClass(java.lang.String eviction_policy_class); 21 22 /** 23 * 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 <code>jboss-aop.xml</code>). Note that <code>List</code>, <code>Map</code>, <code>Set</code> attributes are aop-enabled, by default, as well. 24 * @param fqn The fqn string name to associate with the object in the cache. 25 * @param obj aop-enabled object to be inerted into the cache. If null, it will nullify the fqn node. 26 * @param obj Return the previous content under fqn. 27 * @throws CacheException 28 */ 29 java.lang.Object putObject(java.lang.String fqn, java.lang.Object obj) throws org.jboss.cache.CacheException; 30 31 /** 32 * 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 <code>jboss-aop.xml</code>). Note that <code>List</code>, <code>Map</code>, <code>Set</code> attributes are aop-enabled, by default, as well. 33 * @param fqn The fqn instance to associate with the object in the cache. 34 * @param obj aop-enabled object to be inerted into the cache. If null, it will nullify the fqn node. 35 * @param obj Return the previous content under fqn. 36 * @throws CacheException 37 */ 38 java.lang.Object putObject(org.jboss.cache.Fqn fqn, java.lang.Object obj) throws org.jboss.cache.CacheException; 39 40 /** 41 * Retrieve the aop-enabled object from the cache. 42 * @param fqn String name that associates with this node. 43 * @return Current content value. Null if does not exist. 44 * @throws CacheException 45 */ 46 java.lang.Object getObject(java.lang.String fqn) throws org.jboss.cache.CacheException; 47 48 /** 49 * Retrieve the aop-enabled object from the cache. Return null if object does not exist in the cache. 50 * @param fqn Instance that associates with this node. 51 * @return Current content value. Null if does not exist. 52 * @throws CacheException 53 */ 54 java.lang.Object getObject(org.jboss.cache.Fqn fqn) throws org.jboss.cache.CacheException; 55 56 /** 57 * Remove aop-enabled object from the cache. 58 * @param fqn String name that associates with this node. 59 * @return Value object from this node. 60 * @throws CacheException 61 */ 62 java.lang.Object removeObject(java.lang.String fqn) throws org.jboss.cache.CacheException; 63 64 /** 65 * Remove aop-enabled object from the cache. 66 * @param fqn Instance that associates with this node. 67 * @return Original value object from this node. 68 * @throws CacheException 69 */ 70 java.lang.Object removeObject(org.jboss.cache.Fqn fqn) throws org.jboss.cache.CacheException; 71 72 /** 73 * Obtain a cache aop type for user to traverse the defined "primitive" types in aop. 74 * @param clazz The original pojo class 75 * @return CachedType 76 */ 77 org.jboss.cache.aop.CachedType getCachedType(java.lang.Class clazz); 78 79 java.lang.Object _put(org.jboss.cache.GlobalTransaction tx, org.jboss.cache.Fqn fqn, java.lang.Object key, 80 java.lang.Object value, boolean create_undo_ops) throws org.jboss.cache.CacheException; 81 82 /** 83 * Override to provide aop specific eviction. <p> 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. 84 * @param fqn Will remove everythign assoicated with this fqn. 85 * @throws CacheException */ 86 void evict(org.jboss.cache.Fqn fqn) throws org.jboss.cache.CacheException; 87 88 } 89