Package com.sun.star.comp.connections
Class PipedConnection
java.lang.Object
com.sun.star.comp.connections.PipedConnection
- All Implemented Interfaces:
com.sun.star.connection.XConnection
,com.sun.star.uno.XInterface
The
PipedConnection
is a component that implements the
XConnection
Interface.
It is useful for Thread
communication in one Process.
- Since:
- UDK1.0
- See Also:
-
XConnection
JavaLoader
-
Field Summary
Modifier and TypeFieldDescriptionprotected static final int
The amount of time in milliseconds, to wait to see check the buffers.protected byte[]
protected boolean
protected int
protected PipedConnection
protected int
static final boolean
When set to true, enables various debugging output.Fields inherited from interface com.sun.star.connection.XConnection
UNOTYPEINFO
-
Constructor Summary
ConstructorDescriptionPipedConnection
(Object[] args) Constructs a newPipedConnection
, sees if there is another side, which it should be connected to. -
Method Summary
Modifier and TypeMethodDescriptionstatic 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.Gives a description of this pipe.int
read
(byte[][] aReadBytes, int nBytesToRead) Read the required number of bytes.void
write
(byte[] aData) Write bytes.
-
Field Details
-
DEBUG
public static final boolean DEBUGWhen set to true, enables various debugging output.- See Also:
-
__waitTime
protected static final int __waitTimeThe amount of time in milliseconds, to wait to see check the buffers.- See Also:
-
_buffer
protected byte[] _buffer -
_in
protected int _in -
_out
protected int _out -
_closed
protected boolean _closed -
_otherSide
-
-
Constructor Details
-
PipedConnection
Constructs a newPipedConnection
, sees if there is another side, which it should be connected to.- Parameters:
args
- Another side could be in index 0.- Throws:
com.sun.star.uno.RuntimeException
-
-
Method Details
-
__getServiceFactory
public 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.This method is called by the
JavaLoader
.- Parameters:
implName
- the name of the implementation for which a service is desired.multiFactory
- the service manager to be uses if needed.regKey
- the registryKey.- Returns:
- returns a
XSingleServiceFactory
for creating the component. - See Also:
-
read
public int read(byte[][] aReadBytes, int nBytesToRead) throws com.sun.star.io.IOException, com.sun.star.uno.RuntimeException Read the required number of bytes.- Specified by:
read
in interfacecom.sun.star.connection.XConnection
- Parameters:
aReadBytes
- the out parameter, where the bytes have to be placed.nBytesToRead
- the number of bytes to read.- Returns:
- the number of bytes read.
- Throws:
com.sun.star.io.IOException
com.sun.star.uno.RuntimeException
- See Also:
-
XConnection.read(byte[][], int)
-
write
public void write(byte[] aData) throws com.sun.star.io.IOException, com.sun.star.uno.RuntimeException Write bytes.- Specified by:
write
in interfacecom.sun.star.connection.XConnection
- Parameters:
aData
- the bytes to write.- Throws:
com.sun.star.io.IOException
com.sun.star.uno.RuntimeException
- See Also:
-
XConnection.write(byte[])
-
flush
public void flush() throws com.sun.star.io.IOException, com.sun.star.uno.RuntimeExceptionFlushes the buffer, notifies if necessary the other side that new data has arrived.- Specified by:
flush
in interfacecom.sun.star.connection.XConnection
- Throws:
com.sun.star.io.IOException
com.sun.star.uno.RuntimeException
- See Also:
-
XConnection.flush()
-
close
public void close() throws com.sun.star.io.IOException, com.sun.star.uno.RuntimeExceptionCloses the pipe.- Specified by:
close
in interfacecom.sun.star.connection.XConnection
- Throws:
com.sun.star.io.IOException
com.sun.star.uno.RuntimeException
- See Also:
-
XConnection.close()
-
getDescription
Gives a description of this pipe.- Specified by:
getDescription
in interfacecom.sun.star.connection.XConnection
- Returns:
- the description.
- Throws:
com.sun.star.uno.RuntimeException
- See Also:
-
XConnection.getDescription()
-