类 DefaultManagedAwareThreadFactory

java.lang.Object
cn.taketoday.util.CustomizableThreadCreator
cn.taketoday.scheduling.concurrent.CustomizableThreadFactory
cn.taketoday.scheduling.concurrent.DefaultManagedAwareThreadFactory
所有已实现的接口:
InitializingBean, Serializable, ThreadFactory

public class DefaultManagedAwareThreadFactory extends CustomizableThreadFactory implements InitializingBean
JNDI-based variant of CustomizableThreadFactory, performing a default lookup for JSR-236's "java:comp/DefaultManagedThreadFactory" in a Jakarta EE environment, falling back to the local CustomizableThreadFactory setup if not found.

This is a convenient way to use managed threads when running in a Jakarta EE environment, simply using regular local threads otherwise - without conditional setup (i.e. without profiles).

Note: This class is not strictly JSR-236 based; it can work with any regular ThreadFactory that can be found in JNDI. Therefore, the default JNDI name "java:comp/DefaultManagedThreadFactory" can be customized through the "jndiName" bean property.

从以下版本开始:
4.0
作者:
Juergen Hoeller
另请参阅:
  • 字段概要

    字段
    修饰符和类型
    字段
    说明
    protected final cn.taketoday.logging.Logger
     
  • 构造器概要

    构造器
    构造器
    说明
     
  • 方法概要

    修饰符和类型
    方法
    说明
    void
     
    newThread(Runnable runnable)
     
    void
    setJndiEnvironment(Properties jndiEnvironment)
    Set the JNDI environment to use for JNDI lookups.
    void
    setJndiName(String jndiName)
    Specify a JNDI name of the ThreadFactory to delegate to, replacing the default JNDI name "java:comp/DefaultManagedThreadFactory".
    void
    Set the JNDI template to use for JNDI lookups.
    void
    setResourceRef(boolean resourceRef)
    Set whether the lookup occurs in a Jakarta EE container, i.e. if the prefix "java:comp/env/" needs to be added if the JNDI name doesn't already contain it.

    从类继承的方法 cn.taketoday.util.CustomizableThreadCreator

    createThread, getDefaultThreadNamePrefix, getThreadGroup, getThreadNamePrefix, getThreadPriority, isDaemon, nextThreadName, setDaemon, setThreadGroup, setThreadGroupName, setThreadNamePrefix, setThreadPriority

    从类继承的方法 java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait