本文整理了Java中org.apache.commons.logging.LogFactory.directGetContextClassLoader()
方法的一些代码示例,展示了LogFactory.directGetContextClassLoader()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。LogFactory.directGetContextClassLoader()
方法的具体详情如下:
包路径:org.apache.commons.logging.LogFactory
类名称:LogFactory
方法名:directGetContextClassLoader
[英]Return the thread context class loader if available; otherwise return null.
Most/all code should call getContextClassLoader rather than calling this method directly.
The thread context class loader is available for JDK 1.2 or later, if certain security conditions are met.
Note that no internal logging is done within this method because this method is called every time LogFactory.getLogger() is called, and we don't want too much output generated here.
[中]返回线程上下文类加载器(如果可用);否则返回null。
大多数/所有代码都应该调用getContextClassLoader,而不是直接调用此方法。
如果满足某些安全条件,线程上下文类加载器可用于JDK 1.2或更高版本。
请注意,此方法中没有内部日志记录,因为每次LogFactory都会调用此方法。调用getLogger(),我们不希望在这里生成太多输出。
代码示例来源:origin: commons-logging/commons-logging
public Object run() {
return directGetContextClassLoader();
}
});
代码示例来源:origin: commons-logging/commons-logging
/**
* Returns the current context classloader.
* <p>
* In versions prior to 1.1, this method did not use an AccessController.
* In version 1.1, an AccessController wrapper was incorrectly added to
* this method, causing a minor security flaw.
* <p>
* In version 1.1.1 this change was reverted; this method no longer uses
* an AccessController. User code wishing to obtain the context classloader
* must invoke this method via AccessController.doPrivileged if it needs
* support for that.
*
* @return the context classloader associated with the current thread,
* or null if security doesn't allow it.
* @throws LogConfigurationException if there was some weird error while
* attempting to get the context classloader.
*/
protected static ClassLoader getContextClassLoader() throws LogConfigurationException {
return directGetContextClassLoader();
}
代码示例来源:origin: robovm/robovm
public Object run() {
return directGetContextClassLoader();
}
});
代码示例来源:origin: camunda/camunda-bpm-platform
public Object run() {
return directGetContextClassLoader();
}
});
代码示例来源:origin: camunda/camunda-bpm-platform
/**
* Returns the current context classloader.
* <p>
* In versions prior to 1.1, this method did not use an AccessController.
* In version 1.1, an AccessController wrapper was incorrectly added to
* this method, causing a minor security flaw.
* <p>
* In version 1.1.1 this change was reverted; this method no longer uses
* an AccessController. User code wishing to obtain the context classloader
* must invoke this method via AccessController.doPrivileged if it needs
* support for that.
*
* @return the context classloader associated with the current thread,
* or null if security doesn't allow it.
*
* @throws LogConfigurationException if there was some weird error while
* attempting to get the context classloader.
*
* @throws SecurityException if the current java security policy doesn't
* allow this class to access the context classloader.
*/
protected static ClassLoader getContextClassLoader()
throws LogConfigurationException {
return directGetContextClassLoader();
}
代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded
public Object run() {
return directGetContextClassLoader();
}
});
代码示例来源:origin: com.bugvm/bugvm-rt
public Object run() {
return directGetContextClassLoader();
}
});
代码示例来源:origin: MobiVM/robovm
public Object run() {
return directGetContextClassLoader();
}
});
代码示例来源:origin: apache-logging/commons-logging
public Object run() {
return directGetContextClassLoader();
}
});
代码示例来源:origin: ibinti/bugvm
public Object run() {
return directGetContextClassLoader();
}
});
代码示例来源:origin: FlexoVM/flexovm
public Object run() {
return directGetContextClassLoader();
}
});
代码示例来源:origin: org.apache.openjpa/openjpa-all
public Object run() {
return directGetContextClassLoader();
}
});
代码示例来源:origin: com.mobidevelop.robovm/robovm-rt
public Object run() {
return directGetContextClassLoader();
}
});
代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.apache.commons.logging
public Object run() {
return directGetContextClassLoader();
}
});
代码示例来源:origin: com.gluonhq/robovm-rt
public Object run() {
return directGetContextClassLoader();
}
});
代码示例来源:origin: Nextdoor/bender
public Object run() {
return directGetContextClassLoader();
}
});
代码示例来源:origin: org.apache.openjpa/openjpa-all
/**
* Returns the current context classloader.
* <p>
* In versions prior to 1.1, this method did not use an AccessController.
* In version 1.1, an AccessController wrapper was incorrectly added to
* this method, causing a minor security flaw.
* <p>
* In version 1.1.1 this change was reverted; this method no longer uses
* an AccessController. User code wishing to obtain the context classloader
* must invoke this method via AccessController.doPrivileged if it needs
* support for that.
*
* @return the context classloader associated with the current thread,
* or null if security doesn't allow it.
* @throws LogConfigurationException if there was some weird error while
* attempting to get the context classloader.
*/
protected static ClassLoader getContextClassLoader() throws LogConfigurationException {
return directGetContextClassLoader();
}
代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded
/**
* Returns the current context classloader.
* <p>
* In versions prior to 1.1, this method did not use an AccessController.
* In version 1.1, an AccessController wrapper was incorrectly added to
* this method, causing a minor security flaw.
* <p>
* In version 1.1.1 this change was reverted; this method no longer uses
* an AccessController. User code wishing to obtain the context classloader
* must invoke this method via AccessController.doPrivileged if it needs
* support for that.
*
* @return the context classloader associated with the current thread,
* or null if security doesn't allow it.
* @throws LogConfigurationException if there was some weird error while
* attempting to get the context classloader.
*/
protected static ClassLoader getContextClassLoader() throws LogConfigurationException {
return directGetContextClassLoader();
}
代码示例来源:origin: Nextdoor/bender
/**
* Returns the current context classloader.
* <p>
* In versions prior to 1.1, this method did not use an AccessController.
* In version 1.1, an AccessController wrapper was incorrectly added to
* this method, causing a minor security flaw.
* <p>
* In version 1.1.1 this change was reverted; this method no longer uses
* an AccessController. User code wishing to obtain the context classloader
* must invoke this method via AccessController.doPrivileged if it needs
* support for that.
*
* @return the context classloader associated with the current thread,
* or null if security doesn't allow it.
* @throws LogConfigurationException if there was some weird error while
* attempting to get the context classloader.
* @throws SecurityException if the current java security policy doesn't
* allow this class to access the context classloader.
*/
protected static ClassLoader getContextClassLoader() throws LogConfigurationException {
return directGetContextClassLoader();
}
代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.apache.commons.logging
/**
* Returns the current context classloader.
* <p>
* In versions prior to 1.1, this method did not use an AccessController.
* In version 1.1, an AccessController wrapper was incorrectly added to
* this method, causing a minor security flaw.
* <p>
* In version 1.1.1 this change was reverted; this method no longer uses
* an AccessController. User code wishing to obtain the context classloader
* must invoke this method via AccessController.doPrivileged if it needs
* support for that.
*
* @return the context classloader associated with the current thread,
* or null if security doesn't allow it.
*
* @throws LogConfigurationException if there was some weird error while
* attempting to get the context classloader.
*
* @throws SecurityException if the current java security policy doesn't
* allow this class to access the context classloader.
*/
protected static ClassLoader getContextClassLoader()
throws LogConfigurationException {
return directGetContextClassLoader();
}
内容来源于网络,如有侵权,请联系作者删除!