sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1828101 [3/3] - in /sis/trunk: ./ core/ core/sis-build-helper/ core/sis-build-helper/src/main/resources/org/apache/sis/ core/sis-metadata/src/test/java/org/apache/sis/internal/jaxb/cat/ core/sis-metadata/src/test/java/org/apache/sis/intern...
Date Sat, 31 Mar 2018 12:14:14 GMT
Modified: sis/trunk/ide-project/NetBeans/nbproject/project.properties
URL: http://svn.apache.org/viewvc/sis/trunk/ide-project/NetBeans/nbproject/project.properties?rev=1828101&r1=1828100&r2=1828101&view=diff
==============================================================================
--- sis/trunk/ide-project/NetBeans/nbproject/project.properties [ISO-8859-1] (original)
+++ sis/trunk/ide-project/NetBeans/nbproject/project.properties [ISO-8859-1] Sat Mar 31 12:14:13
2018
@@ -29,10 +29,13 @@ application.desc     = Apache SIS is a f
 #
 includes             = **
 excludes             =
+javadoc.html5        = false
+jlink.launcher       = false
+jlink.launcher.name  = Apache_SIS_on_GeoAPI_3.0
 main.class           =
 manifest.file        = manifest.mf
 project.license      = apache20
-project.licensePath  = ../../ide-project/LicenseHeader.txt
+project.licensePath  = ../LicenseHeader.txt
 no.dependencies      = true
 source.encoding      = UTF-8
 javac.source         = 1.8
@@ -70,6 +73,8 @@ src.feature.dir      = ${project.root}/c
 test.feature.dir     = ${project.root}/core/sis-feature/src/test/java
 src.raster.dir       = ${project.root}/core/sis-raster/src/main/java
 test.raster.dir      = ${project.root}/core/sis-raster/src/test/java
+src.portrayal.dir    = ${project.root}/core/sis-portrayal/src/main/java
+test.portrayal.dir   = ${project.root}/core/sis-portrayal/src/test/java
 src.referencing.dir  = ${project.root}/core/sis-referencing/src/main/java
 test.referencing.dir = ${project.root}/core/sis-referencing/src/test/java
 src.ref-by-id.dir    = ${project.root}/core/sis-referencing-by-identifiers/src/main/java
@@ -94,7 +99,7 @@ georss.version       = 0.9.8
 rome.version         = 0.9
 jdom1.version        = 1.0
 jdom2.version        = 2.0.4
-jee.version          = 7.0
+jee.version          = 8.0
 osgi.version         = 6.0.0
 netcdf.version       = 4.6.10
 joda-time.version    = 2.8.1
@@ -106,7 +111,7 @@ junit.version        = 4.12
 hamcrest.version     = 1.3
 jaxb-ns-mapper       = 2.2.4
 hsqldb.version       = 2.4.0
-postgresql.version   = 42.1.4
+postgresql.version   = 42.2.1
 icons.version        = 3.0.1
 
 #
@@ -162,6 +167,22 @@ debug.test.classpath=\
     ${run.test.classpath}
 
 #
+# Module paths (can be used as a replacement for classpaths on JDK 9).
+#
+javac.modulepath=
+javac.processormodulepath=
+javac.test.modulepath=\
+    ${javac.modulepath}
+run.modulepath=\
+    ${javac.modulepath}
+run.test.modulepath=\
+    ${javac.test.modulepath}
+debug.modulepath=\
+    ${run.modulepath}
+debug.test.modulepath=\
+    ${run.test.modulepath}
+
+#
 # Build configuration and destination directories.
 #
 javac.compilerargs                       = -Xdoclint:syntax,html,reference,missing/protected,accessibility/protected

Modified: sis/trunk/ide-project/NetBeans/nbproject/project.xml
URL: http://svn.apache.org/viewvc/sis/trunk/ide-project/NetBeans/nbproject/project.xml?rev=1828101&r1=1828100&r2=1828101&view=diff
==============================================================================
--- sis/trunk/ide-project/NetBeans/nbproject/project.xml (original)
+++ sis/trunk/ide-project/NetBeans/nbproject/project.xml Sat Mar 31 12:14:13 2018
@@ -26,6 +26,7 @@
                 <root id="src.local-src.dir" name="Local sources (unversioned)"/>
                 <root id="src.webapp.dir" name="Web application"/>
                 <root id="src.console.dir" name="Console"/>
+                <root id="src.portrayal.dir" name="Portrayal"/>
                 <root id="src.earth-obs.dir" name="Earth observation"/>
                 <root id="src.geotiff.dir" name="GeoTIFF"/>
                 <root id="src.netcdf.dir" name="NetCDF"/>
@@ -45,6 +46,7 @@
             <test-roots>
                 <root id="test.webapp.dir" name="Test web application"/>
                 <root id="test.console.dir" name="Test Console"/>
+                <root id="test.portrayal.dir" name="Test Portrayal"/>
                 <root id="test.earth-obs.dir" name="Test Earth observation"/>
                 <root id="test.geotiff.dir" name="Test GeoTIFF"/>
                 <root id="test.netcdf.dir" name="Test NetCDF"/>

Modified: sis/trunk/pom.xml
URL: http://svn.apache.org/viewvc/sis/trunk/pom.xml?rev=1828101&r1=1828100&r2=1828101&view=diff
==============================================================================
--- sis/trunk/pom.xml (original)
+++ sis/trunk/pom.xml Sat Mar 31 12:14:13 2018
@@ -429,7 +429,7 @@ Apache SIS is a free software, Java lang
       <dependency>
         <groupId>javax</groupId>
         <artifactId>javaee-api</artifactId>
-        <version>7.0</version>
+        <version>8.0</version>
         <scope>provided</scope>
       </dependency>
       <dependency>
@@ -499,7 +499,7 @@ Apache SIS is a free software, Java lang
          The last properties in this list depend on the Apache SIS branch.
        =================================================================== -->
   <properties>
-    <netcdf.version>4.6.10</netcdf.version>
+    <netcdf.version>4.6.11</netcdf.version>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
     <website.encoding>UTF-8</website.encoding>
     <website.locale>en</website.locale>
@@ -607,7 +607,7 @@ Apache SIS is a free software, Java lang
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-surefire-plugin</artifactId>
-        <version>2.20.1</version>
+        <version>2.21.0</version>
         <configuration>
           <includes>
             <include>**/*TestSuite.java</include>
@@ -903,20 +903,6 @@ Apache SIS is a free software, Java lang
           <relativizeDecorationLinks>false</relativizeDecorationLinks>
         </configuration>
       </plugin>
-
-      <!-- Dependencies requires for the SIS FindBugs configuration file. -->
-      <plugin>
-        <groupId>org.codehaus.mojo</groupId>
-        <artifactId>findbugs-maven-plugin</artifactId>
-        <version>3.0.5</version>
-        <dependencies>
-          <dependency>
-            <groupId>org.apache.sis.core</groupId>
-            <artifactId>sis-build-helper</artifactId>
-            <version>${sis.plugin.version}</version>
-          </dependency>
-        </dependencies>
-      </plugin>
     </plugins>
 
     <!-- Following plugins are used only by some specific modules. -->

Modified: sis/trunk/storage/sis-earth-observation/src/main/java/org/apache/sis/storage/earthobservation/LandsatStore.java
URL: http://svn.apache.org/viewvc/sis/trunk/storage/sis-earth-observation/src/main/java/org/apache/sis/storage/earthobservation/LandsatStore.java?rev=1828101&r1=1828100&r2=1828101&view=diff
==============================================================================
--- sis/trunk/storage/sis-earth-observation/src/main/java/org/apache/sis/storage/earthobservation/LandsatStore.java
[UTF-8] (original)
+++ sis/trunk/storage/sis-earth-observation/src/main/java/org/apache/sis/storage/earthobservation/LandsatStore.java
[UTF-8] Sat Mar 31 12:14:13 2018
@@ -29,6 +29,8 @@ import org.apache.sis.storage.DataStoreE
 import org.apache.sis.storage.DataStoreReferencingException;
 import org.apache.sis.storage.UnsupportedStorageException;
 import org.apache.sis.storage.StorageConnector;
+import org.apache.sis.storage.event.ChangeEvent;
+import org.apache.sis.storage.event.ChangeListener;
 import org.apache.sis.internal.storage.URIDataStore;
 import org.apache.sis.setup.OptionKey;
 import org.apache.sis.util.Debug;
@@ -63,7 +65,7 @@ import org.apache.sis.util.Debug;
  *
  * @author  Thi Phuong Hao Nguyen (VNSC)
  * @author  Martin Desruisseaux (Geomatys)
- * @version 0.8
+ * @version 1.0
  * @since   0.8
  * @module
  */
@@ -145,6 +147,28 @@ public class LandsatStore extends DataSt
     }
 
     /**
+     * Ignored in current implementation, since this resource produces no events.
+     *
+     * @param  <T>        {@inheritDoc}
+     * @param  listener   {@inheritDoc}
+     * @param  eventType  {@inheritDoc}
+     */
+    @Override
+    public <T extends ChangeEvent> void addListener(ChangeListener<? super T>
listener, Class<T> eventType) {
+    }
+
+    /**
+     * Ignored in current implementation, since this resource produces no events.
+     *
+     * @param  <T>        {@inheritDoc}
+     * @param  listener   {@inheritDoc}
+     * @param  eventType  {@inheritDoc}
+     */
+    @Override
+    public <T extends ChangeEvent> void removeListener(ChangeListener<? super T>
listener, Class<T> eventType) {
+    }
+
+    /**
      * Closes this Landsat store and releases any underlying resources.
      *
      * @throws DataStoreException if an error occurred while closing the Landsat file.

Modified: sis/trunk/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/GeoTiffStore.java
URL: http://svn.apache.org/viewvc/sis/trunk/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/GeoTiffStore.java?rev=1828101&r1=1828100&r2=1828101&view=diff
==============================================================================
--- sis/trunk/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/GeoTiffStore.java
[UTF-8] (original)
+++ sis/trunk/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/GeoTiffStore.java
[UTF-8] Sat Mar 31 12:14:13 2018
@@ -33,13 +33,15 @@ import org.apache.sis.storage.StorageCon
 import org.apache.sis.storage.DataStoreException;
 import org.apache.sis.storage.DataStoreContentException;
 import org.apache.sis.storage.UnsupportedStorageException;
+import org.apache.sis.storage.DataStoreClosedException;
+import org.apache.sis.storage.event.ChangeEvent;
+import org.apache.sis.storage.event.ChangeListener;
 import org.apache.sis.internal.storage.io.ChannelDataInput;
 import org.apache.sis.internal.storage.io.IOUtilities;
 import org.apache.sis.internal.storage.MetadataBuilder;
 import org.apache.sis.internal.storage.URIDataStore;
 import org.apache.sis.internal.util.Constants;
 import org.apache.sis.metadata.sql.MetadataStoreException;
-import org.apache.sis.storage.DataStoreClosedException;
 import org.apache.sis.util.resources.Errors;
 
 
@@ -49,7 +51,7 @@ import org.apache.sis.util.resources.Err
  * @author  Rémi Maréchal (Geomatys)
  * @author  Martin Desruisseaux (Geomatys)
  * @author  Thi Phuong Hao Nguyen (VNSC)
- * @version 0.8
+ * @version 1.0
  * @since   0.8
  * @module
  */
@@ -178,6 +180,28 @@ public class GeoTiffStore extends DataSt
     }
 
     /**
+     * Ignored in current implementation, since this resource produces no events.
+     *
+     * @param  <T>        {@inheritDoc}
+     * @param  listener   {@inheritDoc}
+     * @param  eventType  {@inheritDoc}
+     */
+    @Override
+    public <T extends ChangeEvent> void addListener(ChangeListener<? super T>
listener, Class<T> eventType) {
+    }
+
+    /**
+     * Ignored in current implementation, since this resource produces no events.
+     *
+     * @param  <T>        {@inheritDoc}
+     * @param  listener   {@inheritDoc}
+     * @param  eventType  {@inheritDoc}
+     */
+    @Override
+    public <T extends ChangeEvent> void removeListener(ChangeListener<? super T>
listener, Class<T> eventType) {
+    }
+
+    /**
      * Closes this GeoTIFF store and releases any underlying resources.
      *
      * @throws DataStoreException if an error occurred while closing the GeoTIFF file.

Modified: sis/trunk/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/NetcdfStore.java
URL: http://svn.apache.org/viewvc/sis/trunk/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/NetcdfStore.java?rev=1828101&r1=1828100&r2=1828101&view=diff
==============================================================================
--- sis/trunk/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/NetcdfStore.java
[UTF-8] (original)
+++ sis/trunk/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/NetcdfStore.java
[UTF-8] Sat Mar 31 12:14:13 2018
@@ -34,6 +34,8 @@ import org.apache.sis.internal.util.Unmo
 import org.apache.sis.metadata.ModifiableMetadata;
 import org.apache.sis.setup.OptionKey;
 import org.apache.sis.storage.Resource;
+import org.apache.sis.storage.event.ChangeEvent;
+import org.apache.sis.storage.event.ChangeListener;
 import org.apache.sis.util.CharSequences;
 import org.apache.sis.util.Version;
 import ucar.nc2.constants.CDM;
@@ -44,7 +46,7 @@ import ucar.nc2.constants.CDM;
  * Instances of this data store are created by {@link NetcdfStoreProvider#open(StorageConnector)}.
  *
  * @author  Martin Desruisseaux (Geomatys)
- * @version 0.8
+ * @version 1.0
  *
  * @see NetcdfStoreProvider
  *
@@ -177,6 +179,28 @@ public class NetcdfStore extends DataSto
     }
 
     /**
+     * Ignored in current implementation, since this resource produces no events.
+     *
+     * @param  <T>        {@inheritDoc}
+     * @param  listener   {@inheritDoc}
+     * @param  eventType  {@inheritDoc}
+     */
+    @Override
+    public <T extends ChangeEvent> void addListener(ChangeListener<? super T>
listener, Class<T> eventType) {
+    }
+
+    /**
+     * Ignored in current implementation, since this resource produces no events.
+     *
+     * @param  <T>        {@inheritDoc}
+     * @param  listener   {@inheritDoc}
+     * @param  eventType  {@inheritDoc}
+     */
+    @Override
+    public <T extends ChangeEvent> void removeListener(ChangeListener<? super T>
listener, Class<T> eventType) {
+    }
+
+    /**
      * Closes this netCDF store and releases any underlying resources.
      *
      * @throws DataStoreException if an error occurred while closing the netCDF file.

Modified: sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/AbstractResource.java
URL: http://svn.apache.org/viewvc/sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/AbstractResource.java?rev=1828101&r1=1828100&r2=1828101&view=diff
==============================================================================
--- sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/AbstractResource.java
[UTF-8] (original)
+++ sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/AbstractResource.java
[UTF-8] Sat Mar 31 12:14:13 2018
@@ -29,6 +29,8 @@ import org.apache.sis.util.logging.Warni
 import org.apache.sis.storage.Resource;
 import org.apache.sis.storage.DataStore;
 import org.apache.sis.storage.DataStoreException;
+import org.apache.sis.storage.event.ChangeEvent;
+import org.apache.sis.storage.event.ChangeListener;
 
 // Branch-dependent imports
 import org.opengis.metadata.identification.DataIdentification;
@@ -38,7 +40,7 @@ import org.opengis.metadata.identificati
  * Base implementation of resources contained in data stores.
  *
  * @author  Martin Desruisseaux (Geomatys)
- * @version 0.8
+ * @version 1.0
  * @since   0.8
  * @module
  */
