jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject svn commit: r1532755 - in /jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/server: FusekiServletContextListener.java SPARQLServer.java
Date Wed, 16 Oct 2013 13:16:31 GMT
Author: andy
Date: Wed Oct 16 13:16:31 2013
New Revision: 1532755

URL: http://svn.apache.org/r1532755
Log:
Add placeholder servlet context listener

Added:
    jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/server/FusekiServletContextListener.java
Modified:
    jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/server/SPARQLServer.java

Added: jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/server/FusekiServletContextListener.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/server/FusekiServletContextListener.java?rev=1532755&view=auto
==============================================================================
--- jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/server/FusekiServletContextListener.java
(added)
+++ jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/server/FusekiServletContextListener.java
Wed Oct 16 13:16:31 2013
@@ -0,0 +1,43 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jena.fuseki.server;
+
+import javax.servlet.ServletContextEvent ;
+import javax.servlet.ServletContextListener ;
+
+public class FusekiServletContextListener implements ServletContextListener {
+    // This could do the initialization. 
+    private final SPARQLServer sparqlServer ;
+    public FusekiServletContextListener(SPARQLServer sparqlServer) {
+        this.sparqlServer = sparqlServer ;
+    }
+
+    @Override
+    public void contextInitialized(ServletContextEvent sce) {
+//        Fuseki.serverLog.info("contextInitialized") ;
+//        for ( DatasetRef dsRef : sparqlServer.getDatasets() )
+//            Fuseki.serverLog.info("Dataset: "+dsRef.getName()) ;
+    }
+
+    @Override
+    public void contextDestroyed(ServletContextEvent sce) {
+//        Fuseki.serverLog.info("contextDestroyed") ;
+    }
+}
+

Modified: jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/server/SPARQLServer.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/server/SPARQLServer.java?rev=1532755&r1=1532754&r2=1532755&view=diff
==============================================================================
--- jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/server/SPARQLServer.java (original)
+++ jena/trunk/jena-fuseki/src/main/java/org/apache/jena/fuseki/server/SPARQLServer.java Wed
Oct 16 13:16:31 2013
@@ -179,6 +179,8 @@ public class SPARQLServer {
 
         ServletContextHandler context = new ServletContextHandler(ServletContextHandler.SESSIONS)
;
         context.setErrorHandler(new FusekiErrorHandler()) ;
+        context.addEventListener(new FusekiServletContextListener(this));
+        
         // Increase form size.
         context.getServletContext().getContextHandler().setMaxFormContentSize(10 * 1000 *
1000) ;
 



Mime
View raw message