|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.shiro.jndi.JndiLocator org.apache.shiro.realm.jndi.JndiRealmFactory
public class JndiRealmFactory
Looks up one or more Realm instances from JNDI using specified 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.
Field Summary |
---|
Fields inherited from class org.apache.shiro.jndi.JndiLocator |
---|
CONTAINER_PREFIX |
Constructor Summary | |
---|---|
JndiRealmFactory()
|
Method Summary | |
---|---|
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 . |
Methods inherited from class org.apache.shiro.jndi.JndiLocator |
---|
convertJndiName, getJndiEnvironment, getJndiTemplate, isResourceRef, lookup, lookup, setJndiEnvironment, setJndiTemplate, setResourceRef |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JndiRealmFactory()
Method Detail |
---|
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.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |