org.apache.fulcrum.testcontainer
Class YAAFIContainer

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.fulcrum.testcontainer.YAAFIContainer
All Implemented Interfaces:
org.apache.avalon.framework.activity.Disposable, org.apache.avalon.framework.activity.Initializable, org.apache.avalon.framework.logger.LogEnabled, Container

public class YAAFIContainer
extends org.apache.avalon.framework.logger.AbstractLogEnabled
implements Container

This is a simple YAAFI based container that can be used in unit test of the fulcrum components.

Author:
Siegfried Goeschl

Field Summary
 
Fields inherited from interface org.apache.fulcrum.testcontainer.Container
COMPONENT_APP_ROOT, URN_AVALON_HOME, URN_AVALON_TEMP
 
Constructor Summary
YAAFIContainer()
          Constructor
 
Method Summary
 void dispose()
          Disposes of the container and releases resources
 void initialize()
          Initializes the container
 java.lang.Object lookup(java.lang.String roleName)
          Returns an instance of the named component
 void release(org.apache.avalon.framework.component.Component component)
          Releases the component implementing the Component interface.
 void release(java.lang.Object component)
          Releases the component
 void startup(java.lang.String configFileName, java.lang.String roleFileName, java.lang.String parametersFileName)
          Starts up the container and initializes it.
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

YAAFIContainer

public YAAFIContainer()
Constructor

Method Detail

startup

public void startup(java.lang.String configFileName,
                    java.lang.String roleFileName,
                    java.lang.String parametersFileName)
Starts up the container and initializes it.

Specified by:
startup in interface Container
Parameters:
configFileName - Name of the component configuration file
roleFileName - Name of the role configuration file

initialize

public void initialize()
                throws java.lang.Exception
Initializes the container

Specified by:
initialize in interface org.apache.avalon.framework.activity.Initializable
Throws:
java.lang.Exception - generic exception

dispose

public void dispose()
Disposes of the container and releases resources

Specified by:
dispose in interface org.apache.avalon.framework.activity.Disposable

lookup

public java.lang.Object lookup(java.lang.String roleName)
                        throws org.apache.avalon.framework.component.ComponentException
Returns an instance of the named component

Specified by:
lookup in interface Container
Parameters:
roleName - Name of the role the component fills.
Throws:
org.apache.avalon.framework.component.ComponentException - generic exception

release

public void release(org.apache.avalon.framework.component.Component component)
Releases the component implementing the Component interface. This interface is depracted but still around in Fulcrum

Parameters:
component -

release

public void release(java.lang.Object component)
Releases the component

Specified by:
release in interface Container
Parameters:
component -


Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.