Top Description Fields Constructors Methods
com.sun.star.comp.connections

public Class PipedConnection

extends Object
implements com.sun.star.connection.XConnection
Class Inheritance
Imports
com.sun.star.comp.loader.FactoryHelper, com.sun.star.connection.XConnection, com.sun.star.lang.XMultiServiceFactory, com.sun.star.lang.XSingleServiceFactory, com.sun.star.registry.XRegistryKey

The PipedConnection is a component that implements the XConnection Interface.

It is useful for Thread communication in one Process.

Since
UDK1.0
See Also
com.sun.star.connection.XConnection, com.sun.star.comp.loader.JavaLoader

Field Summary

Modifier and TypeField and Description
private static final String
__serviceName

The name of the service, the JavaLoader accesses this through reflection.

protected static final int
__waitTime

The amount of time in milliseconds, to wait to see check the buffers.

protected byte[]
protected boolean
protected int
protected PipedConnection
protected int
public static final boolean
DEBUG

When set to true, enables various debugging output.

Constructor Summary

AccessConstructor and Description
public
PipedConnection(Object[]
Another side could be in index 0.
args
)

Constructs a new PipedConnection, sees if there is another side, which it should be connected to.

Method Summary

Modifier and TypeMethod and Description
public static com.sun.star.lang.XSingleServiceFactory

Returns:

returns a XSingleServiceFactory for creating the component.
__getServiceFactory
(String
the name of the implementation for which a service is desired.
implName
,
com.sun.star.lang.XMultiServiceFactory
the service manager to be uses if needed.
multiFactory
,
com.sun.star.registry.XRegistryKey
the registryKey.
regKey
)

Gives a factory for creating the service.

public synchronized void
close()

Closes the pipe.

public void
flush()

Flushes the buffer, notifies if necessary the other side that new data has arrived.

public String

Returns:

the description.
getDescription
()

Gives a description of this pipe.

public synchronized int

Returns:

the number of bytes read.
read
(byte[][]
the out parameter, where the bytes have to be placed.
aReadBytes
,
int
the number of bytes to read.
nBytesToRead
)

Read the required number of bytes.

private synchronized void
receive(byte[] aData)

This is a private method, used to communicate internal in the pipe.

public void
write(byte[]
the bytes to write.
aData
)

Write bytes.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

__serviceNameback to summary
private static final String __serviceName

The name of the service, the JavaLoader accesses this through reflection.

__waitTimeback to summary
protected static final int __waitTime

The amount of time in milliseconds, to wait to see check the buffers.

_bufferback to summary
protected byte[] _buffer
_closedback to summary
protected boolean _closed
_inback to summary
protected int _in
_otherSideback to summary
protected PipedConnection _otherSide
_outback to summary
protected int _out
DEBUGback to summary
public static final boolean DEBUG

When set to true, enables various debugging output.

Constructor Detail

PipedConnectionback to summary
public PipedConnection(Object[] args) throws com.sun.star.uno.RuntimeException

Constructs a new PipedConnection, sees if there is another side, which it should be connected to.

Parameters
args:Object[]

Another side could be in index 0.

Method Detail

__getServiceFactoryback to summary
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:String

the name of the implementation for which a service is desired.

multiFactory:com.sun.star.lang.XMultiServiceFactory

the service manager to be uses if needed.

regKey:com.sun.star.registry.XRegistryKey

the registryKey.

Returns:com.sun.star.lang.XSingleServiceFactory

returns a XSingleServiceFactory for creating the component.

See Also
com.sun.star.comp.loader.JavaLoader
closeback to summary
public synchronized void close() throws com.sun.star.io.IOException, com.sun.star.uno.RuntimeException

Closes the pipe.

See Also
com.sun.star.connection.XConnection#close()
flushback to summary
public void flush() throws com.sun.star.io.IOException, com.sun.star.uno.RuntimeException

Flushes the buffer, notifies if necessary the other side that new data has arrived.

See Also
com.sun.star.connection.XConnection#flush
getDescriptionback to summary
public String getDescription() throws com.sun.star.uno.RuntimeException

Gives a description of this pipe.

Returns:String

the description.

See Also
com.sun.star.connection.XConnection#getDescription
readback to summary
public synchronized int read(byte[][] aReadBytes, int nBytesToRead) throws com.sun.star.io.IOException, com.sun.star.uno.RuntimeException

Read the required number of bytes.

Parameters
aReadBytes:byte[][]

the out parameter, where the bytes have to be placed.

nBytesToRead:int

the number of bytes to read.

Returns:int

the number of bytes read.

See Also
com.sun.star.connection.XConnection#read
receiveback to summary
private synchronized void receive(byte[] aData) throws com.sun.star.io.IOException

This is a private method, used to communicate internal in the pipe.

writeback to summary
public void write(byte[] aData) throws com.sun.star.io.IOException, com.sun.star.uno.RuntimeException

Write bytes.

Parameters
aData:byte[]

the bytes to write.

See Also
com.sun.star.connection.XConnection#write