use of org.jowidgets.security.impl.http.server.BasicAuthenticationFilter in project jo-client-platform by jo-source.
the class CapServerStarter method startServer.
public static void startServer(final String brokerId, final int port) throws Exception {
Assert.paramNotNull(brokerId, "brokerId");
final Server server = new Server(port);
final ServletContextHandler root = new ServletContextHandler(ServletContextHandler.SESSIONS);
root.addServlet(new ServletHolder(new SecurityRemotingServlet(brokerId)), "/");
root.addFilter(new FilterHolder(new BasicAuthenticationFilter()), "/", FilterMapping.DEFAULT);
server.setHandler(root);
server.start();
server.join();
}
use of org.jowidgets.security.impl.http.server.BasicAuthenticationFilter in project jo-client-platform by jo-source.
the class CapServerStarter method startServer.
public static void startServer(final String brokerId, final int port, final MessageServletConfig config) throws Exception {
Assert.paramNotNull(brokerId, "brokerId");
final Server server = new Server(port);
final ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(32, 256, 60, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>(), DaemonThreadFactory.multi(CapServerStarter.class.getName() + ".ServletExecutor"));
server.setThreadPool(new ExecutorThreadPool(threadPoolExecutor));
final ServletContextHandler root = new ServletContextHandler(ServletContextHandler.SESSIONS);
final ServletHolder servletHolder = new ServletHolder(new SecurityRemotingServlet(brokerId));
setConfigParameters(servletHolder, config);
root.addServlet(servletHolder, "/");
root.addFilter(new FilterHolder(new BasicAuthenticationFilter()), "/", FilterMapping.DEFAULT);
addServletFilters(root, config);
server.setHandler(root);
server.start();
server.join();
}
Aggregations