private String getMultiLineStatusString(int initial_indent)
{
try
{
StringWriter sw = new StringWriter(2048);
IndentedWriter iw = new IndentedWriter( sw );
for (int i = 0; i < initial_indent; ++i)
iw.upIndent();
if (managed == null)
{
iw.print("[");
iw.print( this );
iw.println(" closed.]");
}
else
{
HashSet active = (HashSet) managed.clone();
active.removeAll( available );
iw.print("Managed Threads: ");
iw.println( managed.size() );
iw.print("Active Threads: ");
iw.println( active.size() );
iw.println("Active Tasks: ");
iw.upIndent();
for (Iterator ii = active.iterator(); ii.hasNext(); )
{
PoolThread pt = (PoolThread) ii.next();
iw.print( pt.getCurrentTask() );
iw.print( " (");
iw.print( pt.getName() );
iw.println(')');
}
iw.downIndent();
iw.println("Pending Tasks: ");
iw.upIndent();
for (int i = 0, len = pendingTasks.size(); i < len; ++i)
iw.println( pendingTasks.get( i ) );
iw.downIndent();
}
for (int i = 0; i < initial_indent; ++i)
iw.downIndent();
iw.flush(); // useless, but I feel better
String out = sw.toString();
iw.close(); // useless, but I feel better;
return out;
}
catch (IOException e)
{
if (logger.isLoggable( MLevel.WARNING ))