Class DefaultRouteManager

java.lang.Object
org.xj3d.impl.core.eventmodel.DefaultRouteManager
All Implemented Interfaces:
RouteManager

public class DefaultRouteManager extends Object implements RouteManager
A manager of high-level route organisation based on execution spaces.

Does not perform direct routing itself, but manages the execution space and delegates the routing to individual router instances, one per execution space. The idea of this is to allow multi-threaded route handlers if required. Each execution space can provide a routing mechanism that operates in its own thread or they all live in one thread.

The implementation provides a one-shot route processing mechanism. It does not continuously evaluate routes. That is left to the caller code. Once the processRoutes() method is called, it will loop through all available routes until none of them have any changed values to send. At this point it will return and wait until the next time it is called.

Routes are added to a particular execution space. Each space represents an encapsulated world, such as a proto or inline. The route manager is expected to be able to deal with these individual spaces, and keep them separate. Thus, when the execution space is no longer referenced, the associated routes and scripts are to be removed and their outputs no longer processed.

Implementation is not particularly efficient in this version...

Version:
$Revision: 1.2 $
Author:
Justin Couch