org.jboss.cache.aop
Class PojoCache

java.lang.Object
  extended by org.jboss.mx.util.JBossNotificationBroadcasterSupport
      extended by org.jboss.system.ServiceMBeanSupport
          extended by org.jboss.cache.TreeCache
              extended by org.jboss.cache.aop.PojoCache
All Implemented Interfaces:
java.lang.Cloneable, javax.management.MBeanRegistration, javax.management.NotificationBroadcaster, javax.management.NotificationEmitter, PojoCacheIfc, PojoCacheMBean, TreeCacheMBean, org.jboss.system.Service, org.jboss.system.ServiceMBean, org.jgroups.MembershipListener
Direct Known Subclasses:
TreeCacheAop

public class PojoCache
extends TreeCache
implements PojoCacheMBean

PojoCache implementation class. User should use the PojoCacheIfc interface directly to access the public APIs.

PojoCache is an in-memory, transactional, fine-grained, and object-oriented cache system. It differs from the typical generic cache library by operating on the pojo level directly without requiring that object to be serializable (although it does require "aspectizing" the POJO). Further, it can preserve object graph during replication or persistency. It also track the replication via fine-grained maner, i.e., only changed fields are replicated.

Since:
1.4
Author:
Ben Wang

Field Summary
protected  java.util.Map cachedTypes
           
protected  TreeCacheAopDelegate delegate_
           
protected  java.lang.ThreadLocal hasSynchronizationHandler_
           
protected  java.lang.String LOCK
           
protected  boolean marshallNonSerializable_
           
protected  int RETRY
           
protected  java.lang.ThreadLocal undoListLocal_
           
 
Fields inherited from class org.jboss.cache.TreeCache
activationChangeNodes, buddyManager, buddyReplicationConfig, cache_mode, cacheLoaderConfig, cacheLoaderManager, channel, cloaderConfig, cluster_name, cluster_props, coordinator, DEFAULT_REPLICATION_VERSION, disp, evictConfig_, eviction_policy_class, eviction_policy_provider, evictionInterceptorClass, evictionRegionManager_, fetchInMemoryState, hasListeners, inactiveOnStartup, interceptor_chain, internalFqns, INVALIDATION_ASYNC, INVALIDATION_SYNC, isolationLevel, isStandalone, isStateSet, LOCAL, lock_acquisition_timeout, log, marshaller_, members, ml, mux_serviceName, mux_stackName, nodeLockingOptimistic, regionManager_, REPL_ASYNC, repl_queue, repl_queue_interval, repl_queue_max_elements, REPL_SYNC, root, SEPARATOR, setStateException, state_fetch_timeout, sync_commit_phase, sync_repl_timeout, sync_rollback_phase, tm, tm_lookup, tm_lookup_class, UNINITIALIZED, use_interceptor_mbeans, use_repl_queue, useCreateService, useRegionBasedMarshalling, usingEviction
 
Fields inherited from class org.jboss.system.ServiceMBeanSupport
server, SERVICE_CONTROLLER_SIG, serviceName
 
Fields inherited from interface org.jboss.system.ServiceMBean
CREATE_EVENT, CREATED, DESTROY_EVENT, DESTROYED, FAILED, REGISTERED, START_EVENT, STARTED, STARTING, states, STOP_EVENT, STOPPED, STOPPING, UNREGISTERED
 
Constructor Summary
PojoCache()
           
PojoCache(org.jgroups.JChannel channel)
           
PojoCache(java.lang.String cluster_name, java.lang.String props, long state_fetch_timeout)
           
 
Method Summary
 java.lang.Object _evictObject(Fqn fqn)
          Used by internal implementation.
protected  void _evictSubtree(Fqn subtree)
          Evicts the node at subtree along with all descendant nodes.
 java.util.Map _findObjects(Fqn fqn)
          Used by internal implementation.
 java.lang.Object _getObject(Fqn fqn)
          Used by internal implementation.
 java.lang.Object _putObject(Fqn fqn, java.lang.Object obj)
          Used by internal implementation.
 java.lang.Object _removeObject(Fqn fqn)
          Used by internal implementation.
 java.lang.Object _removeObject(Fqn fqn, boolean removeCacheInterceptor)
          Used by internal implementation.
