blob: cb2d82b800b23bf012a58a004e81cf67e522503d [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>
<title>ServerContainer</title>
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../script.js"></script>
<link rel="shortcut icon" href="/img/jakarta-favicon.ico">
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="ServerContainer";
}
}
catch(err) {
}
//-->
var methods = {"i0":6,"i1":6,"i2":6};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract 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="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="../../../jakarta/websocket/server/ServerApplicationConfig.html" title="interface in jakarta.websocket.server"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../jakarta/websocket/server/ServerEndpoint.html" title="annotation in jakarta.websocket.server"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?jakarta/websocket/server/ServerContainer.html" target="_top">Frames</a></li>
<li><a href="ServerContainer.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>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">jakarta.websocket.server</div>
<h2 title="Interface ServerContainer" class="title">Interface ServerContainer</h2>
</div>
<div class="contentContainer">
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Superinterfaces:</dt>
<dd><a href="../../../jakarta/websocket/WebSocketContainer.html" title="interface in jakarta.websocket">WebSocketContainer</a></dd>
</dl>
<hr>
<br>
<pre>public interface <span class="typeNameLabel">ServerContainer</span>
extends <a href="../../../jakarta/websocket/WebSocketContainer.html" title="interface in jakarta.websocket">WebSocketContainer</a></pre>
<div class="block">The ServerContainer is the specialized view of the WebSocketContainer available in server-side deployments. There is
one ServerContainer instance per websocket application. The ServerContainer holds the methods to be able to register
server endpoints.
<p>
For websocket enabled web containers, developers may obtain a reference to the ServerContainer instance by retrieving
it as an attribute named <code>jakarta.websocket.server.ServerContainer</code> on the ServletContext. This way, the
registration methods held on this interface may be called to register server endpoints from a ServletContextListener
during the deployment of the WAR file containing the endpoint. Server endpoints may also be registered after the web
application has started.
</p>
<p>
WebSocket implementations that run outside the web container may have other means by which to provide a
ServerContainer instance to the developer at application deployment time.
</p>
<p>
Once the application deployment phase is complete, and the websocket application has begun accepting incoming
connections, the registration methods may no longer be called.</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="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="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract 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>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../jakarta/websocket/server/ServerContainer.html#addEndpoint-java.lang.Class-">addEndpoint</a></span>(java.lang.Class&lt;?&gt;&nbsp;endpointClass)</code>
<div class="block">Deploys the given annotated endpoint into this ServerContainer.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../jakarta/websocket/server/ServerContainer.html#addEndpoint-jakarta.websocket.server.ServerEndpointConfig-">addEndpoint</a></span>(<a href="../../../jakarta/websocket/server/ServerEndpointConfig.html" title="interface in jakarta.websocket.server">ServerEndpointConfig</a>&nbsp;serverConfig)</code>
<div class="block">Deploys the given endpoint described by the provided configuration into this ServerContainer.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../jakarta/websocket/server/ServerContainer.html#upgradeHttpToWebSocket-java.lang.Object-java.lang.Object-jakarta.websocket.server.ServerEndpointConfig-java.util.Map-">upgradeHttpToWebSocket</a></span>(java.lang.Object&nbsp;httpServletRequest,
java.lang.Object&nbsp;httpServletResponse,
<a href="../../../jakarta/websocket/server/ServerEndpointConfig.html" title="interface in jakarta.websocket.server">ServerEndpointConfig</a>&nbsp;sec,
java.util.Map&lt;java.lang.String,java.lang.String&gt;&nbsp;pathParameters)</code>
<div class="block">Upgrade the HTTP connection represented by the <code>HttpServletRequest</code> and <code>HttpServletResponse</code> to the
WebSocket protocol and establish a WebSocket connection as per the provided <a href="../../../jakarta/websocket/server/ServerEndpointConfig.html" title="interface in jakarta.websocket.server"><code>ServerEndpointConfig</code></a>.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.jakarta.websocket.WebSocketContainer">
<!-- -->
</a>
<h3>Methods inherited from interface&nbsp;jakarta.websocket.<a href="../../../jakarta/websocket/WebSocketContainer.html" title="interface in jakarta.websocket">WebSocketContainer</a></h3>
<code><a href="../../../jakarta/websocket/WebSocketContainer.html#connectToServer-java.lang.Class-java.net.URI-">connectToServer</a>, <a href="../../../jakarta/websocket/WebSocketContainer.html#connectToServer-java.lang.Class-jakarta.websocket.ClientEndpointConfig-java.net.URI-">connectToServer</a>, <a href="../../../jakarta/websocket/WebSocketContainer.html#connectToServer-jakarta.websocket.Endpoint-jakarta.websocket.ClientEndpointConfig-java.net.URI-">connectToServer</a>, <a href="../../../jakarta/websocket/WebSocketContainer.html#connectToServer-java.lang.Object-java.net.URI-">connectToServer</a>, <a href="../../../jakarta/websocket/WebSocketContainer.html#getDefaultAsyncSendTimeout--">getDefaultAsyncSendTimeout</a>, <a href="../../../jakarta/websocket/WebSocketContainer.html#getDefaultMaxBinaryMessageBufferSize--">getDefaultMaxBinaryMessageBufferSize</a>, <a href="../../../jakarta/websocket/WebSocketContainer.html#getDefaultMaxSessionIdleTimeout--">getDefaultMaxSessionIdleTimeout</a>, <a href="../../../jakarta/websocket/WebSocketContainer.html#getDefaultMaxTextMessageBufferSize--">getDefaultMaxTextMessageBufferSize</a>, <a href="../../../jakarta/websocket/WebSocketContainer.html#getInstalledExtensions--">getInstalledExtensions</a>, <a href="../../../jakarta/websocket/WebSocketContainer.html#setAsyncSendTimeout-long-">setAsyncSendTimeout</a>, <a href="../../../jakarta/websocket/WebSocketContainer.html#setDefaultMaxBinaryMessageBufferSize-int-">setDefaultMaxBinaryMessageBufferSize</a>, <a href="../../../jakarta/websocket/WebSocketContainer.html#setDefaultMaxSessionIdleTimeout-long-">setDefaultMaxSessionIdleTimeout</a>, <a href="../../../jakarta/websocket/WebSocketContainer.html#setDefaultMaxTextMessageBufferSize-int-">setDefaultMaxTextMessageBufferSize</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="addEndpoint-java.lang.Class-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>addEndpoint</h4>
<pre>void&nbsp;addEndpoint(java.lang.Class&lt;?&gt;&nbsp;endpointClass)
throws <a href="../../../jakarta/websocket/DeploymentException.html" title="class in jakarta.websocket">DeploymentException</a></pre>
<div class="block">Deploys the given annotated endpoint into this ServerContainer.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>endpointClass</code> - the class of the annotated endpoint</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../jakarta/websocket/DeploymentException.html" title="class in jakarta.websocket">DeploymentException</a></code> - if the annotated endpoint was badly formed.</dd>
<dd><code>java.lang.IllegalStateException</code> - if the containing websocket application has already been deployed.</dd>
</dl>
</li>
</ul>
<a name="addEndpoint-jakarta.websocket.server.ServerEndpointConfig-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>addEndpoint</h4>
<pre>void&nbsp;addEndpoint(<a href="../../../jakarta/websocket/server/ServerEndpointConfig.html" title="interface in jakarta.websocket.server">ServerEndpointConfig</a>&nbsp;serverConfig)
throws <a href="../../../jakarta/websocket/DeploymentException.html" title="class in jakarta.websocket">DeploymentException</a></pre>
<div class="block">Deploys the given endpoint described by the provided configuration into this ServerContainer.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>serverConfig</code> - the configuration instance representing the logical endpoint that will be registered.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../jakarta/websocket/DeploymentException.html" title="class in jakarta.websocket">DeploymentException</a></code> - if the endpoint was badly formed.</dd>
<dd><code>java.lang.IllegalStateException</code> - if the containing websocket application has already been deployed.</dd>
</dl>
</li>
</ul>
<a name="upgradeHttpToWebSocket-java.lang.Object-java.lang.Object-jakarta.websocket.server.ServerEndpointConfig-java.util.Map-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>upgradeHttpToWebSocket</h4>
<pre>void&nbsp;upgradeHttpToWebSocket(java.lang.Object&nbsp;httpServletRequest,
java.lang.Object&nbsp;httpServletResponse,
<a href="../../../jakarta/websocket/server/ServerEndpointConfig.html" title="interface in jakarta.websocket.server">ServerEndpointConfig</a>&nbsp;sec,
java.util.Map&lt;java.lang.String,java.lang.String&gt;&nbsp;pathParameters)
throws java.io.IOException,
<a href="../../../jakarta/websocket/DeploymentException.html" title="class in jakarta.websocket">DeploymentException</a></pre>
<div class="block">Upgrade the HTTP connection represented by the <code>HttpServletRequest</code> and <code>HttpServletResponse</code> to the
WebSocket protocol and establish a WebSocket connection as per the provided <a href="../../../jakarta/websocket/server/ServerEndpointConfig.html" title="interface in jakarta.websocket.server"><code>ServerEndpointConfig</code></a>.
<p>
This method is primarily intended to be used by frameworks that implement the front-controller pattern. It does
not deploy the provided endpoint.
<p>
If the WebSocket implementation is not deployed as part of a Jakarta Servlet container, this method will throw an
<code>UnsupportedOperationException</code>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>httpServletRequest</code> - The <code>HttpServletRequest</code> to be processed as a WebSocket handshake as per
section 4.0 of RFC 6455.</dd>
<dd><code>httpServletResponse</code> - The <code>HttpServletResponse</code> to be used when processing the
<code>httpServletRequest</code> as a WebSocket handshake as per section 4.0 of RFC 6455.</dd>
<dd><code>sec</code> - The server endpoint configuration to use to configure the WebSocket endpoint</dd>
<dd><code>pathParameters</code> - Provides a mapping of path parameter names and values, if any, to be used for the
WebSocket connection established by the call to this method. If no such mapping is
defined, an empty Map must be passed.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.IllegalStateException</code> - if the provided request does not meet the requirements of the WebSocket handshake</dd>
<dd><code>java.lang.UnsupportedOperationException</code> - if the WebSocket implementation is not deployed as part of a Jakarta
Servlet container</dd>
<dd><code>java.io.IOException</code> - if an I/O error occurs during the establishment of a WebSocket connection</dd>
<dd><code><a href="../../../jakarta/websocket/DeploymentException.html" title="class in jakarta.websocket">DeploymentException</a></code> - if a configuration error prevents the establishment of a WebSocket connection</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>WebSocket 2.1</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="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="../../../jakarta/websocket/server/ServerApplicationConfig.html" title="interface in jakarta.websocket.server"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../jakarta/websocket/server/ServerEndpoint.html" title="annotation in jakarta.websocket.server"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?jakarta/websocket/server/ServerContainer.html" target="_top">Frames</a></li>
<li><a href="ServerContainer.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>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>