solar.service.dan
Class GraphNode

java.lang.Object
  |
  +--solar.service.dan.GraphNode
All Implemented Interfaces:
DanConstants, Identifiable
Direct Known Subclasses:
Application, Filter, Source

public abstract class GraphNode
extends java.lang.Object
implements Identifiable, DanConstants

The interface for all nodes in the graph. There are three types of nodes: sources, operators, and applications.

Version:
$Id: GraphNode.java,v 1.2 2003/09/25 05:29:56 glchen Exp $
Author:
Guanling Chen

Field Summary
protected  Id _gid
           
private  NodeHandler _handler
           
 
Fields inherited from interface solar.service.dan.DanConstants
DAN_INPORT, DAN_OUTPORT
 
Constructor Summary
GraphNode()
           
 
Method Summary
 Id getId()
          Return the ID of this object.
 java.util.List getInputPorts()
          Return a list of input ports of this node.
 java.util.List getOutputPorts()
          Return a list of output ports of this node.
abstract  void handleEvent(Event evt)
          Handle the event being actively pushed/published to this operator.
 void handleEvent(Event evt, java.lang.String inport)
          Handle the event coming from the specified input port.
abstract  java.lang.Object handleQuery(Request query)
          Handle the query being actively pulled by downstream operators.
 java.lang.Object handleQuery(Request query, java.lang.String outport)
          Handle the query coming from the specified output port.
 void init(NodeHandler handler)
          Initialize the source with a handler.
 void init(serp.util.Options opts)
          Customized initialization derived from graph spec.
protected  void publish(Event evt)
           
protected  void publish(Event evt, java.lang.String outport)
           
 void setId(Id gid)
          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

_gid

protected Id _gid

_handler

private NodeHandler _handler
Constructor Detail

GraphNode

public GraphNode()
Method Detail

setId

public void setId(Id gid)
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

init

public void init(serp.util.Options opts)
          throws java.lang.Exception
Customized initialization derived from graph spec.

java.lang.Exception

init

public void init(NodeHandler handler)
Initialize the source with a handler.


getInputPorts

public java.util.List getInputPorts()
Return a list of input ports of this node.


getOutputPorts

public java.util.List getOutputPorts()
Return a list of output ports of this node.


handleEvent

public abstract void handleEvent(Event evt)
                          throws java.lang.Exception
Handle the event being actively pushed/published to this operator.

java.lang.Exception

handleEvent

public void handleEvent(Event evt,
                        java.lang.String inport)
                 throws java.lang.Exception
Handle the event coming from the specified input port.

java.lang.Exception

handleQuery

public abstract java.lang.Object handleQuery(Request query)
                                      throws java.lang.Exception
Handle the query being actively pulled by downstream operators.

java.lang.Exception

handleQuery

public java.lang.Object handleQuery(Request query,
                                    java.lang.String outport)
                             throws java.lang.Exception
Handle the query coming from the specified output port.

java.lang.Exception

publish

protected final void publish(Event evt)
                      throws java.lang.Exception
java.lang.Exception

publish

protected final void publish(Event evt,
                             java.lang.String outport)
                      throws java.lang.Exception
java.lang.Exception