All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.minijax.jndi.MinijaxInitialContextFactory Maven / Gradle / Ivy

There is a newer version: 0.5.10
Show newest version
package org.minijax.jndi;

import java.util.Hashtable;
import java.util.Map;

import javax.naming.Context;
import javax.naming.NamingException;

public class MinijaxInitialContextFactory implements javax.naming.spi.InitialContextFactory  {

    @Override
    @SuppressWarnings("unchecked")
    public Context getInitialContext(final Hashtable environment) throws NamingException {
        initEnv((Hashtable) environment);
        return new MinijaxContext((Hashtable) environment, true);
    }

    static void initEnv(final Map env) {
        env.putIfAbsent("java.naming.factory.initial", "org.minijax.jndi.MinijaxInitialContextFactory");
        env.putIfAbsent("jndi.syntax.direction", "left_to_right");
        env.putIfAbsent("jndi.syntax.separator", "/");
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy