Example usage for org.apache.commons.configuration JNDIConfiguration setPrefix

List of usage examples for org.apache.commons.configuration JNDIConfiguration setPrefix

Introduction

In this page you can find the example usage for org.apache.commons.configuration JNDIConfiguration setPrefix.

Prototype

public void setPrefix(String prefix) 

Source Link

Document

Sets the prefix.

Usage

From source file:marshalsec.gadgets.CommonsConfiguration.java

@Args(minArgs = 2, args = { "codebase", "class" }, defaultArgs = { MarshallerBase.defaultCodebase,
        MarshallerBase.defaultCodebaseClass })
default Object makeConfiguration(UtilFactory uf, String[] args)
        throws ClassNotFoundException, NoSuchMethodException, InstantiationException, IllegalAccessException,
        InvocationTargetException, NamingException, Exception {
    DirContext ctx = JDKUtil.makeContinuationContext(args[0], args[1]);

    JNDIConfiguration jc = new JNDIConfiguration();
    jc.setContext(ctx);//from  w ww .jav a  2  s.com
    jc.setPrefix("foo");

    Reflections.setFieldValue(jc, "errorListeners", Collections.EMPTY_LIST);
    Reflections.setFieldValue(jc, "listeners", Collections.EMPTY_LIST);
    Reflections.setFieldValue(jc, "log", new NoOpLog());
    return jc;
}