Search in sources :

Example 1 with FusekiErrorHandler

use of org.apache.jena.fuseki.server.FusekiErrorHandler in project jena by apache.

the class ManagementServer method createManagementServer.

public static Server createManagementServer(int mgtPort) {
    Fuseki.serverLog.info("Adding management functions");
    // Separate Jetty server
    Server server = new Server();
    //        BlockingChannelConnector bcConnector = new BlockingChannelConnector() ;
    //        bcConnector.setUseDirectBuffers(false) ;
    //        Connector connector = bcConnector ;
    Connector connector = new SelectChannelConnector();
    // Ignore idle time. 
    // If set, then if this goes off, it keeps going off and you get a lot of log messages.
    // Jetty outputs a lot of messages if this goes off.
    connector.setMaxIdleTime(0);
    connector.setPort(mgtPort);
    server.addConnector(connector);
    ServletContextHandler context = new ServletContextHandler(ServletContextHandler.SESSIONS);
    context.setErrorHandler(new FusekiErrorHandler());
    server.setHandler(context);
    // Add the server control servlet
    addServlet(context, new MgtCmdServlet(), "/mgt");
    addServlet(context, new DumpServlet(), "/dump");
    addServlet(context, new StatsServlet(), "/stats");
    addServlet(context, new PingServlet(), "/ping");
    return server;
// Old plan
//      // Development : server control panel.
//      addServlet(context, new ServerServlet(), "/server") ;
//      addServlet(context, new ActionBackup(), "/backup") ;
}
Also used : Connector(org.eclipse.jetty.server.Connector) SelectChannelConnector(org.eclipse.jetty.server.nio.SelectChannelConnector) SelectChannelConnector(org.eclipse.jetty.server.nio.SelectChannelConnector) DumpServlet(org.apache.jena.fuseki.servlets.DumpServlet) FusekiErrorHandler(org.apache.jena.fuseki.server.FusekiErrorHandler) Server(org.eclipse.jetty.server.Server) ServletContextHandler(org.eclipse.jetty.servlet.ServletContextHandler)

Aggregations

FusekiErrorHandler (org.apache.jena.fuseki.server.FusekiErrorHandler)1 DumpServlet (org.apache.jena.fuseki.servlets.DumpServlet)1 Connector (org.eclipse.jetty.server.Connector)1 Server (org.eclipse.jetty.server.Server)1 SelectChannelConnector (org.eclipse.jetty.server.nio.SelectChannelConnector)1 ServletContextHandler (org.eclipse.jetty.servlet.ServletContextHandler)1