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.OtpErlangPidCaller identity accessor.voidvoidconnect()Client stub side connector.voidCloses the established connection.com.ericsson.otp.erlang.OtpInputStreamgetIs()Input Stream accessor.com.ericsson.otp.erlang.OtpOutputStreamgetOs()Output Stream accessor.com.ericsson.otp.erlang.OtpErlangPidServer skeleton side client (caller) pid accessor.com.ericsson.otp.erlang.OtpErlangRefgetSref()Server skeleton side client call reference accessor.voidinit()Private variable initialization.booleanServer stop request controller.voidreceive()Client message receiver.voidreceive(com.ericsson.otp.erlang.OtpConnection _connection) Universal message receiver.com.ericsson.otp.erlang.OtpErlangRefReceived message reference accessor.voidReconnects a client by closing existing connection and connecting.voidsend()Client side message sender.server()Server RegName/OtpErlangPid accessor.voidvoiduHead()Decodes the message head from existing stream.voiduHead(com.ericsson.otp.erlang.OtpInputStream _is) Decodes the message head and writes over input stream.intuLabel(Dictionary _operations) Operation label accessor.booleanvalidOp(Dictionary _operations) Operation controller.voidClient Pid Encoder.voidClient 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.
-