protected  void acquireLocksForStateTransfer(DataNode root, java.lang.Object lockOwner, long timeout, boolean force)
          Overrides the superclass version by additionally acquiring locks on the internal reference map nodes used for tracking shared objects.
 void activateRegion(java.lang.String subtreeFqn)
          Overrides the superclass method by ensuring that the internal region where information on shared object is stored has been activated.
 void addUndoCollectionProxy(java.lang.reflect.Field field, java.lang.Object key, java.lang.Object oldValue)
           
 void addUndoInterceptor(org.jboss.aop.InstanceAdvisor advisor, BaseInterceptor interceptor, int op)
           
protected  void createEvictionPolicy()
           
protected  void endTransaction(Fqn fqn)
           
 void evict(Fqn fqn)
          Override to provide aop specific eviction.
 java.util.Map findObjects(Fqn fqn)
          Query all managed pojo objects under the fqn recursively.
 java.util.Map findObjects(java.lang.String fqn)
          Query all managed pojo objects under the fqn recursively.
 CachedType getCachedType(java.lang.Class clazz)
          Obtain a cache aop type for user to traverse the defined "primitive" types in aop.
 java.util.List getModList()
           
 java.lang.Object getObject(Fqn fqn)
          Retrieve pojo object from the cache.
 java.lang.Object getObject(java.lang.String fqn)
          Retrieve pojo from the cache.
 org.w3c.dom.Element getPojoCacheConfig()
           
protected  boolean hasCurrentTransaction()
           
protected  void init()
           
 boolean isMarshallNonSerializable()
          Indicate whether the flag is set or not.
protected  boolean lockPojo(java.lang.Object owner, Fqn fqn)
           
protected  void parseConfig()
           
 java.lang.Object putObject(Fqn fqn, java.lang.Object obj)
          Insert a pojo into the cache.
 java.lang.Object putObject(java.lang.String fqn, java.lang.Object obj)
          Insert a pojo into the cache.
protected  void registerTxHandler()
           
protected  void releasePojo(java.lang.Object owner, Fqn fqn)
           
protected  void releaseStateTransferLocks(DataNode root, java.lang.Object lockOwner)
          Overrides the superclass version by additionally releasing locks on the internal reference map nodes used for tracking shared objects.
 java.lang.Object removeObject(Fqn fqn)
          Remove pojo object from the cache.
 java.lang.Object removeObject(java.lang.String fqn)
          Remove pojo object from the cache.
 void resetUndoOp()
           
 void setEvictionPolicyClass(java.lang.String eviction_policy_class)
          Over-ride to make sure we are using an eviction policy specific to aop.
 void setMarshallNonSerializable(boolean marshall)
          If the flag is set, then POJO which is not instrumented under AOP and which is not implementing the Serializable interface will still be marshalled and make serializable.
 void setPojoCacheConfig(org.w3c.dom.Element config)
          Inject the config element that is specific to PojoCache.
 void startService()
          Lifecyle method.
 void stopService()
          Lifecycle method.
 
Methods inherited from class org.jboss.cache.TreeCache
_addChild, _clusteredGet, _createService, _dataGravitationCleanup, _enqueueMethodCall, _evict, _evict, _get, _get, _getAssociatedState, _getChildrenNames, _getData, _getKeys, _getState, _getState, _gravitateData, _loadState, _loadState, _lock, _print, _put, _put, _put, _put, _put, _put, _releaseAllLocks, _remoteAnnounceBuddyPoolName, _remoteAssignToBuddyGroup, _remoteRemoveFromBuddyGroup, _remove, _remove, _remove, _remove, _remove, _remove, _remove, _removeData, _removeData, _removeData, _removeData, _removeData, _replicate, _replicate, _setState, acquireLocksForStateTransfer, addTreeCacheListener, addUndoOperation, block, callRemoteMethods, callRemoteMethods, callRemoteMethods, callRemoteMethods, callRemoteMethods, commit, createService, createSubtreeRootNode, destroyService, determineCoordinator, dumpTransactionTable, exists, exists, exists, exists, fetchState, fetchStateOnStartup, forceAcquireLock, get, get, get, get, get, get, get, get, getBuddyManager, getBuddyReplicationConfig, getCacheLoader, getCacheLoaderAsynchronous, getCacheLoaderClass, getCacheLoaderConfig, getCacheLoaderConfiguration, getCacheLoaderFetchPersistentState, getCacheLoaderFetchTransientState, getCacheLoaderManager, getCacheLoaderPassivation, getCacheLoaderPreload, getCacheLoaderShared, getCacheMode, getCacheModeInternal, getChildrenNames, getChildrenNames, getChildrenNames, getClusterName, getClusterProperties, getCoordinator, getCurrentTransaction, getCurrentTransaction, getCurrentTransaction, getCurrentTransaction, getDeadlockDetection, getDefaultProperties, getEvictionInterceptorClass, getEvictionPolicyClass, getEvictionPolicyConfig, getEvictionRegionManager, getEvictionThreadWakeupIntervalSeconds, getFetchInMemoryState, getFetchPersistentState, getFetchStateOnStartup, getInitialStateRetrievalTimeout, getInstance, getInterceptorChain, getInterceptors, getInternalFqns, getInvocationContext, getIsolationLevel, getIsolationLevelClass, getKeys, getKeys, getLocalAddress, getLocalTransaction, getLockAcquisitionTimeout, getLockTable, getMarshaller, getMembers, getMessageListener, getMultiplexerService, getMultiplexerStack, getNodeLockingScheme, getNumberOfAttributes, getNumberOfAttributes, getNumberOfLocksHeld, getNumberOfNodes, getOwnerForLock, getRegionManager, getReplicationVersion, getReplicationVersionShort, getReplQueue, getReplQueueInterval, getReplQueueMaxElements, getRoot, getStateBytes, getStateTransferVersion, getSyncCommitPhase, getSyncReplTimeout, getSyncRollbackPhase, getTransactionManager, getTransactionManagerLookupClass, getTransactionTable, getTreeCacheListeners, getUseInterceptorMbeans, getUseMarshalling, getUseRegionBasedMarshalling, getUseReplQueue, getVersion, hasChild, inactivateRegion, invokeMethod, isCoordinator, isInactiveOnStartup, isNodeLockingOptimistic, isUsingEviction, load, loadClass, notifyAllNodesCreated, notifyCacheStarted, notifyCacheStopped, notifyCallForInactiveSubtree, notifyNodeActivate, notifyNodeCreated, notifyNodeEvict, notifyNodeEvicted, notifyNodeLoaded, notifyNodeModified, notifyNodeModify, notifyNodePassivate, notifyNodeRemove, notifyNodeRemoved, notifyNodeVisited, notifyViewChange, optimisticPrepare, peek, peek, prepare, print, print, printDetails, printLockInfo, purgeCacheLoaders, put, put, put, put, put, put, putFailFast, putFailFast, registerClassLoader, releaseAllLocks, releaseAllLocks, releaseStateTransferLocks, remove, remove, remove, remove, remove, remove, removeData, removeData, removeTreeCacheListener, rollback, setBuddyReplicationConfig, setCacheLoader, setCacheLoaderAsynchronous, setCacheLoaderClass, setCacheLoaderConfig, setCacheLoaderConfiguration, setCacheLoaderFetchPersistentState, setCacheLoaderFetchTransientState, setCacheLoaderManager, setCacheLoaderPassivation, setCacheLoaderPreload, setCacheLoaderShared, setCacheMode, setCacheMode, setClusterConfig, setClusterName, setClusterProperties, setDeadlockDetection, setEvictionListener, setEvictionPolicyConfig, setEvictionPolicyProvider, setFetchInMemoryState, setFetchStateOnStartup, setInactiveOnStartup, setInitialStateRetrievalTimeout, setInterceptorChain, setInvocationContext, setIsolationLevel, setIsolationLevel, setIsUsingEviction, setLockAcquisitionTimeout, setMultiplexerService, setMultiplexerStack, setNodeLockingOptimistic, setNodeLockingScheme, setReplicationVersion, setReplQueueInterval, setReplQueueMaxElements, setStateBytes, setStateTransferVersion, setSyncCommitPhase, setSyncReplTimeout, setSyncRollbackPhase, setTransactionManagerLookup, setTransactionManagerLookupClass, setUseInterceptorMbeans, setUseMarshalling, setUseRegionBasedMarshalling, setUseReplQueue, string2Mode, suspect, toString, toString, unregisterClassLoader, viewAccepted
 
