<!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_09-icedtea) on Sat Mar 02 06:46:26 UTC 2013 --> <title>OtpNode (Java-Erlang Interface Library)</title> <meta name="date" content="2013-03-02"> <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="OtpNode (Java-Erlang Interface Library)"; } //--> </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="../../../../com/ericsson/otp/erlang/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="../../../../com/ericsson/otp/erlang/OtpMsg.html" title="class in com.ericsson.otp.erlang"><span class="strong">Prev Class</span></a></li> <li><a href="../../../../com/ericsson/otp/erlang/OtpNode.Acceptor.html" title="class in com.ericsson.otp.erlang"><span class="strong">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../index.html?com/ericsson/otp/erlang/OtpNode.html" target="_top">Frames</a></li> <li><a href="OtpNode.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><a href="#nested_class_summary">Nested</a> | </li> <li><a href="#fields_inherited_from_class_com.ericsson.otp.erlang.OtpLocalNode">Field</a> | </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">com.ericsson.otp.erlang</div> <h2 title="Class OtpNode" class="title">Class OtpNode</h2> </div> <div class="contentContainer"> <ul class="inheritance"> <li>java.lang.Object</li> <li> <ul class="inheritance"> <li><a href="../../../../com/ericsson/otp/erlang/AbstractNode.html" title="class in com.ericsson.otp.erlang">com.ericsson.otp.erlang.AbstractNode</a></li> <li> <ul class="inheritance"> <li><a href="../../../../com/ericsson/otp/erlang/OtpLocalNode.html" title="class in com.ericsson.otp.erlang">com.ericsson.otp.erlang.OtpLocalNode</a></li> <li> <ul class="inheritance"> <li>com.ericsson.otp.erlang.OtpNode</li> </ul> </li> </ul> </li> </ul> </li> </ul> <div class="description"> <ul class="blockList"> <li class="blockList"> <hr> <br> <pre>public class <span class="strong">OtpNode</span> extends <a href="../../../../com/ericsson/otp/erlang/OtpLocalNode.html" title="class in com.ericsson.otp.erlang">OtpLocalNode</a></pre> <div class="block"><p> Represents a local OTP node. This class is used when you do not wish to manage connections yourself - outgoing connections are established as needed, and incoming connections accepted automatically. This class supports the use of a mailbox API for communication, while management of the underlying communication mechanism is automatic and hidden from the application programmer. </p> <p> Once an instance of this class has been created, obtain one or more mailboxes in order to send or receive messages. The first message sent to a given node will cause a connection to be set up to that node. Any messages received will be delivered to the appropriate mailboxes. </p> <p> To shut down the node, call <a href="../../../../com/ericsson/otp/erlang/OtpNode.html#close()"><code>close()</code></a>. This will prevent the node from accepting additional connections and it will cause all existing connections to be closed. Any unread messages in existing mailboxes can still be read, however no new messages will be delivered to the mailboxes. </p> <p> Note that the use of this class requires that Epmd (Erlang Port Mapper Daemon) is running on each cooperating host. This class does not start Epmd automatically as Erlang does, you must start it manually or through some other means. See the Erlang documentation for more information about this. </p></div> </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="overviewSummary" 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"> </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>class </code></td> <td class="colLast"><code><strong><a href="../../../../com/ericsson/otp/erlang/OtpNode.Acceptor.html" title="class in com.ericsson.otp.erlang">OtpNode.Acceptor</a></strong></code> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>class </code></td> <td class="colLast"><code><strong><a href="../../../../com/ericsson/otp/erlang/OtpNode.Mailboxes.html" title="class in com.ericsson.otp.erlang">OtpNode.Mailboxes</a></strong></code> </td> </tr> </table> </li> </ul> <!-- =========== FIELD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="field_summary"> <!-- --> </a> <h3>Field Summary</h3> <ul class="blockList"> <li class="blockList"><a name="fields_inherited_from_class_com.ericsson.otp.erlang.OtpLocalNode"> <!-- --> </a> <h3>Fields inherited from class com.ericsson.otp.erlang.<a href="../../../../com/ericsson/otp/erlang/OtpLocalNode.html" title="class in com.ericsson.otp.erlang">OtpLocalNode</a></h3> <code><a href="../../../../com/ericsson/otp/erlang/OtpLocalNode.html#epmd">epmd</a>, <a href="../../../../com/ericsson/otp/erlang/OtpLocalNode.html#port">port</a></code></li> </ul> </li> </ul> <!-- ======== 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="colOne" scope="col">Constructor and Description</th> </tr> <tr class="altColor"> <td class="colOne"><code><strong><a href="../../../../com/ericsson/otp/erlang/OtpNode.html#OtpNode(java.lang.String)">OtpNode</a></strong>(java.lang.String node)</code> <div class="block"> Create a node using the default cookie.</div> </td> </tr> <tr class="rowColor"> <td class="colOne"><code><strong><a href="../../../../com/ericsson/otp/erlang/OtpNode.html#OtpNode(java.lang.String, java.lang.String)">OtpNode</a></strong>(java.lang.String node, java.lang.String cookie)</code> <div class="block">Create a node.</div> </td> </tr> <tr class="altColor"> <td class="colOne"><code><strong><a href="../../../../com/ericsson/otp/erlang/OtpNode.html#OtpNode(java.lang.String, java.lang.String, int)">OtpNode</a></strong>(java.lang.String node, java.lang.String cookie, int port)</code> <div class="block">Create a node.</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>void</code></td> <td class="colLast"><code><strong><a href="../../../../com/ericsson/otp/erlang/OtpNode.html#close()">close</a></strong>()</code> <div class="block">Close the node.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../../com/ericsson/otp/erlang/OtpNode.html#closeMbox(com.ericsson.otp.erlang.OtpMbox)">closeMbox</a></strong>(<a href="../../../../com/ericsson/otp/erlang/OtpMbox.html" title="class in com.ericsson.otp.erlang">OtpMbox</a> mbox)</code> <div class="block">Close the specified mailbox with reason 'normal'.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../../com/ericsson/otp/erlang/OtpNode.html#closeMbox(com.ericsson.otp.erlang.OtpMbox, com.ericsson.otp.erlang.OtpErlangObject)">closeMbox</a></strong>(<a href="../../../../com/ericsson/otp/erlang/OtpMbox.html" title="class in com.ericsson.otp.erlang">OtpMbox</a> mbox, <a href="../../../../com/ericsson/otp/erlang/OtpErlangObject.html" title="class in com.ericsson.otp.erlang">OtpErlangObject</a> reason)</code> <div class="block">Close the specified mailbox with the given reason.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code><a href="../../../../com/ericsson/otp/erlang/OtpMbox.html" title="class in com.ericsson.otp.erlang">OtpMbox</a></code></td> <td class="colLast"><code><strong><a href="../../../../com/ericsson/otp/erlang/OtpNode.html#createMbox()">createMbox</a></strong>()</code> <div class="block">Create an unnamed <a href="../../../../com/ericsson/otp/erlang/OtpMbox.html" title="class in com.ericsson.otp.erlang"><code>mailbox</code></a> that can be used to send and receive messages with other, similar mailboxes and with Erlang processes.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../com/ericsson/otp/erlang/OtpMbox.html" title="class in com.ericsson.otp.erlang">OtpMbox</a></code></td> <td class="colLast"><code><strong><a href="../../../../com/ericsson/otp/erlang/OtpNode.html#createMbox(java.lang.String)">createMbox</a></strong>(java.lang.String name)</code> <div class="block">Create an named mailbox that can be used to send and receive messages with other, similar mailboxes and with Erlang processes.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>protected void</code></td> <td class="colLast"><code><strong><a href="../../../../com/ericsson/otp/erlang/OtpNode.html#finalize()">finalize</a></strong>()</code> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>java.lang.String[]</code></td> <td class="colLast"><code><strong><a href="../../../../com/ericsson/otp/erlang/OtpNode.html#getNames()">getNames</a></strong>()</code> <div class="block">Get a list of all known registered names on this node.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>boolean</code></td> <td class="colLast"><code><strong><a href="../../../../com/ericsson/otp/erlang/OtpNode.html#ping(java.lang.String, long)">ping</a></strong>(java.lang.String node, long timeout)</code> <div class="block"> Determine if another node is alive.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>boolean</code></td> <td class="colLast"><code><strong><a href="../../../../com/ericsson/otp/erlang/OtpNode.html#registerName(java.lang.String, com.ericsson.otp.erlang.OtpMbox)">registerName</a></strong>(java.lang.String name, <a href="../../../../com/ericsson/otp/erlang/OtpMbox.html" title="class in com.ericsson.otp.erlang">OtpMbox</a> mbox)</code> <div class="block"> Register or remove a name for the given mailbox.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../../com/ericsson/otp/erlang/OtpNode.html#registerStatusHandler(com.ericsson.otp.erlang.OtpNodeStatus)">registerStatusHandler</a></strong>(<a href="../../../../com/ericsson/otp/erlang/OtpNodeStatus.html" title="class in com.ericsson.otp.erlang">OtpNodeStatus</a> handler)</code> <div class="block">Register interest in certain system events.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../../com/ericsson/otp/erlang/OtpNode.html#setFlags(int)">setFlags</a></strong>(int flags)</code> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code><a href="../../../../com/ericsson/otp/erlang/OtpErlangPid.html" title="class in com.ericsson.otp.erlang">OtpErlangPid</a></code></td> <td class="colLast"><code><strong><a href="../../../../com/ericsson/otp/erlang/OtpNode.html#whereis(java.lang.String)">whereis</a></strong>(java.lang.String name)</code> <div class="block">Determine the <a href="../../../../com/ericsson/otp/erlang/OtpErlangPid.html" title="class in com.ericsson.otp.erlang"><code>pid</code></a> corresponding to a registered name on this node.</div> </td> </tr> </table> <ul class="blockList"> <li class="blockList"><a name="methods_inherited_from_class_com.ericsson.otp.erlang.OtpLocalNode"> <!-- --> </a> <h3>Methods inherited from class com.ericsson.otp.erlang.<a href="../../../../com/ericsson/otp/erlang/OtpLocalNode.html" title="class in com.ericsson.otp.erlang">OtpLocalNode</a></h3> <code><a href="../../../../com/ericsson/otp/erlang/OtpLocalNode.html#createPid()">createPid</a>, <a href="../../../../com/ericsson/otp/erlang/OtpLocalNode.html#createPort()">createPort</a>, <a href="../../../../com/ericsson/otp/erlang/OtpLocalNode.html#createRef()">createRef</a>, <a href="../../../../com/ericsson/otp/erlang/OtpLocalNode.html#getEpmd()">getEpmd</a>, <a href="../../../../com/ericsson/otp/erlang/OtpLocalNode.html#port()">port</a>, <a href="../../../../com/ericsson/otp/erlang/OtpLocalNode.html#setEpmd(java.net.Socket)">setEpmd</a></code></li> </ul> <ul class="blockList"> <li class="blockList"><a name="methods_inherited_from_class_com.ericsson.otp.erlang.AbstractNode"> <!-- --> </a> <h3>Methods inherited from class com.ericsson.otp.erlang.<a href="../../../../com/ericsson/otp/erlang/AbstractNode.html" title="class in com.ericsson.otp.erlang">AbstractNode</a></h3> <code><a href="../../../../com/ericsson/otp/erlang/AbstractNode.html#alive()">alive</a>, <a href="../../../../com/ericsson/otp/erlang/AbstractNode.html#cookie()">cookie</a>, <a href="../../../../com/ericsson/otp/erlang/AbstractNode.html#host()">host</a>, <a href="../../../../com/ericsson/otp/erlang/AbstractNode.html#node()">node</a>, <a href="../../../../com/ericsson/otp/erlang/AbstractNode.html#setCookie(java.lang.String)">setCookie</a>, <a href="../../../../com/ericsson/otp/erlang/AbstractNode.html#toString()">toString</a></code></li> </ul> <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, getClass, hashCode, notify, notifyAll, wait, wait, wait</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="OtpNode(java.lang.String)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>OtpNode</h4> <pre>public OtpNode(java.lang.String node) throws java.io.IOException</pre> <div class="block"><p> Create a node using the default cookie. The default cookie is found by reading the first line of the .erlang.cookie file in the user's home directory. The home directory is obtained from the System property "user.home". </p> <p> If the file does not exist, an empty string is used. This method makes no attempt to create the file. </p></div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>node</code> - the name of this node.</dd> <dt><span class="strong">Throws:</span></dt> <dd><code>java.io.IOException</code> - if communication could not be initialized.</dd></dl> </li> </ul> <a name="OtpNode(java.lang.String, java.lang.String)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>OtpNode</h4> <pre>public OtpNode(java.lang.String node, java.lang.String cookie) throws java.io.IOException</pre> <div class="block">Create a node.</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>node</code> - the name of this node.</dd><dd><code>cookie</code> - the authorization cookie that will be used by this node when it communicates with other nodes.</dd> <dt><span class="strong">Throws:</span></dt> <dd><code>java.io.IOException</code> - if communication could not be initialized.</dd></dl> </li> </ul> <a name="OtpNode(java.lang.String, java.lang.String, int)"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>OtpNode</h4> <pre>public OtpNode(java.lang.String node, java.lang.String cookie, int port) throws java.io.IOException</pre> <div class="block">Create a node.</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>node</code> - the name of this node.</dd><dd><code>cookie</code> - the authorization cookie that will be used by this node when it communicates with other nodes.</dd><dd><code>port</code> - the port number you wish to use for incoming connections. Specifying 0 lets the system choose an available port.</dd> <dt><span class="strong">Throws:</span></dt> <dd><code>java.io.IOException</code> - if communication could not be initialized.</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="close()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>close</h4> <pre>public void close()</pre> <div class="block">Close the node. Unpublish the node from Epmd (preventing new connections) and close all existing connections.</div> </li> </ul> <a name="finalize()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>finalize</h4> <pre>protected void finalize()</pre> <dl> <dt><strong>Overrides:</strong></dt> <dd><code>finalize</code> in class <code>java.lang.Object</code></dd> </dl> </li> </ul> <a name="createMbox()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>createMbox</h4> <pre>public <a href="../../../../com/ericsson/otp/erlang/OtpMbox.html" title="class in com.ericsson.otp.erlang">OtpMbox</a> createMbox()</pre> <div class="block">Create an unnamed <a href="../../../../com/ericsson/otp/erlang/OtpMbox.html" title="class in com.ericsson.otp.erlang"><code>mailbox</code></a> that can be used to send and receive messages with other, similar mailboxes and with Erlang processes. Messages can be sent to this mailbox by using its associated <a href="../../../../com/ericsson/otp/erlang/OtpMbox.html#self()"><code>pid</code></a>.</div> <dl><dt><span class="strong">Returns:</span></dt><dd>a mailbox.</dd></dl> </li> </ul> <a name="closeMbox(com.ericsson.otp.erlang.OtpMbox)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>closeMbox</h4> <pre>public void closeMbox(<a href="../../../../com/ericsson/otp/erlang/OtpMbox.html" title="class in com.ericsson.otp.erlang">OtpMbox</a> mbox)</pre> <div class="block">Close the specified mailbox with reason 'normal'.</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>mbox</code> - the mailbox to close. <p> After this operation, the mailbox will no longer be able to receive messages. Any delivered but as yet unretrieved messages can still be retrieved however. </p> <p> If there are links from the mailbox to other <a href="../../../../com/ericsson/otp/erlang/OtpErlangPid.html" title="class in com.ericsson.otp.erlang"><code>pids</code></a>, they will be broken when this method is called and exit signals with reason 'normal' will be sent. </p></dd></dl> </li> </ul> <a name="closeMbox(com.ericsson.otp.erlang.OtpMbox, com.ericsson.otp.erlang.OtpErlangObject)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>closeMbox</h4> <pre>public void closeMbox(<a href="../../../../com/ericsson/otp/erlang/OtpMbox.html" title="class in com.ericsson.otp.erlang">OtpMbox</a> mbox, <a href="../../../../com/ericsson/otp/erlang/OtpErlangObject.html" title="class in com.ericsson.otp.erlang">OtpErlangObject</a> reason)</pre> <div class="block">Close the specified mailbox with the given reason.</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>mbox</code> - the mailbox to close.</dd><dd><code>reason</code> - an Erlang term describing the reason for the termination. <p> After this operation, the mailbox will no longer be able to receive messages. Any delivered but as yet unretrieved messages can still be retrieved however. </p> <p> If there are links from the mailbox to other <a href="../../../../com/ericsson/otp/erlang/OtpErlangPid.html" title="class in com.ericsson.otp.erlang"><code>pids</code></a>, they will be broken when this method is called and exit signals with the given reason will be sent. </p></dd></dl> </li> </ul> <a name="createMbox(java.lang.String)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>createMbox</h4> <pre>public <a href="../../../../com/ericsson/otp/erlang/OtpMbox.html" title="class in com.ericsson.otp.erlang">OtpMbox</a> createMbox(java.lang.String name)</pre> <div class="block">Create an named mailbox that can be used to send and receive messages with other, similar mailboxes and with Erlang processes. Messages can be sent to this mailbox by using its registered name or the associated <a href="../../../../com/ericsson/otp/erlang/OtpMbox.html#self()"><code>pid</code></a>.</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>name</code> - a name to register for this mailbox. The name must be unique within this OtpNode.</dd> <dt><span class="strong">Returns:</span></dt><dd>a mailbox, or null if the name was already in use.</dd></dl> </li> </ul> <a name="registerName(java.lang.String, com.ericsson.otp.erlang.OtpMbox)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>registerName</h4> <pre>public boolean registerName(java.lang.String name, <a href="../../../../com/ericsson/otp/erlang/OtpMbox.html" title="class in com.ericsson.otp.erlang">OtpMbox</a> mbox)</pre> <div class="block"><p> Register or remove a name for the given mailbox. Registering a name for a mailbox enables others to send messages without knowing the <a href="../../../../com/ericsson/otp/erlang/OtpErlangPid.html" title="class in com.ericsson.otp.erlang"><code>pid</code></a> of the mailbox. A mailbox can have at most one name; if the mailbox already had a name, calling this method will supercede that name. </p></div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>name</code> - the name to register for the mailbox. Specify null to unregister the existing name from this mailbox.</dd><dd><code>mbox</code> - the mailbox to associate with the name.</dd> <dt><span class="strong">Returns:</span></dt><dd>true if the name was available, or false otherwise.</dd></dl> </li> </ul> <a name="getNames()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getNames</h4> <pre>public java.lang.String[] getNames()</pre> <div class="block">Get a list of all known registered names on this node.</div> <dl><dt><span class="strong">Returns:</span></dt><dd>an array of Strings, containins all known registered names on this node.</dd></dl> </li> </ul> <a name="whereis(java.lang.String)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>whereis</h4> <pre>public <a href="../../../../com/ericsson/otp/erlang/OtpErlangPid.html" title="class in com.ericsson.otp.erlang">OtpErlangPid</a> whereis(java.lang.String name)</pre> <div class="block">Determine the <a href="../../../../com/ericsson/otp/erlang/OtpErlangPid.html" title="class in com.ericsson.otp.erlang"><code>pid</code></a> corresponding to a registered name on this node.</div> <dl><dt><span class="strong">Returns:</span></dt><dd>the <a href="../../../../com/ericsson/otp/erlang/OtpErlangPid.html" title="class in com.ericsson.otp.erlang"><code>pid</code></a> corresponding to the registered name, or null if the name is not known on this node.</dd></dl> </li> </ul> <a name="registerStatusHandler(com.ericsson.otp.erlang.OtpNodeStatus)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>registerStatusHandler</h4> <pre>public void registerStatusHandler(<a href="../../../../com/ericsson/otp/erlang/OtpNodeStatus.html" title="class in com.ericsson.otp.erlang">OtpNodeStatus</a> handler)</pre> <div class="block">Register interest in certain system events. The <a href="../../../../com/ericsson/otp/erlang/OtpNodeStatus.html" title="class in com.ericsson.otp.erlang"><code>OtpNodeStatus</code></a> handler object contains callback methods, that will be called when certain events occur.</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>handler</code> - the callback object to register. To clear the handler, specify null as the handler to use.</dd></dl> </li> </ul> <a name="ping(java.lang.String, long)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>ping</h4> <pre>public boolean ping(java.lang.String node, long timeout)</pre> <div class="block"><p> Determine if another node is alive. This method has the side effect of setting up a connection to the remote node (if possible). Only a single outgoing message is sent; the timeout is how long to wait for a response. </p> <p> Only a single attempt is made to connect to the remote node, so for example it is not possible to specify an extremely long timeout and expect to be notified when the node eventually comes up. If you wish to wait for a remote node to be started, the following construction may be useful: </p> <pre> // ping every 2 seconds until positive response while (!me.ping(him, 2000)) ; </pre></div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>node</code> - the name of the node to ping.</dd><dd><code>timeout</code> - the time, in milliseconds, to wait for response before returning false.</dd> <dt><span class="strong">Returns:</span></dt><dd>true if the node was alive and the correct ping response was returned. false if the correct response was not returned on time.</dd></dl> </li> </ul> <a name="setFlags(int)"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>setFlags</h4> <pre>public void setFlags(int flags)</pre> </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="../../../../com/ericsson/otp/erlang/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="../../../../com/ericsson/otp/erlang/OtpMsg.html" title="class in com.ericsson.otp.erlang"><span class="strong">Prev Class</span></a></li> <li><a href="../../../../com/ericsson/otp/erlang/OtpNode.Acceptor.html" title="class in com.ericsson.otp.erlang"><span class="strong">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../index.html?com/ericsson/otp/erlang/OtpNode.html" target="_top">Frames</a></li> <li><a href="OtpNode.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><a href="#nested_class_summary">Nested</a> | </li> <li><a href="#fields_inherited_from_class_com.ericsson.otp.erlang.OtpLocalNode">Field</a> | </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 ======= --> </body> </html>