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

java.lang.Object
  |
  +--org.apache.avalon.fortress.impl.factory.AbstractObjectFactory
        |
        +--org.apache.avalon.fortress.impl.factory.WrapperObjectFactory
All Implemented Interfaces:
Instrumentable, 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:
Olaf Bergner

Field Summary
 
Fields inherited from class org.apache.avalon.fortress.impl.factory.AbstractObjectFactory
m_delegateFactory
 
Fields inherited from interface org.apache.excalibur.mpool.ObjectFactory
ROLE
 
Fields inherited from interface org.apache.excalibur.instrument.Instrumentable
EMPTY_INSTRUMENT_ARRAY, EMPTY_INSTRUMENTABLE_ARRAY
 
Constructor Summary
WrapperObjectFactory(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(Object object)
           
 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
 

Constructor Detail

WrapperObjectFactory

public WrapperObjectFactory(ObjectFactory objectFactory)
                     throws 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:
IllegalArgumentException - If objFactory is null
Method Detail

newInstance

public Object newInstance()
                   throws Exception
Specified by:
newInstance in interface ObjectFactory
Specified by:
newInstance in class AbstractObjectFactory
Exception
See Also:
ObjectFactory.newInstance()

dispose

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


Copyright © 2000-2002 Apache Avalon Project. All Rights Reserved.