Method from org.apache.geronimo.concurrent.thread.AbstractManagedThreadFactory Detail: |
protected ManagedThread createThread(ThreadGroup group,
Runnable runnable,
String name) {
return new ManagedThread(group, runnable, name, this);
}
|
public long getHungTaskThreshold() {
return this.hungTaskThreshold;
}
|
public ThreadGroup getThreadGroup() {
return this.threadGroup;
}
|
public int getThreadPriority() {
return this.threadPriority;
}
|
public boolean isDaemonThread() {
return this.daemonThread;
}
|
abstract public boolean isRunning()
|
public Thread newThread(Runnable runnable) {
if (!isRunning()) {
throw new IllegalArgumentException(
"Component that created this thread factory is no longer running");
}
String name = this.threadGroup.getName() + "-t" + this.threadNumber.getAndIncrement();
ManagedThread thread = createThread(this.threadGroup, runnable, name);
thread.setPriority(this.threadPriority);
thread.setDaemon(this.daemonThread);
thread.setHungTaskThreshold(this.hungTaskThreshold);
LOG.debug("Created thread: " + thread);
return thread;
}
|
public void setDaemonThread(boolean daemonThread) {
this.daemonThread = daemonThread;
}
|
public void setHungTaskThreshold(long hungTaskThreshold) {
if (hungTaskThreshold < 0) {
throw new IllegalArgumentException("Threshold must be zero or greater");
}
this.hungTaskThreshold = hungTaskThreshold;
}
|
public void setThreadGroup(String groupName) {
this.threadGroup = new ThreadGroup(getTheadGroupName(groupName));
}
|
public void setThreadPriority(int threadPriority) {
if (threadPriority < Thread.MIN_PRIORITY ||
threadPriority > Thread.MAX_PRIORITY) {
throw new IllegalArgumentException("Invalid thread priority: " + threadPriority);
}
this.threadPriority = threadPriority;
}
|
abstract public void shutdown()
|
public void threadStarted(Thread thread) {
}
|
public void threadStopped(Thread thread) {
}
|