Groovy Documentation

src.java
Class BackgroundThreadManager

java.lang.Object
  src.java.BackgroundThreadManager

class BackgroundThreadManager

Field Summary
private static Logger log

private BlockingQueue queue

private SessionFactory sessionFactory

private AtomicBoolean stop

private AtomicInteger tasksPerDrain

private AtomicInteger threadCount

private ThreadFactory threadFactory

 
Constructor Summary
BackgroundThreadManager()

 
Method Summary
private boolean bindSession()

protected java.lang.Thread createNewQueueThread()

protected java.lang.Thread createNewThread(java.lang.Runnable r)

protected java.lang.Runnable createRunnable()

private static void fireThreadException(java.lang.Exception e)

BlockingQueue getQueue()

SessionFactory getSessionFactory()

int getTasksPerDrain()

int getThreadCount()

ThreadFactory getThreadFactory()

private static boolean missesExplicitExceptionHandler(java.lang.Thread thread)

Checks whether the current thread has an exception handler set, which is different from the implicit one (i.e. thread's thread group)

private java.lang.Runnable nextRunnable(List tasks, int size)

void queueRunnable(java.lang.Runnable r)

void setQueue(BlockingQueue newQueue)

void setSessionFactory(SessionFactory newSessionFactory)

void setTasksPerDrain(int newTasksPerDrain)

void setThreadCount(int newThreadCount)

void setThreadFactory(ThreadFactory threadFactory)

void start()

void stop()

private void unbindSession()

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

Field Detail

log

private static final Logger log


queue

private BlockingQueue queue


sessionFactory

private SessionFactory sessionFactory


stop

private final AtomicBoolean stop


tasksPerDrain

private final AtomicInteger tasksPerDrain


threadCount

private final AtomicInteger threadCount


threadFactory

private ThreadFactory threadFactory


 
Constructor Detail

BackgroundThreadManager

BackgroundThreadManager()


 
Method Detail

bindSession

private boolean bindSession()


createNewQueueThread

protected java.lang.Thread createNewQueueThread()


createNewThread

protected java.lang.Thread createNewThread(java.lang.Runnable r)


createRunnable

protected java.lang.Runnable createRunnable()


fireThreadException

private static void fireThreadException(java.lang.Exception e)


getQueue

public BlockingQueue getQueue()


getSessionFactory

public SessionFactory getSessionFactory()


getTasksPerDrain

public int getTasksPerDrain()


getThreadCount

public int getThreadCount()


getThreadFactory

public ThreadFactory getThreadFactory()


missesExplicitExceptionHandler

private static boolean missesExplicitExceptionHandler(java.lang.Thread thread)
Checks whether the current thread has an exception handler set, which is different from the implicit one (i.e. thread's thread group)
param:
thread The thread to investigate
return:
True if the thead doesn't have an explicit exception handler set


nextRunnable

private java.lang.Runnable nextRunnable(List tasks, int size)


queueRunnable

public void queueRunnable(java.lang.Runnable r)


setQueue

@Required
public void setQueue(BlockingQueue newQueue)


setSessionFactory

@Required
public void setSessionFactory(SessionFactory newSessionFactory)


setTasksPerDrain

public void setTasksPerDrain(int newTasksPerDrain)


setThreadCount

public void setThreadCount(int newThreadCount)


setThreadFactory

@Required
public void setThreadFactory(ThreadFactory threadFactory)


start

public void start()


stop

public void stop()


unbindSession

private void unbindSession()


 

Groovy Documentation