|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.activeio.adapter.AsyncToSyncChannelServer
public final class AsyncToSyncChannelServer
Adapts a AsyncChannelServer so that it provides an
org.activeio.SynchChannelServer interface.
This object buffers asynchronous accepts from the AsyncChannelServer
abs buffers them in a Channel util the client accepts the
connection.
| Field Summary |
|---|
| Fields inherited from interface org.activeio.SyncChannelServer |
|---|
NO_WAIT_TIMEOUT, WAIT_FOREVER_TIMEOUT |
| Constructor Summary | |
|---|---|
AsyncToSyncChannelServer(AsyncChannelServer asyncChannelServer)
Deprecated. adapt(ChannelServer) |
|
AsyncToSyncChannelServer(AsyncChannelServer asyncChannelServer,
Channel acceptBuffer)
Deprecated. adapt(ChannelServer, EDU.oswego.cs.dl.util.concurrent.Channel) |
|
| Method Summary | |
|---|---|
Channel |
accept(long timeout)
|
static SyncChannelServer |
adapt(ChannelServer channel)
|
static SyncChannelServer |
adapt(ChannelServer channel,
Channel upPacketChannel)
|
void |
dispose()
This method should not throw any exceptions. |
AsyncChannelServer |
getAsyncChannelServer()
|
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 |
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 |
| Constructor Detail |
|---|
public AsyncToSyncChannelServer(AsyncChannelServer asyncChannelServer)
adapt(ChannelServer)
public AsyncToSyncChannelServer(AsyncChannelServer asyncChannelServer,
Channel acceptBuffer)
adapt(ChannelServer, EDU.oswego.cs.dl.util.concurrent.Channel)
| Method Detail |
|---|
public static SyncChannelServer adapt(ChannelServer channel)
public static SyncChannelServer adapt(ChannelServer channel,
Channel upPacketChannel)
public Channel accept(long timeout)
throws IOException
accept in interface SyncChannelServerIOExceptionSyncChannelServer.accept(long)public void dispose()
Disposable
dispose in interface DisposableDisposable.dispose()
public void start()
throws IOException
Service
start in interface ServiceIOExceptionService.start()
public void stop(long timeout)
throws 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.
IOExceptionService.stop(long)public URI getBindURI()
ChannelServer
getBindURI in interface ChannelServerpublic URI getConnectURI()
ChannelServer
getConnectURI in interface ChannelServerpublic void onAccept(Channel channel)
AcceptListenerAsyncChannelServer will call this method to when a new channel connection has been
accepted.
onAccept in interface AcceptListenerAcceptListener.onAccept(org.activeio.Channel)public void onAcceptError(IOException error)
AcceptListenerAsyncChannelServer will call this method when a async failure occurs when accepting
a connection.
onAcceptError in interface AcceptListenererror - the exception that describes the failure.AcceptListener.onAcceptError(java.io.IOException)public AsyncChannelServer getAsyncChannelServer()
public Object narrow(Class target)
Channel
narrow in interface Channelpublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||