org.apache.avalon.excalibur.component
Class ExcaliburComponentManagerCreator

java.lang.Object
  extended byorg.apache.avalon.excalibur.component.ExcaliburComponentManagerCreator
All Implemented Interfaces:
Disposable

Deprecated. ECM is no longer supported

public class ExcaliburComponentManagerCreator
extends java.lang.Object
implements Disposable

Utility class which can be used to manage the life cycle of a ComponentManager and its RoleManager, LoggerManager, and optional InstrumentManager.

The code necessary to manage all of the above can be reduced to the following:

     m_componentManagerCreator = new ExcaliburComponentManagerCreator(
                                          null,  // Optional Context
                                          new File( "../conf/logkit.xml" ),
                                          new File( "../conf/roles.xml" ),
                                          new File( "../conf/components.xml"),
                                          new File( "../conf/instrument.xml" ) );
 
Then simply remember to dispose of the creator when the application shuts down.
     m_componentManagerCreator.dispose();
     m_componentManagerCreator = null;
 
The ServiceManager (ComponentManager) or any of the other managers can be accessed using their getter methods. getServiceManager() for example. Note that while the ComponentManager is still available, it has been deprecated in favor of the ServiceManager interface.

Since:
4.2
Version:
CVS $Revision: 1.4 $ $Date: 2004/02/28 11:47:14 $
Author:
Avalon Development Team

Constructor Summary
ExcaliburComponentManagerCreator(Context context, Configuration loggerManagerConfig, Configuration roleManagerConfig, Configuration componentManagerConfig, Configuration instrumentManagerConfig)
          Deprecated. Create a new ExcaliburComponentManagerCreator using Configuration objects.
ExcaliburComponentManagerCreator(Context context, java.io.File loggerManagerConfigFile, java.io.File roleManagerConfigFile, java.io.File componentManagerConfigFile, java.io.File instrumentManagerConfigFile)
          Deprecated. Create a new ExcaliburComponentManagerCreator using Files.
ExcaliburComponentManagerCreator(Context context, java.io.InputStream loggerManagerConfigStream, java.io.InputStream roleManagerConfigStream, java.io.InputStream componentManagerConfigStream, java.io.InputStream instrumentManagerConfigStream)
          Deprecated. Create a new ExcaliburComponentManagerCreator using Input Streams.
 
Method Summary
 void dispose()
          Deprecated. Disposes the component manager creator along with the CompoentManager and other managers which it was responsible for creating.
 ComponentManager getComponentManager()
          Deprecated. The ComponentManager interface has been deprecated. Please use the getServiceManager method.
 InstrumentManager getInstrumentManager()
          Deprecated. Returns the configured InstrumentManager.
 LoggerManager getLoggerManager()
          Deprecated. Returns the configured LoggerManager.
 ServiceManager getServiceManager()
          Deprecated. Returns the configured ServiceManager.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExcaliburComponentManagerCreator

public ExcaliburComponentManagerCreator(Context context,
                                        Configuration loggerManagerConfig,
                                        Configuration roleManagerConfig,
                                        Configuration componentManagerConfig,
                                        Configuration instrumentManagerConfig)
                                 throws java.lang.Exception
Deprecated. 
Create a new ExcaliburComponentManagerCreator using Configuration objects.

Parameters:
context - Context to use when creating the ComponentManager. May be null.
loggerManagerConfig - Configuration object to use to create a LoggerManager.
roleManagerConfig - Configuration object to use to create a RoleManager.
componentManagerConfig - Configuration object to use to create a ComponentManager.
instrumentManagerConfig - Configuration object to use to create an InstrumentManager. May be null.
Throws:
java.lang.Exception - If there were any problems initializing the ComponentManager.

ExcaliburComponentManagerCreator

public ExcaliburComponentManagerCreator(Context context,
                                        java.io.InputStream loggerManagerConfigStream,
                                        java.io.InputStream roleManagerConfigStream,
                                        java.io.InputStream componentManagerConfigStream,
                                        java.io.InputStream instrumentManagerConfigStream)
                                 throws java.lang.Exception
Deprecated. 
Create a new ExcaliburComponentManagerCreator using Input Streams.

Parameters:
context - Context to use when creating the ComponentManager. May be null.
loggerManagerConfigStream - InputStream from which to read the Configuration object to use to create a LoggerManager.
roleManagerConfigStream - InputStream from which to read the Configuration object to use to create a RoleManager.
componentManagerConfigStream - InputStream from which to read the Configuration object to use to create a ComponentManager.
instrumentManagerConfigStream - InputStream from which to read the Configuration object to use to create a InstrumentManager. May be null.
Throws:
java.lang.Exception - If there were any problems initializing the ComponentManager.

ExcaliburComponentManagerCreator

public ExcaliburComponentManagerCreator(Context context,
                                        java.io.File loggerManagerConfigFile,
                                        java.io.File roleManagerConfigFile,
                                        java.io.File componentManagerConfigFile,
                                        java.io.File instrumentManagerConfigFile)
                                 throws java.lang.Exception
Deprecated. 
Create a new ExcaliburComponentManagerCreator using Files.

Parameters:
context - Context to use when creating the ComponentManager. May be null.
loggerManagerConfigFile - File from which to read the Configuration object to use to create a LoggerManager.
roleManagerConfigFile - File from which to read the Configuration object to use to create a RoleManager.
componentManagerConfigFile - File from which to read the Configuration object to use to create a ComponentManager.
instrumentManagerConfigFile - File from which to read the Configuration object to use to create a InstrumentManager. May be null.
Throws:
java.lang.Exception - If there were any problems initializing the ComponentManager.
Method Detail

dispose

public void dispose()
Deprecated. 
Disposes the component manager creator along with the CompoentManager and other managers which it was responsible for creating.

Specified by:
dispose in interface Disposable

getLoggerManager

public LoggerManager getLoggerManager()
Deprecated. 
Returns the configured LoggerManager.

Returns:
The configured LoggerManager.

getInstrumentManager

public InstrumentManager getInstrumentManager()
Deprecated. 
Returns the configured InstrumentManager. May be null if an instrument configuration was not specified in the constructor.

Returns:
The configured InstrumentManager.

getComponentManager

public ComponentManager getComponentManager()
Deprecated. The ComponentManager interface has been deprecated. Please use the getServiceManager method.

Returns the configured ComponentManager.

Returns:
The configured ComponentManager.

getServiceManager

public ServiceManager getServiceManager()
Deprecated. 
Returns the configured ServiceManager.

Returns:
The configured ServiceManager.


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