public class PipedConnection extends Object implements com.sun.star.connection.XConnection
PipedConnection is a component that implements the
XConnection Interface.
It is useful for Thread communication in one Process.
XConnection,
JavaLoader| Modifier and Type | Field and Description |
|---|---|
protected static int |
__waitTime
The amount of time in milliseconds, to wait to see check the buffers.
|
protected byte[] |
_buffer |
protected boolean |
_closed |
protected int |
_in |
protected PipedConnection |
_otherSide |
protected int |
_out |
static boolean |
DEBUG
When set to true, enables various debugging output.
|
| Constructor and Description |
|---|
PipedConnection(Object[] args)
Constructs a new
PipedConnection, sees if there is an other
side, which it should be connected to. |
| Modifier and Type | Method and Description |
|---|---|
static com.sun.star.lang.XSingleServiceFactory |
__getServiceFactory(String implName,
com.sun.star.lang.XMultiServiceFactory multiFactory,
com.sun.star.registry.XRegistryKey regKey)
Gives a factory for creating the service.
|
void |
close()
Closes the pipe.
|
void |
flush()
Flushes the buffer, notifies if necessary the other side that new data has
arrived.
|
String |
getDescription()
Gives a description of this pipe.
|
int |
read(byte[][] aReadBytes,
int nBytesToRead)
Read the required number of bytes.
|
void |
write(byte[] aData)
Write bytes.
|
public static final boolean DEBUG
protected static final int __waitTime
protected byte[] _buffer
protected int _in
protected int _out
protected boolean _closed
protected PipedConnection _otherSide
public PipedConnection(Object[] args) throws com.sun.star.uno.RuntimeException
PipedConnection, sees if there is an other
side, which it should be connected to.args - Another side could be in index 0.com.sun.star.uno.RuntimeExceptionpublic static com.sun.star.lang.XSingleServiceFactory __getServiceFactory(String implName, com.sun.star.lang.XMultiServiceFactory multiFactory, com.sun.star.registry.XRegistryKey regKey)
This method is called by the JavaLoader.
implName - the name of the implementation for which a service is desired.multiFactory - the service manager to be uses if needed.regKey - the registryKey.XSingleServiceFactory for creating the component.JavaLoaderpublic int read(byte[][] aReadBytes,
int nBytesToRead)
throws com.sun.star.io.IOException,
com.sun.star.uno.RuntimeException
read in interface com.sun.star.connection.XConnectionaReadBytes - the out parameter, where the bytes have to be placed.nBytesToRead - the number of bytes to read.com.sun.star.io.IOExceptioncom.sun.star.uno.RuntimeExceptionXConnection.read(byte[][], int)public void write(byte[] aData)
throws com.sun.star.io.IOException,
com.sun.star.uno.RuntimeException
write in interface com.sun.star.connection.XConnectionaData - the bytes to write.com.sun.star.io.IOExceptioncom.sun.star.uno.RuntimeExceptionXConnection.write(byte[])public void flush()
throws com.sun.star.io.IOException,
com.sun.star.uno.RuntimeException
flush in interface com.sun.star.connection.XConnectioncom.sun.star.io.IOExceptioncom.sun.star.uno.RuntimeExceptionXConnection.flush()public void close()
throws com.sun.star.io.IOException,
com.sun.star.uno.RuntimeException
close in interface com.sun.star.connection.XConnectioncom.sun.star.io.IOExceptioncom.sun.star.uno.RuntimeExceptionXConnection.close()public String getDescription() throws com.sun.star.uno.RuntimeException
getDescription in interface com.sun.star.connection.XConnectioncom.sun.star.uno.RuntimeExceptionXConnection.getDescription()