planet.commonapi.behaviours
Interface BehavioursPool

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
BehavioursPoolImpl

public interface BehavioursPool
extends java.io.Serializable

The BehavioursPool's interface is aimed at providing an internal scheduler of node's behaviuours. At startup, behaviours are registered to the pool from the current configuration.

Then, a message interceptor is built up and is ready to invoke behaviours when a message pattern matches to those provided by the current configuration.

Any future implementation must incorpore the no arguments constructor.

Author:
Marc Sanchez, Jordi Pujol Date: 10/10/2004

Method Summary
 void 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.
 

Method Detail

onMessage

public void 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