Package org.jcsp.lang
Class One2AnyConnectionImpl<T>
java.lang.Object
org.jcsp.lang.One2AnyConnectionImpl<T>
- All Implemented Interfaces:
ConnectionWithSharedAltingServer<T>,One2AnyConnection<T>
This class is an implementation of
One2AnyConnection.
Each end is safe to be used by one thread at a time.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate One2OneChannel<T> private Any2OneChannel<T> private One2OneChannel<T> private AltingConnectionClient -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
client
-
chanToServer
-
chanFromServer
-
chanSynch
-
-
Constructor Details
-
One2AnyConnectionImpl
public One2AnyConnectionImpl()Initializes all the attributes to necessary values. Channels are created using the static factory in theChannelServerinterface. Constructor for One2OneConnectionImpl.
-
-
Method Details
-
client
Returns theAltingConnectionClientthat can be used by a single process at any instance. Each call to this method will return the same object reference.- Specified by:
clientin interfaceOne2AnyConnection<T>- Returns:
- the
AltingConnectionClientobject.
-
server
Returns aSharedConnectionServerobject for this connection. This method can be called multiple times to return a newSharedConnectionServerobject 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:
serverin interfaceConnectionWithSharedAltingServer<T>- Specified by:
serverin interfaceOne2AnyConnection<T>- Returns:
- a new
SharedConnectionServerobject.
-