blob: 60c46acaaeab1597828843aee2fca368cb001b27 [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) on Sun Aug 28 20:41:43 EST 2016 -->
<title>ServerContext (Apache River v3.0.0 Specification-only API Documentation)</title>
<meta name="date" content="2016-08-28">
<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="ServerContext (Apache River v3.0.0 Specification-only API Documentation)";
}
}
catch(err) {
}
//-->
var methods = {"i0":9,"i1":9,"i2":9};
var tabs = {65535:["t0","All Methods"],1:["t1","Static 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/ServerContext.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="../../../net/jini/export/ProxyAccessor.html" title="interface in net.jini.export"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../net/jini/export/ServerContext.Spi.html" title="interface in net.jini.export"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?net/jini/export/ServerContext.html" target="_top">Frames</a></li>
<li><a href="ServerContext.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><a href="#nested.class.summary">Nested</a>&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">net.jini.export</div>
<h2 title="Class ServerContext" class="title">Class ServerContext</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="http://docs.oracle.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>net.jini.export.ServerContext</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public final class <span class="typeNameLabel">ServerContext</span>
extends <a href="http://docs.oracle.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">The <code>ServerContext</code> class contains static methods to
execute some action within an appropriate server context for the
current thread and to obtain the server context for the current thread.
<p>For example, an <a href="../../../net/jini/export/Exporter.html" title="interface in net.jini.export"><code>Exporter</code></a> implementation may supply context
information for incoming calls dispatched to its exported remote objects
via the <a href="../../../net/jini/export/ServerContext.html#doWithServerContext-java.lang.Runnable-java.util.Collection-"><code>ServerContext.doWithServerContext</code></a>
method.</div>
<dl>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>2.0</dd>
<dt><span class="simpleTagLabel">Author:</span></dt>
<dd>Sun Microsystems, Inc.</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../net/jini/io/context/ClientHost.html" title="interface in net.jini.io.context"><code>ClientHost</code></a>,
<a href="../../../net/jini/io/context/ClientSubject.html" title="interface in net.jini.io.context"><code>ClientSubject</code></a></dd>
</dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== NESTED CLASS SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="nested.class.summary">
<!-- -->
</a>
<h3>Nested Class Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Nested Class Summary table, listing nested classes, and an explanation">
<caption><span>Nested Classes</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Class and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static interface&nbsp;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../net/jini/export/ServerContext.Spi.html" title="interface in net.jini.export">ServerContext.Spi</a></span></code>
<div class="block">Defines the interface for server context providers, which are
consulted by <a href="../../../net/jini/export/ServerContext.html#getServerContext--"><code>getServerContext()</code></a> if no server context
has been explicitly associated with the current thread via a previous
call to <a href="../../../net/jini/export/ServerContext.html#doWithServerContext-java.lang.Runnable-java.util.Collection-"><code>doWithServerContext(java.lang.Runnable, java.util.Collection)</code></a>.</div>
</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="t1" class="tableTab"><span><a href="javascript:show(1);">Static 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>static void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../net/jini/export/ServerContext.html#doWithServerContext-java.lang.Runnable-java.util.Collection-">doWithServerContext</a></span>(<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Runnable.html?is-external=true" title="class or interface in java.lang">Runnable</a>&nbsp;runnable,
<a href="http://docs.oracle.com/javase/6/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&nbsp;context)</code>
<div class="block">Sets the server context for the current thread to the supplied
<code>context</code> collection and invokes the <code>run</code> method
of the supplied <code>runnable</code> object.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>static <a href="http://docs.oracle.com/javase/6/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../net/jini/export/ServerContext.html#getServerContext--">getServerContext</a></span>()</code>
<div class="block">Returns the server context collection for the current thread.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>static <a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../net/jini/export/ServerContext.html#getServerContextElement-java.lang.Class-">getServerContextElement</a></span>(<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a>&nbsp;type)</code>
<div class="block">Returns the first element in the current server context collection
(obtained by calling <a href="../../../net/jini/export/ServerContext.html#getServerContext--"><code>ServerContext.getServerContext</code></a>) that is an instance of the given
type <code>type</code>.</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://docs.oracle.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://docs.oracle.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://docs.oracle.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://docs.oracle.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://docs.oracle.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://docs.oracle.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://docs.oracle.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://docs.oracle.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://docs.oracle.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://docs.oracle.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://docs.oracle.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://docs.oracle.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">
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="doWithServerContext-java.lang.Runnable-java.util.Collection-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>doWithServerContext</h4>
<pre>public static&nbsp;void&nbsp;doWithServerContext(<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Runnable.html?is-external=true" title="class or interface in java.lang">Runnable</a>&nbsp;runnable,
<a href="http://docs.oracle.com/javase/6/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&nbsp;context)</pre>
<div class="block">Sets the server context for the current thread to the supplied
<code>context</code> collection and invokes the <code>run</code> method
of the supplied <code>runnable</code> object. When this method
returns, the thread's server context is unset.
<p>If a server context is currently set for the current thread,
that server context cannot be reset; that is, a server context
cannot be overwritten or nested. If a server context is already
set for the current thread, an <code>IllegalStateException</code> is
thrown.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>runnable</code> - the action to perform in the server context</dd>
<dd><code>context</code> - the context to set</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - if <code>context</code> or
<code>runnable</code> is <code>null</code></dd>
<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</a></code> - if the context is already
set for this thread</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../net/jini/export/ServerContext.html#getServerContextElement-java.lang.Class-"><code>getServerContextElement(java.lang.Class)</code></a></dd>
</dl>
</li>
</ul>
<a name="getServerContext--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getServerContext</h4>
<pre>public static&nbsp;<a href="http://docs.oracle.com/javase/6/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&nbsp;getServerContext()
throws <a href="http://docs.oracle.com/javase/6/docs/api/java/rmi/server/ServerNotActiveException.html?is-external=true" title="class or interface in java.rmi.server">ServerNotActiveException</a></pre>
<div class="block">Returns the server context collection for the current thread. If no
server context collection has been explicitly specified via a
previous call to <a href="../../../net/jini/export/ServerContext.html#doWithServerContext-java.lang.Runnable-java.util.Collection-"><code>ServerContext.doWithServerContext</code></a>, then an ordered list of
providers (obtained as specified below) implementing the <a href="../../../net/jini/export/ServerContext.Spi.html" title="interface in net.jini.export"><code>ServerContext.Spi</code></a> interface is consulted. <a href="../../../net/jini/export/ServerContext.Spi.html#getServerContext--"><code>ServerContext.Spi.getServerContext()</code></a> is called on each provider in
turn; the first non-<code>null</code> return value is returned by
this method. If no provider is able to supply a server context
collection, then a <code>ServerNotActiveException</code> is thrown.
<p>The list of server context providers is obtained as follows. For
each resource named
<code>META-INF/services/net.jini.export.ServerContext$Spi</code>
that is visible to the system class loader, the contents of the
resource are parsed as UTF-8 text to produce a list of class names.
The resource must contain a list of fully-qualified class names, one per
line. Space and tab characters surrounding each name, as well as blank
lines, are ignored. The comment character is <tt>'#'</tt>; all
characters on each line starting with the first comment character are
ignored. Each class name (that is not a duplicate of any previous class
name) is loaded through the system class loader, and the resulting
class must be assignable to <a href="../../../net/jini/export/ServerContext.Spi.html" title="interface in net.jini.export"><code>ServerContext.Spi</code></a> and have a public
no-argument constructor. The constructor is invoked to create a fallback
context provider instance. An implementation is permitted to search for
provider instances eagerly (i.e., upon startup), and cache the
verifier instances rather than recreating them on every call.
<p>The contents of the collection are determined by the caller of
<a href="../../../net/jini/export/ServerContext.html#doWithServerContext-java.lang.Runnable-java.util.Collection-"><code>ServerContext.doWithServerContext</code></a>. The
context information available from a given element of the collection
is determined by that element's type. Examples of types that a
given element might implement include <a href="../../../net/jini/io/context/ClientHost.html" title="interface in net.jini.io.context"><code>ClientHost</code></a> and <a href="../../../net/jini/io/context/ClientSubject.html" title="interface in net.jini.io.context"><code>ClientSubject</code></a>.
<p>The order of the elements in the collection is insignificant.
The collection may be empty.
<p>The caller of this method cannot assume that the returned
collection is modifiable.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the server context for the current thread</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/rmi/server/ServerNotActiveException.html?is-external=true" title="class or interface in java.rmi.server">ServerNotActiveException</a></code> - if no context is set for the
current thread</dd>
</dl>
</li>
</ul>
<a name="getServerContextElement-java.lang.Class-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>getServerContextElement</h4>
<pre>public static&nbsp;<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;getServerContextElement(<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a>&nbsp;type)
throws <a href="http://docs.oracle.com/javase/6/docs/api/java/rmi/server/ServerNotActiveException.html?is-external=true" title="class or interface in java.rmi.server">ServerNotActiveException</a></pre>
<div class="block">Returns the first element in the current server context collection
(obtained by calling <a href="../../../net/jini/export/ServerContext.html#getServerContext--"><code>ServerContext.getServerContext</code></a>) that is an instance of the given
type <code>type</code>. If no element in the collection is an
instance of the type <code>type</code>, then <code>null</code> is
returned.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>type</code> - the type of the element</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the first element in the server context collection that is
an instance of the type <code>type</code> or <code>null</code></dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/6/docs/api/java/rmi/server/ServerNotActiveException.html?is-external=true" title="class or interface in java.rmi.server">ServerNotActiveException</a></code> - if no server context is set for
the current thread</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/ServerContext.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="../../../net/jini/export/ProxyAccessor.html" title="interface in net.jini.export"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../net/jini/export/ServerContext.Spi.html" title="interface in net.jini.export"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?net/jini/export/ServerContext.html" target="_top">Frames</a></li>
<li><a href="ServerContext.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><a href="#nested.class.summary">Nested</a>&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 ======= -->
</body>
</html>