Example usage for org.springframework.jndi.support SimpleJndiBeanFactory setShareableResources

List of usage examples for org.springframework.jndi.support SimpleJndiBeanFactory setShareableResources

Introduction

In this page you can find the example usage for org.springframework.jndi.support SimpleJndiBeanFactory setShareableResources.

Prototype

public void setShareableResources(String... shareableResources) 

Source Link

Document

Set a list of names of shareable JNDI resources, which this factory is allowed to cache once obtained.

Usage

From source file:marshalsec.gadgets.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;/*from  w ww.ja  va 2s .  co  m*/
}