Home » concurrent-sources » EDU.oswego.cs.dl.util.concurrent.misc » [javadoc | source]
public class: PipedChannel [javadoc | source]

All Implemented Interfaces:

A channel based on a java.io.PipedInputStream and java.io.PipedOutputStream. Elements are serialized using ObjectInputStreams and ObjectOutputStreams upon insertion and extraction from the pipe.

IO Exceptions are transformed into Errors. This is in general not a good idea, but seems to be the most reasonable compromise for the intended usage contexts.

Status Uncertain. There are enough conceptual and implementation snags surrounding use of pipes as Channels to downplay use. However, without such bridges, people would have to duplicate code that should work the same way in both cases.

[ Introduction to this package. ]
Field Summary
protected  ObjectInputStream in_     
protected  ObjectOutputStream out_     
protected final  PipedOutputStream outp_     
protected final  PipedInputStream inp_     
Fields inherited from EDU.oswego.cs.dl.util.concurrent.SemaphoreControlledChannel:
putGuard_,  takeGuard_,  capacity_
 public PipedChannel() 
Method from EDU.oswego.cs.dl.util.concurrent.misc.PipedChannel Summary:
extract,   in,   insert,   out,   peek
Methods from EDU.oswego.cs.dl.util.concurrent.SemaphoreControlledChannel:
capacity,   extract,   insert,   offer,   poll,   put,   size,   take
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from EDU.oswego.cs.dl.util.concurrent.misc.PipedChannel Detail:
 protected Object extract() 
    Shared mechanics for take-based methods
 protected synchronized ObjectInputStream in() 
    Return input stream, first constructing if necessary. Needed because Object streams can block on open.
 protected  void insert(Object x) 
    Shared mechanics for put-based methods
 protected synchronized ObjectOutputStream out() 
    Return output stream, first constructing if necessary. Needed because Object streams can block on open.
 public Object peek() 
    Stubbed out for now