/**
* @see java.lang.Runnable#run()
*/
public void run()
{
KeelRequest dsreq = new ModelRequestMessage();
if (! isInitialized())
{
try
{
keelContainer = getContainer();
getLogger().info("Started");
// String mto = System.getProperty ("model.timeout");
//
// if (mto != null)
// {
// try
// {
// int newTimeOut = new Integer(mto).intValue ();
// timeout = newTimeOut;
// }
// catch (Exception e)
// {
// getLogger ().warn ("Unable to set model timeout to '" + mto + "'");
// }
// }
// int initPoolSize = 1;
// int minPoolSize = 1;
// int maxPoolSize = Integer.MAX_VALUE;
// int keepAliveTime = 60 * 1000;
//
// try
// {
// minPoolSize = Integer.parseInt (
// System.getProperty ("keel.processor.threads.min"));
// }
// catch (NumberFormatException x)
// {
// }
//
// try
// {
// maxPoolSize = Integer.parseInt (
// System.getProperty ("keel.processor.threads.max"));
// }
// catch (NumberFormatException x)
// {
// }
//
// try
// {
// initPoolSize = Integer.parseInt (
// System.getProperty ("keel.processor.threads.init"));
// }
// catch (NumberFormatException x)
// {
// }
// pool = new ThreadPoolExecutor(
// minPoolSize, maxPoolSize, keepAliveTime, TimeUnit.MILLISECONDS,
// new SynchronousQueue());
}
catch (Exception ee)
{
getLogger().error("Startup error:", ee);
heldError = ee;
throw new RuntimeException(LOG_PREFIX + "Startup Error", ee);
}
}
while (keepRunningKeelDirectServer)
{
KeelRequest request;
try
{
//There's only one thread taking objects off the requestQueue, so this doesn't need to be synced
byte[] requestBytes = (byte[]) requestChannel.take();
LinkedBlockingQueue replyChannel = (LinkedBlockingQueue) requestChannel.take();
if (keepRunningKeelDirectServer == false)
{
continue;
}
request = dsreq.deserialize(requestBytes);
// MultiThreadedProcessor processor =
// new MultiThreadedProcessor(request, replyChannel);
// pool.execute (processor);