Java 类org.apache.commons.logging.impl.NoOpLog 实例源码

项目:marshalsec    文件:SpringUtil.java   
public static BeanFactory makeMethodTrigger ( Object o, String method ) throws Exception {
    DefaultListableBeanFactory bf = new DefaultListableBeanFactory();
    RootBeanDefinition caller = new RootBeanDefinition();

    caller.setFactoryBeanName("obj");
    caller.setFactoryMethodName(method);
    Reflections.setFieldValue(caller.getMethodOverrides(), "overrides", new HashSet<>());
    bf.registerBeanDefinition("caller", caller);

    Reflections.getField(DefaultListableBeanFactory.class, "beanClassLoader").set(bf, null);
    Reflections.getField(DefaultListableBeanFactory.class, "alreadyCreated").set(bf, new HashSet<>());
    Reflections.getField(DefaultListableBeanFactory.class, "singletonsCurrentlyInCreation").set(bf, new HashSet<>());
    Reflections.getField(DefaultListableBeanFactory.class, "inCreationCheckExclusions").set(bf, new HashSet<>());
    Reflections.getField(DefaultListableBeanFactory.class, "logger").set(bf, new NoOpLog());
    Reflections.getField(DefaultListableBeanFactory.class, "prototypesCurrentlyInCreation").set(bf, new ThreadLocal<>());

    @SuppressWarnings ( "unchecked" )
    Map<String, Object> objs = (Map<String, Object>) Reflections.getFieldValue(bf, "singletonObjects");
    objs.put("obj", o);
    return bf;
}
项目:marshalsec    文件:SpringUtil.java   
public static BeanFactory makeJNDITrigger ( String jndiUrl ) throws Exception {
    SimpleJndiBeanFactory bf = new SimpleJndiBeanFactory();
    bf.setShareableResources(jndiUrl);
    Reflections.setFieldValue(bf, "logger", new NoOpLog());
    Reflections.setFieldValue(bf.getJndiTemplate(), "logger", new NoOpLog());
    return bf;
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:AutoConfigurationReportLoggingInitializerTests.java   
@Override
public Log getInstance(String name) throws LogConfigurationException {
    if (AutoConfigurationReportLoggingInitializer.class.getName().equals(name)) {
        return logThreadLocal.get();
    }
    return new NoOpLog();
}
项目:spring-boot-concourse    文件:AutoConfigurationReportLoggingInitializerTests.java   
@Override
public Log getInstance(String name) throws LogConfigurationException {
    if (AutoConfigurationReportLoggingInitializer.class.getName().equals(name)) {
        return logThreadLocal.get();
    }
    return new NoOpLog();
}
项目:contestparser    文件:AutoConfigurationReportLoggingInitializerTests.java   
@Override
public Log getInstance(String name) throws LogConfigurationException {
    if (AutoConfigurationReportLoggingInitializer.class.getName().equals(name)) {
        return logThreadLocal.get();
    }
    return new NoOpLog();
}