org.huihoo.jfox.pool
Class ProxyObjectFactory

java.lang.Object
  |
  +--org.huihoo.jfox.pool.ObjectFactorySupport
        |
        +--org.huihoo.jfox.pool.ProxyObjectFactory
All Implemented Interfaces:
ObjectFactory
Direct Known Subclasses:
ConnectionFactory

public class ProxyObjectFactory
extends ObjectFactorySupport

Author:
Young Yang

Field Summary
protected  java.lang.Class invokerClass
           
 
Fields inherited from class org.huihoo.jfox.pool.ObjectFactorySupport
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.ObjectFactorySupport
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
Overrides:
validateObject in class ObjectFactorySupport
Following copied from interface: org.huihoo.jfox.pool.ObjectFactory
Parameters:
object -  
Returns:
 

makeObject

public PoolableObject makeObject()
                          throws java.lang.Exception
Description copied from interface: ObjectFactory
create a new poolable object
Overrides:
makeObject in class ObjectFactorySupport
Following copied from interface: org.huihoo.jfox.pool.ObjectFactory
Returns:
 

destroyObject

public void destroyObject(PoolableObject object)
                   throws java.lang.Exception
Description copied from class: ObjectFactorySupport
destroy a poolabled object
Overrides:
destroyObject in class ObjectFactorySupport
Following copied from class: org.huihoo.jfox.pool.ObjectFactorySupport
Parameters:
object -