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 theChannelServer
interface. Constructor for One2OneConnectionImpl.
-
-
Method Details
-
client
Returns theAltingConnectionClient
that can be used by a single process at any instance. Each call to this method will return the same object reference.- Specified by:
client
in interfaceOne2AnyConnection<T>
- Returns:
- the
AltingConnectionClient
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 interfaceConnectionWithSharedAltingServer<T>
- Specified by:
server
in interfaceOne2AnyConnection<T>
- Returns:
- a new
SharedConnectionServer
object.
-