From: <tho...@us...> - 2014-05-04 15:06:05
|
Revision: 8179 http://sourceforge.net/p/bigdata/code/8179 Author: thompsonbry Date: 2014-05-04 15:05:59 +0000 (Sun, 04 May 2014) Log Message: ----------- Removed some comment blocks (dead code). Modified Paths: -------------- branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/NanoSparqlServer.java Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/NanoSparqlServer.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/NanoSparqlServer.java 2014-05-04 14:47:29 UTC (rev 8178) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-sails/src/java/com/bigdata/rdf/sail/webapp/NanoSparqlServer.java 2014-05-04 15:05:59 UTC (rev 8179) @@ -67,37 +67,11 @@ * Embedding Jetty </a> * * @todo If the addressed instance uses full transactions, then mutation should - * also use a full transaction. + * also use a full transaction. Does it? * * @todo Remote command to advance the read-behind point. This will let people * bulk load a bunch of stuff before advancing queries to read from the * new consistent commit point. - * - * @todo Note: There appear to be plenty of ways to setup JSP support for - * embedded jetty, and plenty of ways to get it wrong. I wound up adding - * to the classpath the following jars for jetty 7.2.2 to get this - * running: - * - * <pre> - * com.sun.el_1.0.0.v201004190952.jar - * ecj-3.6.jar - * javax.el_2.1.0.v201004190952.jar - * javax.servlet.jsp.jstl_1.2.0.v201004190952.jar - * javax.servlet.jsp_2.1.0.v201004190952.jar - * jetty-jsp-2.1-7.2.2.v20101205.jar - * org.apache.jasper.glassfish_2.1.0.v201007080150.jar - * org.apache.taglibs.standard.glassfish_1.2.0.v201004190952.jar - * </pre> - * - * Note: JSP pages for the servlet 2.5 specification add the following - * dependencies: - * - * <pre> - * ant-1.6.5.jar - * core-3.1.1.jar - * jsp-2.1.jar - * jsp-api-2.1.jar - * </pre> */ public class NanoSparqlServer { @@ -493,83 +467,7 @@ } -// final Server server = new Server(port); -// -// final ServletContextHandler context = getContextHandler(initParams); -// -// final ResourceHandler resourceHandler = new ResourceHandler(); -// -// setupStaticResources(NanoSparqlServer.class.getClassLoader(), -// resourceHandler); -// -// // same resource base. -// context.setResourceBase(resourceHandler.getResourceBase()); -// context.setWelcomeFiles(resourceHandler.getWelcomeFiles()); -// -// final HandlerList handlers = new HandlerList(); -// -// handlers.setHandlers(new Handler[] { -// context,// maps servlets -// resourceHandler,// maps welcome files. -// new DefaultHandler() // responsible for anything not explicitly served. -// }); -// -// server.setHandler(handlers); -// -// // Force the use of the caller's IIndexManager. -// context.setAttribute(IIndexManager.class.getName(), indexManager); -// -// return server; - } - -// /** -// * Variant used when the life cycle of the {@link IIndexManager} will be -// * managed by the server - this form is used by {@link #main(String[])}. -// * <p> -// * Note: This is mostly a convenience for scripts that do not need to take -// * over the detailed control of the jetty container and the bigdata webapp. -// * -// * @param port -// * The port on which the service will run -OR- ZERO (0) for any -// * open port. -// * @param propertyFile -// * The <code>.properties</code> file (for a standalone database -// * instance) or the <code>.config</code> file (for a federation). -// * @param initParams -// * Initialization parameters for the web application as specified -// * by {@link ConfigParams}. -// * -// * @return The server instance. -// */ -// static public Server newInstance(final int port, final String propertyFileIsNotUsed, -// final Map<String, String> initParams) throws Exception { -// -// final Server server = new Server(port); -// -// final ServletContextHandler context = getContextHandler(initParams); -// -// final ResourceHandler resourceHandler = new ResourceHandler(); -// -// setupStaticResources(NanoSparqlServer.class.getClassLoader(), -// resourceHandler); -// -// // same resource base. -// context.setResourceBase(resourceHandler.getResourceBase()); -// context.setWelcomeFiles(resourceHandler.getWelcomeFiles()); -// -// final HandlerList handlers = new HandlerList(); -// -// handlers.setHandlers(new Handler[] {// -// context,// maps servlets -// resourceHandler,// maps welcome files. -// new DefaultHandler() // responsible for anything not explicitly served. -// }); -// -// server.setHandler(handlers); -// -// return server; -// } /** * Variant used when you already have the {@link IIndexManager} on hand and @@ -753,253 +651,6 @@ } -// /** -// * Construct a {@link ServletContextHandler}. -// * <p> -// * Note: The {@link ContextHandler} uses the longest prefix of the request -// * URI (the contextPath) to select a specific {@link Handler}. -// * <p> -// * Note: If you are using <code>web.xml</code>, then all of this stuff is -// * done there instead. -// * -// * @param initParams -// * The init parameters, per the web.xml definition. -// */ -// static private ServletContextHandler getContextHandler( -// final Map<String, String> initParams) throws Exception { -// -// if (initParams == null) -// throw new IllegalArgumentException(); -// -// final ServletContextHandler context = new ServletContextHandler( -// ServletContextHandler.NO_SECURITY -//// | ServletContextHandler.NO_SESSIONS -// ); -// -// // Path to the webapp. -// context.setContextPath(BigdataStatics.getContextPath()); -// -// /* -// * Register a listener which will handle the life cycle events for the -// * ServletContext. -// */ -// { -// -// String className = initParams -// .get(ConfigParams.SERVLET_CONTEXT_LISTENER_CLASS); -// -// if (className == null) -// className = ConfigParams.DEFAULT_SERVLET_CONTEXT_LISTENER_CLASS; -// -// final Class<BigdataRDFServletContextListener> cls = (Class<BigdataRDFServletContextListener>) Class -// .forName(className); -// -// if (!BigdataRDFServletContextListener.class.isAssignableFrom(cls)) { -// -// throw new RuntimeException("Invalid option: " -// + ConfigParams.SERVLET_CONTEXT_LISTENER_CLASS + "=" -// + className + ":: Class does not extend " -// + BigdataRDFServletContextListener.class); -// -// } -// -// final BigdataRDFServletContextListener listener = cls.newInstance(); -// -// context.addEventListener(listener); -// -// } -// -// /* -// * Set the servlet context properties. -// */ -// for (Map.Entry<String, String> e : initParams.entrySet()) { -// -// context.setInitParameter(e.getKey(), e.getValue()); -// -// } -// -// // html directory. -// context.addServlet(new ServletHolder(new DefaultServlet()), -// "/html/*"); -// -// // Appears necessary for http://localhost:8080/bigdata to bring up index.html. -// context.addServlet(new ServletHolder(new DefaultServlet()), -// "/"); -// -// // Performance counters. -// context.addServlet(new ServletHolder(new CountersServlet()), -// "/counters"); -// -// // Status page. -// context.addServlet(new ServletHolder(new StatusServlet()), "/status"); -// -// // Core RDF REST API, including SPARQL query and update. -// context.addServlet(new ServletHolder(new RESTServlet()), "/sparql/*"); -// -// // Multi-Tenancy API. -// context.addServlet(new ServletHolder(new MultiTenancyServlet()), -// "/namespace/*"); -// -// // Incremental truth maintenance -// context.addServlet(new ServletHolder(new InferenceServlet()), -// "/inference"); -// -//// context.setResourceBase("bigdata-war/src/html"); -//// -//// context.setWelcomeFiles(new String[]{"index.html"}); -// -// return context; -// -// } - -// /** -// * Setup access to the web app resources, especially index.html. -// * -// * @see https://sourceforge.net/apps/trac/bigdata/ticket/330 -// * -// * @param classLoader -// * @param context -// */ -// private static void setupStaticResources(final ClassLoader classLoader, -// final ServletContextHandler context) { -// -// final URL url = getStaticResourceURL(classLoader, "html"); -// -// if (url != null) { -// -// /* -// * We have located the resource. Set it as the resource base from -// * which static content will be served. -// */ -// -// final String webDir = url.toExternalForm(); -// -// context.setResourceBase(webDir); -// -// context.setContextPath("/"); -// -// } -// -// } -// -// /** -// * Setup access to the welcome page (index.html). -// */ -// private static void setupStaticResources(final ClassLoader classLoader, -// final ResourceHandler context) { -// -// context.setDirectoriesListed(false); // Nope! -// -// final String file = "html/index.html"; -// -// final URL url; -// { -// -// URL tmp = null; -// -// if (tmp == null) { -// -//// // project local file system path. -//// classLoader.getResource("bigdata-war/src/html/" + file); -// -// } -// -// if (tmp == null) { -// -// // Check the classpath. -// tmp = classLoader.getResource(file); -// -// } -// -// url = tmp; -// -// if (url == null) { -// -// throw new RuntimeException("Could not locate index.html"); -// -// } -// -// } -// -// /* -// * We have located the resource. Set it as the resource base from which -// * static content will be served. -// */ -// final String indexHtmlUrl = url.toExternalForm(); -// -// final String webDir = indexHtmlUrl.substring(0, indexHtmlUrl.length() -// - file.length()); -// -// // Path to the content in the local file system or JAR. -// context.setResourceBase(webDir); -// -// /* -// * Note: replace with "new.html" for the new UX. Also change in -// * web.xml. -// */ -// context.setWelcomeFiles(new String[]{"html/index.html"}); -// -// if (log.isInfoEnabled()) -// log.info("\nindex.html: =" + indexHtmlUrl + "\nresourceBase=" -// + webDir); -// -// } - -// /** -// * Return the URL for the static web app resources (for example, -// * <code>index.html</code>). -// * -// * @param classLoader -// * The {@link ClassLoader} that will be used to locate the -// * resource (required). -// * @param path -// * The path for the resource (required) -// * -// * @return The URL for the web app resource directory -or- <code>null</code> -// * if it could not be found on the class path. -// * -// * @see https://sourceforge.net/apps/trac/bigdata/ticket/330 -// */ -// private static URL getStaticResourceURL(final ClassLoader classLoader, -// final String path) { -// -// if (classLoader == null) -// throw new IllegalArgumentException(); -// -// if (path == null) -// throw new IllegalArgumentException(); -// -// /* -// * This is the resource path in the JAR. -// */ -// final String WEB_DIR_JAR = "bigdata-war/src/html" -// + (path == null ? "" : "/" + path); -// -// /* -// * This is the resource path in the IDE when NOT using the JAR. -// * -// * Note: You MUST have "bigdata-war/src" on the build path for the IDE. -// */ -// final String WEB_DIR_IDE = "html/" + path; // "html"; -// -// URL url = classLoader.getResource(WEB_DIR_JAR); -// -// if (url == null && path != null) { -// -// url = classLoader.getResource(WEB_DIR_IDE);// "html"); -// -// } -// -// if (url == null) { -// -// log.error("Could not locate: " + WEB_DIR_JAR + ", " + WEB_DIR_IDE -// + ", -or- " + path); -// } -// -// return url; -// -// } - /** * Best effort attempt to return the port at which the local jetty * {@link Server} is receiving http connections. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |