.newInstance( new Object[]{prefix} );
}
}
catch( Exception e )
{
throw new ConfigurationException( "Unable to create new logger manager for class " + className, e );
}
// now test for some lifecycle interfaces
ContainerUtil.enableLogging(m_loggermanager, m_logger );
try
{
ContainerUtil.contextualize( m_loggermanager, m_context );
}
catch( ContextException ce )
{
throw new ConfigurationException( "Unable to contextualize new logger manager.", ce );
}
try
{
ContainerUtil.service( m_loggermanager, m_manager );
}
catch (ServiceException se )
{
throw new ConfigurationException("Unable to service new logger manager.", se);
}
if( m_loggermanager instanceof Configurable )
{
( (Configurable)m_loggermanager ).configure( configuration.getChildren()[ 0 ] );
}
else if( m_loggermanager instanceof Parameterizable )
{
try
{
( (Parameterizable)m_loggermanager ).parameterize( Parameters.fromConfiguration( configuration.getChildren()[ 0 ] ) );
}
catch( ParameterException pe )
{
throw new ConfigurationException( "Unable to parameterize new logger manager.", pe );
}
}
try
{
ContainerUtil.initialize( m_loggermanager );
}
catch (Exception e )
{
throw new ConfigurationException("Unable to initialize new logger manager.");
}
}
else
{
// now test for role name
final String roleName = configuration.getAttribute( "manager-role", null );
if( null == roleName )
{
throw new ConfigurationException( "The LoggerManager needs either a manager-role or a manager-class" );
}
try
{
m_loggermanager = (LoggerManager)m_manager.lookup( roleName );
m_disposeManager = true;
}
catch( ServiceException e )
{
throw new ConfigurationException( "Unable to lookup logger manager with role " + roleName );
}
}
}