Package com.ericsson.otp.ic
Class Environment
java.lang.Object
com.ericsson.otp.ic.Environment
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
ConstructorsConstructorDescriptionServer 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 TypeMethodDescriptioncom.ericsson.otp.erlang.OtpErlangPid
Caller identity accessor.void
void
connect()
Client stub side connector.void
Closes the established connection.com.ericsson.otp.erlang.OtpInputStream
getIs()
Input Stream accessor.com.ericsson.otp.erlang.OtpOutputStream
getOs()
Output Stream accessor.com.ericsson.otp.erlang.OtpErlangPid
Server skeleton side client (caller) pid accessor.com.ericsson.otp.erlang.OtpErlangRef
getSref()
Server skeleton side client call reference accessor.void
init()
Private variable initialization.boolean
Server stop request controller.void
receive()
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
send()
Client side message sender.server()
Server RegName/OtpErlangPid accessor.void
void
uHead()
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.
-
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
Server skeleton side constructor.- Throws:
Exception
-
-
Method Details
-
connect
Client stub side connector.- Throws:
Exception
-
reconnect
Reconnects a client by closing existing connection and connecting.- Throws:
Exception
-
disconnect
public void disconnect()Closes the established connection. -
send
Client side message sender.- Throws:
Exception
-
receive
Client message receiver.- Throws:
Exception
-
receive
Universal message receiver.- Throws:
Exception
-
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
Decodes the message head from existing stream. Assignes message data to private variables of the Environment Object.- Throws:
Exception
-
uHead
Decodes the message head and writes over input stream. Assignes message data to private variables of the Environment Object.- Throws:
Exception
-
uLabel
Operation label accessor.- Returns:
- int, the label hash value.
-
validOp
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
- Throws:
Exception
-
server_stop_server
public void server_stop_server() -
init
public void init()Private variable initialization.
-