org.jboss.cache.aop.collection
Class CachedSetInterceptor

java.lang.Object
  extended by org.jboss.cache.aop.collection.AbstractCollectionInterceptor
      extended by org.jboss.cache.aop.collection.CachedSetInterceptor
All Implemented Interfaces:
org.jboss.aop.advice.Interceptor, BaseInterceptor

public class CachedSetInterceptor
extends AbstractCollectionInterceptor

Set interceptor that delegates underlying impl.

Author:
Ben Wang

Field Summary
protected  java.util.Set cacheImpl_
           
protected  java.util.Set current_
           
protected  java.util.Set inMemImpl_
           
protected static java.util.Map managedMethods_
           
protected  java.util.Map methodMap_
           
 
Fields inherited from class org.jboss.cache.aop.collection.AbstractCollectionInterceptor
aopInstance_, attached_, fqn_
 
Constructor Summary
CachedSetInterceptor(PojoCache cache, Fqn fqn, java.lang.Class clazz, java.util.Set obj)
           
 
Method Summary
 void attach(Fqn fqn, boolean copyToCache)
          When we want to associate this proxy with the cache again.
 void detach(boolean removeFromCache)
          When we want to separate this proxy from the cache.
 java.lang.String getName()
           
 java.lang.Object getOriginalInstance()
           
 java.lang.Object invoke(org.jboss.aop.joinpoint.Invocation invocation)
           
protected  void toCache()
           
protected  void toMemory(boolean removeFromCache)
           
 
Methods inherited from class org.jboss.cache.aop.collection.AbstractCollectionInterceptor
getAopInstance, getFqn, isAttached, setAopInstance, setFqn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

methodMap_

protected java.util.Map methodMap_

managedMethods_

protected static final java.util.Map managedMethods_

cacheImpl_

protected java.util.Set cacheImpl_

current_

protected java.util.Set current_

inMemImpl_

protected java.util.Set inMemImpl_
Constructor Detail

CachedSetInterceptor

public CachedSetInterceptor(PojoCache cache,
                            Fqn fqn,
                            java.lang.Class clazz,
                            java.util.Set obj)
Method Detail

attach

public void attach(Fqn fqn,
                   boolean copyToCache)
When we want to associate this proxy with the cache again. We will need to translate the in-memory content to the cache store first.

Overrides:
attach in class AbstractCollectionInterceptor

toCache

protected void toCache()

detach

public void detach(boolean removeFromCache)
When we want to separate this proxy from the cache. We will destroy the cache content and copy them to the in-memory copy.

Overrides:
detach in class AbstractCollectionInterceptor

toMemory

protected void toMemory(boolean removeFromCache)

getName

public java.lang.String getName()

invoke

public java.lang.Object invoke(org.jboss.aop.joinpoint.Invocation invocation)
                        throws java.lang.Throwable
Throws:
java.lang.Throwable

getOriginalInstance

public java.lang.Object getOriginalInstance()
Overrides:
getOriginalInstance in class AbstractCollectionInterceptor


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