EventRouterImplpublic class EventRouterImpl extends Object implements EventRouterFrom the Spec, an EventRouter is:
The event router is channel based, with rules based on longest-prefix match
dispatching for registered listeners. The "/meta/*" channel is reserved for
communications with the event router itself (including connection setup,
tear-down, and re-connection), and all conformant clients and servers must
implement the following meta-channel verbs:
* handshake
* connect
* reconnect
* disconnect
* status
* subscribe
* unsubscribe
* ping |
Fields Summary |
---|
private static final String | JSON_MESSAGES | private com.sun.enterprise.web.connector.grizzly.comet.CometContext | cometContextThe CometContext associated with this EvenrRouter. |
Methods Summary |
---|
public com.sun.enterprise.web.connector.grizzly.comet.CometContext | getCometContext()
return cometContext;
| public void | route(CometdRequest req, CometdResponse res)Route a CometD message.
String[] messages = req.getParameterValues(JSON_MESSAGES);
if (messages != null && messages.length > 0){
for(String message: messages){
final Verb verb = VerbUtils.parse(JSONParser.parse(message));
// Notify our listener;
getCometContext().notify(BayeuxCometHandler.newCometdContext
(req,res,verb),CometEvent.NOTIFY,
(Integer)cometContext.getAttribute(
BayeuxCometHandler.BAYEUX_COMET_HANDLER));
}
}
| public void | setCometContext(com.sun.enterprise.web.connector.grizzly.comet.CometContext cometContext)
this.cometContext = cometContext;
|
|