Processes may passively wait for a number of events using Alternative. These events include channel inputs (AltingChannelInput / AltingChannelInputInt), channel accepts (AltingChannelAccept), alting barriers (AltingBarrier), timeouts (CSTimer) and skips (org.jcsp.lang.Skip). If more than one event is ready, an Alternative.select<I>arbitrary</I>, Alternative.priSelect<I>prioritised</I> or Alternative.select<I>fair</I> choice can be made between them. The super-interface for all these ALTable events is Guard.
Note that the default semantics for all the above channels are zero-buffering and full synchronisation. This means that a writer to a channel will wait for a matching reader and vice-versa - whoever gets to the channel first will wait for its partner. Various forms of buffering can be introduced by splicing active buffer processes into these channels. However, because this is a common need, JCSP provides a range of plug-ins that can be used to create channels with the common varieties of buffering: org.jcsp.util.Buffer<I</code>blocking FIFO<code>>, org.jcsp.util.OverWriteOldestBuffer<I</code>overwriting (oldest) FIFO<code>>, org.jcsp.util.OverWritingBuffer<I</code>overwriting (latest) FIFO<code>> and org.jcsp.util.InfiniteBuffer<I</code>infinite FIFO<code>>. That set of plug-ins is for Object channels and comes from the org.jcsp.util package. A similar set for int channels is provided in org.jcsp.util.ints.
It is the network builder's responsibility to decide whether to use 1-1, any-1, 1-any or any-any channels and whether to incorporate buffers in them. The process designer is not concerned with these decisions - only with whether the channel is for input or output and what type of information it carries.
The client process sees a server-specific method interface and invokes it in the normal way - however, the invocation will block until the server chooses to accept the call. The server sees the ChannelAccept interface - invoking an ChannelAccept.accept<TT>accept</TT> will block until the client makes a call.
The network builder constructs a server-specific actual call channel by sub-classing from one of One2OneCallChannel, Any2OneCallChannel, One2AnyCallChannel and Any2AnyCallChannel. Precise rules for making this extension are given in their documentation.
Interface | Description |
---|---|
Any2AnyChannel | This defines the interface for an any-to-any object channel, safe for use by many writers and many readers. |
Any2AnyChannelInt | This defines an interface for an any-to-any integer channel, safe for use by many writers and many readers. |
Any2AnyConnection | Defines an interface for a connection shared by multiple clients and multiple servers. |
Any2OneChannel | This defines an interface for an any-to-one object channel, safe for use by many writers and one reader. |
Any2OneChannelInt | This defines an interface for an any-to-one integer channel, safe for use by many writers and one reader. |
Any2OneConnection | |
BufferedChannelArrayFactory | Defines an interface for a factory that can create arrays of channels with user-definable buffering semantics. |
BufferedChannelFactory | Defines an interface for a factory that can create channels with user-definable buffering semantics. |
BufferedChannelIntArrayFactory | Defines an interface for a factory that can create arrays of integer carrying channels with user-definable buffering semantics. |
BufferedChannelIntFactory | Defines an interface for a factory that can create integer carrying channels with user-definable buffering semantics. |
CSProcess | This is the JCSP interface for a process - an active component that encapsulates the data structures on which it operates. |
ChannelAccept | This defines the interface for accepting CALL channels. |
ChannelArrayFactory | Defines an interface for a factory that can create arrays of channels. |
ChannelFactory | Defines an interface for a factory to create instances of channels. |
ChannelInput | This defines the interface for reading from object channels. |
ChannelInputInt | This defines the interface for reading from integer channels. |
ChannelIntArrayFactory | Defines an interface for a factory that can create arrays of channels carrying integers. |
ChannelIntFactory | Defines an interface for a factory that can create channels carrying integers. |
ChannelOutput | This defines the interface for writing to object channels. |
ChannelOutputInt | This defines the interface for writing to integer channels. |
ConnectionArrayFactory | Defines an interface for a factory that can create arrays of connections. |
ConnectionClient | |
ConnectionFactory | |
ConnectionServer | |
One2AnyChannel | This implements a one-to-any object channel, safe for use by one writer and many readers. |
One2AnyChannelInt | This implements a one-to-any integer channel, safe for use by one writer and many readers. |
One2AnyConnection | An interface for a connection which can be used by only one client but which can be used by multiple concurrent servers. |
One2OneChannel | This implements a one-to-one object channel. |
One2OneChannelInt | This implements a one-to-one integer channel. |
One2OneConnection | Defines an interface for a connection that can be used by a single server and single client. |
Poisonable | |
RejectableChannel | Defines an interface for a channel that allows readers to either accept (read ) or
reject data offered by the writer. |
RejectableChannelInput | Defines an interface for an input channel end that gives the reader the ability to reject instead of accepting pending data. |
RejectableChannelOutput | Defines an interface for a channel output end which may reject data if the reader is not prepared
to receive it and calls reject instead of read on the input channel end. |
SharedChannelInput | An interface that should be implemented by ChannelInput objects which can be read by multiple processes concurrently. |
SharedChannelInputInt | An interface that should be implemented by ChannelInputInt objects which can be read by multiple processes concurrently. |
SharedChannelOutput | An interface that should be implemented by ChannelOutput objects which can be written to by multiple processes concurrently. |
SharedChannelOutputInt | An interface that should be implemented by ChannelOutputInt objects which can be written to by multiple processes concurrently. |
SharedConnectionClient | |
SharedConnectionServer |
Class | Description |
---|---|
Alternative | This enables a process to wait passively for and choose between a number of Guard events. |
AltingBarrier | ********************************************************************* JCSP ("CSP for Java") libraries * Copyright (C) 1996-2006 Peter Welch and Paul Austin |
AltingChannelAccept | This extends Guard and ChannelAccept to enable a process to choose between many CALL channel (and other) events. |
AltingChannelInput | This extends Guard and ChannelInput to enable a process to choose between many object input (and other) events. |
AltingChannelInputInt | This extends Guard and ChannelInputInt to enable a process to choose between many integer input (and other) events. |
AltingChannelInputWrapper | This class wraps an ALTable channel so that only the reading part is available to the caller. |
AltingConnectionClient | |
AltingConnectionClientImpl | This class does not need to be used by standard JCSP users. |
AltingConnectionServer | An interface to connection. |
AltingConnectionServerImpl | This class does not need to be used by standard JCSP users. |
Any2AnyCallChannel | This is the super-class for any-to-any interface-specific CALL channels, safe for use by many clients and many servers. |
Any2OneCallChannel | This is the super-class for any-to-one interface-specific CALL channels, safe for use by many clients and one server. |
Barrier | This enables barrier synchronisation between a set of processes. |
BlackHoleChannel | This implements ChannelOutput with black hole semantics. |
BlackHoleChannelInt | This implements ChannelOutputInt with black hole semantics. |
Bucket | This enables bucket synchronisation between a set of processes. |
CSTimer | This is a Guard for setting timeouts in an Alternative. |
Channel | |
ChannelInputWrapper | Defines a wrapper to go around a channel input end. |
ChannelInt | This class provides static factory methods for constructing various different types of int channel objects. |
ChannelOutputImpl | |
ChannelOutputIntImpl | |
ChannelOutputWrapper | Defines a wrapper to go around a channel output end. |
Connection | This class provides static factory methods for constructing different types of connection. |
Crew | This provides a Concurrent Read Exclusive Write (CREW) lock for synchronising fair and secure access to a shared resource. |
Guard | This is the super-class for all Alternative events selectable by a process. |
InlineAlternative | @author Quickstone Technologies Limited |
One2AnyCallChannel | This is the super-class for one-to-any interface-specific CALL channels, safe for use by one client and many servers. |
One2OneCallChannel | This is the super-class for one-to-one interface-specific CALL channels. |
Parallel | This process constructor taks an array of CSProcesses and returns a CSProcess that is the parallel composition of its process arguments. |
PriParallel | This is an extension of the Parallel class that prioritises the processes given to its control. |
ProcessManager | This enables a CSProcess to be spawned concurrently with the process doing the spawning. |
RejectableAltingChannelInput | Defines an interface for an input channel end that gives the reader the ability to reject instead of accepting pending data. |
RejectableBufferedOne2AnyChannel | |
RejectableBufferedOne2OneChannel | |
RejectableChannelOutputImpl | |
RejectableOne2AnyChannel | |
RejectableOne2OneChannel | |
Sequence | This constructor taks an array of CSProcesses and returns a CSProcess that is the sequential composition of its process arguments. |
SharedAltingConnectionClient | |
SharedChannelOutputImpl | |
SharedChannelOutputIntImpl | |
SharedConnectionServerImpl | This class does not need to be used by standard JCSP users. |
Skip | This is a process that immediately terminates and a Guard that is always ready. |
SpuriousLog | ********************************************************************* JCSP ("CSP for Java") libraries * Copyright (C) 1996-2001 Peter Welch and Paul Austin |
StandardChannelFactory | |
StandardChannelIntFactory | |
StandardConnectionFactory | |
Stop | ********************************************************************* JCSP ("CSP for Java") libraries * Copyright (C) 1996-2001 Peter Welch and Paul Austin |
TaggedProtocol | TaggedProtocol is the base class for messages carrying an occam2-like tagged (CASE) protocol over JCSP channels. |
Exception | Description |
---|---|
ChannelDataRejectedException | Thrown by a read or a write method of a channel when a reject has been
called and the synchronization and data transfer will not complete. |
PoisonException |
Error | Description |
---|---|
AlternativeError | ********************************************************************* JCSP ("CSP for Java") libraries * Copyright (C) 1996-2006 Peter Welch and Paul Austin |
AltingBarrierError | ********************************************************************* JCSP ("CSP for Java") libraries * Copyright (C) 1996-2006 Peter Welch and Paul Austin |
BarrierError | This is thrown for an illegal operation on an Barrier. |
JCSP_InternalError | ********************************************************************* JCSP ("CSP for Java") libraries * Copyright (C) 1996-2006 Peter Welch and Paul Austin |
ProcessInterruptedException | ********************************************************************* JCSP ("CSP for Java") libraries * Copyright (C) 1996-2006 Peter Welch and Paul Austin |