<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (version 1.7.0_40) on Fri Oct 18 06:47:25 UTC 2013 --> <title>AbstractConnectionManager (MX4J API)</title> <meta name="date" content="2013-10-18"> <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="AbstractConnectionManager (MX4J API)"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar_top"> <!-- --> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/AbstractConnectionManager.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="../../../mx4j/tools/remote/AbstractConnection.html" title="class in mx4j.tools.remote"><span class="strong">Prev Class</span></a></li> <li><a href="../../../mx4j/tools/remote/AbstractJMXConnector.html" title="class in mx4j.tools.remote"><span class="strong">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../index.html?mx4j/tools/remote/AbstractConnectionManager.html" target="_top">Frames</a></li> <li><a href="AbstractConnectionManager.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: </li> <li>Nested | </li> <li>Field | </li> <li><a href="#constructor_summary">Constr</a> | </li> <li><a href="#method_summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail: </li> <li>Field | </li> <li><a href="#constructor_detail">Constr</a> | </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">mx4j.tools.remote</div> <h2 title="Class AbstractConnectionManager" class="title">Class AbstractConnectionManager</h2> </div> <div class="contentContainer"> <ul class="inheritance"> <li>java.lang.Object</li> <li> <ul class="inheritance"> <li>mx4j.tools.remote.AbstractConnectionManager</li> </ul> </li> </ul> <div class="description"> <ul class="blockList"> <li class="blockList"> <dl> <dt>All Implemented Interfaces:</dt> <dd><a href="../../../mx4j/tools/remote/ConnectionManager.html" title="interface in mx4j.tools.remote">ConnectionManager</a></dd> </dl> <dl> <dt>Direct Known Subclasses:</dt> <dd><a href="../../../mx4j/tools/remote/http/HTTPConnectionManager.html" title="class in mx4j.tools.remote.http">HTTPConnectionManager</a></dd> </dl> <hr> <br> <pre>public abstract class <span class="strong">AbstractConnectionManager</span> extends java.lang.Object implements <a href="../../../mx4j/tools/remote/ConnectionManager.html" title="interface in mx4j.tools.remote">ConnectionManager</a></pre> <div class="block">Implementation of the ConnectionManager interface that implements emission of connection notifications, authentication, and proper closing of connections.</div> <dl><dt><span class="strong">Version:</span></dt> <dd>$Revision: 1.7 $</dd></dl> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor_summary"> <!-- --> </a> <h3>Constructor Summary</h3> <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation"> <caption><span>Constructors</span><span class="tabEnd"> </span></caption> <tr> <th class="colFirst" scope="col">Modifier</th> <th class="colLast" scope="col">Constructor and Description</th> </tr> <tr class="altColor"> <td class="colFirst"><code>protected </code></td> <td class="colLast"><code><strong><a href="../../../mx4j/tools/remote/AbstractConnectionManager.html#AbstractConnectionManager(mx4j.tools.remote.AbstractJMXConnectorServer, java.util.Map)">AbstractConnectionManager</a></strong>(<a href="../../../mx4j/tools/remote/AbstractJMXConnectorServer.html" title="class in mx4j.tools.remote">AbstractJMXConnectorServer</a> server, java.util.Map environment)</code> <div class="block">Called by subclasses.</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="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> <caption><span>Methods</span><span class="tabEnd"> </span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tr class="altColor"> <td class="colFirst"><code>protected javax.security.auth.Subject</code></td> <td class="colLast"><code><strong><a href="../../../mx4j/tools/remote/AbstractConnectionManager.html#authenticate(java.lang.Object)">authenticate</a></strong>(java.lang.Object credentials)</code> <div class="block">Authenticates a Subject with the given credentials, by looking up a JMXAuthenticator in the environment returned by <a href="../../../mx4j/tools/remote/AbstractConnectionManager.html#getEnvironment()"><code>getEnvironment()</code></a>.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../mx4j/tools/remote/AbstractConnectionManager.html#close()">close</a></strong>()</code> <div class="block">Implemented using the template method pattern</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../mx4j/tools/remote/AbstractConnectionManager.html#closeConnection(mx4j.tools.remote.Connection)">closeConnection</a></strong>(<a href="../../../mx4j/tools/remote/Connection.html" title="interface in mx4j.tools.remote">Connection</a> connection)</code> <div class="block">Implemented using the template method pattern, handles the emission of the connection notification of type "closed".</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code><a href="../../../mx4j/tools/remote/Connection.html" title="interface in mx4j.tools.remote">Connection</a></code></td> <td class="colLast"><code><strong><a href="../../../mx4j/tools/remote/AbstractConnectionManager.html#connect(java.lang.Object)">connect</a></strong>(java.lang.Object credentials)</code> <div class="block">Implemented using the template method pattern, it handles authentication, creation of the connection ID, emission of connection notification of type "opened".</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>protected java.lang.String</code></td> <td class="colLast"><code><strong><a href="../../../mx4j/tools/remote/AbstractConnectionManager.html#createConnectionID(javax.security.auth.Subject)">createConnectionID</a></strong>(javax.security.auth.Subject subject)</code> <div class="block">Returns a connection ID as specified by JSR 160.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>protected abstract void</code></td> <td class="colLast"><code><strong><a href="../../../mx4j/tools/remote/AbstractConnectionManager.html#doClose()">doClose</a></strong>()</code> <div class="block">Closes this ConnectionManager but not the connections it manages</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>protected abstract void</code></td> <td class="colLast"><code><strong><a href="../../../mx4j/tools/remote/AbstractConnectionManager.html#doCloseConnection(mx4j.tools.remote.Connection)">doCloseConnection</a></strong>(<a href="../../../mx4j/tools/remote/Connection.html" title="interface in mx4j.tools.remote">Connection</a> connection)</code> <div class="block">Closes the given Connection.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>protected abstract <a href="../../../mx4j/tools/remote/Connection.html" title="interface in mx4j.tools.remote">Connection</a></code></td> <td class="colLast"><code><strong><a href="../../../mx4j/tools/remote/AbstractConnectionManager.html#doConnect(java.lang.String, javax.security.auth.Subject)">doConnect</a></strong>(java.lang.String connectionId, javax.security.auth.Subject subject)</code> <div class="block">Template method to be implemented by subclasses; must return the server-side part of a connection.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>protected java.util.Map</code></td> <td class="colLast"><code><strong><a href="../../../mx4j/tools/remote/AbstractConnectionManager.html#getEnvironment()">getEnvironment</a></strong>()</code> <div class="block">Returns the environment passed when creating the JMXConnectorServer</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>protected java.security.AccessControlContext</code></td> <td class="colLast"><code><strong><a href="../../../mx4j/tools/remote/AbstractConnectionManager.html#getSecurityContext()">getSecurityContext</a></strong>()</code> <div class="block">Returns a security context at the moment of creation of this ConnectionManager.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>protected boolean</code></td> <td class="colLast"><code><strong><a href="../../../mx4j/tools/remote/AbstractConnectionManager.html#isClosed()">isClosed</a></strong>()</code> <div class="block">Returns whether the <a href="../../../mx4j/tools/remote/AbstractConnectionManager.html#close()"><code>close()</code></a> method has been called.</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 java.lang.Object</h3> <code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li> </ul> <ul class="blockList"> <li class="blockList"><a name="methods_inherited_from_class_mx4j.tools.remote.ConnectionManager"> <!-- --> </a> <h3>Methods inherited from interface mx4j.tools.remote.<a href="../../../mx4j/tools/remote/ConnectionManager.html" title="interface in mx4j.tools.remote">ConnectionManager</a></h3> <code><a href="../../../mx4j/tools/remote/ConnectionManager.html#getProtocol()">getProtocol</a></code></li> </ul> </li> </ul> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <!-- ========= CONSTRUCTOR DETAIL ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor_detail"> <!-- --> </a> <h3>Constructor Detail</h3> <a name="AbstractConnectionManager(mx4j.tools.remote.AbstractJMXConnectorServer, java.util.Map)"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>AbstractConnectionManager</h4> <pre>protected AbstractConnectionManager(<a href="../../../mx4j/tools/remote/AbstractJMXConnectorServer.html" title="class in mx4j.tools.remote">AbstractJMXConnectorServer</a> server, java.util.Map environment)</pre> <div class="block">Called by subclasses.</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>server</code> - The JMXConnectorServer that will emit connection notifications</dd><dd><code>environment</code> - The environment passed when the JMXConnectorServer is created.</dd></dl> </li> </ul> </li> </ul> <!-- ============ METHOD DETAIL ========== --> <ul class="blockList"> <li class="blockList"><a name="method_detail"> <!-- --> </a> <h3>Method Detail</h3> <a name="connect(java.lang.Object)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>connect</h4> <pre>public <a href="../../../mx4j/tools/remote/Connection.html" title="interface in mx4j.tools.remote">Connection</a> connect(java.lang.Object credentials) throws java.io.IOException, java.lang.SecurityException</pre> <div class="block">Implemented using the template method pattern, it handles authentication, creation of the connection ID, emission of connection notification of type "opened".</div> <dl> <dt><strong>Specified by:</strong></dt> <dd><code><a href="../../../mx4j/tools/remote/ConnectionManager.html#connect(java.lang.Object)">connect</a></code> in interface <code><a href="../../../mx4j/tools/remote/ConnectionManager.html" title="interface in mx4j.tools.remote">ConnectionManager</a></code></dd> <dt><span class="strong">Parameters:</span></dt><dd><code>credentials</code> - The credentials sent by the client to authenticate a subject.</dd> <dt><span class="strong">Returns:</span></dt><dd>A new client-specific connection.</dd> <dt><span class="strong">Throws:</span></dt> <dd><code>java.io.IOException</code> - If the connection cannot be created.</dd> <dd><code>java.lang.SecurityException</code> - If the authentication fails.</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../mx4j/tools/remote/AbstractConnectionManager.html#doConnect(java.lang.String, javax.security.auth.Subject)"><code>doConnect(java.lang.String, javax.security.auth.Subject)</code></a>, <a href="../../../mx4j/tools/remote/AbstractConnectionManager.html#authenticate(java.lang.Object)"><code>authenticate(java.lang.Object)</code></a>, <a href="../../../mx4j/tools/remote/AbstractConnectionManager.html#createConnectionID(javax.security.auth.Subject)"><code>createConnectionID(javax.security.auth.Subject)</code></a></dd></dl> </li> </ul> <a name="createConnectionID(javax.security.auth.Subject)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>createConnectionID</h4> <pre>protected java.lang.String createConnectionID(javax.security.auth.Subject subject)</pre> <div class="block">Returns a connection ID as specified by JSR 160.</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>subject</code> - The authenticated Subject</dd></dl> </li> </ul> <a name="doConnect(java.lang.String, javax.security.auth.Subject)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>doConnect</h4> <pre>protected abstract <a href="../../../mx4j/tools/remote/Connection.html" title="interface in mx4j.tools.remote">Connection</a> doConnect(java.lang.String connectionId, javax.security.auth.Subject subject) throws java.io.IOException</pre> <div class="block">Template method to be implemented by subclasses; must return the server-side part of a connection. When an remote invocation arrives, it will lookup the corrispondent server-side part of the connection and delegate the call to it. The server-side part of the connection must then (eventually) call the MBeanServer to satisfy the request.</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>connectionId</code> - The connection ID for connection that is returned</dd><dd><code>subject</code> - The authenticated Subject</dd> <dt><span class="strong">Returns:</span></dt><dd>The server-side part of a connection (with the given connection ID)</dd> <dt><span class="strong">Throws:</span></dt> <dd><code>java.io.IOException</code> - If the connection cannot be created</dd></dl> </li> </ul> <a name="close()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>close</h4> <pre>public void close() throws java.io.IOException</pre> <div class="block">Implemented using the template method pattern</div> <dl> <dt><strong>Specified by:</strong></dt> <dd><code><a href="../../../mx4j/tools/remote/ConnectionManager.html#close()">close</a></code> in interface <code><a href="../../../mx4j/tools/remote/ConnectionManager.html" title="interface in mx4j.tools.remote">ConnectionManager</a></code></dd> <dt><span class="strong">Throws:</span></dt> <dd><code>java.io.IOException</code></dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../mx4j/tools/remote/AbstractConnectionManager.html#doClose()"><code>doClose()</code></a>, <a href="../../../mx4j/tools/remote/AbstractConnectionManager.html#closeConnection(mx4j.tools.remote.Connection)"><code>closeConnection(mx4j.tools.remote.Connection)</code></a></dd></dl> </li> </ul> <a name="doClose()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>doClose</h4> <pre>protected abstract void doClose() throws java.io.IOException</pre> <div class="block">Closes this ConnectionManager but not the connections it manages</div> <dl><dt><span class="strong">Throws:</span></dt> <dd><code>java.io.IOException</code> - If this ConnectionManager cannot be closed</dd></dl> </li> </ul> <a name="closeConnection(mx4j.tools.remote.Connection)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>closeConnection</h4> <pre>public void closeConnection(<a href="../../../mx4j/tools/remote/Connection.html" title="interface in mx4j.tools.remote">Connection</a> connection) throws java.io.IOException</pre> <div class="block">Implemented using the template method pattern, handles the emission of the connection notification of type "closed". This method is called both when closing the connector server and when closing a connector.</div> <dl> <dt><strong>Specified by:</strong></dt> <dd><code><a href="../../../mx4j/tools/remote/ConnectionManager.html#closeConnection(mx4j.tools.remote.Connection)">closeConnection</a></code> in interface <code><a href="../../../mx4j/tools/remote/ConnectionManager.html" title="interface in mx4j.tools.remote">ConnectionManager</a></code></dd> <dt><span class="strong">Throws:</span></dt> <dd><code>java.io.IOException</code></dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../mx4j/tools/remote/AbstractConnectionManager.html#doCloseConnection(mx4j.tools.remote.Connection)"><code>doCloseConnection(mx4j.tools.remote.Connection)</code></a></dd></dl> </li> </ul> <a name="doCloseConnection(mx4j.tools.remote.Connection)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>doCloseConnection</h4> <pre>protected abstract void doCloseConnection(<a href="../../../mx4j/tools/remote/Connection.html" title="interface in mx4j.tools.remote">Connection</a> connection) throws java.io.IOException</pre> <div class="block">Closes the given Connection.</div> <dl><dt><span class="strong">Throws:</span></dt> <dd><code>java.io.IOException</code></dd></dl> </li> </ul> <a name="isClosed()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>isClosed</h4> <pre>protected boolean isClosed()</pre> <div class="block">Returns whether the <a href="../../../mx4j/tools/remote/AbstractConnectionManager.html#close()"><code>close()</code></a> method has been called.</div> </li> </ul> <a name="getEnvironment()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getEnvironment</h4> <pre>protected java.util.Map getEnvironment()</pre> <div class="block">Returns the environment passed when creating the JMXConnectorServer</div> </li> </ul> <a name="getSecurityContext()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getSecurityContext</h4> <pre>protected java.security.AccessControlContext getSecurityContext()</pre> <div class="block">Returns a security context at the moment of creation of this ConnectionManager. This security context is the restricting context that should be used when a call from a remote client is invoked in a doPrivileged() block.</div> </li> </ul> <a name="authenticate(java.lang.Object)"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>authenticate</h4> <pre>protected javax.security.auth.Subject authenticate(java.lang.Object credentials) throws java.io.IOException, java.lang.SecurityException</pre> <div class="block">Authenticates a Subject with the given credentials, by looking up a JMXAuthenticator in the environment returned by <a href="../../../mx4j/tools/remote/AbstractConnectionManager.html#getEnvironment()"><code>getEnvironment()</code></a>.</div> <dl><dt><span class="strong">Throws:</span></dt> <dd><code>java.io.IOException</code></dd> <dd><code>java.lang.SecurityException</code></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/AbstractConnectionManager.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="../../../mx4j/tools/remote/AbstractConnection.html" title="class in mx4j.tools.remote"><span class="strong">Prev Class</span></a></li> <li><a href="../../../mx4j/tools/remote/AbstractJMXConnector.html" title="class in mx4j.tools.remote"><span class="strong">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../index.html?mx4j/tools/remote/AbstractConnectionManager.html" target="_top">Frames</a></li> <li><a href="AbstractConnectionManager.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: </li> <li>Nested | </li> <li>Field | </li> <li><a href="#constructor_summary">Constr</a> | </li> <li><a href="#method_summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail: </li> <li>Field | </li> <li><a href="#constructor_detail">Constr</a> | </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><center><small>Copyright © 2001-2005 The MX4J Contributors. All Rights Reserved.</small></center></small></p> </body> </html>