|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jcsp.lang.Guard
org.jcsp.lang.AltingConnectionServer
org.jcsp.net2.NetAltingConnectionServer
public final class NetAltingConnectionServer
Field Summary |
---|
Fields inherited from interface org.jcsp.lang.ConnectionServer |
---|
FACTORY |
Method Summary | |
---|---|
void |
destroy()
Destroys the Networked construct |
NetLocation |
getLocation()
Gets the networked location of the Networked construct |
void |
reply(Object data)
Sends some data back to the client after a request has been received but keeps the connection open. |
void |
reply(Object data,
boolean close)
Sends some data back to the client after a request has been received. |
void |
replyAndClose(Object data)
Sends some data back to the client and closes the connection. |
Object |
request()
Receives a request from a client. |
Methods inherited from class org.jcsp.lang.AltingConnectionServer |
---|
getAltingChannel, pending, setAltingChannel |
Methods inherited from class org.jcsp.lang.Guard |
---|
schedule |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public void destroy()
Networked
destroy
in interface Networked
public NetLocation getLocation()
Networked
getLocation
in interface Networked
public void reply(Object data, boolean close) throws IllegalStateException
ConnectionServer
Sends 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 ConnectionServer
data
- 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.
IllegalStateException
public void reply(Object data) throws IllegalStateException
ConnectionServer
Sends 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 ConnectionServer
data
- the data to send to the client.
IllegalStateException
public void replyAndClose(Object data) throws IllegalStateException
ConnectionServer
Sends 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 ConnectionServer
data
- the data to send back to client.
IllegalStateException
public Object request() throws IllegalStateException
ConnectionServer
Receives 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 ConnectionServer
Object
sent by the client.
IllegalStateException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |