blob: fac50184cd1f5b2de3f1ceed1d3e6f40dac75770 [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>
<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
<title>AccessController (Apache Axis2)</title>
<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="AccessController (Apache Axis2)";
}
//-->
</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/AccessController.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>Prev Class</li>
<li><a href="../../../../../org/apache/axis2/java/security/TrustAllTrustManager.html" title="class in org.apache.axis2.java.security"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/axis2/java/security/AccessController.html" target="_top">Frames</a></li>
<li><a href="AccessController.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>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&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.axis2.java.security</div>
<h2 title="Class AccessController" class="title">Class AccessController</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="https://docs.oracle.com/javase/7/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.axis2.java.security.AccessController</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public class <span class="strong">AccessController</span>
extends <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></pre>
<div class="block">This utility wrapper class is created to support AXIS2 runs
inside of Java 2 Security environment. Due to the access control
checking algorithm, for Java 2 Security to function properly,
<code>doPrivileged()</code>
is required in cases where there is application code on the stack frame
accessing the system resources (ie, read/write files, opening ports, and etc).
This class also improve performance no matther Security Manager is being enabled
or not.
<p/>
Note: This utility should be used properly, otherwise might introduce
security holes.
<p/>
Usage Example:
<code>
public void changePassword() {
...
AccessController.doPrivileged(new PrivilegedAction() {
public Object run() {
f = Util.openPasswordFile();
...
<p/>
}
});
...
}
</code></div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ========== 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>static void</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/axis2/java/security/AccessController.html#checkPermission(java.security.Permission)">checkPermission</a></strong>(<a href="https://docs.oracle.com/javase/7/docs/api/java/security/Permission.html?is-external=true" title="class or interface in java.security">Permission</a>&nbsp;perm)</code>
<div class="block">Determines whether the access request indicated by the
specified permission should be allowed or denied, based on
the security policy currently in effect.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static &lt;T&gt;&nbsp;T</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/axis2/java/security/AccessController.html#doPrivileged(java.security.PrivilegedAction)">doPrivileged</a></strong>(<a href="https://docs.oracle.com/javase/7/docs/api/java/security/PrivilegedAction.html?is-external=true" title="class or interface in java.security">PrivilegedAction</a>&lt;T&gt;&nbsp;action)</code>
<div class="block">Performs the specified <code>PrivilegedAction</code> with privileges
enabled if a security manager is present.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static &lt;T&gt;&nbsp;T</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/axis2/java/security/AccessController.html#doPrivileged(java.security.PrivilegedAction, java.security.AccessControlContext)">doPrivileged</a></strong>(<a href="https://docs.oracle.com/javase/7/docs/api/java/security/PrivilegedAction.html?is-external=true" title="class or interface in java.security">PrivilegedAction</a>&lt;T&gt;&nbsp;action,
<a href="https://docs.oracle.com/javase/7/docs/api/java/security/AccessControlContext.html?is-external=true" title="class or interface in java.security">AccessControlContext</a>&nbsp;context)</code>
<div class="block">Performs the specified <code>PrivilegedAction</code> with privileges
enabled and restricted by the specified <code>AccessControlContext</code>.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static &lt;T&gt;&nbsp;T</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/axis2/java/security/AccessController.html#doPrivileged(java.security.PrivilegedExceptionAction)">doPrivileged</a></strong>(<a href="https://docs.oracle.com/javase/7/docs/api/java/security/PrivilegedExceptionAction.html?is-external=true" title="class or interface in java.security">PrivilegedExceptionAction</a>&lt;T&gt;&nbsp;action)</code>
<div class="block">Performs the specified <code>PrivilegedExceptionAction</code> with
privileges enabled.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static &lt;T&gt;&nbsp;T</code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/axis2/java/security/AccessController.html#doPrivileged(java.security.PrivilegedExceptionAction, java.security.AccessControlContext)">doPrivileged</a></strong>(<a href="https://docs.oracle.com/javase/7/docs/api/java/security/PrivilegedExceptionAction.html?is-external=true" title="class or interface in java.security">PrivilegedExceptionAction</a>&lt;T&gt;&nbsp;action,
<a href="https://docs.oracle.com/javase/7/docs/api/java/security/AccessControlContext.html?is-external=true" title="class or interface in java.security">AccessControlContext</a>&nbsp;context)</code>
<div class="block">Performs the specified <code>PrivilegedExceptionAction</code> with
privileges enabled and restricted by the specified
<code>AccessControlContext</code>.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/7/docs/api/java/security/AccessControlContext.html?is-external=true" title="class or interface in java.security">AccessControlContext</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../org/apache/axis2/java/security/AccessController.html#getContext()">getContext</a></strong>()</code>
<div class="block">This method takes a "snapshot" of the current calling context, which
includes the current Thread's inherited AccessControlContext,
and places it in an AccessControlContext object.</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="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3>
<code><a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</a>, <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</a>, <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</a>, <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</a>, <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</a>, <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</a>, <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</a>, <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</a>, <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</a>, <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</a>, <a href="https://docs.oracle.com/javase/7/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">
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="doPrivileged(java.security.PrivilegedAction)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>doPrivileged</h4>
<pre>public static&nbsp;&lt;T&gt;&nbsp;T&nbsp;doPrivileged(<a href="https://docs.oracle.com/javase/7/docs/api/java/security/PrivilegedAction.html?is-external=true" title="class or interface in java.security">PrivilegedAction</a>&lt;T&gt;&nbsp;action)</pre>
<div class="block">Performs the specified <code>PrivilegedAction</code> with privileges
enabled if a security manager is present.
<p/>
If the action's <code>run</code> method throws an (unchecked) exception,
it will propagate through this method.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>action</code> - the action to be performed.</dd>
<dt><span class="strong">Returns:</span></dt><dd>the value returned by the action's <code>run</code> method.</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../org/apache/axis2/java/security/AccessController.html#doPrivileged(java.security.PrivilegedAction, java.security.AccessControlContext)"><code>doPrivileged(PrivilegedAction,AccessControlContext)</code></a>,
<a href="../../../../../org/apache/axis2/java/security/AccessController.html#doPrivileged(java.security.PrivilegedExceptionAction)"><code>doPrivileged(PrivilegedExceptionAction)</code></a></dd></dl>
</li>
</ul>
<a name="doPrivileged(java.security.PrivilegedAction, java.security.AccessControlContext)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>doPrivileged</h4>
<pre>public static&nbsp;&lt;T&gt;&nbsp;T&nbsp;doPrivileged(<a href="https://docs.oracle.com/javase/7/docs/api/java/security/PrivilegedAction.html?is-external=true" title="class or interface in java.security">PrivilegedAction</a>&lt;T&gt;&nbsp;action,
<a href="https://docs.oracle.com/javase/7/docs/api/java/security/AccessControlContext.html?is-external=true" title="class or interface in java.security">AccessControlContext</a>&nbsp;context)</pre>
<div class="block">Performs the specified <code>PrivilegedAction</code> with privileges
enabled and restricted by the specified <code>AccessControlContext</code>.
The action is performed with the intersection of the permissions
possessed by the caller's protection domain, and those possessed
by the domains represented by the specified
<code>AccessControlContext</code> if a security manager is present.
<p/>
<p/>
If the action's <code>run</code> method throws an (unchecked) exception,
it will propagate through this method.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>action</code> - the action to be performed.</dd><dd><code>context</code> - an <i>access control context</i> representing the
restriction to be applied to the caller's domain's
privileges before performing the specified action.</dd>
<dt><span class="strong">Returns:</span></dt><dd>the value returned by the action's <code>run</code> method.</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../org/apache/axis2/java/security/AccessController.html#doPrivileged(java.security.PrivilegedAction)"><code>doPrivileged(PrivilegedAction)</code></a>,
<a href="../../../../../org/apache/axis2/java/security/AccessController.html#doPrivileged(java.security.PrivilegedExceptionAction, java.security.AccessControlContext)"><code>doPrivileged(PrivilegedExceptionAction,AccessControlContext)</code></a></dd></dl>
</li>
</ul>
<a name="doPrivileged(java.security.PrivilegedExceptionAction)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>doPrivileged</h4>
<pre>public static&nbsp;&lt;T&gt;&nbsp;T&nbsp;doPrivileged(<a href="https://docs.oracle.com/javase/7/docs/api/java/security/PrivilegedExceptionAction.html?is-external=true" title="class or interface in java.security">PrivilegedExceptionAction</a>&lt;T&gt;&nbsp;action)
throws <a href="https://docs.oracle.com/javase/7/docs/api/java/security/PrivilegedActionException.html?is-external=true" title="class or interface in java.security">PrivilegedActionException</a></pre>
<div class="block">Performs the specified <code>PrivilegedExceptionAction</code> with
privileges enabled. The action is performed with <i>all</i> of the
permissions possessed by the caller's protection domain.
<p/>
If the action's <code>run</code> method throws an <i>unchecked</i>
exception, it will propagate through this method.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>action</code> - the action to be performed.</dd>
<dt><span class="strong">Returns:</span></dt><dd>the value returned by the action's <code>run</code> method.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code>PrivilgedActionException</code> - the specified action's
<code>run</code> method threw a <i>checked</i> exception.</dd>
<dd><code><a href="https://docs.oracle.com/javase/7/docs/api/java/security/PrivilegedActionException.html?is-external=true" title="class or interface in java.security">PrivilegedActionException</a></code></dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../org/apache/axis2/java/security/AccessController.html#doPrivileged(java.security.PrivilegedExceptionAction, java.security.AccessControlContext)"><code>doPrivileged(PrivilegedExceptionAction,AccessControlContext)</code></a>,
<a href="../../../../../org/apache/axis2/java/security/AccessController.html#doPrivileged(java.security.PrivilegedAction)"><code>doPrivileged(PrivilegedAction)</code></a></dd></dl>
</li>
</ul>
<a name="doPrivileged(java.security.PrivilegedExceptionAction, java.security.AccessControlContext)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>doPrivileged</h4>
<pre>public static&nbsp;&lt;T&gt;&nbsp;T&nbsp;doPrivileged(<a href="https://docs.oracle.com/javase/7/docs/api/java/security/PrivilegedExceptionAction.html?is-external=true" title="class or interface in java.security">PrivilegedExceptionAction</a>&lt;T&gt;&nbsp;action,
<a href="https://docs.oracle.com/javase/7/docs/api/java/security/AccessControlContext.html?is-external=true" title="class or interface in java.security">AccessControlContext</a>&nbsp;context)
throws <a href="https://docs.oracle.com/javase/7/docs/api/java/security/PrivilegedActionException.html?is-external=true" title="class or interface in java.security">PrivilegedActionException</a></pre>
<div class="block">Performs the specified <code>PrivilegedExceptionAction</code> with
privileges enabled and restricted by the specified
<code>AccessControlContext</code>. The action is performed with the
intersection of the the permissions possessed by the caller's
protection domain, and those possessed by the domains represented by the
specified <code>AccessControlContext</code>.
<p/>
If the action's <code>run</code> method throws an <i>unchecked</i>
exception, it will propagate through this method.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>action</code> - the action to be performed.</dd><dd><code>context</code> - an <i>access control context</i> representing the
restriction to be applied to the caller's domain's
privileges before performing the specified action.</dd>
<dt><span class="strong">Returns:</span></dt><dd>the value returned by the action's <code>run</code> method.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/7/docs/api/java/security/PrivilegedActionException.html?is-external=true" title="class or interface in java.security">PrivilegedActionException</a></code> - the specified action's
<code>run</code> method
threw a <i>checked</i> exception.</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../org/apache/axis2/java/security/AccessController.html#doPrivileged(java.security.PrivilegedAction)"><code>doPrivileged(PrivilegedAction)</code></a>,
<a href="../../../../../org/apache/axis2/java/security/AccessController.html#doPrivileged(java.security.PrivilegedExceptionAction, java.security.AccessControlContext)"><code>doPrivileged(PrivilegedExceptionAction,AccessControlContext)</code></a></dd></dl>
</li>
</ul>
<a name="getContext()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getContext</h4>
<pre>public static&nbsp;<a href="https://docs.oracle.com/javase/7/docs/api/java/security/AccessControlContext.html?is-external=true" title="class or interface in java.security">AccessControlContext</a>&nbsp;getContext()</pre>
<div class="block">This method takes a "snapshot" of the current calling context, which
includes the current Thread's inherited AccessControlContext,
and places it in an AccessControlContext object. This context may then
be checked at a later point, possibly in another thread.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>the AccessControlContext based on the current context.</dd><dt><span class="strong">See Also:</span></dt><dd><a href="https://docs.oracle.com/javase/7/docs/api/java/security/AccessControlContext.html?is-external=true" title="class or interface in java.security"><code>AccessControlContext</code></a></dd></dl>
</li>
</ul>
<a name="checkPermission(java.security.Permission)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>checkPermission</h4>
<pre>public static&nbsp;void&nbsp;checkPermission(<a href="https://docs.oracle.com/javase/7/docs/api/java/security/Permission.html?is-external=true" title="class or interface in java.security">Permission</a>&nbsp;perm)
throws <a href="https://docs.oracle.com/javase/7/docs/api/java/security/AccessControlException.html?is-external=true" title="class or interface in java.security">AccessControlException</a></pre>
<div class="block">Determines whether the access request indicated by the
specified permission should be allowed or denied, based on
the security policy currently in effect.
This method quietly returns if the access request
is permitted, or throws a suitable AccessControlException otherwise.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>perm</code> - the requested permission.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/7/docs/api/java/security/AccessControlException.html?is-external=true" title="class or interface in java.security">AccessControlException</a></code> - if the specified permission
is not permitted, based on the current security policy.</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/AccessController.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>Prev Class</li>
<li><a href="../../../../../org/apache/axis2/java/security/TrustAllTrustManager.html" title="class in org.apache.axis2.java.security"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/axis2/java/security/AccessController.html" target="_top">Frames</a></li>
<li><a href="AccessController.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>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&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 &copy; <a href="https://www.apache.org/">The Apache Software Foundation</a>. All Rights Reserved.</small></p>
</body>
</html>