* @param context a <code>Context</code> value
* @exception ContextException if an error occurs
*/
public void contextualize(Context context) throws ContextException {
if (this.context == null) {
this.context = new DefaultContext(context);
try
{
DefaultContext setup = (DefaultContext)this.context;
threads = new TPCThreadManager();
CommandManager commands = new CommandManager();
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(threads, getLogger().getChildLogger("thread.manager"));
ContainerUtil.parameterize(threads, params);
ContainerUtil.initialize(threads);
threads.register(commands);
setup.put(Queue.ROLE, commands.getCommandSink());
setup.makeReadOnly();
}
catch (Exception e)
{
getLogger().error("Could not set up the Command Manager", e);
}