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)

Variable Index

 o EAPPLY
 o ENEW_CLIENT
 o ESEND
 o ESPAWN

Constructor Index

 o ESock(String, int)
Creates an ESock object that communicates with a given host and port.

Method Index

 o apply(EAtom, EAtom, EList)
Performs an Erlang apply.
 o apply(String, String, EList)
Performs an Erlang apply.
 o connect()
This method opens a socket connection to the port on the server and returns the socket.
 o getHost()
Returns the host of the Jive server.
 o getPort()
Returns the port of the Jive server.
 o initReceiver(EReceiver)
This method is called when initiating the EReceiver.
 o print(byte[])
Just for debugging!
 o send(EProcess, EVar)
Sends a message asynchronously to an Erlang process.
 o spawn(EAtom, EAtom, EList)
Spawns a new Erlang process, result is a EProcess representing the Erlang PID
 o spawn(String, String, EList)
Spawns a new Erlang process.

Variables

 o EAPPLY
 public static byte EAPPLY
 o ESPAWN
 public static byte ESPAWN
 o ESEND
 public static byte ESEND
 o ENEW_CLIENT
 public static byte ENEW_CLIENT

Constructors

 o ESock
 public ESock(String host,
              int port)
Creates an ESock object that communicates with a given host and port.

Methods

 o getPort
 public int getPort()
Returns the port of the Jive server.

 o getHost
 public String getHost()
Returns the host of the Jive server.

 o 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.
 o 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.
 o 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.
 o 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.
 o 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.
 o print
 public void print(byte message[])
Just for debugging!

 o 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.
 o 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