blob: 33a95925816973e0f0cb081d53aa5247c0c3d986 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_65) on Fri Mar 04 17:58:55 EST 2016 -->
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
JndiTemplate (Apache Shiro 1.2.4 API)
</TITLE>
<META NAME="date" CONTENT="2016-03-04">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="JndiTemplate (Apache Shiro 1.2.4 API)";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/JndiTemplate.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../org/apache/shiro/jndi/JndiObjectFactory.html" title="class in org.apache.shiro.jndi"><B>PREV CLASS</B></A>&nbsp;
&nbsp;NEXT CLASS</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../index.html?org/apache/shiro/jndi/JndiTemplate.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="JndiTemplate.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
org.apache.shiro.jndi</FONT>
<BR>
Class JndiTemplate</H2>
<PRE>
<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A>
<IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>org.apache.shiro.jndi.JndiTemplate</B>
</PRE>
<HR>
<DL>
<DT><PRE>public class <A HREF="../../../../src-html/org/apache/shiro/jndi/JndiTemplate.html#line.45"><B>JndiTemplate</B></A><DT>extends <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></DL>
</PRE>
<P>
Helper class that simplifies JNDI operations. It provides methods to lookup and
bind objects, and allows implementations of the <A HREF="../../../../org/apache/shiro/jndi/JndiCallback.html" title="interface in org.apache.shiro.jndi"><CODE>JndiCallback</CODE></A> interface
to perform any operation they like with a JNDI naming context provided.
<p/>
<p>Note that this implementation is an almost exact copy of the Spring Framework's identically named class from
their 2.5.4 distribution - we didn't want to re-invent the wheel, but not require a full dependency on the
Spring framework, nor does Spring make available only its JNDI classes in a small jar, or we would have used that.
Since Shiro is also Apache 2.0 licensed, all regular licenses and conditions and authors have remained in tact.
<P>
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../org/apache/shiro/jndi/JndiCallback.html" title="interface in org.apache.shiro.jndi"><CODE>JndiCallback</CODE></A>,
<A HREF="../../../../org/apache/shiro/jndi/JndiTemplate.html#execute(org.apache.shiro.jndi.JndiCallback)"><CODE>execute(org.apache.shiro.jndi.JndiCallback)</CODE></A></DL>
<HR>
<P>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../org/apache/shiro/jndi/JndiTemplate.html#JndiTemplate()">JndiTemplate</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Create a new JndiTemplate instance.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../org/apache/shiro/jndi/JndiTemplate.html#JndiTemplate(java.util.Properties)">JndiTemplate</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/util/Properties.html?is-external=true" title="class or interface in java.util">Properties</A>&nbsp;environment)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Create a new JndiTemplate instance, using the given environment.</TD>
</TR>
</TABLE>
&nbsp;
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/shiro/jndi/JndiTemplate.html#bind(java.lang.String, java.lang.Object)">bind</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;name,
<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>&nbsp;object)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Bind the given object to the current JNDI context, using the given name.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;<A HREF="http://java.sun.com/javase/6/docs/api/javax/naming/Context.html?is-external=true" title="class or interface in javax.naming">Context</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/shiro/jndi/JndiTemplate.html#createInitialContext()">createInitialContext</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Create a new JNDI initial context.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/shiro/jndi/JndiTemplate.html#execute(org.apache.shiro.jndi.JndiCallback)">execute</A></B>(<A HREF="../../../../org/apache/shiro/jndi/JndiCallback.html" title="interface in org.apache.shiro.jndi">JndiCallback</A>&nbsp;contextCallback)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Execute the given JNDI context callback implementation.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="http://java.sun.com/javase/6/docs/api/java/util/Properties.html?is-external=true" title="class or interface in java.util">Properties</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/shiro/jndi/JndiTemplate.html#getEnvironment()">getEnvironment</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Return the environment for the JNDI InitialContext, or <code>null</code> if none should be used.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/shiro/jndi/JndiTemplate.html#lookup(java.lang.String)">lookup</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;name)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Look up the object with the given name in the current JNDI context.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/shiro/jndi/JndiTemplate.html#lookup(java.lang.String, java.lang.Class)">lookup</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;name,
<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A>&nbsp;requiredType)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Look up the object with the given name in the current JNDI context.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/shiro/jndi/JndiTemplate.html#rebind(java.lang.String, java.lang.Object)">rebind</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;name,
<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>&nbsp;object)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Rebind the given object to the current JNDI context, using the given name.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/shiro/jndi/JndiTemplate.html#setEnvironment(java.util.Properties)">setEnvironment</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/util/Properties.html?is-external=true" title="class or interface in java.util">Properties</A>&nbsp;environment)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set the environment for the JNDI InitialContext.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/apache/shiro/jndi/JndiTemplate.html#unbind(java.lang.String)">unbind</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;name)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Remove the binding for the given name from the current JNDI context.</TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD>
</TR>
</TABLE>
&nbsp;
<P>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="JndiTemplate()"><!-- --></A><H3>
JndiTemplate</H3>
<PRE>
public <A HREF="../../../../src-html/org/apache/shiro/jndi/JndiTemplate.html#line.52"><B>JndiTemplate</B></A>()</PRE>
<DL>
<DD>Create a new JndiTemplate instance.
<P>
</DL>
<HR>
<A NAME="JndiTemplate(java.util.Properties)"><!-- --></A><H3>
JndiTemplate</H3>
<PRE>
public <A HREF="../../../../src-html/org/apache/shiro/jndi/JndiTemplate.html#line.60"><B>JndiTemplate</B></A>(<A HREF="http://java.sun.com/javase/6/docs/api/java/util/Properties.html?is-external=true" title="class or interface in java.util">Properties</A>&nbsp;environment)</PRE>
<DL>
<DD>Create a new JndiTemplate instance, using the given environment.
<P>
<DL>
<DT><B>Parameters:</B><DD><CODE>environment</CODE> - the Properties to initialize with</DL>
</DL>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="setEnvironment(java.util.Properties)"><!-- --></A><H3>
setEnvironment</H3>
<PRE>
public void <A HREF="../../../../src-html/org/apache/shiro/jndi/JndiTemplate.html#line.69"><B>setEnvironment</B></A>(<A HREF="http://java.sun.com/javase/6/docs/api/java/util/Properties.html?is-external=true" title="class or interface in java.util">Properties</A>&nbsp;environment)</PRE>
<DL>
<DD>Set the environment for the JNDI InitialContext.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>environment</CODE> - the Properties to initialize with</DL>
</DD>
</DL>
<HR>
<A NAME="getEnvironment()"><!-- --></A><H3>
getEnvironment</H3>
<PRE>
public <A HREF="http://java.sun.com/javase/6/docs/api/java/util/Properties.html?is-external=true" title="class or interface in java.util">Properties</A> <A HREF="../../../../src-html/org/apache/shiro/jndi/JndiTemplate.html#line.78"><B>getEnvironment</B></A>()</PRE>
<DL>
<DD>Return the environment for the JNDI InitialContext, or <code>null</code> if none should be used.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>the environment for the JNDI InitialContext, or <code>null</code> if none should be used.</DL>
</DD>
</DL>
<HR>
<A NAME="execute(org.apache.shiro.jndi.JndiCallback)"><!-- --></A><H3>
execute</H3>
<PRE>
public <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> <A HREF="../../../../src-html/org/apache/shiro/jndi/JndiTemplate.html#line.90"><B>execute</B></A>(<A HREF="../../../../org/apache/shiro/jndi/JndiCallback.html" title="interface in org.apache.shiro.jndi">JndiCallback</A>&nbsp;contextCallback)
throws <A HREF="http://java.sun.com/javase/6/docs/api/javax/naming/NamingException.html?is-external=true" title="class or interface in javax.naming">NamingException</A></PRE>
<DL>
<DD>Execute the given JNDI context callback implementation.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>contextCallback</CODE> - JndiCallback implementation
<DT><B>Returns:</B><DD>a result object returned by the callback, or <code>null</code>
<DT><B>Throws:</B>
<DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/javax/naming/NamingException.html?is-external=true" title="class or interface in javax.naming">NamingException</A></CODE> - thrown by the callback implementation<DT><B>See Also:</B><DD><A HREF="../../../../org/apache/shiro/jndi/JndiTemplate.html#createInitialContext()"><CODE>createInitialContext()</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="createInitialContext()"><!-- --></A><H3>
createInitialContext</H3>
<PRE>
protected <A HREF="http://java.sun.com/javase/6/docs/api/javax/naming/Context.html?is-external=true" title="class or interface in javax.naming">Context</A> <A HREF="../../../../src-html/org/apache/shiro/jndi/JndiTemplate.html#line.113"><B>createInitialContext</B></A>()
throws <A HREF="http://java.sun.com/javase/6/docs/api/javax/naming/NamingException.html?is-external=true" title="class or interface in javax.naming">NamingException</A></PRE>
<DL>
<DD>Create a new JNDI initial context. Invoked by <A HREF="../../../../org/apache/shiro/jndi/JndiTemplate.html#execute(org.apache.shiro.jndi.JndiCallback)"><CODE>execute(org.apache.shiro.jndi.JndiCallback)</CODE></A>.
<p>The default implementation use this template's environment settings.
Can be subclassed for custom contexts, e.g. for testing.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>the initial Context instance
<DT><B>Throws:</B>
<DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/javax/naming/NamingException.html?is-external=true" title="class or interface in javax.naming">NamingException</A></CODE> - in case of initialization errors</DL>
</DD>
</DL>
<HR>
<A NAME="lookup(java.lang.String)"><!-- --></A><H3>
lookup</H3>
<PRE>
public <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> <A HREF="../../../../src-html/org/apache/shiro/jndi/JndiTemplate.html#line.135"><B>lookup</B></A>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;name)
throws <A HREF="http://java.sun.com/javase/6/docs/api/javax/naming/NamingException.html?is-external=true" title="class or interface in javax.naming">NamingException</A></PRE>
<DL>
<DD>Look up the object with the given name in the current JNDI context.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>name</CODE> - the JNDI name of the object
<DT><B>Returns:</B><DD>object found (cannot be <code>null</code>; if a not so well-behaved
JNDI implementations returns null, a NamingException gets thrown)
<DT><B>Throws:</B>
<DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/javax/naming/NamingException.html?is-external=true" title="class or interface in javax.naming">NamingException</A></CODE> - if there is no object with the given
name bound to JNDI</DL>
</DD>
</DL>
<HR>
<A NAME="lookup(java.lang.String, java.lang.Class)"><!-- --></A><H3>
lookup</H3>
<PRE>
public <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> <A HREF="../../../../src-html/org/apache/shiro/jndi/JndiTemplate.html#line.162"><B>lookup</B></A>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;name,
<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</A>&nbsp;requiredType)
throws <A HREF="http://java.sun.com/javase/6/docs/api/javax/naming/NamingException.html?is-external=true" title="class or interface in javax.naming">NamingException</A></PRE>
<DL>
<DD>Look up the object with the given name in the current JNDI context.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>name</CODE> - the JNDI name of the object<DD><CODE>requiredType</CODE> - type the JNDI object must match. Can be an interface or
superclass of the actual class, or <code>null</code> for any match. For example,
if the value is <code>Object.class</code>, this method will succeed whatever
the class of the returned instance.
<DT><B>Returns:</B><DD>object found (cannot be <code>null</code>; if a not so well-behaved
JNDI implementations returns null, a NamingException gets thrown)
<DT><B>Throws:</B>
<DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/javax/naming/NamingException.html?is-external=true" title="class or interface in javax.naming">NamingException</A></CODE> - if there is no object with the given
name bound to JNDI</DL>
</DD>
</DL>
<HR>
<A NAME="bind(java.lang.String, java.lang.Object)"><!-- --></A><H3>
bind</H3>
<PRE>
public void <A HREF="../../../../src-html/org/apache/shiro/jndi/JndiTemplate.html#line.180"><B>bind</B></A>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;name,
<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>&nbsp;object)
throws <A HREF="http://java.sun.com/javase/6/docs/api/javax/naming/NamingException.html?is-external=true" title="class or interface in javax.naming">NamingException</A></PRE>
<DL>
<DD>Bind the given object to the current JNDI context, using the given name.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>name</CODE> - the JNDI name of the object<DD><CODE>object</CODE> - the object to bind
<DT><B>Throws:</B>
<DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/javax/naming/NamingException.html?is-external=true" title="class or interface in javax.naming">NamingException</A></CODE> - thrown by JNDI, mostly name already bound</DL>
</DD>
</DL>
<HR>
<A NAME="rebind(java.lang.String, java.lang.Object)"><!-- --></A><H3>
rebind</H3>
<PRE>
public void <A HREF="../../../../src-html/org/apache/shiro/jndi/JndiTemplate.html#line.198"><B>rebind</B></A>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;name,
<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A>&nbsp;object)
throws <A HREF="http://java.sun.com/javase/6/docs/api/javax/naming/NamingException.html?is-external=true" title="class or interface in javax.naming">NamingException</A></PRE>
<DL>
<DD>Rebind the given object to the current JNDI context, using the given name.
Overwrites any existing binding.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>name</CODE> - the JNDI name of the object<DD><CODE>object</CODE> - the object to rebind
<DT><B>Throws:</B>
<DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/javax/naming/NamingException.html?is-external=true" title="class or interface in javax.naming">NamingException</A></CODE> - thrown by JNDI</DL>
</DD>
</DL>
<HR>
<A NAME="unbind(java.lang.String)"><!-- --></A><H3>
unbind</H3>
<PRE>
public void <A HREF="../../../../src-html/org/apache/shiro/jndi/JndiTemplate.html#line.214"><B>unbind</B></A>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;name)
throws <A HREF="http://java.sun.com/javase/6/docs/api/javax/naming/NamingException.html?is-external=true" title="class or interface in javax.naming">NamingException</A></PRE>
<DL>
<DD>Remove the binding for the given name from the current JNDI context.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>name</CODE> - the JNDI name of the object
<DT><B>Throws:</B>
<DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/javax/naming/NamingException.html?is-external=true" title="class or interface in javax.naming">NamingException</A></CODE> - thrown by JNDI, mostly name not found</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/JndiTemplate.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../org/apache/shiro/jndi/JndiObjectFactory.html" title="class in org.apache.shiro.jndi"><B>PREV CLASS</B></A>&nbsp;
&nbsp;NEXT CLASS</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../index.html?org/apache/shiro/jndi/JndiTemplate.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="JndiTemplate.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
Copyright &#169; 2004-2016 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All Rights Reserved.
</BODY>
</HTML>