Class Environment

java.lang.Object
com.ericsson.otp.ic.Environment

public class Environment extends Object
The Environment class handles communication setup and stub state. The methods of this class are specially designed for the generated stubs. This class must be used when designing asynchronous message passing.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Server skeleton side constructor.
    Environment(com.ericsson.otp.erlang.OtpConnection _connection, Object _Server)
    Client stub side constructor.
    Environment(com.ericsson.otp.erlang.OtpSelf _Self, com.ericsson.otp.erlang.OtpPeer _Peer, Object _Server)
    Client stub side constructor.
    Environment(String _SelfNode, String _PeerNode, String _Cookie, Object _Server)
    Client stub side constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    com.ericsson.otp.erlang.OtpErlangPid
    Caller identity accessor.
    void
     
    void
    Client stub side connector.
    void
    Closes the established connection.
    com.ericsson.otp.erlang.OtpInputStream
    Input Stream accessor.
    com.ericsson.otp.erlang.OtpOutputStream
    Output Stream accessor.
    com.ericsson.otp.erlang.OtpErlangPid
    Server skeleton side client (caller) pid accessor.
    com.ericsson.otp.erlang.OtpErlangRef
    Server skeleton side client call reference accessor.
    void
    Private variable initialization.
    boolean
    Server stop request controller.
    void
    Client message receiver.
    void
    receive(com.ericsson.otp.erlang.OtpConnection _connection)
    Universal message receiver.
    com.ericsson.otp.erlang.OtpErlangRef
    Received message reference accessor.
    void
    Reconnects a client by closing existing connection and connecting.
    void
    Client side message sender.
    Server RegName/OtpErlangPid accessor.
    void
     
    void
    Decodes the message head from existing stream.
    void
    uHead(com.ericsson.otp.erlang.OtpInputStream _is)
    Decodes the message head and writes over input stream.
    int
    uLabel(Dictionary _operations)
    Operation label accessor.
    boolean
    validOp(Dictionary _operations)
    Operation controller.
    void
    Client Pid Encoder.
    void
    Client Ref Encoder.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Environment

      public Environment(com.ericsson.otp.erlang.OtpSelf _Self, com.ericsson.otp.erlang.OtpPeer _Peer, Object _Server) throws Exception
      Client stub side constructor.
      Throws:
      Exception
    • Environment

      public Environment(String _SelfNode, String _PeerNode, String _Cookie, Object _Server) throws Exception
      Client stub side constructor.
      Throws:
      Exception
    • Environment

      public Environment(com.ericsson.otp.erlang.OtpConnection _connection, Object _Server) throws Exception
      Client stub side constructor.
      Throws:
      Exception
    • Environment

      public Environment() throws Exception
      Server skeleton side constructor.
      Throws:
      Exception
  • Method Details

    • connect

      public void connect() throws Exception
      Client stub side connector.
      Throws:
      Exception
    • reconnect

      public void reconnect() throws Exception
      Reconnects a client by closing existing connection and connecting.
      Throws:
      Exception
    • disconnect

      public void disconnect()
      Closes the established connection.
    • send

      public void send() throws Exception
      Client side message sender.
      Throws:
      Exception
    • receive

      public void receive() throws Exception
      Client message receiver.
      Throws:
      Exception
    • receive

      public void receive(com.ericsson.otp.erlang.OtpConnection _connection) throws Exception
      Universal message receiver.
      Throws:
      Exception
    • server

      public Object server()
      Server RegName/OtpErlangPid accessor. Used to access the server Reg/Pid, which initiated the connection.
      Returns:
      java.lang.Object, the server for the active OtpConnection.
    • caller_pid

      public com.ericsson.otp.erlang.OtpErlangPid caller_pid()
      Caller identity accessor. Used by a server stub to access the caller identity of the received message.
      Returns:
      OtpErlangPid, the caller identity.
    • received_ref

      public com.ericsson.otp.erlang.OtpErlangRef received_ref()
      Received message reference accessor. Used by a server stub to access the reference of the received message.
      Returns:
      OtpErlangRef, the reference of the received message.
    • write_client_pid

      public void write_client_pid()
      Client Pid Encoder. Used by a server stub to encode the enclosed client process identity.
    • write_client_ref

      public void write_client_ref()
      Client Ref Encoder. Used by a server stub to encode the enclosed client message reference.
    • getOs

      public com.ericsson.otp.erlang.OtpOutputStream getOs()
      Output Stream accessor.
      Returns:
      OtpOutputStream, the enclosed output stream.
    • getIs

      public com.ericsson.otp.erlang.OtpInputStream getIs()
      Input Stream accessor.
      Returns:
      OtpInputStream, the enclosed input stream.
    • getScaller

      public com.ericsson.otp.erlang.OtpErlangPid getScaller()
      Server skeleton side client (caller) pid accessor.
      Returns:
      OtpErlangPid, the caller process identity.
    • getSref

      public com.ericsson.otp.erlang.OtpErlangRef getSref()
      Server skeleton side client call reference accessor.
      Returns:
      OtpErlangRef, the latest call message reference.
    • uHead

      public void uHead() throws Exception
      Decodes the message head from existing stream. Assignes message data to private variables of the Environment Object.
      Throws:
      Exception
    • uHead

      public void uHead(com.ericsson.otp.erlang.OtpInputStream _is) throws Exception
      Decodes the message head and writes over input stream. Assignes message data to private variables of the Environment Object.
      Throws:
      Exception
    • uLabel

      public int uLabel(Dictionary _operations)
      Operation label accessor.
      Returns:
      int, the label hash value.
    • validOp

      public boolean validOp(Dictionary _operations)
      Operation controller.
      Returns:
      boolean, true if the operation variable found in Environment class is supported in the input operation dictionary, false otherwize.
    • isStopped

      public boolean isStopped()
      Server stop request controller.
      Returns:
      boolean, true if there is a client request for the server to be stopped, false otherwize.
    • client_stop_server

      public void client_stop_server() throws Exception
      Throws:
      Exception
    • server_stop_server

      public void server_stop_server()
    • init

      public void init()
      Private variable initialization.