simnet
Class PluginType

java.lang.Object
  extended bysimnet.PluginType
Direct Known Subclasses:
ApplicationPluginType, DropPolicyPluginType, IPFilterPluginType, LinkProcessorPluginType, NodePluginType, ResolverPluginType, RoutingTablePluginType, TopologyParserPluginType, TransportPluginType

public abstract class PluginType
extends java.lang.Object

Subclasses of this type are responsible for plugging in and out objects of a specific class.


Constructor Summary
PluginType()
           
 
Method Summary
abstract  java.lang.Object findInstance(Node node, java.lang.Class the_class, java.lang.String[] args)
          Find and return the instance of the specified class on the specified node that matches the given arguments.
abstract  java.lang.String getType()
          Returns the name of the class that this PluginType is for.
abstract  java.lang.String getUsage()
          Returns a string describing how to use this type of plugin, suitable for being displayed by help.
abstract  boolean initInstance(Node node, java.lang.Object instance, java.lang.String[] args)
          Initialize the instance of an object that is passed to it, and "running" on the specified node.
abstract  boolean isBatch(boolean in, Node node, java.lang.Class the_class, java.lang.String[] args)
          Called before every plug operation.
abstract  boolean removeInstance(Node node, java.lang.Class the_class, java.lang.String[] args)
          Remove the object specified (in the same way as findInstance) from its "primary location", as defined by this type of plugin.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PluginType

public PluginType()
Method Detail

getType

public abstract java.lang.String getType()
Returns the name of the class that this PluginType is for.


getUsage

public abstract java.lang.String getUsage()
Returns a string describing how to use this type of plugin, suitable for being displayed by help. Should not include the common part, i.e.: "plug (in|out) [all|@]"


isBatch

public abstract boolean isBatch(boolean in,
                                Node node,
                                java.lang.Class the_class,
                                java.lang.String[] args)
Called before every plug operation. If the combination of paramaters (ususally just args) indicate that multiple objects should be plugged in/out (ex: DropPolicy and IPFilter), this method should call Simulator.getSim().plug(in,node,the_class,[specific args]) for every element of the batch (typically, per link), and return true. Otherwise, this method should do nothing except to return false.


findInstance

public abstract java.lang.Object findInstance(Node node,
                                              java.lang.Class the_class,
                                              java.lang.String[] args)
Find and return the instance of the specified class on the specified node that matches the given arguments. Return null if no such object exists.


removeInstance

public abstract boolean removeInstance(Node node,
                                       java.lang.Class the_class,
                                       java.lang.String[] args)
Remove the object specified (in the same way as findInstance) from its "primary location", as defined by this type of plugin. Returns if the operation was sucessful.


initInstance

public abstract boolean initInstance(Node node,
                                     java.lang.Object instance,
                                     java.lang.String[] args)
Initialize the instance of an object that is passed to it, and "running" on the specified node. Then add the instance to its "primary location". Returns if the operation was sucessful.