while ( i.hasNext() )
{
entry = (ComponentHandlerEntry) i.next();
try
{
final ComponentHandler handler = entry.getHandler();
// Depending on the activation policy of the component decide
// how to initialize the component. Make sure that we can
// perform the specified activation policy, if not modify it.
int activation = entry.getMetaData().getActivation();
if ( activation == ComponentHandlerMetaData.ACTIVATION_BACKGROUND )
{
// If a sink is not set then we must change to inline.
if ( null == m_commandSink )
{
activation = ComponentHandlerMetaData.ACTIVATION_INLINE;
}
}
// We now have an activation policy we can handle.
switch ( activation )
{
case ComponentHandlerMetaData.ACTIVATION_BACKGROUND:
// Add a command to initialize the component to the command
// sink so it will be initialized asynchronously in the
// background.
final PrepareHandlerCommand element =
new PrepareHandlerCommand( handler, getLogger() );
m_commandSink.enqueue( element );
break;
case ComponentHandlerMetaData.ACTIVATION_INLINE:
// Initialize the component now.
handler.prepareHandler();
break;
default: // ComponentHandlerMetaData.ACTIVATION_LAZY
if ( getLogger().isDebugEnabled() )
{