Methods inherited from class org.jboss.system.ServiceMBeanSupport
create, destroy, getDeploymentInfo, 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
addNotificationListener, getNotificationInfo, handleNotification, nextNotificationSequenceNumber, removeNotificationListener, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jboss.cache.TreeCacheMBean
_put, _put, _put, _put, _put, _remove, _remove, _remove, _remove, addTreeCacheListener, callRemoteMethods, callRemoteMethods, createService, destroyService, dumpTransactionTable, exists, exists, exists, exists, fetchState, get, get, get, get, get, get, get, getBuddyReplicationConfig, getCacheLoader, getCacheLoaderAsynchronous, getCacheLoaderClass, getCacheLoaderConfig, getCacheLoaderConfiguration, getCacheLoaderFetchPersistentState, getCacheLoaderFetchTransientState, getCacheLoaderPassivation, getCacheLoaderPreload, getCacheLoaderShared, getCacheMode, getChildrenNames, getChildrenNames, getChildrenNames, getClusterName, getClusterProperties, getDeadlockDetection, getEvictionPolicyClass, getEvictionThreadWakeupIntervalSeconds, getFetchInMemoryState, getFetchStateOnStartup, getInitialStateRetrievalTimeout, getInstance, getInterceptorChain, getInterceptors, getIsolationLevel, getKeys, getKeys, getLocalAddress, getLockAcquisitionTimeout, getMembers, getMultiplexerService, getMultiplexerStack, getNodeLockingScheme, getNumberOfAttributes, getNumberOfLocksHeld, getNumberOfNodes, getReplicationVersion, getReplQueueInterval, getReplQueueMaxElements, getStateTransferVersion, getSyncCommitPhase, getSyncReplTimeout, getSyncRollbackPhase, getTransactionManager, getTransactionManagerLookupClass, getUseInterceptorMbeans, getUseMarshalling, getUseRegionBasedMarshalling, getUseReplQueue, getVersion, inactivateRegion, isCoordinator, isInactiveOnStartup, isUsingEviction, load, print, print, printDetails, printLockInfo, purgeCacheLoaders, put, put, put, put, put, put, registerClassLoader, releaseAllLocks, releaseAllLocks, remove, remove, remove, remove, remove, remove, removeData, removeData, removeTreeCacheListener, setBuddyReplicationConfig, setCacheLoader, setCacheLoaderAsynchronous, setCacheLoaderClass, setCacheLoaderConfig, setCacheLoaderConfiguration, setCacheLoaderFetchPersistentState, setCacheLoaderFetchTransientState, setCacheLoaderPassivation, setCacheLoaderPreload, setCacheLoaderShared, setCacheMode, setClusterConfig, setClusterName, setClusterProperties, setDeadlockDetection, setEvictionPolicyConfig, setFetchInMemoryState, setFetchStateOnStartup, setInactiveOnStartup, setInitialStateRetrievalTimeout, setIsolationLevel, setLockAcquisitionTimeout, setMultiplexerService, setMultiplexerStack, setNodeLockingScheme, setReplicationVersion, setReplQueueInterval, setReplQueueMaxElements, setStateTransferVersion, setSyncCommitPhase, setSyncReplTimeout, setSyncRollbackPhase, setTransactionManagerLookup, setTransactionManagerLookupClass, setUseMarshalling, setUseRegionBasedMarshalling, setUseReplQueue, toString, unregisterClassLoader
 
