Package org.apache.fulcrum.testcontainer
Class YAAFIContainer
java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
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,org.apache.fulcrum.yaafi.container.Container
public class YAAFIContainer
extends org.apache.avalon.framework.logger.AbstractLogEnabled
implements org.apache.fulcrum.yaafi.container.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.yaafi.container.Container
COMPONENT_APP_ROOT, URN_AVALON_HOME, URN_AVALON_TEMP -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddispose()Disposes of the container and releases resources.voidInitializes the container.Returns an instance of the named component.voidReleases the component.voidrelease(org.apache.avalon.framework.component.Component component) Releases the component implementing the Component interface.voidStarts up the container and initializes it.Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
Constructor Details
-
YAAFIContainer
public YAAFIContainer()Constructor. -
YAAFIContainer
public YAAFIContainer(int logLevel) Constructor.- Parameters:
logLevel- the log level to be used:ConsoleLoggerLEVEL_*.
-
-
Method Details
-
startup
Starts up the container and initializes it.- Specified by:
startupin interfaceorg.apache.fulcrum.yaafi.container.Container- Parameters:
configFileName- Name of the component configuration fileroleFileName- Name of the role configuration file
-
initialize
Initializes the container.- Specified by:
initializein interfaceorg.apache.avalon.framework.activity.Initializable- Throws:
Exception- generic exception
-
dispose
public void dispose()Disposes of the container and releases resources.- Specified by:
disposein interfaceorg.apache.avalon.framework.activity.Disposable
-
lookup
public Object lookup(String roleName) throws org.apache.avalon.framework.component.ComponentException Returns an instance of the named component.- Specified by:
lookupin interfaceorg.apache.fulcrum.yaafi.container.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 deprecated but still around in Fulcrum- Parameters:
component- instance of the component to release
-
release
Releases the component.- Specified by:
releasein interfaceorg.apache.fulcrum.yaafi.container.Container- Parameters:
component- component to be released
-