373272: maintain the start order of aggregate beans when adding a thread pool

This commit is contained in:
Greg Wilkins 2012-03-06 11:47:18 +11:00
parent 01ffa7cc48
commit de8a1b3fe4
2 changed files with 15 additions and 1 deletions

View File

@ -80,6 +80,15 @@ public class SelectChannelConnector extends AbstractNIOConnector
setAcceptors(Math.max(1,(Runtime.getRuntime().availableProcessors()+3)/4));
}
@Override
public void setThreadPool(ThreadPool pool)
{
super.setThreadPool(pool);
// preserve start order
removeBean(_manager);
addBean(_manager,true);
}
/* ------------------------------------------------------------ */
@Override
public void accept(int acceptorID) throws IOException

View File

@ -39,6 +39,11 @@ public class AggregateLifeCycle extends AbstractLifeCycle implements Destroyable
}
final Object _bean;
volatile boolean _managed=true;
public String toString()
{
return "{"+_bean+","+_managed+"}";
}
}
/* ------------------------------------------------------------ */