Class PipedConnection

java.lang.Object
com.sun.star.comp.connections.PipedConnection
All Implemented Interfaces:
com.sun.star.connection.XConnection, com.sun.star.uno.XInterface

public class PipedConnection extends Object implements com.sun.star.connection.XConnection
The PipedConnection is a component that implements the XConnection Interface.

It is useful for Thread communication in one Process.

Since:
UDK1.0
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected 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

    Constructors
    Constructor
    Description
    Constructs a new PipedConnection, sees if there is another side, which it should be connected to.
  • Method Summary

    Modifier and Type
    Method
    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
    Closes the pipe.
    void
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • DEBUG

      public static final boolean DEBUG
      When set to true, enables various debugging output.
      See Also:
    • __waitTime

      protected static final int __waitTime
      The 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

      protected PipedConnection _otherSide
  • Constructor Details

    • PipedConnection

      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 - 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 interface com.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 interface com.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.RuntimeException
      Flushes the buffer, notifies if necessary the other side that new data has arrived.
      Specified by:
      flush in interface com.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.RuntimeException
      Closes the pipe.
      Specified by:
      close in interface com.sun.star.connection.XConnection
      Throws:
      com.sun.star.io.IOException
      com.sun.star.uno.RuntimeException
      See Also:
      • XConnection.close()
    • getDescription

      public String getDescription() throws com.sun.star.uno.RuntimeException
      Gives a description of this pipe.
      Specified by:
      getDescription in interface com.sun.star.connection.XConnection
      Returns:
      the description.
      Throws:
      com.sun.star.uno.RuntimeException
      See Also:
      • XConnection.getDescription()