Methods inherited from interface org.jboss.system.ServiceMBean
getName, getState, getStateString, jbossInternalLifecycle
 
Methods inherited from interface org.jboss.system.Service
create, destroy, start, stop
 

Field Detail

cachedTypes

protected java.util.Map cachedTypes

delegate_

protected TreeCacheAopDelegate delegate_

LOCK

protected final java.lang.String LOCK
See Also:
Constant Field Values

RETRY

protected final int RETRY
See Also:
Constant Field Values

marshallNonSerializable_

protected boolean marshallNonSerializable_

undoListLocal_

protected java.lang.ThreadLocal undoListLocal_

hasSynchronizationHandler_

protected java.lang.ThreadLocal hasSynchronizationHandler_
Constructor Detail

PojoCache

public PojoCache(java.lang.String cluster_name,
                 java.lang.String props,
                 long state_fetch_timeout)
          throws java.lang.Exception
Throws:
java.lang.Exception

PojoCache

public PojoCache()
          throws java.lang.Exception
Throws:
java.lang.Exception

PojoCache

public PojoCache(org.jgroups.JChannel channel)
          throws java.lang.Exception
Throws:
java.lang.Exception
Method Detail

init

protected void init()

startService

public void startService()
                  throws java.lang.Exception
Description copied from class: TreeCache
Lifecyle method. This is the same thing as calling start

Specified by:
startService in interface TreeCacheMBean
Overrides:
startService in class TreeCache
Throws:
java.lang.Exception

stopService

public void stopService()
Description copied from class: TreeCache
Lifecycle method. Same thing as calling stop.

Specified by:
stopService in interface TreeCacheMBean
Overrides:
stopService in class TreeCache

parseConfig

protected void parseConfig()

setEvictionPolicyClass

public void setEvictionPolicyClass(java.lang.String eviction_policy_class)
Over-ride to make sure we are using an eviction policy specific to aop.

Specified by:
setEvictionPolicyClass in interface TreeCacheMBean
Overrides:
setEvictionPolicyClass in class TreeCache

addUndoInterceptor

public void addUndoInterceptor(org.jboss.aop.InstanceAdvisor advisor,
                               BaseInterceptor interceptor,
                               int op)

addUndoCollectionProxy

public void addUndoCollectionProxy(java.lang.reflect.Field field,
                                   java.lang.Object key,
                                   java.lang.Object oldValue)

resetUndoOp

public void resetUndoOp()

getModList

public java.util.List getModList()

evict

public void evict(Fqn fqn)
           throws CacheException
Override to provide aop specific eviction.

Called by eviction policy provider. Note that eviction is done only in local mode, that is, it doesn't replicate the node removal. This will cause the replication 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.

Specified by:
evict in interface TreeCacheMBean
Overrides:
evict in class TreeCache
Parameters:
fqn - Will remove everythign assoicated with this fqn.
Throws:
CacheException

createEvictionPolicy

protected void createEvictionPolicy()
Overrides:
createEvictionPolicy in class TreeCache

_evictSubtree

protected void _evictSubtree(Fqn subtree)
                      throws CacheException
Description copied from class: TreeCache
Evicts the node at subtree along with all descendant nodes.

Overrides:
_evictSubtree in class TreeCache
Parameters:
subtree - Fqn indicating the uppermost node in the portion of the tree that should be evicted.
Throws:
CacheException

activateRegion

public void activateRegion(java.lang.String subtreeFqn)
                    throws RegionNotEmptyException,
                           RegionNameConflictException,
                           CacheException
Overrides the superclass method by ensuring that the internal region where information on shared object is stored has been activated.

Specified by:
activateRegion in interface TreeCacheMBean
Overrides:
activateRegion in class TreeCache
Parameters:
subtreeFqn - Fqn string indicating the uppermost node in the portion of the tree that should be activated.
Throws:
RegionNotEmptyException - if the node subtreeFqn exists and has either data or children
RegionNameConflictException
CacheException

