This weekend I had some more concrete ideas about the stage driven process. I very much like the idea of bringing components together into a staged driven process using the transparency of the servicemanager. As a default a component would know nothing about the process it participates in. Currently the process is synchronous, but we could define a staged driven process as well.
The idea is that an invocation of a service method on a component is not straightly executed but with the service manager proxying the service interface, enqueued as a special type of "request" into the component's queue. The service manager is responsible for putting together the request object which contains the method requested to be invoked, the parameters passed, a reference to the caller (for priority handling) and maybe already a component reference for the instance on which the method should be invoked (This allows for load balancing). The request is then enqueued in the requested service component's event queue, where it sits until dispatched. When the thread manager has time it dequeues the request and performs the contained method, pushing any exception into a predefined queue for logging or handling. Load balancing and multiplexing could be pushed up into the configuration as well by defining the used stratagies. This would allow us to use a simple staged driven system without changing existing component implementations. More advanced stages that implement interfaces that give more access to the event system could use simple components in this scenario in an event driven way. These interfaces could allow the stage e.g. to provide a special queue other than the ones the manager knows about or allow for processing and filtering the queue, or to process requests by priority. In this case the component would implement an event handler interface that takes more than one "request" as an argument. Unfortunately, we will not be able to use components with methods that have return values (if we wanted to use the return values). For one that's the nature of asynchronous method calling, but then again all my components rely on the return value of the components' service methods. But at least in this scenario we could achieve a better reuse rate than when using stages as hardcoded adaptors for existing components. Let me know what you think... Cheers, Marc -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
