org.openejb.cache
Interface InstanceFactory

All Known Implementing Classes:
EntityInstanceFactory, MDBInstanceFactory, StatefulInstanceFactory, StatelessInstanceFactory

public interface InstanceFactory

A factory for instances of Pooled or Cached objects

Version:
$Revision: 444624 $ $Date: 2004-03-01 08:17:26 +0100 (Mon, 01 Mar 2004) $

Method Summary
 Object createInstance()
          Create an instance ready for insertion into the pool.
 void destroyInstance(Object instance)
          Destroy an instance that the pool decided was not needed any longer.
 

Method Detail

createInstance

public Object createInstance()
                      throws Exception
Create an instance ready for insertion into the pool. This method should have performed any initialization needed by the object's lifecycle

Returns:
an instance ready to be used
Throws:
Exception - if there was a problem initializing the instance

destroyInstance

public void destroyInstance(Object instance)
Destroy an instance that the pool decided was not needed any longer. This method should perform any shutdown needed by the lifecycle

Parameters:
instance - the instance to destroy


Copyright © 1999-2006 OpenEJB. All Rights Reserved.