solar.service.dan
Class NodeHandler

java.lang.Object
  |
  +--solar.service.dan.NodeHandler
All Implemented Interfaces:
DanConstants, DataSink, DataSource, java.lang.Runnable

class NodeHandler
extends java.lang.Object
implements DataSource, DataSink, java.lang.Runnable, DanConstants

The wrapper class of graph nodes through which the resident sources and operators interact with other services of the local Planet.

Version:
$Id: NodeHandler.java,v 1.1 2003/09/19 00:38:28 glchen Exp $
Author:
Guanling Chen

Field Summary
protected  GraphNode _gnode
           
protected  java.util.List _inputs
           
protected  java.util.List _outputs
           
protected  boolean _pullOnly
           
protected  boolean _pushOnly
           
protected  java.lang.Thread _runner
           
 
Fields inherited from interface solar.service.dan.DanConstants
DAN_INPORT, DAN_OUTPORT
 
Constructor Summary
NodeHandler(GraphNode gnode)
           
 
Method Summary
 void attachInputPipe(Pipe pipe, InputPort inport)
          Attach an input pipe to this data sink.
 void attachOutputPipe(Pipe pipe, OutputPort outport)
          Attach an output pipe to this data source at a specific port.
 Pipe[] getInputPipes()
          Return all the input pipes in an array.
 InputPort[] getInputPorts()
          Return all the input ports in an array.
 Pipe[] getOutputPipes()
          Return all the output pipes in an array.
 OutputPort[] getOutputPorts()
          Return all the output ports in an array.
 void publish(Event evt)
          Publish an event to all its subscribers.
 void publish(Event evt, java.lang.String outport)
          Publish an event to all its subscribers through a specified port.
 java.lang.Object pullData(java.lang.Object query, OutputPort outport)
          Pull data from this data source at a specific port.
 void pushData(java.lang.Object data, InputPort inport)
          Push data to this data sink at a specific port.
 void run()
           
 void start()
          Start this graph node as a thread.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_inputs

protected java.util.List _inputs

_outputs

protected java.util.List _outputs

_gnode

protected GraphNode _gnode

_pullOnly

protected boolean _pullOnly

_pushOnly

protected boolean _pushOnly

_runner

protected java.lang.Thread _runner
Constructor Detail

NodeHandler

public NodeHandler(GraphNode gnode)
Method Detail

run

public void run()
Specified by:
run in interface java.lang.Runnable

attachOutputPipe

public void attachOutputPipe(Pipe pipe,
                             OutputPort outport)
                      throws FapException
Description copied from interface: DataSource
Attach an output pipe to this data source at a specific port.

Specified by:
attachOutputPipe in interface DataSource
FapException

getOutputPipes

public Pipe[] getOutputPipes()
Description copied from interface: DataSource
Return all the output pipes in an array.

Specified by:
getOutputPipes in interface DataSource

getOutputPorts

public OutputPort[] getOutputPorts()
Description copied from interface: DataSource
Return all the output ports in an array.

Specified by:
getOutputPorts in interface DataSource

pullData

public java.lang.Object pullData(java.lang.Object query,
                                 OutputPort outport)
                          throws FapException
Description copied from interface: DataSource
Pull data from this data source at a specific port.

Specified by:
pullData in interface DataSource
FapException

attachInputPipe

public void attachInputPipe(Pipe pipe,
                            InputPort inport)
                     throws FapException
Description copied from interface: DataSink
Attach an input pipe to this data sink.

Specified by:
attachInputPipe in interface DataSink
FapException

getInputPipes

public Pipe[] getInputPipes()
Description copied from interface: DataSink
Return all the input pipes in an array.

Specified by:
getInputPipes in interface DataSink

getInputPorts

public InputPort[] getInputPorts()
Description copied from interface: DataSink
Return all the input ports in an array.

Specified by:
getInputPorts in interface DataSink

pushData

public void pushData(java.lang.Object data,
                     InputPort inport)
              throws FapException
Description copied from interface: DataSink
Push data to this data sink at a specific port.

Specified by:
pushData in interface DataSink
FapException

start

public void start()
Start this graph node as a thread.


publish

public void publish(Event evt)
             throws java.lang.Exception
Publish an event to all its subscribers.

java.lang.Exception

publish

public void publish(Event evt,
                    java.lang.String outport)
             throws java.lang.Exception
Publish an event to all its subscribers through a specified port.

java.lang.Exception