Filip Hanik - Dev Lists wrote:
5. CometEvent
public class CometEvent {
public enum EventType {
READ,TIMEOUT,SOCKET_CLOSE,CONTAINER_SHUTDOWN,CONTEXT_SHUTDOWN,GENERIC_ERROR
//and anything else, we could also create groups of types,
READ,ERROR,SHUTDOWN, with subtypes
}
public HttpServletRequest getRequest();
public HttpServletResponse getResponse();
...and other useful info here
}
I believe this would allow for more flexibility in the future and a
cleaner interface.
The CometServlet can actually stay exactly the same, if need be, as the
begin,end methods can be called based on service() and event()
I still mixed on this. Switching to events is a bit more heavyweight
(objects, ifs blocks to handle the event type), and will cleanup the
interface but make the implementations slightly more complex.
What I really have a problem with is the many event types, since adding
more adds complexity for the application code: for starters, the many
error types (besides error and timeout, anything extra seems useless to
me) and shutdown (this portion of the code does not have any business to
get this sort of notifications, especially differentiating between
shutdown types). As you said it, it's still actually down to 3 useful
events: read, error and shutdown (aka, end).
Rémy
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]