public class JndiRealmFactory extends JndiLocator implements RealmFactory
jndiNames
.
This is primarily provided to support Realm instances configured in JEE and EJB environments, but will
work in any environment where Realm
instances are bound in JNDI instead of using
programmatic or text-based configuration.
CONTAINER_PREFIX
Constructor and Description |
---|
JndiRealmFactory() |
Modifier and Type | Method and Description |
---|---|
Collection<String> |
getJndiNames()
Returns the JNDI names that will be used to look up Realm(s) from JNDI.
|
Collection<Realm> |
getRealms()
Performs the JNDI lookups for each specified
JNDI name and returns all
discovered Realms in an ordered collection. |
void |
setJndiNames(Collection<String> jndiNames)
Sets the JNDI names that will be used to look up Realm(s) from JNDI.
|
void |
setJndiNames(String commaDelimited)
Specifies a comma-delimited list of JNDI names to lookup, each one corresponding to a jndi-bound
Realm . |
convertJndiName, getJndiEnvironment, getJndiTemplate, isResourceRef, lookup, lookup, setJndiEnvironment, setJndiTemplate, setResourceRef
public JndiRealmFactory()
public Collection<String> getJndiNames()
setJndiNames(String)
,
setJndiNames(Collection)
public void setJndiNames(Collection<String> jndiNames)
setJndiNames(String)
method instead.jndiNames
- the JNDI names that will be used to look up Realm(s) from JNDI.setJndiNames(String)
public void setJndiNames(String commaDelimited) throws IllegalStateException
Realm
. The Realms will be made available to the SecurityManager in the order
they are defined.commaDelimited
- a comma-delimited list of JNDI names, each representing the JNDI name used to
look up a corresponding jndi-bound Realm.IllegalStateException
- if the specified argument is null or the empty string.public Collection<Realm> getRealms() throws IllegalStateException
JNDI name
and returns all
discovered Realms in an ordered collection.
The returned Collection is in the same order as the specified
jndiNames
getRealms
in interface RealmFactory
specified Realms
found in JNDI.IllegalStateException
- if any of the JNDI names fails to successfully look up a Realm instance.Copyright © 2004–2020 The Apache Software Foundation. All rights reserved.