This is a convenient way to use managed threads when running in a Java EE 7
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.
Set whether the lookup occurs in a Java EE container, i.e. if the prefix
"java:comp/env/" needs to be added if the JNDI name doesn't already
contain it. PersistenceAnnotationBeanPostProcessor's default is "true".