本文整理汇总了Java中org.apache.commons.logging.impl.NoOpLog类的典型用法代码示例。如果您正苦于以下问题:Java NoOpLog类的具体用法?Java NoOpLog怎么用?Java NoOpLog使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NoOpLog类属于org.apache.commons.logging.impl包,在下文中一共展示了NoOpLog类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: makeMethodTrigger
import org.apache.commons.logging.impl.NoOpLog; //导入依赖的package包/类
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;
}
开发者ID:mbechler,项目名称:marshalsec,代码行数:22,代码来源:SpringUtil.java
示例2: makeJNDITrigger
import org.apache.commons.logging.impl.NoOpLog; //导入依赖的package包/类
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;
}
开发者ID:mbechler,项目名称:marshalsec,代码行数:8,代码来源:SpringUtil.java
示例3: getInstance
import org.apache.commons.logging.impl.NoOpLog; //导入依赖的package包/类
@Override
public Log getInstance(String name) throws LogConfigurationException {
if (AutoConfigurationReportLoggingInitializer.class.getName().equals(name)) {
return logThreadLocal.get();
}
return new NoOpLog();
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:8,代码来源:AutoConfigurationReportLoggingInitializerTests.java
注:本文中的org.apache.commons.logging.impl.NoOpLog类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论