|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.activeio.adapter.AsynchToSynchChannelServerAdapter
Adapts a AsynchChannelServer
so that it provides an
SynchChannelServer
interface.
This object buffers asynchronous accepts from the AsynchChannelServer
abs buffers them in a Channel
util the client accepts the
connection.
Field Summary |
Fields inherited from interface org.activeio.SynchChannelServer |
NO_WAIT_TIMEOUT, WAIT_FOREVER_TIMEOUT |
Constructor Summary | |
AsynchToSynchChannelServerAdapter(AsynchChannelServer asynchChannelServer)
Deprecated. adapt(ChannelServer) |
|
AsynchToSynchChannelServerAdapter(AsynchChannelServer asynchChannelServer,
EDU.oswego.cs.dl.util.concurrent.Channel acceptBuffer)
Deprecated. adapt(ChannelServer, EDU.oswego.cs.dl.util.concurrent.Channel) |
Method Summary | |
Channel |
accept(long timeout)
|
static SynchChannelServer |
adapt(ChannelServer channel)
|
static SynchChannelServer |
adapt(ChannelServer channel,
EDU.oswego.cs.dl.util.concurrent.Channel upPacketChannel)
|
void |
dispose()
This method should not throw any exceptions. |
AsynchChannelServer |
getAsynchChannelServer()
|
java.net.URI |
getBindURI()
The URI that was used when the channel was bound. |
java.net.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. |
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 |
onAccept(Channel channel)
A AsynchChannelServer will call this method to when a new channel connection has been
accepted. |
void |
onAcceptError(java.io.IOException error)
A AsynchChannelServer will call this method when a async failure occurs when accepting
a connection. |
void |
start()
Starts the channel. |
void |
stop(long timeout)
Stops the channel. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public AsynchToSynchChannelServerAdapter(AsynchChannelServer asynchChannelServer)
adapt(ChannelServer)
public AsynchToSynchChannelServerAdapter(AsynchChannelServer asynchChannelServer, EDU.oswego.cs.dl.util.concurrent.Channel acceptBuffer)
adapt(ChannelServer, EDU.oswego.cs.dl.util.concurrent.Channel)
Method Detail |
public static SynchChannelServer adapt(ChannelServer channel)
public static SynchChannelServer adapt(ChannelServer channel, EDU.oswego.cs.dl.util.concurrent.Channel upPacketChannel)
public Channel accept(long timeout) throws java.io.IOException
accept
in interface SynchChannelServer
java.io.IOException
SynchChannelServer.accept(long)
public void dispose()
Disposable
dispose
in interface Disposable
Disposable.dispose()
public void start() throws java.io.IOException
Service
start
in interface Service
java.io.IOException
Service.start()
public void stop(long timeout) throws java.io.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.
java.io.IOException
Service.stop(long)
public java.net.URI getBindURI()
ChannelServer
getBindURI
in interface ChannelServer
public java.net.URI getConnectURI()
ChannelServer
getConnectURI
in interface ChannelServer
public void onAccept(Channel channel)
AcceptListener
AsynchChannelServer
will call this method to when a new channel connection has been
accepted.
onAccept
in interface AcceptListener
AcceptListener.onAccept(org.activeio.Channel)
public void onAcceptError(java.io.IOException error)
AcceptListener
AsynchChannelServer
will call this method when a async failure occurs when accepting
a connection.
onAcceptError
in interface AcceptListener
error
- the exception that describes the failure.AcceptListener.onAcceptError(java.io.IOException)
public AsynchChannelServer getAsynchChannelServer()
public java.lang.Object narrow(java.lang.Class target)
Channel
narrow
in interface Channel
public java.lang.String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |