You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by oh...@apache.org on 2014/07/22 21:57:08 UTC

svn commit: r1612661 - /commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/builder/EventListenerProvider.java

Author: oheger
Date: Tue Jul 22 19:57:08 2014
New Revision: 1612661

URL: http://svn.apache.org/r1612661
Log:
Added EventListenerProvider interface.

This is a special parameters interface for initializing a configuration
builder with information about event listener registrations.

Added:
    commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/builder/EventListenerProvider.java

Added: commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/builder/EventListenerProvider.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/builder/EventListenerProvider.java?rev=1612661&view=auto
==============================================================================
--- commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/builder/EventListenerProvider.java (added)
+++ commons/proper/configuration/trunk/src/main/java/org/apache/commons/configuration/builder/EventListenerProvider.java Tue Jul 22 19:57:08 2014
@@ -0,0 +1,52 @@
+/*
+ * 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.commons.configuration.builder;
+
+import org.apache.commons.configuration.event.EventListenerList;
+
+/**
+ * <p>
+ * Definition of an interface that is evaluated by a
+ * {@link ConfigurationBuilder} to initialize event listeners.
+ * </p>
+ * <p>
+ * This interface allows a convenient initialization of a configuration builder
+ * with event listeners to be registered at the managed configuration object.
+ * The {@code configure()} method of {@link BasicConfigurationBuilder} checks
+ * whether a parameters object passed to it implements this interface. If this
+ * is the case, all event listeners defined by the object are added to the
+ * internal list managed by the builder. They are then automatically registered
+ * at the managed configuration when it is created. When using a corresponding
+ * implementation the configuration of event listeners can be done in the same
+ * fluent API style as the other initialization of the configuration builder.
+ * </p>
+ *
+ * @version $Id$
+ * @since 2.0
+ */
+public interface EventListenerProvider
+{
+    /**
+     * Returns an {@code EventListenerList} object with information about event
+     * listener registrations. All listeners contained in this object are added
+     * to the processing {@code ConfigurationBuilder}.
+     *
+     * @return the {@code EventListenerList} with event listener registrations
+     *         (must not be <b>null</b>)
+     */
+    EventListenerList getListeners();
+}