acquireLocksForStateTransfer

protected void acquireLocksForStateTransfer(DataNode root,
                                            java.lang.Object lockOwner,
                                            long timeout,
                                            boolean force)
                                     throws java.lang.Exception
Overrides the superclass version by additionally acquiring locks on the internal reference map nodes used for tracking shared objects.

Throws:
java.lang.Exception

releaseStateTransferLocks

protected void releaseStateTransferLocks(DataNode root,
                                         java.lang.Object lockOwner)
Overrides the superclass version by additionally releasing locks on the internal reference map nodes used for tracking shared objects.


getCachedType

public CachedType getCachedType(java.lang.Class clazz)
Obtain a cache aop type for user to traverse the defined "primitive" types in aop. Note that this is not a synchronized call now for speed optimization.

Specified by:
getCachedType in interface PojoCacheIfc
Parameters:
clazz - The original pojo class
Returns:
CachedType

getObject

public java.lang.Object getObject(java.lang.String fqn)
                           throws CacheException
Description copied from interface: PojoCacheIfc
Retrieve pojo from the cache. Return null if object does not exist in the cache. Note that this operation is fast if there is already an POJO instance attached to the cache.

Specified by:
getObject in interface PojoCacheIfc
Parameters:
fqn - Instance that associates with this node.
Returns:
Current content value. Null if does not exist.
Throws:
CacheException - Throws if there is an error related to the cache operation, e.g., TimeoutException.

getObject

public java.lang.Object getObject(Fqn fqn)
                           throws CacheException
Description copied from interface: PojoCacheIfc
Retrieve pojo object from the cache. Return null if object does not exist in the cache. Note that this operation is fast if there is already an POJO instance attached to the cache.

Specified by:
getObject in interface PojoCacheIfc
Parameters:
fqn - Instance that associates with this node.
Returns:
Current content value. Null if does not exist.
Throws:
CacheException - Throws if there is an error related to the cache operation, e.g., TimeoutException.

putObject

public java.lang.Object putObject(java.lang.String fqn,
                                  java.lang.Object obj)
                           throws CacheException
Description copied from interface: PojoCacheIfc
Insert a pojo 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.

Specified by:
putObject in interface PojoCacheIfc
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.
Returns:
Existing POJO or null if there is not.
Throws:
CacheException - Throws if there is an error related to the cache operation, e.g., TimeoutException.

putObject

public java.lang.Object putObject(Fqn fqn,
                                  java.lang.Object obj)
                           throws CacheException
Description copied from interface: PojoCacheIfc
Insert a pojo 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.

Specified by:
putObject in interface PojoCacheIfc
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.
Returns:
Existing POJO or null if there is not.
Throws:
CacheException - Throws if there is an error related to the cache operation, e.g., TimeoutException.

removeObject

public java.lang.Object removeObject(java.lang.String fqn)
                              throws CacheException
Description copied from interface: PojoCacheIfc
Remove pojo object from the cache.

Specified by:
removeObject in interface PojoCacheIfc
Parameters:
fqn - Instance that associates with this node.
Returns:
Original value object from this node.
Throws:
CacheException - Throws if there is an error related to the cache operation, e.g., TimeoutException.

removeObject

public java.lang.Object removeObject(Fqn fqn)
                              throws CacheException
Description copied from interface: PojoCacheIfc
Remove pojo object from the cache.

Specified by:
removeObject in interface PojoCacheIfc
Parameters:
fqn - Instance that associates with this node.
Returns:
Original value object from this node.
Throws:
CacheException - Throws if there is an error related to the cache operation, e.g., TimeoutException.

findObjects

public java.util.Map findObjects(java.lang.String fqn)
                          throws CacheException
Description copied from interface: PojoCacheIfc
Query all managed pojo objects under the fqn recursively. Note that this will not return the sub-object pojos, e.g., if Person has a sub-object of Address, it won't return Address pojo. Note also that this operation is not thread-safe now. In addition, it assumes that once a pojo is found with a fqn, no more pojo is stored under the children of the fqn. That is, we don't mixed the fqn with different pojos.

