Groovy Documentation

src.java
Class DefaultThreadFactory

java.lang.Object
  src.java.DefaultThreadFactory
All Implemented Interfaces:
java.util.concurrent.ThreadFactory

class DefaultThreadFactory

Provides a standard way to create new threads. The created threads get their daemons flags set as well as their priority is set to Thread.MIN_PRIORITY. Instance of this thread factory is used by the BackgroundThreadManager by default. You can supply your own thread factory by altering the resources.groovy file the following way:

 bgThreadFactory(my.package.MyThreadFactory)
 
Bear in mind that all created threads are required to have the uncaughtExceptionHandler property set by the thread factory.


Field Summary
private def handler

private AtomicLong threadIdSource

 
Constructor Summary
DefaultThreadFactory()

 
Method Summary
def getExceptionHandler()

java.lang.Thread newThread(java.lang.Runnable r)

void setExceptionHandler(def newHandler)

 
Methods inherited from class java.lang.Object
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll
 

Field Detail

handler

private def handler


threadIdSource

private final AtomicLong threadIdSource


 
Constructor Detail

DefaultThreadFactory

DefaultThreadFactory()


 
Method Detail

getExceptionHandler

public def getExceptionHandler()


newThread

public java.lang.Thread newThread(java.lang.Runnable r)


setExceptionHandler

@Required
public void setExceptionHandler(def newHandler)


 

Groovy Documentation