org.apache.cocoon.components.thread
Class DefaultThreadFactory

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

public class DefaultThreadFactory
extends Object
implements 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 1304258 2012-03-23 10:09:27Z ilgrosso $
Author:
Otego AG, Switzerland

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

Parameters:
isDaemon - Whether or not new Thread should run as daemons.

isDaemon

public boolean isDaemon()
Get the isDaemon property

Returns:
Whether or not new Thread will run as daemons.

setPriority

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

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

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 EDU.oswego.cs.dl.util.concurrent.ThreadFactory
Parameters:
command - The Runnable
Returns:
A new Thread instance


Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.