org.apache.cocoon.components.thread
Class SynchronousChannel

java.lang.Object
  extended by EDU.oswego.cs.dl.util.concurrent.SynchronousChannel
      extended by org.apache.cocoon.components.thread.SynchronousChannel
All Implemented Interfaces:
EDU.oswego.cs.dl.util.concurrent.BoundedChannel, EDU.oswego.cs.dl.util.concurrent.Channel, EDU.oswego.cs.dl.util.concurrent.Puttable, EDU.oswego.cs.dl.util.concurrent.Takable, Queue

public class SynchronousChannel
extends EDU.oswego.cs.dl.util.concurrent.SynchronousChannel
implements Queue

A rendezvous channel, similar to those used in CSP and Ada. Each put must wait for a take, and vice versa. Synchronous channels are well suited for handoff designs, in which an object running in one thread must synch up with an object running in another thread in order to hand it some information, event, or task.

If you only need threads to synch up without exchanging information, consider using a Barrier. If you need bidirectional exchanges, consider using a Rendezvous.

[ Introduction to this package. ]

See Also:
CyclicBarrier, Rendezvous

Nested Class Summary
 
Nested classes/interfaces inherited from class EDU.oswego.cs.dl.util.concurrent.SynchronousChannel
EDU.oswego.cs.dl.util.concurrent.SynchronousChannel.Queue
 
Field Summary
 
Fields inherited from class EDU.oswego.cs.dl.util.concurrent.SynchronousChannel
CANCELLED, waitingPuts, waitingTakes
 
Constructor Summary
SynchronousChannel()
           
 
Method Summary
 int getQueueSize()
          get the current queue size
 
Methods inherited from class EDU.oswego.cs.dl.util.concurrent.SynchronousChannel
capacity, offer, peek, poll, put, take
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface EDU.oswego.cs.dl.util.concurrent.Channel
offer, peek, poll, put, take
 

Constructor Detail

SynchronousChannel

public SynchronousChannel()
Method Detail

getQueueSize

public int getQueueSize()
Description copied from interface: Queue
get the current queue size

Specified by:
getQueueSize in interface Queue
Returns:
current size of queue. If the size of the queue is not maintained by an implementation -1 should be returned.
See Also:
Queue.getQueueSize()


Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.