Class PipeConnection

  • All Implemented Interfaces:
    com.sun.star.connection.XConnection, com.sun.star.connection.XConnectionBroadcaster, com.sun.star.uno.XInterface

    public class PipeConnection
    extends java.lang.Object
    implements com.sun.star.connection.XConnection, com.sun.star.connection.XConnectionBroadcaster
    The PipeConnection implements the XConnection interface and is uses by the PipeConnector and the PipeAcceptor. This class is not part of the provided api. The native implementation is in jurt/source/pipe/com_sun_star_lib_connections_pipe_PipeConnection.c
    Since:
    UDK1.0
    See Also:
    pipeAcceptor, pipeConnector, XConnection
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.lang.String _aDescription  
      protected java.util.ArrayList<com.sun.star.io.XStreamListener> _aListeners  
      protected boolean _bFirstRead  
      protected long _nPipeHandle  
      static boolean DEBUG
      When set to true, enables various debugging output.
      • Fields inherited from interface com.sun.star.connection.XConnection

        UNOTYPEINFO
      • Fields inherited from interface com.sun.star.connection.XConnectionBroadcaster

        UNOTYPEINFO
    • Constructor Summary

      Constructors 
      Constructor Description
      PipeConnection​(java.lang.String description)
      Constructs a new PipeConnection.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addStreamListener​(com.sun.star.io.XStreamListener aListener)  
      void close()
      Closes the connection.
      void flush()
      Flushes the buffer.
      java.lang.String getDescription()
      Gives a description of the connection.
      int read​(byte[][] bytes, int nBytesToRead)
      Read the required number of bytes.
      void removeStreamListener​(com.sun.star.io.XStreamListener aListener)  
      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 Detail

      • DEBUG

        public static final boolean DEBUG
        When set to true, enables various debugging output.
        See Also:
        Constant Field Values
      • _aDescription

        protected java.lang.String _aDescription
      • _nPipeHandle

        protected long _nPipeHandle
      • _aListeners

        protected java.util.ArrayList<com.sun.star.io.XStreamListener> _aListeners
      • _bFirstRead

        protected boolean _bFirstRead
    • Constructor Detail

      • PipeConnection

        public PipeConnection​(java.lang.String description)
                       throws java.io.IOException
        Constructs a new PipeConnection.
        Parameters:
        description - the description of the connection.
        Throws:
        java.io.IOException
    • Method Detail

      • addStreamListener

        public void addStreamListener​(com.sun.star.io.XStreamListener aListener)
                               throws com.sun.star.uno.RuntimeException
        Specified by:
        addStreamListener in interface com.sun.star.connection.XConnectionBroadcaster
        Throws:
        com.sun.star.uno.RuntimeException
      • removeStreamListener

        public void removeStreamListener​(com.sun.star.io.XStreamListener aListener)
                                  throws com.sun.star.uno.RuntimeException
        Specified by:
        removeStreamListener in interface com.sun.star.connection.XConnectionBroadcaster
        Throws:
        com.sun.star.uno.RuntimeException
      • read

        public int read​(byte[][] bytes,
                        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:
        bytes - the outparameter, 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.
        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 connection.
        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 java.lang.String getDescription()
                                        throws com.sun.star.uno.RuntimeException
        Gives a description of the connection.
        Specified by:
        getDescription in interface com.sun.star.connection.XConnection
        Returns:
        the description.
        Throws:
        com.sun.star.uno.RuntimeException
        See Also:
        XConnection.getDescription()