blob: 5cd9b1318d867b5bed3d5964b4a78f3141c93566 [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 (1.8.0_92) on Mon Nov 14 15:04:21 EST 2016 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>EnvironmentLoader (Apache Shiro 1.4.0-RC2 API)</title>
<meta name="date" content="2016-11-14">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="EnvironmentLoader (Apache Shiro 1.4.0-RC2 API)";
}
}
catch(err) {
}
//-->
var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<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="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../../org/apache/shiro/web/env/EnvironmentLoaderListener.html" title="class in org.apache.shiro.web.env"><span class="typeNameLink">Next&nbsp;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&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../allclasses-noframe.html">All&nbsp;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="simpleTagLabel">Since:</span></dt>
<dd>1.2</dd>
<dt><span class="seeLabel">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="memberSummary" 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><span class="memberNameLink"><a href="../../../../../org/apache/shiro/web/env/EnvironmentLoader.html#CONFIG_LOCATIONS_PARAM">CONFIG_LOCATIONS_PARAM</a></span></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><span class="memberNameLink"><a href="../../../../../org/apache/shiro/web/env/EnvironmentLoader.html#ENVIRONMENT_ATTRIBUTE_KEY">ENVIRONMENT_ATTRIBUTE_KEY</a></span></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><span class="memberNameLink"><a href="../../../../../org/apache/shiro/web/env/EnvironmentLoader.html#ENVIRONMENT_CLASS_PARAM">ENVIRONMENT_CLASS_PARAM</a></span></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="memberSummary" 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><span class="memberNameLink"><a href="../../../../../org/apache/shiro/web/env/EnvironmentLoader.html#EnvironmentLoader--">EnvironmentLoader</a></span>()</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="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" 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><span class="memberNameLink"><a href="../../../../../org/apache/shiro/web/env/EnvironmentLoader.html#createEnvironment-javax.servlet.ServletContext-">createEnvironment</a></span>(<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 id="i1" class="rowColor">
<td class="colFirst"><code>protected void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/shiro/web/env/EnvironmentLoader.html#customizeEnvironment-org.apache.shiro.web.env.WebEnvironment-">customizeEnvironment</a></span>(<a href="../../../../../org/apache/shiro/web/env/WebEnvironment.html" title="interface in org.apache.shiro.web.env">WebEnvironment</a>&nbsp;environment)</code>
<div class="block">Any additional customization of the Environment can be by overriding this method.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/shiro/web/env/EnvironmentLoader.html#destroyEnvironment-javax.servlet.ServletContext-">destroyEnvironment</a></span>(<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 id="i3" 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><span class="memberNameLink"><a href="../../../../../org/apache/shiro/web/env/EnvironmentLoader.html#determineWebEnvironmentClass-javax.servlet.ServletContext-">determineWebEnvironmentClass</a></span>(<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 id="i4" class="altColor">
<td class="colFirst"><code>protected void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/shiro/web/env/EnvironmentLoader.html#finalizeEnvironment-org.apache.shiro.web.env.WebEnvironment-">finalizeEnvironment</a></span>(<a href="../../../../../org/apache/shiro/web/env/WebEnvironment.html" title="interface in org.apache.shiro.web.env">WebEnvironment</a>&nbsp;environment)</code>
<div class="block">Any additional cleanup of the Environment can be done by overriding this method.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<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><span class="memberNameLink"><a href="../../../../../org/apache/shiro/web/env/EnvironmentLoader.html#initEnvironment-javax.servlet.ServletContext-">initEnvironment</a></span>(<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="seeLabel">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="seeLabel">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="paramLabel">Parameters:</span></dt>
<dd><code>servletContext</code> - current servlet context</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the new Shiro <code>WebEnvironment</code> instance.</dd>
<dt><span class="throwsLabel">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.166">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="paramLabel">Parameters:</span></dt>
<dd><code>servletContext</code> - current servlet context</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the WebEnvironment implementation class to use</dd>
<dt><span class="seeLabel">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.194">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="paramLabel">Parameters:</span></dt>
<dd><code>sc</code> - current servlet context</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the constructed Shiro WebEnvironment instance</dd>
<dt><span class="seeLabel">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.232">customizeEnvironment</a>(<a href="../../../../../org/apache/shiro/web/env/WebEnvironment.html" title="interface in org.apache.shiro.web.env">WebEnvironment</a>&nbsp;environment)</pre>
<div class="block">Any additional customization of the Environment can be by overriding this method. For example setup shared
resources, etc. By default this method does nothing.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>environment</code> - </dd>
</dl>
</li>
</ul>
<a name="destroyEnvironment-javax.servlet.ServletContext-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>destroyEnvironment</h4>
<pre>public&nbsp;void&nbsp;<a href="../../../../../src-html/org/apache/shiro/web/env/EnvironmentLoader.html#line.240">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="paramLabel">Parameters:</span></dt>
<dd><code>servletContext</code> - the ServletContext attributed to the WebSecurityManager</dd>
</dl>
</li>
</ul>
<a name="finalizeEnvironment-org.apache.shiro.web.env.WebEnvironment-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>finalizeEnvironment</h4>
<pre>protected&nbsp;void&nbsp;<a href="../../../../../src-html/org/apache/shiro/web/env/EnvironmentLoader.html#line.259">finalizeEnvironment</a>(<a href="../../../../../org/apache/shiro/web/env/WebEnvironment.html" title="interface in org.apache.shiro.web.env">WebEnvironment</a>&nbsp;environment)</pre>
<div class="block">Any additional cleanup of the Environment can be done by overriding this method. For example clean up shared
resources, etc. By default this method does nothing.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>environment</code> - </dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>1.3</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>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<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="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../../org/apache/shiro/web/env/EnvironmentLoaderListener.html" title="class in org.apache.shiro.web.env"><span class="typeNameLink">Next&nbsp;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&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../allclasses-noframe.html">All&nbsp;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&#x2013;2016 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
</body>
</html>