public boolean initialize(SubSystem subSystem) {
if (this.state == STATE_CONFIGURED)
{
try
{
this.module.initialize(subSystem);
this.state = STATE_INITIALIZED;
return true;
}
catch (NoClassDefFoundError noClassDef)
{
Log.warn (new Log.SimpleMessage("Unable to load module classes for ",
this.module.getName(), ":", noClassDef.getMessage()));
this.state = STATE_ERROR;
}
catch (ModuleInitializeException me)
{
if (Log.isDebugEnabled())
{
// its still worth a warning, but now we are more verbose ...
Log.warn("Unable to initialize the module " + this.module.getName(), me);
}
else if (Log.isWarningEnabled())
{
Log.warn("Unable to initialize the module " + this.module.getName());
}
this.state = STATE_ERROR;
}
catch (Exception e)
{
if (Log.isDebugEnabled())
{
// its still worth a warning, but now we are more verbose ...
Log.warn("Unable to initialize the module " + this.module.getName(), e);
}
else if (Log.isWarningEnabled())
{
Log.warn("Unable to initialize the module " + this.module.getName());
}
this.state = STATE_ERROR;
}
}
return false;
}
Initializes the contained module and raises the set of the module to
STATE_INITIALIZED, if the module was not yet initialized. In case of an
error, the module state will be set to STATE_ERROR and the module will
not be available. |