Package org.jcsp.net
Class NetSharedAltingConnectionClient
- java.lang.Object
-
- org.jcsp.lang.Guard
-
- org.jcsp.lang.AltingConnectionClient<T>
-
- org.jcsp.lang.AltingConnectionClientImpl<T>
-
- org.jcsp.lang.SharedAltingConnectionClient
-
- org.jcsp.net.NetSharedAltingConnectionClient
-
- All Implemented Interfaces:
ConnectionClient
,SharedConnectionClient
,NetSharedConnectionClient
,Networked
public class NetSharedAltingConnectionClient extends SharedAltingConnectionClient implements NetSharedConnectionClient
Defines a class whose instances should be
that connect to aSharedAltingConnectionClient
ConnectionServer
over a JCSP.NET network.Individual instances may not be used by multiple processes but duplicate clients can be obtained by invoking
. These duplicates work over the same connection and each one may be used by a different process.duplicate()
-
-
Field Summary
Fields Modifier and Type Field Description private NetChannelOutput
backToClient
private NetAltingChannelInput
fromServer
private NetChannelOutput
openToServer
private NetChannelOutput
reqToServer
private NetConnectionLocation
serverLocation
private Any2OneChannel
synchChan
-
Constructor Summary
Constructors Modifier Constructor Description protected
NetSharedAltingConnectionClient(Any2OneChannel synchChan, NetAltingChannelInput fromServer, NetChannelOutput openToServer, NetChannelOutput reqToServer, NetChannelOutput backToClient)
Constructor for NetSharedAltingConnectionClient.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) static NetSharedAltingConnectionClient
create(NetChannelLocation serverLoc)
void
destroyClient()
Destroys this networked client object.SharedConnectionClient
duplicate()
Produces a duplicateNetSharedAltingConnectionClient
object which may be used by another process.NetChannelLocation
getChannelLocation()
Returns the address location of the connection server.-
Methods inherited from class org.jcsp.lang.SharedAltingConnectionClient
claim, release
-
Methods inherited from class org.jcsp.lang.AltingConnectionClientImpl
isOpen, reply, request
-
Methods inherited from class org.jcsp.lang.AltingConnectionClient
getAltingChannel, pending, setAltingChannel
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jcsp.lang.ConnectionClient
isOpen, reply, request
-
-
-
-
Field Detail
-
synchChan
private Any2OneChannel synchChan
-
fromServer
private NetAltingChannelInput fromServer
-
openToServer
private NetChannelOutput openToServer
-
reqToServer
private NetChannelOutput reqToServer
-
backToClient
private NetChannelOutput backToClient
-
serverLocation
private NetConnectionLocation serverLocation
-
-
Constructor Detail
-
NetSharedAltingConnectionClient
protected NetSharedAltingConnectionClient(Any2OneChannel synchChan, NetAltingChannelInput fromServer, NetChannelOutput openToServer, NetChannelOutput reqToServer, NetChannelOutput backToClient)
Constructor for NetSharedAltingConnectionClient.
- Parameters:
fromServer
-synchIn
-toServer
-synchOut
-backToClient
-parent
-
-
-
Method Detail
-
create
static NetSharedAltingConnectionClient create(NetChannelLocation serverLoc)
-
getChannelLocation
public NetChannelLocation getChannelLocation()
Returns the address location of the connection server.- Specified by:
getChannelLocation
in interfaceNetworked
- Returns:
- the
NetChannelLocation
object. - See Also:
Networked.getChannelLocation()
-
duplicate
public SharedConnectionClient duplicate()
Produces a duplicate
NetSharedAltingConnectionClient
object which may be used by another process.- Specified by:
duplicate
in interfaceSharedConnectionClient
- Overrides:
duplicate
in classSharedAltingConnectionClient
- Returns:
- a new duplicate
SharedConnectionClient
object.
-
destroyClient
public void destroyClient()
Destroys this networked client object.
This frees any resources used within the JCSP.NET infrastructure.
-
-