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

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

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

Loader.getClassLoaderOfClass介绍

[英]Return the class loader which loaded the class passed as argument. Return the system class loader if appropriate.
[中]返回加载作为参数传递的类的类加载器。如果合适,返回系统类加载器。

代码示例

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

private static ClassLoader getServiceLoaderClassLoader() {
  return testServiceLoaderClassLoader == null ? Loader.getClassLoaderOfClass(EnvUtil.class) : testServiceLoaderClassLoader;
}

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

static public boolean isGroovyAvailable() {
  ClassLoader classLoader = Loader.getClassLoaderOfClass(EnvUtil.class);
  try {
    Class<?> bindingClass = classLoader.loadClass("groovy.lang.Binding");
    return (bindingClass != null);
  } catch (ClassNotFoundException e) {
    return false;
  }
}

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

static public boolean isGroovyAvailable() {
 ClassLoader classLoader = Loader.getClassLoaderOfClass(EnvUtil.class);
 try {
  Class bindingClass = classLoader.loadClass("groovy.lang.Binding");
  return (bindingClass != null);
 } catch (ClassNotFoundException e) {
  return false;
 }
}

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

/**
 * Get the class loader of the object passed as argument. Return the system
 * class loader if appropriate.
 *
 * @param o
 * @return
 */
public static ClassLoader getClassLoaderOfObject(Object o) {
 if (o == null) {
  throw new NullPointerException("Argument cannot be null");
 }
 return getClassLoaderOfClass(o.getClass());
}

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

/**
 * Attempt to find a resource by using the classloader that loaded this class,
 * namely Loader.class.
 *
 * @param resource
 * @return
 */
public static URL getResourceBySelfClassLoader(String resource) {
 return getResource(resource, getClassLoaderOfClass(Loader.class));
}

代码示例来源:origin: Nextdoor/bender

static public boolean isGroovyAvailable() {
  ClassLoader classLoader = Loader.getClassLoaderOfClass(EnvUtil.class);
  try {
    Class<?> bindingClass = classLoader.loadClass("groovy.lang.Binding");
    return (bindingClass != null);
  } catch (ClassNotFoundException e) {
    return false;
  }
}

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

static public boolean isGroovyAvailable() {
  ClassLoader classLoader = Loader.getClassLoaderOfClass(EnvUtil.class);
  try {
    Class<?> bindingClass = classLoader.loadClass("groovy.lang.Binding");
    return (bindingClass != null);
  } catch (ClassNotFoundException e) {
    return false;
  }
}

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

static public boolean isGroovyAvailable() {
  ClassLoader classLoader = Loader.getClassLoaderOfClass(EnvUtil.class);
  try {
    Class<?> bindingClass = classLoader.loadClass("groovy.lang.Binding");
    return (bindingClass != null);
  } catch (ClassNotFoundException e) {
    return false;
  }
}

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

/**
 * Get the class loader of the object passed as argument. Return the system
 * class loader if appropriate.
 *
 * @param o object to evaluate
 * @return the classloader of the object
 */
public static ClassLoader getClassLoaderOfObject(Object o) {
 if (o == null) {
  throw new NullPointerException("Argument cannot be null");
 }
 return getClassLoaderOfClass(o.getClass());
}

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

/**
 * Get the class loader of the object passed as argument. Return the system
 * class loader if appropriate.
 *
 * @param o
 * @return
 */
public static ClassLoader getClassLoaderOfObject(Object o) {
 if (o == null) {
  throw new NullPointerException("Argument cannot be null");
 }
 return getClassLoaderOfClass(o.getClass());
}

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

/**
 * Get the class loader of the object passed as argument. Return the system
 * class loader if appropriate.
 *
 * @param o
 * @return
 */
public static ClassLoader getClassLoaderOfObject(Object o) {
 if (o == null) {
  throw new NullPointerException("Argument cannot be null");
 }
 return getClassLoaderOfClass(o.getClass());
}

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

/**
 * Get the class loader of the object passed as argument. Return the system
 * class loader if appropriate.
 * 
 * @param o
 * @return
 */
public static ClassLoader getClassLoaderOfObject(Object o) {
 if (o == null) {
  throw new NullPointerException("Argument cannot be null");
 }
 return getClassLoaderOfClass(o.getClass());
}

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

/**
 * Attempt to find a resource by using the classloader that loaded this class,
 * namely Loader.class.
 *
 * @param resource
 * @return
 */
public static URL getResourceBySelfClassLoader(String resource) {
  return getResource(resource, getClassLoaderOfClass(Loader.class));
}

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

/**
 * Attempt to find a resource by using the classloader that loaded this class,
 * namely Loader.class.
 * 
 * @param resource
 * @return
 */
public static URL getResourceBySelfClassLoader(String resource) {
 return getResource(resource, getClassLoaderOfClass(Loader.class));
}

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

/**
 * Attempt to find a resource by using the classloader that loaded this class,
 * namely Loader.class.
 *
 * @param resource
 * @return
 */
public static URL getResourceBySelfClassLoader(String resource) {
 return getResource(resource, getClassLoaderOfClass(Loader.class));
}

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

/**
 * Attempt to find a resource by using the classloader that loaded this class,
 * namely Loader.class.
 *
 * @param resource
 * @return
 */
public static URL getResourceBySelfClassLoader(String resource) {
  return getResource(resource, getClassLoaderOfClass(Loader.class));
}

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

/**
 * Attempt to find a resource by using the classloader that loaded this class,
 * namely Loader.class.
 *
 * @param resource the resource name to look for
 * @return resource URL
 */
public static URL getResourceBySelfClassLoader(String resource) {
 return getResource(resource, getClassLoaderOfClass(Loader.class));
}

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

/**
 * Attempt to find a resource by using the classloader that loaded this class,
 * namely Loader.class.
 *
 * @param resource
 * @return
 */
public static URL getResourceBySelfClassLoader(String resource) {
 return getResource(resource, getClassLoaderOfClass(Loader.class));
}

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

/**
 * Attempt to find a resource by using the classloader that loaded this class,
 * namely Loader.class.
 *
 * @param resource
 * @return
 */
public static URL getResourceBySelfClassLoader(String resource) {
 return getResource(resource, getClassLoaderOfClass(Loader.class));
}

代码示例来源:origin: Nextdoor/bender

/**
 * Attempt to find a resource by using the classloader that loaded this class,
 * namely Loader.class.
 *
 * @param resource
 * @return
 */
public static URL getResourceBySelfClassLoader(String resource) {
  return getResource(resource, getClassLoaderOfClass(Loader.class));
}

相关文章