Top Description Methods
com.sun.star.lib.uno.environments.remote

public Interface IProtocol

Known Direct Implementers
com.sun.star.lib.uno.protocols.urp.urp
Imports
com.sun.star.lib.uno.typedesc.TypeDescription, java.io.IOException

An abstraction of remote bridge protocols.

A class implementing a given protocol prot must be named com.sun.star.lib.uno.protocols.prot.prot and must have a public constructor that takes four arguments: The first argument of type com.sun.star.uno.IBridge must not be null. The second argument of type String represents any attributes; it may be null if there are no attributes. The third argument of type java.io.InputStream must not be null. The fourth argument of type java.io.OutputStream must not be null.

Method Summary

Modifier and TypeMethod and Description
public void
init()

Initializes the connection.

public Message

Returns:

a non-null message; if the input stream is exhausted, a java.io.IOException is thrown instead.
readMessage
()

Reads a request or reply message.

public void
public void
writeReply(boolean
true if the reply corresponds to a raised exception.
exception
,
ThreadId
a non-null TID.
tid
,
Object
if exception is true, a non-null UNO exception; otherwise, a UNO return value, which may be null to represent a VOID return value.
result
)

Writes a reply message.

public boolean

Returns:

true if the request message is sent as a synchronous request.
writeRequest
(String
a non-null OID.
oid
,
TypeDescription
a non-null UNO type.
type
,
String
a non-null function (the name of a UNO interface method or attribute compatible with the given type, or either "queryInterface" or "release").
function
,
ThreadId
a non-null TID.
tid
,
Object[]
a list of UNO arguments compatible with the given type and function; may be null to represent an empty list.
arguments
)

Writes a request message.

Method Detail

initback to summary
public void init() throws IOException

Initializes the connection.

This method must be called exactly once, after the readMessage loop has already been established.

readMessageback to summary
public Message readMessage() throws IOException

Reads a request or reply message.

Access to this method from multiple threads must be properly synchronized.

Returns:Message

a non-null message; if the input stream is exhausted, a java.io.IOException is thrown instead.

terminateback to summary
public void terminate()
writeReplyback to summary
public void writeReply(boolean exception, ThreadId tid, Object result) throws IOException

Writes a reply message.

Parameters
exception:boolean

true if the reply corresponds to a raised exception.

tid:ThreadId

a non-null TID.

result:Object

if exception is true, a non-null UNO exception; otherwise, a UNO return value, which may be null to represent a VOID return value.

writeRequestback to summary
public boolean writeRequest(String oid, TypeDescription type, String function, ThreadId tid, Object[] arguments) throws IOException

Writes a request message.

Parameters
oid:String

a non-null OID.

type:TypeDescription

a non-null UNO type.

function:String

a non-null function (the name of a UNO interface method or attribute compatible with the given type, or either "queryInterface" or "release").

tid:ThreadId

a non-null TID.

arguments:Object[]

a list of UNO arguments compatible with the given type and function; may be null to represent an empty list.

Returns:boolean

true if the request message is sent as a synchronous request.