public final class NetAltingConnectionServer extends AltingConnectionServer implements NetConnectionServer
| Modifier and Type | Field and Description |
|---|---|
private ConnectionData |
data |
private NetworkMessageFilter.FilterRx |
inputFilter |
private NetworkMessage |
lastRead |
private Link |
linkConnectedTo |
private NetConnectionLocation |
location |
private AltingChannelInput |
openIn |
private NetworkMessageFilter.FilterTx |
outputFilter |
private AltingChannelInput |
requestIn |
FACTORY| Modifier | Constructor and Description |
|---|---|
private |
NetAltingConnectionServer(AltingChannelInput openChan,
AltingChannelInput requestChan,
ConnectionData connData,
NetworkMessageFilter.FilterRx filterRX,
NetworkMessageFilter.FilterTx filterTX) |
| Modifier and Type | Method and Description |
|---|---|
(package private) static NetAltingConnectionServer |
create(int index,
NetworkMessageFilter.FilterRx filterRX,
NetworkMessageFilter.FilterTx filterTX) |
(package private) static NetAltingConnectionServer |
create(NetworkMessageFilter.FilterRx filterRX,
NetworkMessageFilter.FilterTx filterTX) |
void |
destroy()
Destroys the Networked construct
|
NetLocation |
getLocation()
Gets the networked location of the Networked construct
|
void |
reply(java.lang.Object data)
Sends some data back to the client after a request
has been received but keeps the connection open.
|
void |
reply(java.lang.Object data,
boolean close)
Sends some data back to the client after a request
has been received.
|
void |
replyAndClose(java.lang.Object data)
Sends some data back to the client and closes the connection.
|
java.lang.Object |
request()
Receives a request from a client.
|
getAltingChannel, pending, setAltingChannelprivate final AltingChannelInput requestIn
private final AltingChannelInput openIn
private final NetConnectionLocation location
private final NetworkMessageFilter.FilterRx inputFilter
private final NetworkMessageFilter.FilterTx outputFilter
private final ConnectionData data
private final NetworkMessage lastRead
private final Link linkConnectedTo
private NetAltingConnectionServer(AltingChannelInput openChan, AltingChannelInput requestChan, ConnectionData connData, NetworkMessageFilter.FilterRx filterRX, NetworkMessageFilter.FilterTx filterTX) throws JCSPNetworkException
JCSPNetworkExceptionstatic NetAltingConnectionServer create(int index, NetworkMessageFilter.FilterRx filterRX, NetworkMessageFilter.FilterTx filterTX) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentExceptionstatic NetAltingConnectionServer create(NetworkMessageFilter.FilterRx filterRX, NetworkMessageFilter.FilterTx filterTX)
public void destroy()
Networkedpublic NetLocation getLocation()
NetworkedgetLocation in interface Networkedpublic void reply(java.lang.Object data,
boolean close)
throws java.lang.IllegalStateException
ConnectionServerSends some data back to the client after a request
has been received. The boolean close parameter
indicates whether the connection should be closed after this
reply has been sent.
This method should not block.
reply in interface ConnectionServerdata - the data to send back to client.close - boolean that should be true
iff the connection should be dropped after the reply
has been sent.java.lang.IllegalStateExceptionpublic void reply(java.lang.Object data)
throws java.lang.IllegalStateException
ConnectionServerSends some data back to the client after a request
has been received but keeps the connection open. After calling
this method, the server should call recieve()
to receive a further request.
A call to this method is equivalent to a call to
reply(Object, boolean) with the boolean set to
false.
reply in interface ConnectionServerdata - the data to send to the client.java.lang.IllegalStateExceptionpublic void replyAndClose(java.lang.Object data)
throws java.lang.IllegalStateException
ConnectionServerSends some data back to the client and closes the connection.
A call to this method is equivalent to a call to
reply(Object, boolean) with the boolean set to
true.
replyAndClose in interface ConnectionServerdata - the data to send back to client.java.lang.IllegalStateExceptionpublic java.lang.Object request()
throws java.lang.IllegalStateException
ConnectionServerReceives a request from a client. This will block until the client
calls its request(Object) method. Implementations may
make this ALTable.
After this method has returned, the server should call one of the reply methods. Performing any external process synchronization between these method calls could be potentially hazardous and could lead to deadlock.
request in interface ConnectionServerObject sent by the client.java.lang.IllegalStateException