Package org.jcsp.lang
Class Any2AnyConnectionImpl<T>
java.lang.Object
org.jcsp.lang.AbstractConnectionImpl
org.jcsp.lang.Any2AnyConnectionImpl<T>
- All Implemented Interfaces:
Any2AnyConnection<T>
,ConnectionWithSharedAltingClient<T>
,ConnectionWithSharedAltingServer<T>
This class is an implementation of
Any2AnyConnection
.
Each end is safe to be used by one thread at a time.-
Nested Class Summary
Nested classes/interfaces inherited from class org.jcsp.lang.AbstractConnectionImpl
AbstractConnectionImpl.NonSingleRequestOpenMsg
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Any2OneChannel<T>
private One2OneChannel<T>
private Any2OneChannel<T>
private One2OneChannel<T>
Fields inherited from class org.jcsp.lang.AbstractConnectionImpl
CLIENT_STATE_CLOSED, CLIENT_STATE_MADE_REQ, CLIENT_STATE_OPEN, nonSingleRequestMsg, SERVER_STATE_CLOSED, SERVER_STATE_OPEN, SERVER_STATE_RECEIVED
-
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
chanToServer
-
chanFromServer
-
chanClientSynch
-
chanServerSynch
-
-
Constructor Details
-
Any2AnyConnectionImpl
public Any2AnyConnectionImpl()Initializes all the attributes to necessary values. Channels are created using the static factory in theChannelServer
inteface. Constructor for One2OneConnectionImpl.
-
-
Method Details
-
client
Returns aSharedAltingConnectionClient
object for this connection. This method can be called multiple times to return a newSharedAltingConnectionClient
object each time. Any object created can only be used by one process at a time but the set of objects constructed can be used concurrently.- Specified by:
client
in interfaceAny2AnyConnection<T>
- Specified by:
client
in interfaceConnectionWithSharedAltingClient<T>
- Returns:
- a new
SharedAltingConnectionClient
object.
-
server
Returns aSharedConnectionServer
object for this connection. This method can be called multiple times to return a newSharedConnectionServer
object each time. Any object created can only be used by one process at a time but the set of objects constructed can be used concurrently.- Specified by:
server
in interfaceAny2AnyConnection<T>
- Specified by:
server
in interfaceConnectionWithSharedAltingServer<T>
- Returns:
- a new
SharedConnectionServer
object.
-