After re-examining Matt Welsh's SandStorm server kernel, I have come to the conclusion that Stages conceptually are the EventHandlers. The confusion came from studying the interfaces and reading his thesis. While the concepts relate, the names are somewhat different. In SandStorm (his SEDA kernel), the Stage is merely an object to manage stage/queue relationships. The EventHandler is where the real work is done. In fact, after examining the Haboob HTTP server code, there is no class that extends Stage or directly implements Stage. There is only the classes the implement EventHandler.
Because of this conclusion, I will make the Stage interface in Cornerstone extend EventHandler. It is in fact the correct thing to do. Once I have the interfaces defined, I will put together a re-implementation of the nonblocking connection management code, and asynchronous file IO code. I will make these specific stages, but I am unsure of how to expose it via the normal Block Interface. I am open to suggestions of how to reconcile the Stage and Block pieces. I see how some of it will work together quite nicely, but I also see how some of it will overlap. Here are places of overlap: ConnectionManager, SocketManager, ObjectStore Here are places that compliment: DataSourceSelector, TimeScheduler The big thing is that driving the architecture with events is a very different model. I personally would prefer to have portions of files read and the information passed as QueueElements. Bringing this into the world of JDK 1.4 with the new Buffer classes, we could have a Cache stage that had a pool of MappedByteBuffers that had direct to memory mapping for a group of files. This implementation allows us to read in a chunk of the file automatically, pass it in a BufferMessage that eventually gets serialized via nonblocking IO to the client. In fact, with such a scheme, we can have a portion of several files open, reading enough in for the next message, and as messages are consumed, we reuse them for the next section of the file. It provides alot of functionality, but I wonder if providing the ability to separate portions of the event driven architecture accross block boundaries is a flawed concept. My original thinking in this line was to keep the ability to separate a server into ProtocolHandling sections and Store management sections (i.e. SMTP, POP3, IMAP, mail queue, etc.). However, that could also be happening at the Stage level. Any input would be helpful. ---------------------------------------------------- Sign Up for NetZero Platinum Today Only $9.95 per month! http://my.netzero.net/s/signup?r=platinum&refcd=PT97 -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
