Constructor and Description |
---|
urp(IBridge bridge,
java.lang.String attributes,
java.io.InputStream input,
java.io.OutputStream output) |
Modifier and Type | Method and Description |
---|---|
void |
init()
Initializes the connection.
|
Message |
readMessage()
Reads a request or reply message.
|
void |
terminate() |
void |
writeReply(boolean exception,
ThreadId tid,
java.lang.Object result)
Writes a reply message.
|
boolean |
writeRequest(java.lang.String oid,
TypeDescription type,
java.lang.String function,
ThreadId tid,
java.lang.Object[] arguments)
Writes a request message.
|
public urp(IBridge bridge, java.lang.String attributes, java.io.InputStream input, java.io.OutputStream output)
public void init() throws java.io.IOException
IProtocol
This method must be called exactly once, after the
readMessage
loop has already been established.
public Message readMessage() throws java.io.IOException
IProtocol
Access to this method from multiple threads must be properly synchronized.
readMessage
in interface IProtocol
java.io.IOException
is thrown insteadjava.io.IOException
public boolean writeRequest(java.lang.String oid, TypeDescription type, java.lang.String function, ThreadId tid, java.lang.Object[] arguments) throws java.io.IOException
IProtocol
writeRequest
in interface IProtocol
oid
- a non-null OIDtype
- a non-null UNO typefunction
- a non-null function (the name of a UNO interface method
or attribute compatible with the given type
, or either
"queryInterface"
or "release"
)arguments
- a list of UNO arguments compatible with the given
type
and function
; may be null to represent
an empty listtrue
if the request message is sent as a synchronous
requestjava.io.IOException
public void writeReply(boolean exception, ThreadId tid, java.lang.Object result) throws java.io.IOException
IProtocol
writeReply
in interface IProtocol
exception
- true
if the reply corresponds to a raised
exceptiontid
- a non-null TIDresult
- if exception
is true
, a non-null
UNO exception; otherwise, a UNO return value, which may be null to
represent a VOID
return valuejava.io.IOException