Search in sources :

Example 1 with CustomListener

use of com.xrtb.bidder.CustomListener in project XRTB by benmfaul.

the class Handler method run.

/**
	 * Starts the JETTY server
	 */
public void run() {
    Server server = new Server(port);
    Handler handler = new Handler();
    try {
        // org.eclipse.jetty.server.session.SessionHandler
        SessionHandler sh = new SessionHandler();
        sh.addEventListener(new CustomListener());
        sh.setHandler(handler);
        server.setHandler(sh);
        server.start();
        server.join();
    } catch (Exception e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
}
Also used : SessionHandler(org.eclipse.jetty.server.session.SessionHandler) Server(org.eclipse.jetty.server.Server) AbstractHandler(org.eclipse.jetty.server.handler.AbstractHandler) SessionHandler(org.eclipse.jetty.server.session.SessionHandler) CustomListener(com.xrtb.bidder.CustomListener) ServletException(javax.servlet.ServletException) IOException(java.io.IOException)

Aggregations

CustomListener (com.xrtb.bidder.CustomListener)1 IOException (java.io.IOException)1 ServletException (javax.servlet.ServletException)1 Server (org.eclipse.jetty.server.Server)1 AbstractHandler (org.eclipse.jetty.server.handler.AbstractHandler)1 SessionHandler (org.eclipse.jetty.server.session.SessionHandler)1