planet.behaviour
Interface BehavioursPool

All Known Implementing Classes:
BehavioursPoolImpl

public interface BehavioursPool

The BehavioursPool's interface is aimed at providing an internal scheduler of node's behaviuours. At startup, behaviours are registered to the pool from Behaviour.properties file, following the next syntax: Class = Type, Mode, Probability Then, a message interceptor is build up and is ready to invoke behaviours when a message pattern matches to those provided by Behaviour.properties file.

Author:
Marc Sanchez Date: 10/10/2004

Field Summary
static java.lang.String NumberOfModes
           
static java.lang.String NumberOfTypes
           
 
Method Summary
 RouteMessage[] onMessage(RouteMessage msg, Node node)
          Given a RouteMessage and a Node as input, onMessage's method intends to invoke some behaviours only if RouteMessage's type and mode fields matches some behaviour's pattern.
 

Field Detail

NumberOfTypes

public static final java.lang.String NumberOfTypes
See Also:
Constant Field Values

NumberOfModes

public static final java.lang.String NumberOfModes
See Also:
Constant Field Values
Method Detail

onMessage

public RouteMessage[] onMessage(RouteMessage msg,
                                Node node)
                         throws NoSuchBehaviourException,
                                NoBehaviourDispatchedException
Given a RouteMessage and a Node as input, onMessage's method intends to invoke some behaviours only if RouteMessage's type and mode fields matches some behaviour's pattern.

Parameters:
msg - RoteMessage taken as input.
node - Node taken as input.
Returns:
Returns either an array of RouteMessages or null when no messages need to transmit this node.
Throws:
NoSuchBehaviourException - when no behaviour matches RouteMessage's pattern.
NoBehaviourDispatchedException