ServletHolder dftServlet = context.addServlet(DefaultServlet.class, "/");
dftServlet.setInitOrder(1);
// CometD servlet
AnnotationCometDServlet cometdServlet = new AnnotationCometDServlet();
ServletHolder comet = new ServletHolder(cometdServlet);
context.addServlet(comet, "/cometd/*");
comet.setInitParameter("timeout", "20000");
comet.setInitParameter("interval", "100");
comet.setInitParameter("maxInterval", "10000");
comet.setInitParameter("multiSessionInterval", "5000");
comet.setInitParameter("services", "org.cometd.examples.ChatService");
comet.setInitOrder(2);
ServletHolder demo = context.addServlet(CometDDemoServlet.class, "/demo");
demo.setInitOrder(3);
server.start();
BayeuxServer bayeux = cometdServlet.getBayeux();
bayeux.setSecurityPolicy(new DefaultSecurityPolicy());
// Demo lazy messages
if (Boolean.getBoolean("LAZY"))
{