|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.activeio.FilterAsynchChannel
A AsynchChannelFilter can be used as a filter between a AsynchChannel
and it's org.activeio.ChannelConsumer. Most AsynchChannel
that are not directly accessing the network will extends the AsynchChannelFilter since they act as a
filter between the client and the network. O
| Field Summary | |
protected AsynchChannelListener |
channelListener
|
protected AsynchChannel |
next
|
| Fields inherited from interface org.activeio.Service |
NO_WAIT_TIMEOUT, WAIT_FOREVER_TIMEOUT |
| Constructor Summary | |
FilterAsynchChannel(AsynchChannel next)
|
|
| Method Summary | |
void |
dispose()
This method should not throw any exceptions. |
void |
flush()
Some channels may buffer data which may be sent down if flush() is called. |
AsynchChannelListener |
getAsynchChannelListener()
|
AsynchChannel |
getNext()
|
java.lang.Object |
narrow(java.lang.Class target)
Since a Channel may be composed from a chain of other Channel obejcts, this method allows you to query the chain for the specified interface. |
void |
onPacket(Packet packet)
A AsynchChannel will call this method to deliver an 'up' packet to a consumer. |
void |
onPacketError(java.io.IOException error)
A AsynchChannel will call this method when a async failure occurs in the channel. |
void |
setAsynchChannelListener(AsynchChannelListener channelListener)
Registers the ChannelConsumer that the protcol will use to deliver packets
comming 'up' the channel. |
void |
start()
Starts the channel. |
void |
stop(long timeout)
Stops the channel. |
java.lang.String |
toString()
|
void |
write(Packet packet)
Sends a packet down the channel towards the media. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected final AsynchChannel next
protected AsynchChannelListener channelListener
| Constructor Detail |
public FilterAsynchChannel(AsynchChannel next)
| Method Detail |
public void setAsynchChannelListener(AsynchChannelListener channelListener)
InputAsynchChannelChannelConsumer that the protcol will use to deliver packets
comming 'up' the channel.
setAsynchChannelListener in interface InputAsynchChannel
public void write(Packet packet)
throws java.io.IOException
OutputChannel
write in interface OutputChannelpacket -
java.io.IOExceptionorg.activeio.Channel#write(org.activeio.channel.Packet)
public void flush()
throws java.io.IOException
OutputChannel
flush in interface OutputChanneljava.io.IOExceptionorg.activeio.Channel#flush()public void dispose()
Disposable
dispose in interface DisposableDisposable.dispose()
public void start()
throws java.io.IOException
Service
start in interface Servicejava.io.IOException - if the next channel has not been set.Service.start()
public void stop(long timeout)
throws java.io.IOException
Service
stop in interface Servicetimeout - The amount of time the channel is allowed to take to gracefully stop. If the timeout
is exceeded, the channel should do a forcefull stop.
java.io.IOExceptionService.stop(long)public void onPacket(Packet packet)
AsynchChannelListenerAsynchChannel will call this method to deliver an 'up' packet to a consumer.
onPacket in interface AsynchChannelListenerpacket - org.activeio.AsynchChannelListener#onPacket(org.activeio.channel.Packet)public void onPacketError(java.io.IOException error)
AsynchChannelListenerAsynchChannel will call this method when a async failure occurs in the channel.
onPacketError in interface AsynchChannelListenererror - the exception that describes the failure.org.activeio.AsynchChannelListener#onPacketError(org.activeio.channel.ChannelException)public AsynchChannel getNext()
public AsynchChannelListener getAsynchChannelListener()
getAsynchChannelListener in interface InputAsynchChannelpublic java.lang.Object narrow(java.lang.Class target)
Channel
narrow in interface Channelpublic java.lang.String toString()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||