blob: c1f5c1e1214d759ddd661311f1adf17e67efcb5c [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_21) on Thu May 30 15:02:19 PDT 2013 -->
<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
<title>EnvironmentLoader (Apache Shiro 1.2.2 API)</title>
<meta name="date" content="2013-05-30">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="EnvironmentLoader (Apache Shiro 1.2.2 API)";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/EnvironmentLoader.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../org/apache/shiro/web/env/DefaultWebEnvironment.html" title="class in org.apache.shiro.web.env"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../../org/apache/shiro/web/env/EnvironmentLoaderListener.html" title="class in org.apache.shiro.web.env"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/shiro/web/env/EnvironmentLoader.html" target="_top">Frames</a></li>
<li><a href="EnvironmentLoader.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field_summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field_detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.apache.shiro.web.env</div>
<h2 title="Class EnvironmentLoader" class="title">Class EnvironmentLoader</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><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></li>
<li>
<ul class="inheritance">
<li>org.apache.shiro.web.env.EnvironmentLoader</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>Direct Known Subclasses:</dt>
<dd><a href="../../../../../org/apache/shiro/web/env/EnvironmentLoaderListener.html" title="class in org.apache.shiro.web.env">EnvironmentLoaderListener</a></dd>
</dl>
<hr>
<br>
<pre>public class <a href="../../../../../src-html/org/apache/shiro/web/env/EnvironmentLoader.html#line.92">EnvironmentLoader</a>
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></pre>
<div class="block">An <code>EnvironmentLoader</code> is responsible for loading a web application's Shiro <a href="../../../../../org/apache/shiro/web/env/WebEnvironment.html" title="interface in org.apache.shiro.web.env"><code>WebEnvironment</code></a>
(which includes the web app's <a href="../../../../../org/apache/shiro/web/mgt/WebSecurityManager.html" title="interface in org.apache.shiro.web.mgt"><code>WebSecurityManager</code></a>) into the
<code>ServletContext</code> at application startup.
<p/>
In Shiro 1.1 and earlier, the Shiro ServletFilter was responsible for creating the <code>WebSecurityManager</code> and
any additional objects (security filters, etc). However, any component not filtered by the Shiro Filter (such
as other context listeners) was not able to easily acquire the these objects to perform security operations.
<p/>
Due to this, in Shiro 1.2 and later, this <code>EnvironmentLoader</code> (or more likely, the
<a href="../../../../../org/apache/shiro/web/env/EnvironmentLoaderListener.html" title="class in org.apache.shiro.web.env"><code>EnvironmentLoaderListener</code></a> subclass) is the preferred mechanism to initialize
a Shiro environment. The Shiro Filter, while still required for request filtering, will not perform this
initialization at startup if the <code>EnvironmentLoader</code> (or listener) runs first.
<h2>Usage</h2>
This implementation will look for two servlet context <code>context-param</code>s in <code>web.xml</code>:
<code>shiroEnvironmentClass</code> and <code>shiroConfigLocations</code> that customize how the <code>WebEnvironment</code> instance
will be initialized.
<h3>shiroEnvironmentClass</h3>
The <code>shiroEnvironmentClass</code> <code>context-param</code>, if it exists, allows you to specify the
fully-qualified implementation class name of the <a href="../../../../../org/apache/shiro/web/env/WebEnvironment.html" title="interface in org.apache.shiro.web.env"><code>WebEnvironment</code></a> to instantiate. For example:
<pre>
&lt;context-param&gt;
&lt;param-name&gt;shiroEnvironmentClass&lt;/param-name&gt;
&lt;param-value&gt;com.foo.bar.shiro.MyWebEnvironment&lt;/param-value&gt;
&lt;/context-param&gt;
</pre>
If not specified, the default value is the <a href="../../../../../org/apache/shiro/web/env/IniWebEnvironment.html" title="class in org.apache.shiro.web.env"><code>IniWebEnvironment</code></a> class, which assumes Shiro's default
<a href="http://shiro.apache.org/configuration.html">INI configuration format</a>
<h3>shiroConfigLocations</h3>
The <code>shiroConfigLocations</code> <code>context-param</code>, if it exists, allows you to specify the config location(s)
(resource path(s)) that will be relayed to the instantiated <a href="../../../../../org/apache/shiro/web/env/WebEnvironment.html" title="interface in org.apache.shiro.web.env"><code>WebEnvironment</code></a>. For example:
<pre>
&lt;context-param&gt;
&lt;param-name&gt;shiroConfigLocations&lt;/param-name&gt;
&lt;param-value&gt;/WEB-INF/someLocation/shiro.ini&lt;/param-value&gt;
&lt;/context-param&gt;
</pre>
The <code>WebEnvironment</code> implementation must implement the <a href="../../../../../org/apache/shiro/config/ResourceConfigurable.html" title="interface in org.apache.shiro.config"><code>ResourceConfigurable</code></a> interface if it is to
acquire the <code>shiroConfigLocations</code> value.
<p/>
If this <code>context-param</code> is not specified, the <code>WebEnvironment</code> instance determines default resource
lookup behavior. For example, the <a href="../../../../../org/apache/shiro/web/env/IniWebEnvironment.html" title="class in org.apache.shiro.web.env"><code>IniWebEnvironment</code></a> will check the following two locations for INI config
by default (in order):
<ol>
<li>/WEB-INF/shiro.ini</li>
<li>classpath:shiro.ini</li>
</ol>
<h2>Web Security Enforcement</h2>
Using this loader will only initialize Shiro's environment in a web application - it will not filter web requests or
perform web-specific security operations. To do this, you must ensure that you have also configured the
<a href="../../../../../org/apache/shiro/web/servlet/ShiroFilter.html" title="class in org.apache.shiro.web.servlet"><code>ShiroFilter</code></a> in <code>web.xml</code>.
<p/>
Finally, it should be noted that this implementation was based on ideas in Spring 3's
<code>org.springframework.web.context.ContextLoader</code> implementation - no need to reinvent the wheel for this common
behavior.</div>
<dl><dt><span class="strong">Since:</span></dt>
<dd>1.2</dd>
<dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../org/apache/shiro/web/env/EnvironmentLoaderListener.html" title="class in org.apache.shiro.web.env"><code>EnvironmentLoaderListener</code></a>,
<a href="../../../../../org/apache/shiro/web/servlet/ShiroFilter.html" title="class in org.apache.shiro.web.servlet"><code>ShiroFilter</code></a></dd></dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field_summary">
<!-- -->
</a>
<h3>Field Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation">
<caption><span>Fields</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Field and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static <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></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/shiro/web/env/EnvironmentLoader.html#CONFIG_LOCATIONS_PARAM">CONFIG_LOCATIONS_PARAM</a></strong></code>
<div class="block">Servlet Context config param for the resource path to use for configuring the <a href="../../../../../org/apache/shiro/web/env/WebEnvironment.html" title="interface in org.apache.shiro.web.env"><code>WebEnvironment</code></a> instance:
<code>shiroConfigLocations</code></div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static <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></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/shiro/web/env/EnvironmentLoader.html#ENVIRONMENT_ATTRIBUTE_KEY">ENVIRONMENT_ATTRIBUTE_KEY</a></strong></code>&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static <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></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/shiro/web/env/EnvironmentLoader.html#ENVIRONMENT_CLASS_PARAM">ENVIRONMENT_CLASS_PARAM</a></strong></code>
<div class="block">Servlet Context config param for specifying the <a href="../../../../../org/apache/shiro/web/env/WebEnvironment.html" title="interface in org.apache.shiro.web.env"><code>WebEnvironment</code></a> implementation class to use:
<code>shiroEnvironmentClass</code></div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../../../org/apache/shiro/web/env/EnvironmentLoader.html#EnvironmentLoader()">EnvironmentLoader</a></strong>()</code>&nbsp;</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected <a href="../../../../../org/apache/shiro/web/env/WebEnvironment.html" title="interface in org.apache.shiro.web.env">WebEnvironment</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/shiro/web/env/EnvironmentLoader.html#createEnvironment(javax.servlet.ServletContext)">createEnvironment</a></strong>(<a href="http://java.sun.com/javaee/5/docs/api/javax/servlet/ServletContext.html?is-external=true" title="class or interface in javax.servlet">ServletContext</a>&nbsp;sc)</code>
<div class="block">Instantiates a <a href="../../../../../org/apache/shiro/web/env/WebEnvironment.html" title="interface in org.apache.shiro.web.env"><code>WebEnvironment</code></a> based on the specified ServletContext.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected void</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/shiro/web/env/EnvironmentLoader.html#customizeEnvironment(org.apache.shiro.web.env.WebEnvironment)">customizeEnvironment</a></strong>(<a href="../../../../../org/apache/shiro/web/env/WebEnvironment.html" title="interface in org.apache.shiro.web.env">WebEnvironment</a>&nbsp;environment)</code>&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/shiro/web/env/EnvironmentLoader.html#destroyEnvironment(javax.servlet.ServletContext)">destroyEnvironment</a></strong>(<a href="http://java.sun.com/javaee/5/docs/api/javax/servlet/ServletContext.html?is-external=true" title="class or interface in javax.servlet">ServletContext</a>&nbsp;servletContext)</code>
<div class="block">Destroys the <a href="../../../../../org/apache/shiro/web/env/WebEnvironment.html" title="interface in org.apache.shiro.web.env"><code>WebEnvironment</code></a> for the given servlet context.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected <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>&lt;?&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/shiro/web/env/EnvironmentLoader.html#determineWebEnvironmentClass(javax.servlet.ServletContext)">determineWebEnvironmentClass</a></strong>(<a href="http://java.sun.com/javaee/5/docs/api/javax/servlet/ServletContext.html?is-external=true" title="class or interface in javax.servlet">ServletContext</a>&nbsp;servletContext)</code>
<div class="block">Return the WebEnvironment implementation class to use, either the default
<a href="../../../../../org/apache/shiro/web/env/IniWebEnvironment.html" title="class in org.apache.shiro.web.env"><code>IniWebEnvironment</code></a> or a custom class if specified.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../org/apache/shiro/web/env/WebEnvironment.html" title="interface in org.apache.shiro.web.env">WebEnvironment</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/shiro/web/env/EnvironmentLoader.html#initEnvironment(javax.servlet.ServletContext)">initEnvironment</a></strong>(<a href="http://java.sun.com/javaee/5/docs/api/javax/servlet/ServletContext.html?is-external=true" title="class or interface in javax.servlet">ServletContext</a>&nbsp;servletContext)</code>
<div class="block">Initializes Shiro's <a href="../../../../../org/apache/shiro/web/env/WebEnvironment.html" title="interface in org.apache.shiro.web.env"><code>WebEnvironment</code></a> instance for the specified <code>ServletContext</code> based on the
<a href="../../../../../org/apache/shiro/web/env/EnvironmentLoader.html#CONFIG_LOCATIONS_PARAM"><code>CONFIG_LOCATIONS_PARAM</code></a> value.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;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></h3>
<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></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ FIELD DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="field_detail">
<!-- -->
</a>
<h3>Field Detail</h3>
<a name="ENVIRONMENT_CLASS_PARAM">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>ENVIRONMENT_CLASS_PARAM</h4>
<pre>public static final&nbsp;<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> <a href="../../../../../src-html/org/apache/shiro/web/env/EnvironmentLoader.html#line.98">ENVIRONMENT_CLASS_PARAM</a></pre>
<div class="block">Servlet Context config param for specifying the <a href="../../../../../org/apache/shiro/web/env/WebEnvironment.html" title="interface in org.apache.shiro.web.env"><code>WebEnvironment</code></a> implementation class to use:
<code>shiroEnvironmentClass</code></div>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../constant-values.html#org.apache.shiro.web.env.EnvironmentLoader.ENVIRONMENT_CLASS_PARAM">Constant Field Values</a></dd></dl>
</li>
</ul>
<a name="CONFIG_LOCATIONS_PARAM">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>CONFIG_LOCATIONS_PARAM</h4>
<pre>public static final&nbsp;<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> <a href="../../../../../src-html/org/apache/shiro/web/env/EnvironmentLoader.html#line.104">CONFIG_LOCATIONS_PARAM</a></pre>
<div class="block">Servlet Context config param for the resource path to use for configuring the <a href="../../../../../org/apache/shiro/web/env/WebEnvironment.html" title="interface in org.apache.shiro.web.env"><code>WebEnvironment</code></a> instance:
<code>shiroConfigLocations</code></div>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../constant-values.html#org.apache.shiro.web.env.EnvironmentLoader.CONFIG_LOCATIONS_PARAM">Constant Field Values</a></dd></dl>
</li>
</ul>
<a name="ENVIRONMENT_ATTRIBUTE_KEY">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>ENVIRONMENT_ATTRIBUTE_KEY</h4>
<pre>public static final&nbsp;<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> <a href="../../../../../src-html/org/apache/shiro/web/env/EnvironmentLoader.html#line.106">ENVIRONMENT_ATTRIBUTE_KEY</a></pre>
</li>
</ul>
</li>
</ul>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="EnvironmentLoader()">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>EnvironmentLoader</h4>
<pre>public&nbsp;<a href="../../../../../src-html/org/apache/shiro/web/env/EnvironmentLoader.html#line.92">EnvironmentLoader</a>()</pre>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="initEnvironment(javax.servlet.ServletContext)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>initEnvironment</h4>
<pre>public&nbsp;<a href="../../../../../org/apache/shiro/web/env/WebEnvironment.html" title="interface in org.apache.shiro.web.env">WebEnvironment</a>&nbsp;<a href="../../../../../src-html/org/apache/shiro/web/env/EnvironmentLoader.html#line.119">initEnvironment</a>(<a href="http://java.sun.com/javaee/5/docs/api/javax/servlet/ServletContext.html?is-external=true" title="class or interface in javax.servlet">ServletContext</a>&nbsp;servletContext)
throws <a href="http://java.sun.com/javase/6/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</a></pre>
<div class="block">Initializes Shiro's <a href="../../../../../org/apache/shiro/web/env/WebEnvironment.html" title="interface in org.apache.shiro.web.env"><code>WebEnvironment</code></a> instance for the specified <code>ServletContext</code> based on the
<a href="../../../../../org/apache/shiro/web/env/EnvironmentLoader.html#CONFIG_LOCATIONS_PARAM"><code>CONFIG_LOCATIONS_PARAM</code></a> value.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>servletContext</code> - current servlet context</dd>
<dt><span class="strong">Returns:</span></dt><dd>the new Shiro <code>WebEnvironment</code> instance.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://java.sun.com/javase/6/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</a></code> - if an existing WebEnvironment has already been initialized and associated with
the specified <code>ServletContext</code>.</dd></dl>
</li>
</ul>
<a name="determineWebEnvironmentClass(javax.servlet.ServletContext)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>determineWebEnvironmentClass</h4>
<pre>protected&nbsp;<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>&lt;?&gt;&nbsp;<a href="../../../../../src-html/org/apache/shiro/web/env/EnvironmentLoader.html#line.165">determineWebEnvironmentClass</a>(<a href="http://java.sun.com/javaee/5/docs/api/javax/servlet/ServletContext.html?is-external=true" title="class or interface in javax.servlet">ServletContext</a>&nbsp;servletContext)</pre>
<div class="block">Return the WebEnvironment implementation class to use, either the default
<a href="../../../../../org/apache/shiro/web/env/IniWebEnvironment.html" title="class in org.apache.shiro.web.env"><code>IniWebEnvironment</code></a> or a custom class if specified.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>servletContext</code> - current servlet context</dd>
<dt><span class="strong">Returns:</span></dt><dd>the WebEnvironment implementation class to use</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../org/apache/shiro/web/env/EnvironmentLoader.html#ENVIRONMENT_CLASS_PARAM"><code>ENVIRONMENT_CLASS_PARAM</code></a>,
<a href="../../../../../org/apache/shiro/web/env/IniWebEnvironment.html" title="class in org.apache.shiro.web.env"><code>IniWebEnvironment</code></a></dd></dl>
</li>
</ul>
<a name="createEnvironment(javax.servlet.ServletContext)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>createEnvironment</h4>
<pre>protected&nbsp;<a href="../../../../../org/apache/shiro/web/env/WebEnvironment.html" title="interface in org.apache.shiro.web.env">WebEnvironment</a>&nbsp;<a href="../../../../../src-html/org/apache/shiro/web/env/EnvironmentLoader.html#line.193">createEnvironment</a>(<a href="http://java.sun.com/javaee/5/docs/api/javax/servlet/ServletContext.html?is-external=true" title="class or interface in javax.servlet">ServletContext</a>&nbsp;sc)</pre>
<div class="block">Instantiates a <a href="../../../../../org/apache/shiro/web/env/WebEnvironment.html" title="interface in org.apache.shiro.web.env"><code>WebEnvironment</code></a> based on the specified ServletContext.
<p/>
This implementation <a href="../../../../../org/apache/shiro/web/env/EnvironmentLoader.html#determineWebEnvironmentClass(javax.servlet.ServletContext)"><code>determines</code></a> a
<a href="../../../../../org/apache/shiro/web/env/WebEnvironment.html" title="interface in org.apache.shiro.web.env"><code>WebEnvironment</code></a> implementation class to use. That class is instantiated, configured, and returned.
<p/>
This allows custom <code>WebEnvironment</code> implementations to be specified via a ServletContext init-param if
desired. If not specified, the default <a href="../../../../../org/apache/shiro/web/env/IniWebEnvironment.html" title="class in org.apache.shiro.web.env"><code>IniWebEnvironment</code></a> implementation will be used.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>sc</code> - current servlet context</dd>
<dt><span class="strong">Returns:</span></dt><dd>the constructed Shiro WebEnvironment instance</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../org/apache/shiro/web/env/MutableWebEnvironment.html" title="interface in org.apache.shiro.web.env"><code>MutableWebEnvironment</code></a>,
<a href="../../../../../org/apache/shiro/config/ResourceConfigurable.html" title="interface in org.apache.shiro.config"><code>ResourceConfigurable</code></a></dd></dl>
</li>
</ul>
<a name="customizeEnvironment(org.apache.shiro.web.env.WebEnvironment)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>customizeEnvironment</h4>
<pre>protected&nbsp;void&nbsp;<a href="../../../../../src-html/org/apache/shiro/web/env/EnvironmentLoader.html#line.226">customizeEnvironment</a>(<a href="../../../../../org/apache/shiro/web/env/WebEnvironment.html" title="interface in org.apache.shiro.web.env">WebEnvironment</a>&nbsp;environment)</pre>
</li>
</ul>
<a name="destroyEnvironment(javax.servlet.ServletContext)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>destroyEnvironment</h4>
<pre>public&nbsp;void&nbsp;<a href="../../../../../src-html/org/apache/shiro/web/env/EnvironmentLoader.html#line.234">destroyEnvironment</a>(<a href="http://java.sun.com/javaee/5/docs/api/javax/servlet/ServletContext.html?is-external=true" title="class or interface in javax.servlet">ServletContext</a>&nbsp;servletContext)</pre>
<div class="block">Destroys the <a href="../../../../../org/apache/shiro/web/env/WebEnvironment.html" title="interface in org.apache.shiro.web.env"><code>WebEnvironment</code></a> for the given servlet context.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>servletContext</code> - the ServletContext attributed to the WebSecurityManager</dd></dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/EnvironmentLoader.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../org/apache/shiro/web/env/DefaultWebEnvironment.html" title="class in org.apache.shiro.web.env"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../../org/apache/shiro/web/env/EnvironmentLoaderListener.html" title="class in org.apache.shiro.web.env"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/shiro/web/env/EnvironmentLoader.html" target="_top">Frames</a></li>
<li><a href="EnvironmentLoader.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field_summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field_detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright &#169; 2004-2013 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All Rights Reserved.</small></p>
</body>
</html>