public final class JndiLookupAccessor extends Object
Modifier and Type | Method and Description |
---|---|
static JndiLookupFacade |
getJndiLookupFacade() |
static Object |
lookup(String name)
Looks up the object for the given name.
|
static void |
setJndiLookupFacade(JndiLookupFacade jndiLookupFacade)
Replaces the default
JndiLookupFacade instance. |
static io.vavr.control.Try<Object> |
tryLookup(String name)
Looks up the object for the given name.
|
@Nonnull public static JndiLookupFacade getJndiLookupFacade()
JndiLookupFacade
instance.public static void setJndiLookupFacade(@Nullable JndiLookupFacade jndiLookupFacade)
JndiLookupFacade
instance.jndiLookupFacade
- An instance of JndiLookupFacade
. Use null
to reset the facade.@Nonnull public static Object lookup(@Nonnull String name) throws ObjectLookupFailedException
Caution: JNDI lookups may not work in non-container managed threads. If you need to obtain an object within such a thread, consider performing the lookup in a ThreadContextListener instead.
name
- The name to lookup a JNDI object.ObjectLookupFailedException
- If there was an issue looking up the object.@Nonnull public static io.vavr.control.Try<Object> tryLookup(@Nonnull String name)
Caution: JNDI lookups may not work in non-container managed threads. If you need to obtain an object within such a thread, consider performing the lookup in a ThreadContextListener instead.
name
- The name to lookup a JNDI object.Try
of the object returned by the lookup.Copyright © 2020 SAP SE. All rights reserved.