All Packages Class Hierarchy This Package Previous Next Index
Class jive.erlang.Unpacker
java.lang.Object
|
+----jive.erlang.Unpacker
- public class Unpacker
- extends Object
Unpacker is a class that parses messages sent from the Erlang side.
The class transforms the messages into EVar objects depending of the
type of variable.
Accepted variable types are:
EString, EInteger, EFloat, EAtom, EList, ETuple, EProcess, EBinary
The Unpacker class will either parse an expression and return the EVar or
it will parse a message consisting of a receiver and a message and then
deliver the message to a given receiver.
- Author:
- Kaj Nygren (kaj@medialab.ericsson.se), Joakim Grebenö (jocke@erix.ericsson.se)
-
s
-
-
Unpacker(InputStream, EReceiver)
- Creates an Unpacker that parses messages from the
Erlang side and deliver them to a receiver on the Java side.
-
getAtom(boolean)
-
This method parses the input stream for an Erlang atom and
returns an EAtom object containing the atom.
-
getBinary(boolean)
-
This method parses the input stream for an Erlang binary and
returns a EBinary object containing the binary.
-
getError(boolean)
-
This method parses the input stream for an error message and
throws a JiveException with a given message
If the tag parameter is true it will expect an EERROR tag
first in the stream, otherwise it will assume that the stream contains
a valid error message.
-
getFloat(boolean)
-
This method parses the input stream for an Erlang float and
returns an EFloat object containing the float.
-
getInteger(boolean)
-
This method parses the input stream for an Erlang integer and
returns an EInteger object containing the integer.
-
getList(boolean)
-
This method parses the input stream for an Erlang list and
returns a EList object containing the list.
-
getPid(boolean)
-
This method parses the input stream for an Erlang pid and
returns a EPid object containing the pid.
-
getPort(boolean)
-
This method parses the input stream for an Erlang port and
returns a EPort object containing the port.
-
getProcess(boolean)
-
This method parses the input stream for an Erlang pid-id and
returns a EProcess object containing the pid-id.
-
getReference(boolean)
-
This method parses the input stream for an Erlang reference and
returns a EReference object containing the reference.
-
getString(boolean)
-
This method parses the input stream for an Erlang string and
returns an EString object containing the string.
-
getTuple(boolean)
-
This method parses the input stream for an Erlang tuple and
returns a ETuple object containing the tuple.
-
parseExpression()
-
This method parses an expression from the input stream and returns
the expression as an EVar object.
-
parseMessage()
- Parses a message sent from the Erlang server to a client.
-
parseReply()
- Parses a reply sent from the Erlang server to a client.
s
public Socket s
Unpacker
public Unpacker(InputStream input,
EReceiver receiver)
- Creates an Unpacker that parses messages from the
Erlang side and deliver them to a receiver on the Java side.
getString
public synchronized EString getString(boolean tag) throws JiveException
- This method parses the input stream for an Erlang string and
returns an EString object containing the string.
If the tag parameter is true it will expect an ESTRING tag
first in the stream, otherwise it will assume that the stream contains
a valid string.
- Throws: JiveException
- if a connection or parsing error occurred.
getAtom
public synchronized EAtom getAtom(boolean tag) throws JiveException
- This method parses the input stream for an Erlang atom and
returns an EAtom object containing the atom.
If the tag parameter is true it will expect an EATOM tag
first in the stream, otherwise it will assume that the stream contains
a valid atom.
- Throws: JiveException
- if a connection or parsing error occurred.
getFloat
public synchronized EFloat getFloat(boolean tag) throws JiveException
- This method parses the input stream for an Erlang float and
returns an EFloat object containing the float.
If the tag parameter is true it will expect an EFLOAT tag
first in the stream, otherwise it will assume that the stream contains
a valid float.
- Throws: JiveException
- if a connection or parsing error occurred.
getInteger
public synchronized EInteger getInteger(boolean tag) throws JiveException
- This method parses the input stream for an Erlang integer and
returns an EInteger object containing the integer.
If the tag parameter is true it will expect an EINTEGER tag
first in the stream, otherwise it will assume that the stream contains
a valid integer.
- Throws: JiveException
- if a connection or parsing error occurred.
getProcess
public synchronized EProcess getProcess(boolean tag) throws JiveException
- This method parses the input stream for an Erlang pid-id and
returns a EProcess object containing the pid-id.
The pid-id is NOT the same as an Erlang pid. Instead it is an id-value
used internally by the jive Erlang server.
If the tag parameter is true it will expect an EPROCESS tag
first in the stream, otherwise it will assume that the stream contains
a valid pid-id.
- Throws: JiveException
- if a connection or parsing error occurred.
getTuple
public synchronized ETuple getTuple(boolean tag) throws JiveException
- This method parses the input stream for an Erlang tuple and
returns a ETuple object containing the tuple.
If the tag parameter is true it will expect an ETUPLE tag
first in the stream, otherwise it will assume that the stream contains
a valid tuple.
- Throws: JiveException
- if a connection or parsing error occurred.
getList
public synchronized EList getList(boolean tag) throws JiveException
- This method parses the input stream for an Erlang list and
returns a EList object containing the list.
If the tag parameter is true it will expect an ELIST tag
first in the stream, otherwise it will assume that the stream contains
a valid list.
- Throws: JiveException
- if a connection or parsing error occurred.
getBinary
public synchronized EBinary getBinary(boolean tag) throws JiveException
- This method parses the input stream for an Erlang binary and
returns a EBinary object containing the binary.
If the tag parameter is true it will expect an ELIST tag
first in the stream, otherwise it will assume that the stream contains
a valid list.
- Throws: JiveException
- if a connection or parsing error occurred.
getReference
public synchronized EReference getReference(boolean tag) throws JiveException
- This method parses the input stream for an Erlang reference and
returns a EReference object containing the reference.
If the tag parameter is true it will expect an ELIST tag
first in the stream, otherwise it will assume that the stream contains
a valid list.
- Throws: JiveException
- if a connection or parsing error occurred.
getPort
public synchronized EPort getPort(boolean tag) throws JiveException
- This method parses the input stream for an Erlang port and
returns a EPort object containing the port.
If the tag parameter is true it will expect an ELIST tag
first in the stream, otherwise it will assume that the stream contains
a valid list.
- Throws: JiveException
- if a connection or parsing error occurred.
getPid
public synchronized EPid getPid(boolean tag) throws JiveException
- This method parses the input stream for an Erlang pid and
returns a EPid object containing the pid.
If the tag parameter is true it will expect an ELIST tag
first in the stream, otherwise it will assume that the stream contains
a valid list.
- Throws: JiveException
- if a connection or parsing error occurred.
getError
public synchronized void getError(boolean tag) throws JiveSecurityException, JiveIOException, JiveException
- This method parses the input stream for an error message and
throws a JiveException with a given message
If the tag parameter is true it will expect an EERROR tag
first in the stream, otherwise it will assume that the stream contains
a valid error message.
- 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.
parseExpression
public synchronized EVar parseExpression() throws JiveSecurityException, JiveIOException, JiveException
- This method parses an expression from the input stream and returns
the expression as an EVar object.
- 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.
parseMessage
public synchronized void parseMessage() throws JiveSecurityException, JiveIOException, JiveException
- Parses a message sent from the Erlang server to a client.
First the receiver of the message is read from the input stream, then
the Erlang expression is read and converted to an EVar object.
Finally the EVar object is delivered to the recipient.
- 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.
parseReply
public synchronized EVar parseReply() throws JiveSecurityException, JiveIOException, JiveException
- Parses a reply sent from the Erlang server to a client.
The reply is either an Erlang variable, which is returned as an EVar,
or an error message which causes a JiveException to be thrown.
- 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.
All Packages Class Hierarchy This Package Previous Next Index