|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.activeio.FilterAsyncChannelServer
public class FilterAsyncChannelServer
A AsyncChannelFilter can be used as a filter between a AsyncChannel
and it's org.activeio.ChannelConsumer
. Most AsyncChannel
that are not directly accessing the network will extends the AsyncChannelFilter since they act as a
filter between the client and the network. O
Field Summary | |
---|---|
protected AcceptListener |
acceptListener
|
protected AsyncChannelServer |
next
|
Fields inherited from interface org.activeio.Service |
---|
NO_WAIT_TIMEOUT, WAIT_FOREVER_TIMEOUT |
Constructor Summary | |
---|---|
FilterAsyncChannelServer(AsyncChannelServer next)
|
Method Summary | |
---|---|
void |
dispose()
This method should not throw any exceptions. |
URI |
getBindURI()
The URI that was used when the channel was bound. |
URI |
getConnectURI()
Once bound, the channel may be able to construct a URI that is more sutible for when a client needs to connect to the server. |
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 |
onAccept(Channel channel)
A AsyncChannelServer will call this method to when a new channel connection has been
accepted. |
void |
onAcceptError(IOException error)
A AsyncChannelServer will call this method when a async failure occurs when accepting
a connection. |
void |
setAcceptListener(AcceptListener acceptListener)
Registers an AcceptListener which is notified of accepted channels. |
void |
start()
Starts the channel. |
void |
stop(long timeout)
Stops the channel. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected final AsyncChannelServer next
protected AcceptListener acceptListener
Constructor Detail |
---|
public FilterAsyncChannelServer(AsyncChannelServer next)
Method Detail |
---|
public void setAcceptListener(AcceptListener acceptListener)
AsyncChannelServer
setAcceptListener
in interface AsyncChannelServer
public void dispose()
Disposable
dispose
in interface Disposable
Disposable.dispose()
public void start() throws IOException
Service
start
in interface Service
IOException
- if the next channel has not been set.Service.start()
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
Service.stop(long)
public void onAccept(Channel channel)
AcceptListener
AsyncChannelServer
will call this method to when a new channel connection has been
accepted.
onAccept
in interface AcceptListener
public void onAcceptError(IOException error)
AcceptListener
AsyncChannelServer
will call this method when a async failure occurs when accepting
a connection.
onAcceptError
in interface AcceptListener
error
- the exception that describes the failure.public URI getBindURI()
ChannelServer
getBindURI
in interface ChannelServer
public URI getConnectURI()
ChannelServer
getConnectURI
in interface ChannelServer
public Object narrow(Class target)
Channel
narrow
in interface Channel
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |