You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tamaya.apache.org by an...@apache.org on 2015/03/24 22:20:26 UTC
[09/16] incubator-tamaya git commit: Renamed EventSupport to
ConfigEventSupport.
Renamed EventSupport to ConfigEventSupport.
Project: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/commit/54bf732b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/tree/54bf732b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/diff/54bf732b
Branch: refs/heads/master
Commit: 54bf732b01470d40100af7f7be29baa9b60b4a43
Parents: ab2ad07
Author: anatole <an...@apache.org>
Authored: Tue Mar 24 15:59:46 2015 +0100
Committer: anatole <an...@apache.org>
Committed: Tue Mar 24 15:59:46 2015 +0100
----------------------------------------------------------------------
.../tamaya/events/ConfigEventSupport.java | 83 ++++++++++++++++++++
.../org/apache/tamaya/events/EventSupport.java | 83 --------------------
.../ObservingPropertySourceProvider.java | 4 +-
.../tamaya/events/spi/EventSupportSpi.java | 2 +-
...org.apache.tamaya.spi.PropertySourceProvider | 2 +-
5 files changed, 87 insertions(+), 87 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/54bf732b/modules/events/src/main/java/org/apache/tamaya/events/ConfigEventSupport.java
----------------------------------------------------------------------
diff --git a/modules/events/src/main/java/org/apache/tamaya/events/ConfigEventSupport.java b/modules/events/src/main/java/org/apache/tamaya/events/ConfigEventSupport.java
new file mode 100644
index 0000000..87561f4
--- /dev/null
+++ b/modules/events/src/main/java/org/apache/tamaya/events/ConfigEventSupport.java
@@ -0,0 +1,83 @@
+/*
+ * 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.tamaya.events;
+
+import org.apache.tamaya.ConfigException;
+import org.apache.tamaya.events.spi.EventSupportSpi;
+import org.apache.tamaya.spi.ServiceContext;
+
+/**
+ * Singleton accessor for accessing the event support component that distributes change events of
+ * {@link org.apache.tamaya.spi.PropertySource} and {@link org.apache.tamaya.Configuration}.
+ */
+public class ConfigEventSupport {
+ /**
+ * The backing SPI.
+ */
+ private static final EventSupportSpi SPI = ServiceContext.getInstance()
+ .getService(EventSupportSpi.class)
+ .orElseThrow(() -> new ConfigException("No SPI registered for " +
+ ConfigEventSupport.class.getName()));
+
+ /**
+ * Private singleton constructor.
+ */
+ private ConfigEventSupport() {
+ }
+
+ /**
+ * Add a listener for observing change events on {@link org.apache.tamaya.Configuration}. References of this
+ * component to the listeners must be managed as weak references.
+ *
+ * @param l the listener not null.
+ */
+ public static <T> void addListener(Listener<T> l) {
+ SPI.addListener(l);
+ }
+
+ /**
+ * Add a listener for observing change events on {@link org.apache.tamaya.spi.PropertySource}. References of this
+ * component to the listeners must be managed as weak references.
+ *
+ * @param l the listener not null.
+ */
+ public static <T> void removeListener(Listener<T> l) {
+ SPI.removeListener(l);
+ }
+
+ /**
+ * Publishes sn event to all interested listeners.
+ *
+ * @param event the event, not null.
+ */
+ public static void fireEvent(Object event) {
+ fireEvent(event, (Class)event.getClass());
+ }
+
+ /**
+ * Publishes a {@link org.apache.tamaya.events.delta.ConfigurationChange} to all interested listeners.
+ *
+ * @param event the event, not null.
+ * @param eventType the event type, the vent may be a subclass.
+ */
+ public static <T> void fireEvent(T event, Class<T> eventType) {
+ SPI.fireEvent(event, eventType);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/54bf732b/modules/events/src/main/java/org/apache/tamaya/events/EventSupport.java
----------------------------------------------------------------------
diff --git a/modules/events/src/main/java/org/apache/tamaya/events/EventSupport.java b/modules/events/src/main/java/org/apache/tamaya/events/EventSupport.java
deleted file mode 100644
index f3b9e19..0000000
--- a/modules/events/src/main/java/org/apache/tamaya/events/EventSupport.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * 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.tamaya.events;
-
-import org.apache.tamaya.ConfigException;
-import org.apache.tamaya.events.spi.EventSupportSpi;
-import org.apache.tamaya.spi.ServiceContext;
-
-/**
- * Singleton accessor for accessing the event support component that distributes change events of
- * {@link org.apache.tamaya.spi.PropertySource} and {@link org.apache.tamaya.Configuration}.
- */
-public class EventSupport {
- /**
- * The backing SPI.
- */
- private static final EventSupportSpi SPI = ServiceContext.getInstance()
- .getService(EventSupportSpi.class)
- .orElseThrow(() -> new ConfigException("No SPI registered for " +
- EventSupport.class.getName()));
-
- /**
- * Private singleton constructor.
- */
- private EventSupport() {
- }
-
- /**
- * Add a listener for observing change events on {@link org.apache.tamaya.Configuration}. References of this
- * component to the listeners must be managed as weak references.
- *
- * @param l the listener not null.
- */
- public static <T> void addListener(Listener<T> l) {
- SPI.addListener(l);
- }
-
- /**
- * Add a listener for observing change events on {@link org.apache.tamaya.spi.PropertySource}. References of this
- * component to the listeners must be managed as weak references.
- *
- * @param l the listener not null.
- */
- public static <T> void removeListener(Listener<T> l) {
- SPI.removeListener(l);
- }
-
- /**
- * Publishes sn event to all interested listeners.
- *
- * @param event the event, not null.
- */
- public static void fireEvent(Object event) {
- fireEvent(event, (Class)event.getClass());
- }
-
- /**
- * Publishes a {@link org.apache.tamaya.events.delta.ConfigurationChange} to all interested listeners.
- *
- * @param event the event, not null.
- * @param eventType the event type, the vent may be a subclass.
- */
- public static <T> void fireEvent(T event, Class<T> eventType) {
- SPI.fireEvent(event, eventType);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/54bf732b/modules/events/src/main/java/org/apache/tamaya/events/folderobserver/ObservingPropertySourceProvider.java
----------------------------------------------------------------------
diff --git a/modules/events/src/main/java/org/apache/tamaya/events/folderobserver/ObservingPropertySourceProvider.java b/modules/events/src/main/java/org/apache/tamaya/events/folderobserver/ObservingPropertySourceProvider.java
index ed21d58..4464bc3 100644
--- a/modules/events/src/main/java/org/apache/tamaya/events/folderobserver/ObservingPropertySourceProvider.java
+++ b/modules/events/src/main/java/org/apache/tamaya/events/folderobserver/ObservingPropertySourceProvider.java
@@ -19,7 +19,7 @@
package org.apache.tamaya.events.folderobserver;
import org.apache.tamaya.ConfigException;
-import org.apache.tamaya.events.EventSupport;
+import org.apache.tamaya.events.ConfigEventSupport;
import org.apache.tamaya.events.delta.ConfigurationContextChange;
import org.apache.tamaya.events.delta.ConfigurationContextChangeBuilder;
import org.apache.tamaya.format.ConfigurationData;
@@ -212,7 +212,7 @@ public class ObservingPropertySourceProvider implements PropertySourceProvider,
}
ConfigurationContextChange changeEvent = b.build();
LOG.fine(() -> "Trigger Config Context Change: " + changeEvent);
- EventSupport.fireEvent(changeEvent);
+ ConfigEventSupport.fireEvent(changeEvent);
}
@Override
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/54bf732b/modules/events/src/main/java/org/apache/tamaya/events/spi/EventSupportSpi.java
----------------------------------------------------------------------
diff --git a/modules/events/src/main/java/org/apache/tamaya/events/spi/EventSupportSpi.java b/modules/events/src/main/java/org/apache/tamaya/events/spi/EventSupportSpi.java
index 0a42286..1cbf6fc 100644
--- a/modules/events/src/main/java/org/apache/tamaya/events/spi/EventSupportSpi.java
+++ b/modules/events/src/main/java/org/apache/tamaya/events/spi/EventSupportSpi.java
@@ -21,7 +21,7 @@ package org.apache.tamaya.events.spi;
import org.apache.tamaya.events.Listener;
/**
- * SPI interface to implement the {@link org.apache.tamaya.events.EventSupport} singleton.
+ * SPI interface to implement the {@link org.apache.tamaya.events.ConfigEventSupport} singleton.
* Implementations of this interface must be registered with the current {@link org.apache.tamaya.spi.ServiceContext},
* by default this equals to registering it with {@link java.util.ServiceLoader}. Add {@link javax.annotation.Priority}
* annotations for overriding (higher values overriden lower values).
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/54bf732b/modules/events/src/test/resources/META-INF/services/org.apache.tamaya.spi.PropertySourceProvider
----------------------------------------------------------------------
diff --git a/modules/events/src/test/resources/META-INF/services/org.apache.tamaya.spi.PropertySourceProvider b/modules/events/src/test/resources/META-INF/services/org.apache.tamaya.spi.PropertySourceProvider
index acb3a45..52c4603 100644
--- a/modules/events/src/test/resources/META-INF/services/org.apache.tamaya.spi.PropertySourceProvider
+++ b/modules/events/src/test/resources/META-INF/services/org.apache.tamaya.spi.PropertySourceProvider
@@ -16,4 +16,4 @@
# specific language governing permissions and limitations
# under the License.
#
-org.apache.tamaya.events.tests.TestObservingProvider
+org.apache.tamaya.events.tests.org.apache.tamaya.examples.fileobserver.TestObservingProvider