public void contextualize(Context context) throws ContextException {
if (this.context == null) {
this.context = new ComponentContext(context);
try {
DefaultContext setup = (DefaultContext)this.context;
this.threads = new TPCThreadManager();
Parameters params = new Parameters();
params.setParameter("threads-per-processor", "1");
params.setParameter("sleep-time", "100");
params.setParameter("block-timeout", "1000");
params.setParameter("force-shutdown", "false");
params.makeReadOnly();
ContainerUtil.enableLogging(this.threads, getLogger().getChildLogger("thread.manager"));
ContainerUtil.parameterize(this.threads, params);
ContainerUtil.initialize(this.threads);
this.commands = new CommandManager();
ContainerUtil.enableLogging(this.commands, getLogger().getChildLogger("thread.manager"));
this.threads.register(this.commands);
setup.put(Queue.ROLE, this.commands.getCommandSink());
setup.makeReadOnly();
} catch (Exception e) {
getLogger().error("Could not set up the Command Manager", e);
}
this.classpath = (String)context.get(Constants.CONTEXT_CLASSPATH);