Specified by:
findObjects in interface PojoCacheIfc
Parameters:
fqn - The starting place to find all pojos.
Returns:
Map of all pojos found with (fqn, pojo) pair. Return size of 0, if not found.
Throws:
CacheException - Throws if there is an error related to the cache operation, e.g., TimeoutException.

findObjects

public java.util.Map findObjects(Fqn fqn)
                          throws CacheException
Description copied from interface: PojoCacheIfc
Query all managed pojo objects under the fqn recursively. Note that this will not return the sub-object pojos, e.g., if Person has a sub-object of Address, it won't return Address pojo. Note also that this operation is not thread-safe now. In addition, it assumes that once a pojo is found with a fqn, no more pojo is stored under the children of the fqn. That is, we don't mixed the fqn with different pojos.

Specified by:
findObjects in interface PojoCacheIfc
Parameters:
fqn - The starting place to find all pojos.
Returns:
Map of all pojos found with (fqn, pojo) pair. Return size of 0, if not found.
Throws:
CacheException

setMarshallNonSerializable

public void setMarshallNonSerializable(boolean marshall)
Description copied from interface: PojoCacheIfc
If the flag is set, then POJO which is not instrumented under AOP and which is not implementing the Serializable interface will still be marshalled and make serializable.

Specified by:
setMarshallNonSerializable in interface PojoCacheIfc

isMarshallNonSerializable

public boolean isMarshallNonSerializable()
Description copied from interface: PojoCacheIfc
Indicate whether the flag is set or not.

Specified by:
isMarshallNonSerializable in interface PojoCacheIfc

setPojoCacheConfig

public void setPojoCacheConfig(org.w3c.dom.Element config)
                        throws CacheException
Inject the config element that is specific to PojoCache.

Specified by:
setPojoCacheConfig in interface PojoCacheMBean
Specified by:
setPojoCacheConfig in interface TreeCacheMBean
Overrides:
setPojoCacheConfig in class TreeCache
Parameters:
config -
Throws:
CacheException

getPojoCacheConfig

public org.w3c.dom.Element getPojoCacheConfig()
Specified by:
getPojoCacheConfig in interface PojoCacheMBean
Specified by:
getPojoCacheConfig in interface TreeCacheMBean
Overrides:
getPojoCacheConfig in class TreeCache

lockPojo

protected boolean lockPojo(java.lang.Object owner,
                           Fqn fqn)
                    throws CacheException
Throws:
CacheException

releasePojo

protected void releasePojo(java.lang.Object owner,
                           Fqn fqn)
                    throws CacheException
Throws:
CacheException

hasCurrentTransaction

protected boolean hasCurrentTransaction()

endTransaction

protected void endTransaction(Fqn fqn)

_getObject

public java.lang.Object _getObject(Fqn fqn)
                            throws CacheException
Used by internal implementation. Not for general public.

Throws:
CacheException

_putObject

public java.lang.Object _putObject(Fqn fqn,
                                   java.lang.Object obj)
                            throws CacheException
Used by internal implementation. Not for general public.

Throws:
CacheException

registerTxHandler

protected void registerTxHandler()
                          throws CacheException
Throws:
CacheException

_removeObject

public java.lang.Object _removeObject(Fqn fqn)
                               throws CacheException
Used by internal implementation. Not for general public.

Throws:
CacheException

_removeObject

public java.lang.Object _removeObject(Fqn fqn,
                                      boolean removeCacheInterceptor)
                               throws CacheException
Used by internal implementation. Not for general public.

Throws:
CacheException

_evictObject

public java.lang.Object _evictObject(Fqn fqn)
                              throws CacheException
Used by internal implementation. Not for general public.

Throws:
CacheException

_findObjects

public java.util.Map _findObjects(Fqn fqn)
                           throws CacheException
Used by internal implementation. Not for general public.

Throws:
CacheException


Copyright 1998-2005 JBoss Inc . All Rights Reserved.