at.spardat.xma.pipes
Class XMAPipe

java.lang.Object
  extended byat.spardat.xma.pipes.XMAPipe
Direct Known Subclasses:
WindowsPipe

public abstract class XMAPipe
extends java.lang.Object

Since:
version_number

Constructor Summary
protected XMAPipe(java.lang.String pipeName)
           
 
Method Summary
abstract  void close()
          Closes and flushes the connection to a client.
abstract  void destroyPipe()
          Closes the Pipe itself, which the can then not be used further.
static XMAPipe getInstance(java.lang.String pipeName)
          Creates the pipe (as Object and on the OS).
 java.lang.String getPipeName()
           
abstract  void open()
          Waits for a client to connect and connects to it.
abstract  byte[] read()
          Reads from pipe (client).
abstract  void write(byte[] out)
          Writes out to pipe (client).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMAPipe

protected XMAPipe(java.lang.String pipeName)
           throws java.io.IOException
Method Detail

getInstance

public static XMAPipe getInstance(java.lang.String pipeName)
                           throws java.io.IOException
Creates the pipe (as Object and on the OS). The actual implementation is OS depend, therfore a factory is used.

Parameters:
pipeName -
Returns:
a new created XMAPipe
Throws:
java.io.IOException
Since:
version_number

destroyPipe

public abstract void destroyPipe()
                          throws java.io.IOException
Closes the Pipe itself, which the can then not be used further. Should always be called after pipe is not further used.

Throws:
java.io.IOException
Since:
version_number

open

public abstract void open()
                   throws java.io.IOException
Waits for a client to connect and connects to it.

Throws:
java.io.IOException
Since:
version_number

close

public abstract void close()
                    throws java.io.IOException
Closes and flushes the connection to a client.

Throws:
java.io.IOException
Since:
version_number

write

public abstract void write(byte[] out)
                    throws java.io.IOException
Writes out to pipe (client). Do not try to write more than 4096 bytes ! (Actual Win32 Impl).

Parameters:
out - - the byte[] must not be longer than 4096.
Throws:
java.io.IOException
Since:
version_number

read

public abstract byte[] read()
                     throws java.io.IOException
Reads from pipe (client).

Returns:
the bytes read from the pipe
Throws:
java.io.IOException
Since:
version_number

getPipeName

public java.lang.String getPipeName()
Returns:
Returns the pipeName.