SSF.OS
Class ProtocolGraph

java.lang.Object
  |
  +--com.renesys.raceway.SSF.Entity
        |
        +--SSF.OS.ProtocolGraph
All Implemented Interfaces:
com.renesys.raceway.DML.Configurable
Direct Known Subclasses:
Host

public class ProtocolGraph
extends com.renesys.raceway.SSF.Entity
implements com.renesys.raceway.DML.Configurable

Protocol graph class providing some simple initialization and management functions for instances of class SSF.OS.ProtocolSession. Each protocol graph is an entity, with in-channels and out-channels for exchanging PacketEvents with the rest of the simulation. A protocol graph is configured using the com.renesys.raceway.DML Configurable interface. For example, the following DML flat file describes a simple protocol graph:


 graph [
   description "Sample protocol graph, using trivial TCP/IP."
                
   ProtocolSession [
     name ip
     use SSF.OS.IP.ipSession
   ]
   ProtocolSession [
     name tcp
     use SSF.OS.TCP.tcpSession
   ]
 ]
 


Field Summary
 java.lang.String description
          Optional string describing the protocol.
 
Constructor Summary
ProtocolGraph()
           
 
Method Summary
 void config(com.renesys.raceway.DML.Configuration cfg)
          Configure the protocol graph by instantiating and configuring each named protocol session.
 Resource cpu()
           
 void init()
          Initialize all the protocols in the graph when the simulation begins.
 ProtocolSession SessionForName(java.lang.String protocol_name)
          If a protocol has been registered under the given name, return an instance (session) of it.
 
Methods inherited from class com.renesys.raceway.SSF.Entity
alignment, alignTo, coalignedEntities, inChannels, joinAll, makeIndependent, now, outChannels, pauseAll, playRole, processes, resetSimulation, resumeAll, startAll, startAll, startClient, startClient, startServer, Vx, Yx
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

description

public java.lang.String description
Optional string describing the protocol.

Constructor Detail

ProtocolGraph

public ProtocolGraph()
Method Detail

cpu

public Resource cpu()

config

public void config(com.renesys.raceway.DML.Configuration cfg)
            throws com.renesys.raceway.DML.configException
Configure the protocol graph by instantiating and configuring each named protocol session.

Specified by:
config in interface com.renesys.raceway.DML.Configurable
com.renesys.raceway.DML.configException

init

public void init()
Initialize all the protocols in the graph when the simulation begins.

Overrides:
init in class com.renesys.raceway.SSF.Entity

SessionForName

public ProtocolSession SessionForName(java.lang.String protocol_name)
                               throws ProtocolException
If a protocol has been registered under the given name, return an instance (session) of it. Otherwise, create a new session of the protocol and return that.

Throws:
ProtocolException - if the specified protocol name doesn't name a valid protocol class, or if the class could not be instantiated due to its lack of a public zero-argument constructor.