com.ericsson.otp.erlang
Class OtpServer

java.lang.Object
  |
  +--com.ericsson.otp.erlang.AbstractNode
        |
        +--com.ericsson.otp.erlang.OtpLocalNode
              |
              +--com.ericsson.otp.erlang.OtpSelf
                    |
                    +--com.ericsson.otp.erlang.OtpServer

Deprecated. the functionality of this class has been moved to OtpSelf.

public class OtpServer
extends OtpSelf

Represents a local OTP client or server node. It is used when you want other nodes to be able to establish connections to this one. When you create an instance of this class, it will bind a socket to a port so that incoming connections can be accepted. However the port number will not be made available to other nodes wishing to connect until you explicitely register with the port mapper daemon by calling OtpSelf.publishPort().

When the Java node will be connecting to a remote Erlang, Java or C node, it must first identify itself as a node by creating an instance of this class, after which it may connect to the remote node.

Setting up a connection may be done as follows:

 OtpServer self = new OtpServer("server","cookie"); // identify self
 self.publishPort(); // make port information available
 
 OtpConnection conn = self.accept(); // get incoming connection
 

See Also:
OtpSelf

Fields inherited from class com.ericsson.otp.erlang.OtpLocalNode
epmd, port
 
Constructor Summary
OtpServer(OtpSelf self)
          Deprecated. Create an OtpServer from an existing OtpSelf.
OtpServer(java.lang.String node, java.lang.String cookie)
          Deprecated. Create an OtpServer, using a vacant port chosen by the operating system.
OtpServer(java.lang.String node, java.lang.String cookie, int port)
          Deprecated. Create an OtpServer, using the specified port number.
 
Methods inherited from class com.ericsson.otp.erlang.OtpSelf
accept, connect, pid, publishPort, unPublishPort
 
Methods inherited from class com.ericsson.otp.erlang.OtpLocalNode
createPid, createPort, createRef, getEpmd, port, setEpmd
 
Methods inherited from class com.ericsson.otp.erlang.AbstractNode
alive, cookie, host, node, setCookie, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OtpServer

public OtpServer(OtpSelf self)
          throws java.io.IOException
Deprecated. 
Create an OtpServer from an existing OtpSelf.
Parameters:
self - an existing self node.
Throws:
java.io.IOException - if a ServerSocket could not be created.

OtpServer

public OtpServer(java.lang.String node,
                 java.lang.String cookie)
          throws java.io.IOException
Deprecated. 
Create an OtpServer, using a vacant port chosen by the operating system. To determine what port was chosen, call the object's OtpLocalNode.port() method.
Parameters:
node - the name of the node.
cookie - the authorization cookie that will be used by this node when accepts connections from remote nodes.
Throws:
java.io.IOException - if a ServerSocket could not be created.

OtpServer

public OtpServer(java.lang.String node,
                 java.lang.String cookie,
                 int port)
          throws java.io.IOException
Deprecated. 
Create an OtpServer, using the specified port number.
Parameters:
node - a name for this node, as above.
cookie - the authorization cookie that will be used by this node when accepts connections from remote nodes.
port - the port number to bind the socket to.
Throws:
java.io.IOException - if a ServerSocket could not be created or if the chosen port number was not available.