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

java.lang.Object
  extended byorg.apache.avalon.fortress.impl.factory.AbstractObjectFactory
All Implemented Interfaces:
Instrumentable, org.d_haven.mpool.ObjectFactory
Direct Known Subclasses:
NoopObjectFactory, ProxyObjectFactory, WrapperObjectFactory

public abstract class AbstractObjectFactory
extends java.lang.Object
implements org.d_haven.mpool.ObjectFactory, Instrumentable

AbstractObjectFactory does XYZ

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

Field Summary
protected  org.d_haven.mpool.ObjectFactory m_delegateFactory
          The ObjectFactory proper we delegate all calls to.
 
Fields inherited from interface org.apache.excalibur.instrument.Instrumentable
EMPTY_INSTRUMENT_ARRAY, EMPTY_INSTRUMENTABLE_ARRAY
 
Constructor Summary
AbstractObjectFactory(org.d_haven.mpool.ObjectFactory objectFactory)
           
 
Method Summary
abstract  void dispose(java.lang.Object object)
           
 Instrumentable[] getChildInstrumentables()
          Any Object which implements Instrumentable can also make use of other Instrumentable child objects.
 java.lang.Class getCreatedClass()
           
 java.lang.String getInstrumentableName()
          Gets the name of the Instrumentable.
 Instrument[] getInstruments()
          Obtain a reference to all the Instruments that the Instrumentable object wishes to expose.
protected static java.lang.Class[] guessWorkInterfaces(java.lang.Class clazz)
          Get a list of interfaces to proxy by scanning through all interfaces a class implements and skipping invalid interfaces (as defined in #INVALID_INTERFACES).
abstract  java.lang.Object newInstance()
           
 void setInstrumentableName(java.lang.String name)
          Sets the name for the Instrumentable.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_delegateFactory

protected final org.d_haven.mpool.ObjectFactory m_delegateFactory
The ObjectFactory proper we delegate all calls to.

Constructor Detail

AbstractObjectFactory

public AbstractObjectFactory(org.d_haven.mpool.ObjectFactory objectFactory)
Method Detail

newInstance

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

getCreatedClass

public final java.lang.Class getCreatedClass()
Specified by:
getCreatedClass in interface org.d_haven.mpool.ObjectFactory
See Also:
ObjectFactory.getCreatedClass()

dispose

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

setInstrumentableName

public final void setInstrumentableName(java.lang.String name)
Description copied from interface: Instrumentable
Sets the name for the Instrumentable. The Instrumentable Name is used to uniquely identify the Instrumentable during the configuration of the InstrumentManager and to gain access to an InstrumentableDescriptor through the InstrumentManager. The value should be a string which does not contain spaces or periods.

This value may be set by a parent Instrumentable, or by the InstrumentManager using the value of the 'instrumentable' attribute in the configuration of the component.

Specified by:
setInstrumentableName in interface Instrumentable
Parameters:
name - The name used to identify a Instrumentable.

getInstrumentableName

public final java.lang.String getInstrumentableName()
Description copied from interface: Instrumentable
Gets the name of the Instrumentable.

Specified by:
getInstrumentableName in interface Instrumentable
Returns:
The name used to identify a Instrumentable.

getInstruments

public final Instrument[] getInstruments()
Description copied from interface: Instrumentable
Obtain a reference to all the Instruments that the Instrumentable object wishes to expose. All sampling is done directly through the Instruments as opposed to the Instrumentable interface.

Specified by:
getInstruments in interface Instrumentable
Returns:
An array of the Instruments available for profiling. Should never be null. If there are no Instruments, then EMPTY_INSTRUMENT_ARRAY can be returned. This should never be the case though unless there are child Instrumentables with Instruments.

getChildInstrumentables

public final Instrumentable[] getChildInstrumentables()
Description copied from interface: Instrumentable
Any Object which implements Instrumentable can also make use of other Instrumentable child objects. This method is used to tell the InstrumentManager about them.

Specified by:
getChildInstrumentables in interface Instrumentable
Returns:
An array of child Instrumentables. This method should never return null. If there are no child Instrumentables, then EMPTY_INSTRUMENTABLE_ARRAY can be returned.

guessWorkInterfaces

protected static java.lang.Class[] guessWorkInterfaces(java.lang.Class clazz)
Get a list of interfaces to proxy by scanning through all interfaces a class implements and skipping invalid interfaces (as defined in #INVALID_INTERFACES).

Parameters:
clazz - the class
Returns:
the list of interfaces to proxy


Copyright © 1997-2005 The Apache Software Foundation. All Rights Reserved.