@@ -124,4 +126,26 @@ public abstract class AbstractResource i
         }
         return bounds;
     }
+
+    /**
+     * Ignored in current implementation, on the assumption that most resources produce no
events.
+     *
+     * @param  <T>        {@inheritDoc}
+     * @param  listener   {@inheritDoc}
+     * @param  eventType  {@inheritDoc}
+     */
+    @Override
+    public <T extends ChangeEvent> void addListener(ChangeListener<? super T>
listener, Class<T> eventType) {
+    }
+
+    /**
+     * Ignored in current implementation, on the assumption that most resources produce no
events.
+     *
+     * @param  <T>        {@inheritDoc}
+     * @param  listener   {@inheritDoc}
+     * @param  eventType  {@inheritDoc}
+     */
+    @Override
+    public <T extends ChangeEvent> void removeListener(ChangeListener<? super T>
listener, Class<T> eventType) {
+    }
 }

Modified: sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/URIDataStore.java
URL: http://svn.apache.org/viewvc/sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/URIDataStore.java?rev=1828101&r1=1828100&r2=1828101&view=diff
==============================================================================
--- sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/URIDataStore.java
[UTF-8] (original)
+++ sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/URIDataStore.java
[UTF-8] Sat Mar 31 12:14:13 2018
@@ -28,6 +28,8 @@ import org.apache.sis.storage.DataStore;
 import org.apache.sis.storage.DataStoreProvider;
 import org.apache.sis.storage.DataStoreException;
 import org.apache.sis.storage.IllegalOpenParameterException;
+import org.apache.sis.storage.event.ChangeEvent;
+import org.apache.sis.storage.event.ChangeListener;
 import org.apache.sis.internal.storage.io.IOUtilities;
 
 
@@ -227,4 +229,28 @@ public abstract class URIDataStore exten
             builder.addTitleOrIdentifier(IOUtilities.filenameWithoutExtension(super.getDisplayName()),
MetadataBuilder.Scope.ALL);
         }
     }
+
+    /**
+     * Ignored in current implementation, on the assumption that most data stores
+     * (at least the read-only ones) produce no events.
+     *
+     * @param  <T>        {@inheritDoc}
+     * @param  listener   {@inheritDoc}
+     * @param  eventType  {@inheritDoc}
+     */
+    @Override
+    public <T extends ChangeEvent> void addListener(ChangeListener<? super T>
listener, Class<T> eventType) {
+    }
+
+    /**
+     * Ignored in current implementation, on the assumption that most data stores
+     * (at least the read-only ones) produce no events.
+     *
+     * @param  <T>        {@inheritDoc}
+     * @param  listener   {@inheritDoc}
+     * @param  eventType  {@inheritDoc}
+     */
+    @Override
+    public <T extends ChangeEvent> void removeListener(ChangeListener<? super T>
listener, Class<T> eventType) {
+    }
 }

Modified: sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/folder/Store.java
URL: http://svn.apache.org/viewvc/sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/folder/Store.java?rev=1828101&r1=1828100&r2=1828101&view=diff
==============================================================================
--- sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/folder/Store.java
[UTF-8] (original)
+++ sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/folder/Store.java
[UTF-8] Sat Mar 31 12:14:13 2018
@@ -48,6 +48,8 @@ import org.apache.sis.internal.util.Unmo
 import org.apache.sis.internal.storage.MetadataBuilder;
 import org.apache.sis.internal.storage.StoreUtilities;
 import org.apache.sis.internal.storage.Resources;
+import org.apache.sis.storage.event.ChangeEvent;
+import org.apache.sis.storage.event.ChangeListener;
 
 
 /**
@@ -340,6 +342,28 @@ class Store extends DataStore implements
     }
 
     /**
+     * Ignored in current implementation, since this resource produces no events.
+     *
+     * @param  <T>        {@inheritDoc}
+     * @param  listener   {@inheritDoc}
+     * @param  eventType  {@inheritDoc}
+     */
+    @Override
+    public <T extends ChangeEvent> void addListener(ChangeListener<? super T>
listener, Class<T> eventType) {
+    }
+
+    /**
+     * Ignored in current implementation, since this resource produces no events.
+     *
+     * @param  <T>        {@inheritDoc}
+     * @param  listener   {@inheritDoc}
+     * @param  eventType  {@inheritDoc}
+     */
+    @Override
+    public <T extends ChangeEvent> void removeListener(ChangeListener<? super T>
listener, Class<T> eventType) {
+    }
+
+    /**
      * Closes all children resources.
      */
     @Override

Modified: sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStore.java
URL: http://svn.apache.org/viewvc/sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStore.java?rev=1828101&r1=1828100&r2=1828101&view=diff
==============================================================================
--- sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStore.java [UTF-8]
(original)
+++ sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/storage/DataStore.java [UTF-8]
Sat Mar 31 12:14:13 2018
@@ -34,7 +34,7 @@ import org.apache.sis.internal.util.Cita
 /**
  * Manages a series of features, coverages or sensor data.
  * Different {@code DataStore} subclasses exist for different formats (netCDF, GeoTIFF, <i>etc.</i>).
- * The supported format can be identifier by the {@linkplain #getProvider() provider}.
+ * The supported format can be identified by the {@linkplain #getProvider() provider}.
  *
  * <p>Each data store is itself a {@link Resource}. The data store subclasses should
implement
  * a more specialized {@code Resource} interface depending on the format characteristics.

Modified: sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/storage/Resource.java
URL: http://svn.apache.org/viewvc/sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/storage/Resource.java?rev=1828101&r1=1828100&r2=1828101&view=diff
==============================================================================
--- sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/storage/Resource.java [UTF-8]
(original)
+++ sis/trunk/storage/sis-storage/src/main/java/org/apache/sis/storage/Resource.java [UTF-8]
Sat Mar 31 12:14:13 2018
@@ -16,6 +16,8 @@
  */
 package org.apache.sis.storage;
 
+import org.apache.sis.storage.event.ChangeEvent;
+import org.apache.sis.storage.event.ChangeListener;
 import org.opengis.metadata.Metadata;
 
 
@@ -41,7 +43,7 @@ import org.opengis.metadata.Metadata;
  * </div>
  *
  * @author  Johann Sorel (Geomatys)
- * @version 0.8
+ * @version 1.0
  *
  * @see Aggregate#components()
  *
@@ -103,4 +105,44 @@ public interface Resource {
      * @see DataStore#getMetadata()
      */
     Metadata getMetadata() throws DataStoreException;
+
+    /**
+     * Registers a listener that is notified each time a change occurs in the resource content
or structure.
+     * The resource will call the {@link ChangeListener#changeOccured(ChangeEvent)}
+     * method when a new event matching the {@code eventType} is produced.
+     *
+     * <p>Registering a listener for a given {@code eventType} also register the listener
for all sub-types.
+     * The same listener can be added multiple times for different even type.
+     * Adding many times the same listener with the same even type has no effect:
+     * the listener will only be called once per event.</p>
+     *
+     * @todo When adding a listener to an aggregate, should the listener be added to all
components?
+     *       In other words, should listeners in a tree node also listen to events from all
children?
+     *
+     * <p>The resource is not required to keep a reference to the listener.
+     * For example the resource may discard a listener if no event of the given type happen
on this resource.</p>
+     *
+     * @param  <T>        compile-time value of the {@code eventType} argument.
+     * @param  listener   listener to notify about changes.
+     * @param  eventType  type of {@linkplain ChangeEvent} to listen (can not be {@code null}).
+     */
+    <T extends ChangeEvent> void addListener(ChangeListener<? super T> listener,
Class<T> eventType);
+
+    /**
+     * Unregisters a listener previously added to this resource for the given type of events.
+     * The {@code eventType} must be the exact same class than the one given to the {@code
addListener(…)} method.
+     *
+     * <div class="note"><b>Example:</b>
+     * if the same listener has been added for {@code ChangeEvent} and {@code StructuralChangeEvent},
that listener
+     * will be notified only once for all {@code ChangeEvent}s. If that listener is removed
for {@code ChangeEvent},
+     * then the listener will still receive {@code StructuralChangeEvent}s.</div>
+     *
+     * <p>Calling multiple times this method with the same listener and event type
or a listener
+     * which is unknown to this resource will have no effect and will not raise an exception.</p>
+     *
+     * @param  <T>        compile-time value of the {@code eventType} argument.
+     * @param  listener   listener to stop notifying about changes.
+     * @param  eventType  type of {@linkplain ChangeEvent} which were listened (can not be
{@code null}).
+     */
+    <T extends ChangeEvent> void removeListener(ChangeListener<? super T> listener,
Class<T> eventType);
 }

Modified: sis/trunk/storage/sis-storage/src/test/java/org/apache/sis/storage/DataStoreMock.java
URL: http://svn.apache.org/viewvc/sis/trunk/storage/sis-storage/src/test/java/org/apache/sis/storage/DataStoreMock.java?rev=1828101&r1=1828100&r2=1828101&view=diff
==============================================================================
--- sis/trunk/storage/sis-storage/src/test/java/org/apache/sis/storage/DataStoreMock.java
[UTF-8] (original)
+++ sis/trunk/storage/sis-storage/src/test/java/org/apache/sis/storage/DataStoreMock.java
[UTF-8] Sat Mar 31 12:14:13 2018
@@ -16,6 +16,8 @@
  */
 package org.apache.sis.storage;
 
+import org.apache.sis.storage.event.ChangeEvent;
+import org.apache.sis.storage.event.ChangeListener;
 import org.opengis.metadata.Metadata;
 import org.opengis.parameter.ParameterValueGroup;
 
@@ -24,7 +26,7 @@ import org.opengis.parameter.ParameterVa
  * A dummy data store
  *
  * @author  Martin Desruisseaux (Geomatys)
- * @version 0.8
+ * @version 1.0
  * @since   0.8
  * @module
  */
@@ -60,6 +62,14 @@ final strictfp class DataStoreMock exten
     }
 
     @Override
+    public <T extends ChangeEvent> void addListener(ChangeListener<? super T>
listener, Class<T> eventType) {
+    }
+
+    @Override
+    public <T extends ChangeEvent> void removeListener(ChangeListener<? super T>
listener, Class<T> eventType) {
+    }
+
+    @Override
     public void close() {
     }
 }

Propchange: sis/trunk/storage/sis-storage/src/test/resources/org/apache/sis/internal/storage/folder/test-data/data1.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sis/trunk/storage/sis-storage/src/test/resources/org/apache/sis/internal/storage/folder/test-data/data1.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Propchange: sis/trunk/storage/sis-storage/src/test/resources/org/apache/sis/internal/storage/folder/test-data/data2.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sis/trunk/storage/sis-storage/src/test/resources/org/apache/sis/internal/storage/folder/test-data/data2.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Propchange: sis/trunk/storage/sis-storage/src/test/resources/org/apache/sis/internal/storage/folder/test-data/data3.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sis/trunk/storage/sis-storage/src/test/resources/org/apache/sis/internal/storage/folder/test-data/data3.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Propchange: sis/trunk/storage/sis-storage/src/test/resources/org/apache/sis/internal/storage/folder/test-data/data4/data5.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sis/trunk/storage/sis-storage/src/test/resources/org/apache/sis/internal/storage/folder/test-data/data4/data5.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml



Mime
View raw message