|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.activeio.adapter.AsyncChannelToServerRequestChannel
Creates a RequestChannel
out of a AsyncChannel
.
Does not support sending requests. It can only be used to handle requests.
Field Summary |
Fields inherited from interface org.activeio.Service |
NO_WAIT_TIMEOUT, WAIT_FOREVER_TIMEOUT |
Constructor Summary | |
AsyncChannelToServerRequestChannel(AsyncChannel next)
|
Method Summary | |
void |
dispose()
This method should not throw any exceptions. |
RequestListener |
getRequestListener()
|
Object |
narrow(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 AsyncChannel will call this method to deliver an 'up' packet to a consumer. |
void |
onPacketError(IOException error)
A AsyncChannel will call this method when a async failure occurs in the channel. |
Packet |
request(Packet request,
long timeout)
Used to send a packet of information going 'down' the channel and wait for it's reponse 'up' packet. |
void |
setRequestListener(RequestListener requestListener)
Registers the RequestListener that the protcol will use to deliver request packets
comming 'up' the channel. |
void |
start()
Starts the channel. |
void |
stop(long timeout)
Stops the channel. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public AsyncChannelToServerRequestChannel(AsyncChannel next) throws IOException
Method Detail |
public Packet request(Packet request, long timeout) throws IOException
RequestChannel
request
in interface RequestChannel
request
- timeout
-
IOException
public void setRequestListener(RequestListener requestListener) throws IOException
RequestChannel
RequestListener
that the protcol will use to deliver request packets
comming 'up' the channel.
setRequestListener
in interface RequestChannel
IOException
public RequestListener getRequestListener()
getRequestListener
in interface RequestChannel
public Object narrow(Class target)
Channel
narrow
in interface Channel
public void dispose()
Disposable
dispose
in interface Disposable
public void start() throws IOException
Service
start
in interface Service
IOException
public void stop(long timeout) throws IOException
Service
stop
in interface Service
timeout
- 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.
IOException
public void onPacket(Packet packet)
AsyncChannelListener
AsyncChannel
will call this method to deliver an 'up' packet to a consumer.
onPacket
in interface AsyncChannelListener
packet
- public void onPacketError(IOException error)
AsyncChannelListener
AsyncChannel
will call this method when a async failure occurs in the channel.
onPacketError
in interface AsyncChannelListener
error
- the exception that describes the failure.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |