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>
client
private 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 theAltingConnectionClient
that can be used by a single process at any instance.AltingConnectionServer<T>
server()
Returns theAltingConnectionServer
that 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 theAltingConnectionClient
that can be used by a single process at any instance. This method will always return the sameAltingConnectionClient
object.One2OneConnection
is only intendended to have two ends.- Specified by:
client
in interfaceOne2OneConnection<T>
- Returns:
- the
AltingConnectionClient
object.
-
server
public AltingConnectionServer<T> server()
Returns theAltingConnectionServer
that can be used by a single process at any instance. This method will always return the sameAltingConnectionServer
object.One2OneConnection
is only intendended to have two ends.- Specified by:
server
in interfaceOne2OneConnection<T>
- Returns:
- the
AltingConnectionServer
object.
-
-