ch.qos.logback.core.util.Loader.getClassLoaderOfObject()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(7.1k)|赞(0)|评价(0)|浏览(208)

本文整理了Java中ch.qos.logback.core.util.Loader.getClassLoaderOfObject()方法的一些代码示例,展示了Loader.getClassLoaderOfObject()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Loader.getClassLoaderOfObject()方法的具体详情如下:
包路径:ch.qos.logback.core.util.Loader
类名称:Loader
方法名:getClassLoaderOfObject

Loader.getClassLoaderOfObject介绍

[英]Get the class loader of the object passed as argument. Return the system class loader if appropriate.
[中]获取作为参数传递的对象的类装入器。如果合适,返回系统类加载器。

代码示例

代码示例来源:origin: ch.qos.logback/logback-classic

  1. public URL findURLOfDefaultConfigurationFile(boolean updateStatus) {
  2. ClassLoader myClassLoader = Loader.getClassLoaderOfObject(this);
  3. URL url = findConfigFileURLFromSystemProperties(myClassLoader, updateStatus);
  4. if (url != null) {
  5. return url;
  6. }
  7. url = getResource(TEST_AUTOCONFIG_FILE, myClassLoader, updateStatus);
  8. if (url != null) {
  9. return url;
  10. }
  11. url = getResource(GROOVY_AUTOCONFIG_FILE, myClassLoader, updateStatus);
  12. if (url != null) {
  13. return url;
  14. }
  15. return getResource(AUTOCONFIG_FILE, myClassLoader, updateStatus);
  16. }

代码示例来源:origin: camunda/camunda-bpm-platform

  1. public static Class<?> loadClass(String clazz, Context context)
  2. throws ClassNotFoundException {
  3. ClassLoader cl = getClassLoaderOfObject(context);
  4. return cl.loadClass(clazz);
  5. }

代码示例来源:origin: camunda/camunda-bpm-platform

  1. public static Object instantiateByClassNameAndParameter(String className,
  2. Class<?> superClass, Context context, Class<?> type, Object param) throws IncompatibleClassException,
  3. DynamicClassLoadingException {
  4. ClassLoader classLoader = Loader.getClassLoaderOfObject(context);
  5. return instantiateByClassNameAndParameter(className, superClass, classLoader, type, param);
  6. }

代码示例来源:origin: camunda/camunda-bpm-platform

  1. public static Object instantiateByClassName(String className,
  2. Class<?> superClass, Context context) throws IncompatibleClassException,
  3. DynamicClassLoadingException {
  4. ClassLoader classLoader = Loader.getClassLoaderOfObject(context);
  5. return instantiateByClassName(className, superClass, classLoader);
  6. }

代码示例来源:origin: camunda/camunda-bpm-platform

  1. public URL findURLOfDefaultConfigurationFile(boolean updateStatus) {
  2. ClassLoader myClassLoader = Loader.getClassLoaderOfObject(this);
  3. URL url = findConfigFileURLFromSystemProperties(myClassLoader, updateStatus);
  4. if (url != null) {
  5. return url;
  6. }
  7. url = getResource(GROOVY_AUTOCONFIG_FILE, myClassLoader, updateStatus);
  8. if (url != null) {
  9. return url;
  10. }
  11. url = getResource(TEST_AUTOCONFIG_FILE, myClassLoader, updateStatus);
  12. if (url != null) {
  13. return url;
  14. }
  15. return getResource(AUTOCONFIG_FILE, myClassLoader, updateStatus);
  16. }

代码示例来源:origin: com.alibaba.citrus.tool/antx-autoexpand

  1. public static Class loadClass(String clazz, Context context)
  2. throws ClassNotFoundException {
  3. ClassLoader cl = getClassLoaderOfObject(context);
  4. return cl.loadClass(clazz);
  5. }

代码示例来源:origin: tony19/logback-android

  1. /**
  2. *
  3. * @param clazz the name of the class to find
  4. * @param context the logging context
  5. * @return the class
  6. * @throws ClassNotFoundException if class not found
  7. */
  8. public static Class<?> loadClass(String clazz, Context context)
  9. throws ClassNotFoundException {
  10. ClassLoader cl = getClassLoaderOfObject(context);
  11. return cl.loadClass(clazz);
  12. }

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/ch.qos.logback.core

  1. public static Class loadClass(String clazz, Context context)
  2. throws ClassNotFoundException {
  3. ClassLoader cl = getClassLoaderOfObject(context);
  4. return cl.loadClass(clazz);
  5. }

