CSP for Java
(JCSP) 1.1-rc4

org.jcsp.lang
Class AltingConnectionClient

java.lang.Object
  extended by org.jcsp.lang.Guard
      extended by org.jcsp.lang.AltingConnectionClient
All Implemented Interfaces:
ConnectionClient
Direct Known Subclasses:
AltingConnectionClientImpl

public abstract class AltingConnectionClient
extends Guard
implements ConnectionClient

This class is sub-classed by JCSP.NET classes to provide ConnectionClient objects which can have their receive() method alted over.

Although JCSP users could sub-class this class, under most circumstances, there is no need. AltingConnectionClient objects can be constructed using one of the Connection factory mechanisms. See Connection and StandardConnectionFactory.

Author:
Quickstone Technologies Limited

Constructor Summary
protected AltingConnectionClient(AltingChannelInput altingChannel)
           Constructor.
 
Method Summary
protected  AltingChannelInput getAltingChannel()
           Returns the channel used to implement the Guard.
 boolean pending()
           Returns whether there is an open() pending on this connection.
protected  void setAltingChannel(AltingChannelInput chan)
           ConnectionServer implementations are likely to be implemented over channels.
 
Methods inherited from class org.jcsp.lang.Guard
schedule
 
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
 

Constructor Detail

AltingConnectionClient

protected AltingConnectionClient(AltingChannelInput altingChannel)

Constructor.

Note that this is only intended for use by JCSP, and should not be called by user processes. Users should use one of the subclasses.

Parameters:
altingChannel - The channel used to implement the Guard
Method Detail

getAltingChannel

protected AltingChannelInput getAltingChannel()

Returns the channel used to implement the Guard.

Note that this method is only intended for use by JCSP, and should not be called by user processes.

Concrete subclasses should override this method to return null, to ensure that the alting channel is kept private.

Returns:
The channel passed to the constructor.

setAltingChannel

protected void setAltingChannel(AltingChannelInput chan)

ConnectionServer implementations are likely to be implemented over channels. Multiple channels from the client to server may be used; one could be used for the initial connection while another one could be used for data requests.

This method allows sub-classes to specify which channel should be the next one to be alted over.

Parameters:
chan - the channel to be ALTed over.

pending

public boolean pending()

Returns whether there is an open() pending on this connection.

Note: if there is, it won't go away until you accept it. But if there isn't, there may be one by the time you check the result of this method.

Returns:
true only if open() will complete without blocking.

CSP for Java
(JCSP) 1.1-rc4

Submit a bug or feature to jcsp-team@kent.ac.uk
Version 1.1-rc4 of the JCSP API Specification (Copyright 1997-2008 P.D.Austin and P.H.Welch - All Rights Reserved)
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.