public abstract class AltingConnectionServer<T> extends Guard implements ConnectionServer<T>
ALT
over a connection. Note that you cannot have
more than one server serving an AltingConnectionServer.ConnectionServer
,
ConnectionClient
,
Connection
Modifier and Type | Field and Description |
---|---|
private AltingChannelInput<ConnectionMessage<T>> |
altingChannel
The channel used to ALT over.
|
FACTORY
Modifier | Constructor and Description |
---|---|
protected |
AltingConnectionServer(AltingChannelInput<ConnectionMessage<T>> altingChannel)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
(package private) boolean |
disable()
Disables the guard for selection.
|
(package private) boolean |
enable(Alternative alt)
Returns true if the event is ready.
|
protected AltingChannelInput<ConnectionMessage<T>> |
getAltingChannel()
Returns the channel used to implement the Guard.
|
boolean |
pending()
Returns whether there is an open() pending on this connection.
|
protected void |
setAltingChannel(AltingChannelInput<ConnectionMessage<T>> chan)
ConnectionServer implementations are likely to be
implemented over channels. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
reply, reply, replyAndClose, request
private AltingChannelInput<ConnectionMessage<T>> altingChannel
protected AltingConnectionServer(AltingChannelInput<ConnectionMessage<T>> altingChannel)
altingChannel
- The channel used to implement the Guardprotected AltingChannelInput<ConnectionMessage<T>> getAltingChannel()
protected void setAltingChannel(AltingChannelInput<ConnectionMessage<T>> chan)
ConnectionServer
implementations are likely to be
implemented over channels. Multiple channels from the client
to server may be used; one could be used for the initial
connection while another one could be used for data requests.
This method allows sub-classes to specify which channel should
be the next one to be alted over.chan
- the channel to be ALTed over.boolean enable(Alternative alt)
Note: this method should only be called by the Alternative class
boolean disable()
Note: this method should only be called by the Alternative class
public boolean pending()
Note: if there is, it won't go away until you accept it. But if there isn't, there may be one by the time you check the result of this method.