代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded

  1. public static Class<?> loadClass(String clazz, Context context) throws ClassNotFoundException {
  2. ClassLoader cl = getClassLoaderOfObject(context);
  3. return cl.loadClass(clazz);
  4. }

代码示例来源:origin: io.virtdata/virtdata-lib-realer

  1. public static Class<?> loadClass(String clazz, Context context) throws ClassNotFoundException {
  2. ClassLoader cl = getClassLoaderOfObject(context);
  3. return cl.loadClass(clazz);
  4. }

代码示例来源:origin: ch.qos.logback/core

  1. public static Class loadClass(String clazz, Context context)
  2. throws ClassNotFoundException {
  3. ClassLoader cl = getClassLoaderOfObject(context);
  4. return cl.loadClass(clazz);
  5. }

代码示例来源:origin: io.virtdata/virtdata-lib-realer

  1. public static Object instantiateByClassNameAndParameter(String className, Class<?> superClass, Context context, Class<?> type, Object param)
  2. throws IncompatibleClassException, DynamicClassLoadingException {
  3. ClassLoader classLoader = Loader.getClassLoaderOfObject(context);
  4. return instantiateByClassNameAndParameter(className, superClass, classLoader, type, param);
  5. }

代码示例来源:origin: tony19/logback-android

  1. public static Object instantiateByClassName(String className,
  2. Class<?> superClass, Context context) throws IncompatibleClassException,
  3. DynamicClassLoadingException {
  4. ClassLoader classLoader = Loader.getClassLoaderOfObject(context);
  5. return instantiateByClassName(className, superClass, classLoader);
  6. }

代码示例来源:origin: tony19/logback-android

  1. public static Object instantiateByClassNameAndParameter(String className,
  2. Class<?> superClass, Context context, Class<?> type, Object param) throws IncompatibleClassException,
  3. DynamicClassLoadingException {
  4. ClassLoader classLoader = Loader.getClassLoaderOfObject(context);
  5. return instantiateByClassNameAndParameter(className, superClass, classLoader, type, param);
  6. }

代码示例来源:origin: com.hynnet/logback-core

  1. public static Object instantiateByClassName(String className,
  2. Class<?> superClass, Context context) throws IncompatibleClassException,
  3. DynamicClassLoadingException {
  4. ClassLoader classLoader = Loader.getClassLoaderOfObject(context);
  5. return instantiateByClassName(className, superClass, classLoader);
  6. }

代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded

  1. public static Object instantiateByClassNameAndParameter(String className, Class<?> superClass, Context context, Class<?> type, Object param)
  2. throws IncompatibleClassException, DynamicClassLoadingException {
  3. ClassLoader classLoader = Loader.getClassLoaderOfObject(context);
  4. return instantiateByClassNameAndParameter(className, superClass, classLoader, type, param);
  5. }

代码示例来源:origin: com.hynnet/logback-core

  1. public static Object instantiateByClassNameAndParameter(String className,
  2. Class<?> superClass, Context context, Class<?> type, Object param) throws IncompatibleClassException,
  3. DynamicClassLoadingException {
  4. ClassLoader classLoader = Loader.getClassLoaderOfObject(context);
  5. return instantiateByClassNameAndParameter(className, superClass, classLoader, type, param);
  6. }

代码示例来源:origin: ch.qos.logback/core

  1. public static Object instantiateByClassName(String className,
  2. Class superClass, Context context) throws IncompatibleClassException,
  3. DynamicClassLoadingException {
  4. ClassLoader classLoader = Loader.getClassLoaderOfObject(context);
  5. return instantiateByClassName(className, superClass, classLoader);
  6. }

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/ch.qos.logback.core

  1. public static Object instantiateByClassNameAndParameter(String className,
  2. Class superClass, Context context, Class type, Object param) throws IncompatibleClassException,
  3. DynamicClassLoadingException {
  4. ClassLoader classLoader = Loader.getClassLoaderOfObject(context);
  5. return instantiateByClassNameAndParameter(className, superClass, classLoader, type, param);
  6. }

代码示例来源:origin: com.alibaba.citrus.tool/antx-autoexpand

  1. public static Object instantiateByClassName(String className,
  2. Class superClass, Context context) throws IncompatibleClassException,
  3. DynamicClassLoadingException {
  4. ClassLoader classLoader = Loader.getClassLoaderOfObject(context);
  5. return instantiateByClassName(className, superClass, classLoader);
  6. }

相关文章