com.jagacy
Class AbstractConduit

java.lang.Object
  extended bycom.jagacy.AbstractConduit

public abstract class AbstractConduit
extends java.lang.Object

TODO Description of class

Author:
Robert M. Preston

Field Summary
protected static int BUFFER_SIZE
           
protected  int myHeight
           
protected  java.io.BufferedInputStream myInput
           
protected  Loggable myLogger
           
protected  java.lang.Object myMutex
           
protected  java.io.BufferedOutputStream myOutput
           
protected  JagacyProperties myProperties
           
protected  java.lang.String myTerminal
           
protected  int myWidth
           
 
Constructor Summary
protected AbstractConduit()
           
 
Method Summary
protected  void abort()
           
 void close()
           
protected abstract  int[] createReceiveState()
           
 int getHeight()
           
protected abstract  int[] getHeights()
           
protected abstract  java.lang.String[] getTerminals()
           
 int getWidth()
           
protected abstract  int[] getWidths()
           
protected  void init()
           
abstract  boolean isExtended()
           
protected abstract  boolean isInitialReceiveState(int[] state)
           
protected abstract  boolean isReceiveDone(int[] state, byte b)
           
protected abstract  boolean isValidReceivedData(int[] state, byte b)
           
protected  void logBytes(java.lang.String message, byte[] b)
           
abstract  void open()
           
protected abstract  int read()
           
protected  ByteBuffer receive(ByteBuffer readBuffer)
           
abstract  ByteBuffer receive(int timeout)
           
protected abstract  void resetTimeout()
           
protected  void send(byte[] data)
           
abstract  void send(ByteBuffer data)
           
abstract  void sendBreak()
           
 void setLogger(Loggable logger)
           
 void setProperties(JagacyProperties properties)
           
protected abstract  void write(byte[] data)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BUFFER_SIZE

protected static final int BUFFER_SIZE
See Also:
Constant Field Values

myWidth

protected int myWidth

myHeight

protected int myHeight

myProperties

protected JagacyProperties myProperties

myLogger

protected Loggable myLogger

myInput

protected java.io.BufferedInputStream myInput

myOutput

protected java.io.BufferedOutputStream myOutput

myMutex

protected java.lang.Object myMutex

myTerminal

protected java.lang.String myTerminal
Constructor Detail

AbstractConduit

protected AbstractConduit()
Method Detail

open

public abstract void open()
                   throws JagacyException
Throws:
JagacyException

send

public abstract void send(ByteBuffer data)
                   throws JagacyException
Throws:
JagacyException

receive

public abstract ByteBuffer receive(int timeout)
                            throws JagacyException
Throws:
JagacyException

isExtended

public abstract boolean isExtended()

getTerminals

protected abstract java.lang.String[] getTerminals()

getWidths

protected abstract int[] getWidths()

getHeights

protected abstract int[] getHeights()

read

protected abstract int read()
                     throws java.io.IOException
Throws:
java.io.IOException

write

protected abstract void write(byte[] data)
                       throws java.io.IOException,
                              JagacyException
Throws:
java.io.IOException
JagacyException

createReceiveState

protected abstract int[] createReceiveState()

resetTimeout

protected abstract void resetTimeout()
                              throws JagacyException
Throws:
JagacyException

isInitialReceiveState

protected abstract boolean isInitialReceiveState(int[] state)

isValidReceivedData

protected abstract boolean isValidReceivedData(int[] state,
                                               byte b)

isReceiveDone

protected abstract boolean isReceiveDone(int[] state,
                                         byte b)

logBytes

protected void logBytes(java.lang.String message,
                        byte[] b)

setLogger

public void setLogger(Loggable logger)

setProperties

public void setProperties(JagacyProperties properties)

getWidth

public int getWidth()

getHeight

public int getHeight()

init

protected void init()
             throws JagacyException
Throws:
JagacyException

send

protected void send(byte[] data)
             throws JagacyException
Throws:
JagacyException

receive

protected ByteBuffer receive(ByteBuffer readBuffer)
                      throws JagacyException
Throws:
JagacyException

sendBreak

public abstract void sendBreak()
                        throws JagacyException
Throws:
JagacyException

abort

protected void abort()
              throws JagacyException
Throws:
JagacyException

close

public void close()
           throws JagacyException
Throws:
JagacyException