All Packages Class Hierarchy This Package Previous Next Index
Class jive.erlang.ESock
java.lang.Object
|
+----jive.erlang.ESock
- public class ESock
- extends Object
ESock is a class that performs the socket communication between
a Java client and the Erlang server.
The class contains methods for performing: apply,
spawn, send on the server-side.
- Author:
- Kaj Nygren (kaj@medialab.ericsson.se), Joakim Grebenö (jocke@erix.ericsson.se)
-
EAPPLY
-
-
ENEW_CLIENT
-
-
ESEND
-
-
ESPAWN
-
-
ESock(String, int)
- Creates an ESock object that communicates with a given host and port.
-
apply(EAtom, EAtom, EList)
- Performs an Erlang apply.
-
apply(String, String, EList)
- Performs an Erlang apply.
-
connect()
-
This method opens a socket connection to the port on the server
and returns the socket.
-
getHost()
- Returns the host of the Jive server.
-
getPort()
- Returns the port of the Jive server.
-
initReceiver(EReceiver)
-
This method is called when initiating the EReceiver.
-
print(byte[])
- Just for debugging!
-
send(EProcess, EVar)
- Sends a message asynchronously to an Erlang process.
-
spawn(EAtom, EAtom, EList)
-
Spawns a new Erlang process, result is a EProcess representing
the Erlang PID
-
spawn(String, String, EList)
-
Spawns a new Erlang process.
EAPPLY
public static byte EAPPLY
ESPAWN
public static byte ESPAWN
ESEND
public static byte ESEND
ENEW_CLIENT
public static byte ENEW_CLIENT
ESock
public ESock(String host,
int port)
- Creates an ESock object that communicates with a given host and port.
getPort
public int getPort()
- Returns the port of the Jive server.
getHost
public String getHost()
- Returns the host of the Jive server.
apply
public EVar apply(String module,
String name,
EList params) throws JiveSecurityException, JiveIOException, JiveException
- Performs an Erlang apply.
- Returns:
- An EVar representing an Erlang variable.
- Throws: JiveSecurityException
- is thrown if a security violation
occurred.
- Throws: JiveIOException
- is thrown if a communication error occurred.
- Throws: JiveException
- is thrown with an error text given by the server.
apply
public EVar apply(EAtom module,
EAtom name,
EList params) throws JiveSecurityException, JiveIOException, JiveException
- Performs an Erlang apply.
- Returns:
- An EVar representing an Erlang variable.
- Throws: JiveSecurityException
- is thrown if a security violation
occurred.
- Throws: JiveIOException
- is thrown if a communication error occurred.
- Throws: JiveException
- is thrown with an error text given by the server.
spawn
public EProcess spawn(String module,
String name,
EList params) throws JiveSecurityException, JiveIOException, JiveException
- Spawns a new Erlang process.
- Returns:
- An EProcess representing the Erlang Pid.
- Throws: JiveSecurityException
- is thrown if a security violation
occurred.
- Throws: JiveIOException
- is thrown if a communication error occurred.
- Throws: JiveException
- is thrown with an error text given by the server.
spawn
public EProcess spawn(EAtom module,
EAtom name,
EList params) throws JiveSecurityException, JiveIOException, JiveException
- Spawns a new Erlang process, result is a EProcess representing
the Erlang PID
- Returns:
- An EProcess representing the Erlang Pid.
- Throws: JiveSecurityException
- is thrown if a security violation
occurred.
- Throws: JiveIOException
- is thrown if a communication error occurred.
- Throws: JiveException
- is thrown with an error text given by the server.
send
public void send(EProcess pid,
EVar data) throws JiveIOException
- Sends a message asynchronously to an Erlang process.
- Throws: JiveIOException
- is thrown if a communication error occurred.
print
public void print(byte message[])
- Just for debugging!
connect
protected Socket connect() throws JiveIOException
- This method opens a socket connection to the port on the server
and returns the socket.
- Throws: JiveIOException
- is thrown if a communication error occurred.
initReceiver
protected synchronized void initReceiver(EReceiver receiver) throws JiveIOException
- This method is called when initiating the EReceiver. The method
opens a socket connection used by the EReceiver and initiates the
self pid.
Note: This method should probably first init the self pid and
then open and return an array of socket connections to allow
for multiple back channel!
- Throws: JiveIOException
- is thrown if a communication error occurred.
All Packages Class Hierarchy This Package Previous Next Index