org.jmage.cache
Class CachingFactoryProxy

java.lang.Object
  extended by org.jmage.cache.CachingFactoryProxy
All Implemented Interfaces:
java.lang.reflect.InvocationHandler

public class CachingFactoryProxy
extends java.lang.Object
implements java.lang.reflect.InvocationHandler

Intercepting object cache for Factories. The contract for this proxy is that all proxied classes need to implement an arbitrary interface that has at least one createFrom() method. The proxy will wrap this method with an object cache and cache it's results.


Field Summary
protected  Cache cache
           
protected  CacheManager cacheManager
           
protected  java.lang.Object factory
           
protected static org.apache.log4j.Logger log
           
 
Method Summary
 java.lang.Object invoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args)
           
static java.lang.Object newInstance(java.lang.Object factory, java.util.Properties properties)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

cacheManager

protected CacheManager cacheManager

cache

protected Cache cache

factory

protected java.lang.Object factory

log

protected static org.apache.log4j.Logger log
Method Detail

newInstance

public static java.lang.Object newInstance(java.lang.Object factory,
                                           java.util.Properties properties)

invoke

public java.lang.Object invoke(java.lang.Object proxy,
                               java.lang.reflect.Method method,
                               java.lang.Object[] args)
                        throws java.lang.Throwable
Specified by:
invoke in interface java.lang.reflect.InvocationHandler
Throws:
java.lang.Throwable

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2004-2008 Sourceforge. All Rights Reserved.