anon.client
Class AbstractChannel

java.lang.Object
  extended by anon.client.AbstractChannel
Direct Known Subclasses:
AbstractControlChannel, AbstractDataChannel

public abstract class AbstractChannel
extends java.lang.Object

Author:
Stefan Lieske

Field Summary
private  int m_channelId
           
private  boolean m_channelOpen
           
private  java.lang.Object m_internalSynchronization
           
protected  Multiplexer m_parentMultiplexer
           
 
Constructor Summary
AbstractChannel(int a_channelId, Multiplexer a_parentMultiplexer)
           
 
Method Summary
 MixPacket createEmptyMixPacket()
           
 void deleteChannel()
           
 boolean isClosed()
           
 void multiplexerClosed()
          This method is called on every channel in the channel-table after the multiplexer is closed.
abstract  void processReceivedPacket(MixPacket a_mixPacket)
           
 void sendPacket(MixPacket a_mixPacket)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_channelId

private int m_channelId

m_parentMultiplexer

protected Multiplexer m_parentMultiplexer

m_channelOpen

private volatile boolean m_channelOpen

m_internalSynchronization

private java.lang.Object m_internalSynchronization
Constructor Detail

AbstractChannel

public AbstractChannel(int a_channelId,
                       Multiplexer a_parentMultiplexer)
Method Detail

createEmptyMixPacket

public MixPacket createEmptyMixPacket()

sendPacket

public void sendPacket(MixPacket a_mixPacket)
                throws java.io.IOException
Throws:
java.io.IOException

isClosed

public boolean isClosed()

deleteChannel

public void deleteChannel()

multiplexerClosed

public void multiplexerClosed()
This method is called on every channel in the channel-table after the multiplexer is closed. Children of AbstractChannel should overwrite this method. It's not necessary to delete the channel from the channel-table but maybe there are some other tasks to do.


processReceivedPacket

public abstract void processReceivedPacket(MixPacket a_mixPacket)