com.laamella.parameter_source.JndiParameterSource Maven / Gradle / Ivy
package com.laamella.parameter_source;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import java.util.Optional;
import static java.util.Objects.requireNonNull;
/**
* Uses a JNDI InitialContext as the parameter source.
*/
public class JndiParameterSource implements ParameterSource {
private final InitialContext initialContext;
public JndiParameterSource() throws NamingException {
this(new InitialContext());
}
public JndiParameterSource(InitialContext initialContext) {
requireNonNull(initialContext);
this.initialContext = initialContext;
}
@Override
public Optional