sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1468111 - in /sis/branches/JDK7: ./ ide-project/NetBeans/nbproject/ ide-project/eclipse/ sis-utility/ sis-utility/src/main/java/org/apache/sis/internal/util/ sis-webapp/
Date Mon, 15 Apr 2013 15:18:43 GMT
Author: desruisseaux
Date: Mon Apr 15 15:18:43 2013
New Revision: 1468111

URL: http://svn.apache.org/r1468111
Log:
Added a servlet listener in order to shutdown SIS when the web application is undeployed.

Added:
    sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/util/ServletListener.java
  (with props)
Modified:
    sis/branches/JDK7/ide-project/NetBeans/nbproject/project.properties
    sis/branches/JDK7/ide-project/eclipse/classpath
    sis/branches/JDK7/pom.xml
    sis/branches/JDK7/sis-utility/pom.xml
    sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/util/OSGiActivator.java
    sis/branches/JDK7/sis-webapp/pom.xml

Modified: sis/branches/JDK7/ide-project/NetBeans/nbproject/project.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/ide-project/NetBeans/nbproject/project.properties?rev=1468111&r1=1468110&r2=1468111&view=diff
==============================================================================
--- sis/branches/JDK7/ide-project/NetBeans/nbproject/project.properties [ISO-8859-1] (original)
+++ sis/branches/JDK7/ide-project/NetBeans/nbproject/project.properties [ISO-8859-1] Mon Apr
15 15:18:43 2013
@@ -48,7 +48,7 @@ vecmath.version      = 1.5.2
 georss.version       = 0.9.8
 rome.version         = 0.9
 jdom.version         = 1.0
-servlet.version      = 2.4
+jee.version          = 6.0
 jcip.version         = 1.0
 osgi.version         = 5.0.0
 junit.version        = 4.10
@@ -67,7 +67,7 @@ javac.classpath=\
     ${maven.repository}/org/geonames/georss-rome/${georss.version}/georss-rome-${georss.version}.jar:\
     ${maven.repository}/rome/rome/${rome.version}/rome-${rome.version}.jar:\
     ${maven.repository}/jdom/jdom/${jdom.version}/jdom-${jdom.version}.jar:\
-    ${maven.repository}/javax/servlet/servlet-api/${servlet.version}/servlet-api-${servlet.version}.jar:\
+    ${maven.repository}/javax/javaee-api/${jee.version}/javaee-api-${jee.version}.jar:\
     ${maven.repository}/net/jcip/jcip-annotations/${jcip.version}/jcip-annotations-${jcip.version}.jar:\
     ${maven.repository}/org/osgi/org.osgi.core/${osgi.version}/org.osgi.core-${osgi.version}.jar
 javac.processorpath=\

Modified: sis/branches/JDK7/ide-project/eclipse/classpath
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/ide-project/eclipse/classpath?rev=1468111&r1=1468110&r2=1468111&view=diff
==============================================================================
--- sis/branches/JDK7/ide-project/eclipse/classpath (original)
+++ sis/branches/JDK7/ide-project/eclipse/classpath Mon Apr 15 15:18:43 2013
@@ -16,7 +16,7 @@
 	<classpathentry kind="var" path="M2_REPO/org/geonames/georss-rome/0.9.8/georss-rome-0.9.8.jar"/>
 	<classpathentry kind="var" path="M2_REPO/rome/rome/0.9/rome-0.9.jar"/>
 	<classpathentry kind="var" path="M2_REPO/jdom/jdom/1.0/jdom-1.0.jar"/>
-	<classpathentry kind="var" path="M2_REPO/javax/servlet/servlet-api/2.4/servlet-api-2.4.jar"/>
+	<classpathentry kind="var" path="M2_REPO/javax/javaee-api/6.0/javaee-api-6.0.jar"/>
 	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
 	<classpathentry kind="var" path="M2_REPO/org/opengis/geoapi/3.0.0/geoapi-3.0.0.jar"/>
 	<classpathentry kind="var" path="M2_REPO/org/opengis/geoapi-conformance/3.0.0/geoapi-conformance-3.0.0.jar"/>

Modified: sis/branches/JDK7/pom.xml
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/pom.xml?rev=1468111&r1=1468110&r2=1468111&view=diff
==============================================================================
--- sis/branches/JDK7/pom.xml (original)
+++ sis/branches/JDK7/pom.xml Mon Apr 15 15:18:43 2013
@@ -311,9 +311,10 @@ Apache SIS is a toolkit for describing l
 
       <!-- Libraries (language, XML, network) -->
       <dependency>
-        <groupId>javax.servlet</groupId>
-        <artifactId>servlet-api</artifactId>
-        <version>2.4</version>
+        <groupId>javax</groupId>
+        <artifactId>javaee-api</artifactId>
+        <version>6.0</version>
+        <scope>provided</scope>
       </dependency>
       <dependency>
         <groupId>org.geonames</groupId>

Modified: sis/branches/JDK7/sis-utility/pom.xml
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-utility/pom.xml?rev=1468111&r1=1468110&r2=1468111&view=diff
==============================================================================
--- sis/branches/JDK7/sis-utility/pom.xml (original)
+++ sis/branches/JDK7/sis-utility/pom.xml Mon Apr 15 15:18:43 2013
@@ -177,11 +177,14 @@ Miscellaneous utilities.
       <artifactId>jcip-annotations</artifactId>
     </dependency>
 
-    <!-- Optional dependencies -->
+    <!-- Optional dependencies (provided scope) -->
     <dependency>
       <groupId>org.osgi</groupId>
       <artifactId>org.osgi.core</artifactId>
-      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>javax</groupId>
+      <artifactId>javaee-api</artifactId>
     </dependency>
   </dependencies>
 

Modified: sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/util/OSGiActivator.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/util/OSGiActivator.java?rev=1468111&r1=1468110&r2=1468111&view=diff
==============================================================================
--- sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/util/OSGiActivator.java
[UTF-8] (original)
+++ sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/util/OSGiActivator.java
[UTF-8] Mon Apr 15 15:18:43 2013
@@ -25,12 +25,15 @@ import org.osgi.framework.BundleListener
 
 /**
  * Bundle activator for OSGi environment.
- * This class should not be used directly.
+ * This class is declared in the {@code maven-bundle-plugin} configuration in the
+ * {@code sis-utility/pom.xml} file. This class should not be used directly.
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3
  * @version 0.3
  * @module
+ *
+ * @see ServletListener
  */
 public final class OSGiActivator implements BundleActivator, BundleListener {
     /**

Added: sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/util/ServletListener.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/util/ServletListener.java?rev=1468111&view=auto
==============================================================================
--- sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/util/ServletListener.java
(added)
+++ sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/util/ServletListener.java
[UTF-8] Mon Apr 15 15:18:43 2013
@@ -0,0 +1,60 @@
+/*
+ * 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.sis.internal.util;
+
+import javax.management.JMException;
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletContextListener;
+import javax.servlet.annotation.WebListener;
+
+
+/**
+ * Listener for servlet context, used as a shutdown hook when the application is undeployed.
+ * This class should not be used directly.
+ *
+ * @author  Martin Desruisseaux (Geomatys)
+ * @since   0.3
+ * @version 0.3
+ * @module
+ *
+ * @see OSGiActivator
+ */
+@WebListener("Apache SIS shutdown hook")
+public final class ServletListener implements ServletContextListener {
+    /**
+     * Receives notification that the web application initialization process is starting.
+     *
+     * @param event The context of the servlet being initialized.
+     */
+    @Override
+    public void contextInitialized(final ServletContextEvent event) {
+    }
+
+    /**
+     * Receives notification that the application is about to be shutdown.
+     *
+     * @param event The context of the servlet being shutdown.
+     */
+    @Override
+    public void contextDestroyed(final ServletContextEvent event) {
+        try {
+            Shutdown.stop(getClass());
+        } catch (JMException e) {
+            event.getServletContext().log(e.toString(), e);
+        }
+    }
+}

Propchange: sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/util/ServletListener.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sis/branches/JDK7/sis-utility/src/main/java/org/apache/sis/internal/util/ServletListener.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain;charset=UTF-8

Modified: sis/branches/JDK7/sis-webapp/pom.xml
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/sis-webapp/pom.xml?rev=1468111&r1=1468110&r2=1468111&view=diff
==============================================================================
--- sis/branches/JDK7/sis-webapp/pom.xml (original)
+++ sis/branches/JDK7/sis-webapp/pom.xml Mon Apr 15 15:18:43 2013
@@ -38,8 +38,8 @@
 
   <dependencies>
     <dependency>
-      <groupId>javax.servlet</groupId>
-      <artifactId>servlet-api</artifactId>
+      <groupId>javax</groupId>
+      <artifactId>javaee-api</artifactId>
     </dependency>
     <dependency>
       <groupId>org.geonames</groupId>



Mime
View raw message