org.huihoo.jfox.pool
Class ProxyObjectFactory

java.lang.Object
  extended byorg.huihoo.jfox.pool.ObjectFactoryImpl
      extended byorg.huihoo.jfox.pool.ProxyObjectFactory
All Implemented Interfaces:
ObjectFactory
Direct Known Subclasses:
ConnectionFactory

public class ProxyObjectFactory
extends ObjectFactoryImpl


Field Summary
protected  java.lang.Class invokerClass
           
 
Fields inherited from class org.huihoo.jfox.pool.ObjectFactoryImpl
classType
 
Constructor Summary
ProxyObjectFactory(java.lang.Class classType)
          使用 PoolableObjectInvocationHandler 作为默认的 InvocationHandler
ProxyObjectFactory(java.lang.Class classType, java.lang.Class invokerClass)
           
 
Method Summary
 void destroyObject(PoolableObject object)
          destroy a poolabled object
 PoolableObject makeObject()
          create a new poolable object
 boolean validateObject(PoolableObject object)
          Ensures that the instance is safe to be returned by the pool
 
Methods inherited from class org.huihoo.jfox.pool.ObjectFactoryImpl
equals, getObjectClass, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

invokerClass

protected java.lang.Class invokerClass
Constructor Detail

ProxyObjectFactory

public ProxyObjectFactory(java.lang.Class classType)
                   throws java.lang.Exception
使用 PoolableObjectInvocationHandler 作为默认的 InvocationHandler

Parameters:
classType - PoolableObject 的 Class
Throws:
java.lang.Exception

ProxyObjectFactory

public ProxyObjectFactory(java.lang.Class classType,
                          java.lang.Class invokerClass)
                   throws java.lang.Exception
Method Detail

validateObject

public boolean validateObject(PoolableObject object)
Description copied from interface: ObjectFactory
Ensures that the instance is safe to be returned by the pool

Specified by:
validateObject in interface ObjectFactory
Overrides:
validateObject in class ObjectFactoryImpl

makeObject

public PoolableObject makeObject()
                          throws java.lang.Exception
Description copied from interface: ObjectFactory
create a new poolable object

Specified by:
makeObject in interface ObjectFactory
Overrides:
makeObject in class ObjectFactoryImpl
Throws:
java.lang.Exception

destroyObject

public void destroyObject(PoolableObject object)
                   throws java.lang.Exception
Description copied from class: ObjectFactoryImpl
destroy a poolabled object

Specified by:
destroyObject in interface ObjectFactory
Overrides:
destroyObject in class ObjectFactoryImpl
Parameters:
object -
Throws:
java.lang.Exception