org.apache.avalon.fortress.impl.factory
Class WrapperObjectFactory

java.lang.Object
  extended by org.apache.avalon.fortress.impl.factory.AbstractObjectFactory
      extended by org.apache.avalon.fortress.impl.factory.WrapperObjectFactory
All Implemented Interfaces:
org.apache.excalibur.instrument.Instrumentable, org.d_haven.mpool.ObjectFactory

public final class WrapperObjectFactory
extends AbstractObjectFactory

An object factory that delegates all calls to another object factory and wraps the returned object into another object that exposes only the wrapped object's work interface(s).

Version:
CVS $ Revision: 1.1 $
Author:
Avalon Development Team

Field Summary
private  BCELWrapperGenerator m_wrapperGenerator
          The BCELWrapperGenerator to use for creating the wrapper.
 
Fields inherited from class org.apache.avalon.fortress.impl.factory.AbstractObjectFactory
m_delegateFactory
 
Fields inherited from interface org.apache.excalibur.instrument.Instrumentable
EMPTY_INSTRUMENT_ARRAY, EMPTY_INSTRUMENTABLE_ARRAY
 
Constructor Summary
WrapperObjectFactory(org.d_haven.mpool.ObjectFactory objectFactory)
          Creates a WrapperObjectFactory with the specified ObjectFactory as the object factory to delegate all calls for new instances to.
 
Method Summary
 void dispose(java.lang.Object object)
           
 java.lang.Object newInstance()
           
 
Methods inherited from class org.apache.avalon.fortress.impl.factory.AbstractObjectFactory
getChildInstrumentables, getCreatedClass, getInstrumentableName, getInstruments, guessWorkInterfaces, setInstrumentableName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_wrapperGenerator

private final BCELWrapperGenerator m_wrapperGenerator
The BCELWrapperGenerator to use for creating the wrapper.

Constructor Detail

WrapperObjectFactory

public WrapperObjectFactory(org.d_haven.mpool.ObjectFactory objectFactory)
                     throws java.lang.IllegalArgumentException
Creates a WrapperObjectFactory with the specified ObjectFactory as the object factory to delegate all calls for new instances to.

Parameters:
objectFactory - The ObjectFactory to sue when creating new instances
Throws:
java.lang.IllegalArgumentException - If objFactory is null
Method Detail

newInstance

public java.lang.Object newInstance()
                             throws java.lang.Exception
Specified by:
newInstance in interface org.d_haven.mpool.ObjectFactory
Specified by:
newInstance in class AbstractObjectFactory
Throws:
java.lang.Exception
See Also:
ObjectFactory.newInstance()

dispose

public void dispose(java.lang.Object object)
             throws java.lang.Exception
Specified by:
dispose in interface org.d_haven.mpool.ObjectFactory
Specified by:
dispose in class AbstractObjectFactory
Throws:
java.lang.Exception
See Also:
ObjectFactory.dispose(java.lang.Object)