solar.service.fap
Class Pipe

java.lang.Object
  |
  +--solar.service.fap.Pipe
All Implemented Interfaces:
Identifiable
Direct Known Subclasses:
DirectPipe

public abstract class Pipe
extends java.lang.Object
implements Identifiable

A pipe consists of a pair of channels: A writable sink channel and a readable source channel. A pipe is unidirectional.

Version:
$Id: Pipe.java,v 1.12 2003/09/25 05:30:02 glchen Exp $
Author:
Guanling Chen

Field Summary
protected  Id _pid
           
protected  SinkChannel _sink
           
protected  SourceChannel _source
           
protected  int _type
           
 
Constructor Summary
Pipe(Id pid, int type)
          Constructs a pipe with specified ID and pull/push type.
Pipe(Id pid, int type, SourceChannel source, SinkChannel sink)
          Constructs a pipe with additional pair of source/sink channels.
 
Method Summary
 void attachSinkChannel(SinkChannel sink)
          Attach a sink channel to this pipe.
 void attachSourceChannel(SourceChannel source)
          Attach the source channel to this pipe.
 Id getId()
          Return the ID of this object.
 java.lang.String getInputPort()
          Return the name of the input port for this pipe.
 java.lang.String getOutputPort()
          Return the name of the output port for this pipe.
 SinkChannel getSinkChannel()
          Return the sink channel of this pipe.
 SourceChannel getSourceChannel()
          Return the source channel of this pipe.
 int getType()
          Return whether this is a push or pull pipe.
abstract  java.lang.Object pullData(java.lang.Object query)
          Pull data from this pipe.
abstract  void pushData(java.lang.Object data)
          Push data through this pipe.
 void setId(Id id)
          Set the ID of this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_pid

protected Id _pid

_type

protected int _type

_source

protected SourceChannel _source

_sink

protected SinkChannel _sink
Constructor Detail

Pipe

public Pipe(Id pid,
            int type)
Constructs a pipe with specified ID and pull/push type.


Pipe

public Pipe(Id pid,
            int type,
            SourceChannel source,
            SinkChannel sink)
Constructs a pipe with additional pair of source/sink channels.

Method Detail

setId

public void setId(Id id)
Description copied from interface: Identifiable
Set the ID of this object.

Specified by:
setId in interface Identifiable

getId

public Id getId()
Description copied from interface: Identifiable
Return the ID of this object.

Specified by:
getId in interface Identifiable

getType

public int getType()
Return whether this is a push or pull pipe.


attachSourceChannel

public void attachSourceChannel(SourceChannel source)
                         throws FapException
Attach the source channel to this pipe.

FapException

getSourceChannel

public SourceChannel getSourceChannel()
Return the source channel of this pipe.


getInputPort

public java.lang.String getInputPort()
                              throws FapException
Return the name of the input port for this pipe.

FapException

attachSinkChannel

public void attachSinkChannel(SinkChannel sink)
                       throws FapException
Attach a sink channel to this pipe.

FapException

getSinkChannel

public SinkChannel getSinkChannel()
Return the sink channel of this pipe.


getOutputPort

public java.lang.String getOutputPort()
                               throws FapException
Return the name of the output port for this pipe.

FapException

pushData

public abstract void pushData(java.lang.Object data)
                       throws FapException
Push data through this pipe.

FapException

pullData

public abstract java.lang.Object pullData(java.lang.Object query)
                                   throws FapException
Pull data from this pipe.

FapException