org.apache.cocoon.thread.impl
Class DefaultThreadFactory

java.lang.Object
  extended byorg.apache.cocoon.thread.impl.DefaultThreadFactory
All Implemented Interfaces:
EDU.oswego.cs.dl.util.concurrent.ThreadFactory, org.apache.cocoon.thread.ThreadFactory

public class DefaultThreadFactory
extends Object
implements org.apache.cocoon.thread.ThreadFactory, EDU.oswego.cs.dl.util.concurrent.ThreadFactory

This class is responsible to create new Thread instances to run a command.

Version:
$Id: DefaultThreadFactory.html 1304280 2012-03-23 11:18:01Z ilgrosso $

Constructor Summary
DefaultThreadFactory()
           
 
Method Summary
 int getPriority()
          Get the priority newly created Threads will have
 boolean isDaemon()
          Get the isDaemon property
 Thread newThread(Runnable command)
          Create a new Thread for Runnable
 void setDaemon(boolean isDaemon)
          Set the isDaemon property
 void setPriority(int priority)
          Set the priority newly created Threads should have
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultThreadFactory

public DefaultThreadFactory()
Method Detail

setDaemon

public void setDaemon(boolean isDaemon)
Set the isDaemon property

Specified by:
setDaemon in interface org.apache.cocoon.thread.ThreadFactory
Parameters:
isDaemon - Whether or not new Thread should run as daemons.

isDaemon

public boolean isDaemon()
Get the isDaemon property

Specified by:
isDaemon in interface org.apache.cocoon.thread.ThreadFactory
Returns:
Whether or not new Thread will run as daemons.

setPriority

public void setPriority(int priority)
Set the priority newly created Threads should have

Specified by:
setPriority in interface org.apache.cocoon.thread.ThreadFactory
Parameters:
priority - One of Thread.MIN_PRIORITY, Thread.NORM_PRIORITY, Thread.MAX_PRIORITY

getPriority

public int getPriority()
Get the priority newly created Threads will have

Specified by:
getPriority in interface org.apache.cocoon.thread.ThreadFactory
Returns:
One of Thread.MIN_PRIORITY, Thread.NORM_PRIORITY, Thread.MAX_PRIORITY

newThread

public Thread newThread(Runnable command)
Create a new Thread for Runnable

Specified by:
newThread in interface org.apache.cocoon.thread.ThreadFactory
Parameters:
command - The Runnable
Returns:
A new Thread instance


Copyright 1999-2008 The Apache Software Foundation. All Rights Reserved.