Interface RouteManager
- All Known Implementing Classes:
DefaultRouteManager
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.1 $
- Author:
- Justin Couch
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addRoute
(VRMLExecutionSpace space, ROUTE route) Add a route object to the system.void
addRoute
(VRMLExecutionSpace space, VRMLNodeType srcNode, int srcIndex, VRMLNodeType destNode, int destIndex) Add a route to the system.void
addSpace
(VRMLExecutionSpace space) Add an execution space to the system.void
clear()
Clear all the routes currently being managed here.boolean
processRoutes
(double timestamp) Process all of the available routes until there are no more to process.void
removeRoute
(VRMLExecutionSpace space, ROUTE route) Remove a route object from the system.void
removeRoute
(VRMLExecutionSpace space, VRMLNodeType srcNode, int srcIndex, VRMLNodeType destNode, int destIndex) Remove a route from the system.void
removeSpace
(VRMLExecutionSpace space) Remove an execution space to the system.void
setErrorReporter
(org.j3d.util.ErrorReporter reporter) Register an error reporter with the manager so that any errors generated by the loading of script code can be reported in a nice, pretty fashion.void
Set the factory needed to create new router instances for a new execution space.void
Notification that the route manager should now propagate all added and removed routes from this list into the core evaluatable space.void
Notification that the route manager should now propagate all added and removed spaces from this list into the core evaluatable system.
-
Method Details
-
setErrorReporter
void setErrorReporter(org.j3d.util.ErrorReporter reporter) Register an error reporter with the manager so that any errors generated by the loading of script code can be reported in a nice, pretty fashion. Setting a value of null will clear the currently set reporter. If one is already set, the new value replaces the old.- Parameters:
reporter
- The instance to use or null
-
setRouterFactory
Set the factory needed to create new router instances for a new execution space. If the reference is null, then this clears the current factory so that we don't accept sub-space handling.- Parameters:
fac
- The factory instance to use
-
processRoutes
boolean processRoutes(double timestamp) Process all of the available routes until there are no more to process. This method will not return until all routes have been processed.- Parameters:
timestamp
- The timestamp for when these routes should be executed- Returns:
- false No event outs needed processing this call
-
addRoute
void addRoute(VRMLExecutionSpace space, VRMLNodeType srcNode, int srcIndex, VRMLNodeType destNode, int destIndex) Add a route to the system. If the route exists in the system, this silently ignores the request. If the space reference is null then- Parameters:
space
- The execution space for the routesrcNode
- The source node of the routesrcIndex
- The index of the source fielddestNode
- The destination node of the routedestIndex
- The index of the destination field
-
addRoute
Add a route object to the system. If the route exists in the system, this silently ignores the request.- Parameters:
space
- The execution space for the routeroute
- The object to add
-
removeRoute
void removeRoute(VRMLExecutionSpace space, VRMLNodeType srcNode, int srcIndex, VRMLNodeType destNode, int destIndex) Remove a route from the system. If the route does not exist in the system, this silently ignores the request.- Parameters:
space
- The execution space for the routesrcNode
- The source node of the routesrcIndex
- The index of the source fielddestNode
- The destination node of the routedestIndex
- The index of the destination field
-
removeRoute
Remove a route object from the system. If the route does not exist in the system, this silently ignores the request.- Parameters:
space
- The execution space for the routeroute
- The object to remove
-
addSpace
Add an execution space to the system. This will add all its routes and any contained spaces such as protos and inlines. If this space has already been added, the request will be ignored.- Parameters:
space
- The execution space to add
-
removeSpace
Remove an execution space to the system. This will add all its routes and any contained spaces such as protos and inlines. If this request has not been added it will be ignored.- Parameters:
space
- The execution space to add
-
updateSpaces
void updateSpaces()Notification that the route manager should now propagate all added and removed spaces from this list into the core evaluatable system. It should call the normal addRoute method of the space and not directly propagate the route modifications immediately. They should wait for the separate updateRoutes() call. -
updateRoutes
void updateRoutes()Notification that the route manager should now propagate all added and removed routes from this list into the core evaluatable space. -
clear
void clear()Clear all the routes currently being managed here. The space this router represents is being deleted.
-