public class ExcaliburComponentManagerCreator
extends java.lang.Object
implements org.apache.avalon.framework.activity.Disposable
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.| Modifier and Type | Field and Description |
|---|---|
private org.apache.avalon.framework.component.ComponentManager |
m_componentManager
Deprecated.
Internal component manager.
|
private org.apache.avalon.framework.context.Context |
m_context
Deprecated.
Context to create the ComponentManager with.
|
private org.apache.excalibur.instrument.InstrumentManager |
m_instrumentManager
Deprecated.
Internal instrument manager.
|
private org.apache.avalon.framework.logger.Logger |
m_logger
Deprecated.
Internal logger set once the LoggerManager has been initialized.
|
private org.apache.avalon.excalibur.logger.LoggerManager |
m_loggerManager
Deprecated.
Internal logger manager.
|
private org.apache.avalon.framework.logger.Logger |
m_primordialLogger
Deprecated.
Simple logger which can be used until the LoggerManager has been setup.
|
private RoleManager |
m_roleManager
Deprecated.
Internal role manager.
|
private org.apache.avalon.framework.service.ServiceManager |
m_serviceManager
Deprecated.
Internal service manager.
|
| Constructor and Description |
|---|
ExcaliburComponentManagerCreator(org.apache.avalon.framework.context.Context context,
org.apache.avalon.framework.configuration.Configuration loggerManagerConfig,
org.apache.avalon.framework.configuration.Configuration roleManagerConfig,
org.apache.avalon.framework.configuration.Configuration componentManagerConfig,
org.apache.avalon.framework.configuration.Configuration instrumentManagerConfig)
Deprecated.
Create a new ExcaliburComponentManagerCreator using Configuration
objects.
|
ExcaliburComponentManagerCreator(org.apache.avalon.framework.context.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(org.apache.avalon.framework.context.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.
|
| Modifier and Type | Method and Description |
|---|---|
private static org.apache.avalon.framework.context.Context |
createDefaultContext()
Deprecated.
Creates and initializes a default context.
|
void |
dispose()
Deprecated.
Disposes the component manager creator along with the CompoentManager
and other managers which it was responsible for creating.
|
org.apache.avalon.framework.component.ComponentManager |
getComponentManager()
Deprecated.
The ComponentManager interface has been deprecated.
Please use the getServiceManager method.
|
org.apache.excalibur.instrument.InstrumentManager |
getInstrumentManager()
Deprecated.
Returns the configured InstrumentManager.
|
private org.apache.avalon.framework.logger.Logger |
getLogger()
Deprecated.
Returns the logger for internal use.
|
org.apache.avalon.excalibur.logger.LoggerManager |
getLoggerManager()
Deprecated.
Returns the configured LoggerManager.
|
org.apache.avalon.framework.service.ServiceManager |
getServiceManager()
Deprecated.
Returns the configured ServiceManager.
|
private void |
initializeComponentManager(org.apache.avalon.framework.configuration.Configuration componentManagerConfig)
Deprecated.
|
private void |
initializeInstrumentManager(org.apache.avalon.framework.configuration.Configuration instrumentManagerConfig)
Deprecated.
|
private void |
initializeLoggerManager(org.apache.avalon.framework.configuration.Configuration loggerManagerConfig)
Deprecated.
|
private void |
initializeRoleManager(org.apache.avalon.framework.configuration.Configuration roleManagerConfig)
Deprecated.
|
private static org.apache.avalon.framework.configuration.Configuration |
readConfigurationFromFile(java.io.File file)
Deprecated.
Creates a Configuration object from data read from an InputStream.
|
private static org.apache.avalon.framework.configuration.Configuration |
readConfigurationFromStream(java.io.InputStream is)
Deprecated.
Creates a Configuration object from data read from an InputStream.
|
private org.apache.avalon.framework.logger.Logger m_logger
private final org.apache.avalon.framework.logger.Logger m_primordialLogger
private org.apache.avalon.framework.context.Context m_context
private org.apache.avalon.excalibur.logger.LoggerManager m_loggerManager
private RoleManager m_roleManager
private org.apache.avalon.framework.component.ComponentManager m_componentManager
private org.apache.avalon.framework.service.ServiceManager m_serviceManager
private org.apache.excalibur.instrument.InstrumentManager m_instrumentManager
public ExcaliburComponentManagerCreator(org.apache.avalon.framework.context.Context context,
org.apache.avalon.framework.configuration.Configuration loggerManagerConfig,
org.apache.avalon.framework.configuration.Configuration roleManagerConfig,
org.apache.avalon.framework.configuration.Configuration componentManagerConfig,
org.apache.avalon.framework.configuration.Configuration instrumentManagerConfig)
throws java.lang.Exception
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.java.lang.Exception - If there were any problems initializing the
ComponentManager.public ExcaliburComponentManagerCreator(org.apache.avalon.framework.context.Context context,
java.io.InputStream loggerManagerConfigStream,
java.io.InputStream roleManagerConfigStream,
java.io.InputStream componentManagerConfigStream,
java.io.InputStream instrumentManagerConfigStream)
throws java.lang.Exception
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.java.lang.Exception - If there were any problems initializing the
ComponentManager.public ExcaliburComponentManagerCreator(org.apache.avalon.framework.context.Context context,
java.io.File loggerManagerConfigFile,
java.io.File roleManagerConfigFile,
java.io.File componentManagerConfigFile,
java.io.File instrumentManagerConfigFile)
throws java.lang.Exception
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.java.lang.Exception - If there were any problems initializing the
ComponentManager.private static org.apache.avalon.framework.context.Context createDefaultContext()
private static org.apache.avalon.framework.configuration.Configuration readConfigurationFromStream(java.io.InputStream is)
throws java.lang.Exception
is - InputStream from which the Configuration is created.java.lang.Exception - If the configuration could not be processed.private static org.apache.avalon.framework.configuration.Configuration readConfigurationFromFile(java.io.File file)
throws java.lang.Exception
file - InputStream from which the Configuration is created.java.lang.Exception - If the configuration could not be read or processed.public void dispose()
dispose in interface org.apache.avalon.framework.activity.Disposablepublic org.apache.avalon.excalibur.logger.LoggerManager getLoggerManager()
public org.apache.excalibur.instrument.InstrumentManager getInstrumentManager()
public org.apache.avalon.framework.component.ComponentManager getComponentManager()
public org.apache.avalon.framework.service.ServiceManager getServiceManager()
private org.apache.avalon.framework.logger.Logger getLogger()
private void initializeLoggerManager(org.apache.avalon.framework.configuration.Configuration loggerManagerConfig)
throws java.lang.Exception
java.lang.Exceptionprivate void initializeRoleManager(org.apache.avalon.framework.configuration.Configuration roleManagerConfig)
throws java.lang.Exception
java.lang.Exceptionprivate void initializeInstrumentManager(org.apache.avalon.framework.configuration.Configuration instrumentManagerConfig)
throws java.lang.Exception
java.lang.Exceptionprivate void initializeComponentManager(org.apache.avalon.framework.configuration.Configuration componentManagerConfig)
throws java.lang.Exception
java.lang.Exception