Package org.jcsp.lang
Class One2OneConnectionImpl<T>
- java.lang.Object
-
- org.jcsp.lang.AbstractConnectionImpl
-
- org.jcsp.lang.One2OneConnectionImpl<T>
-
- All Implemented Interfaces:
One2OneConnection<T>
class One2OneConnectionImpl<T> extends AbstractConnectionImpl implements One2OneConnection<T>
This class is an implementation ofOne2OneConnection. 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
Fields Modifier and Type Field Description private AltingConnectionClient<T>clientprivate AltingConnectionServer<T>server-
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 Constructor Description One2OneConnectionImpl()Initializes all the attributes to necessary values.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AltingConnectionClient<T>client()Returns theAltingConnectionClientthat can be used by a single process at any instance.AltingConnectionServer<T>server()Returns theAltingConnectionServerthat can be used by a single process at any instance.
-
-
-
Field Detail
-
client
private AltingConnectionClient<T> client
-
server
private AltingConnectionServer<T> server
-
-
Method Detail
-
client
public AltingConnectionClient<T> client()
Returns theAltingConnectionClientthat can be used by a single process at any instance. This method will always return the sameAltingConnectionClientobject.One2OneConnectionis only intendended to have two ends.- Specified by:
clientin interfaceOne2OneConnection<T>- Returns:
- the
AltingConnectionClientobject.
-
server
public AltingConnectionServer<T> server()
Returns theAltingConnectionServerthat can be used by a single process at any instance. This method will always return the sameAltingConnectionServerobject.One2OneConnectionis only intendended to have two ends.- Specified by:
serverin interfaceOne2OneConnection<T>- Returns:
- the
AltingConnectionServerobject.
-
-