james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nor...@apache.org
Subject svn commit: r1220718 - in /james/protocols/trunk: ./ api/ api/src/main/java/org/apache/james/protocols/api/handler/
Date Mon, 19 Dec 2011 12:33:48 GMT
Author: norman
Date: Mon Dec 19 12:33:48 2011
New Revision: 1220718

URL: http://svn.apache.org/viewvc?rev=1220718&view=rev
Log:
Remove dependency on commons-configuration by providing a ProtocolHandlerConfiguration. See
PROTOCOLS-55

Added:
    james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/handler/ProtocolHandlerConfiguration.java
    james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/handler/ProtocolHandlerConfigurationException.java
Modified:
    james/protocols/trunk/api/pom.xml
    james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/handler/LifecycleAwareProtocolHandler.java
    james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/handler/ProtocolHandlerLoader.java
    james/protocols/trunk/pom.xml

Modified: james/protocols/trunk/api/pom.xml
URL: http://svn.apache.org/viewvc/james/protocols/trunk/api/pom.xml?rev=1220718&r1=1220717&r2=1220718&view=diff
==============================================================================
--- james/protocols/trunk/api/pom.xml (original)
+++ james/protocols/trunk/api/pom.xml Mon Dec 19 12:33:48 2011
@@ -37,10 +37,6 @@
             <groupId>org.slf4j</groupId>
             <artifactId>slf4j-api</artifactId>
         </dependency>
-        <dependency>
-            <groupId>commons-configuration</groupId>
-            <artifactId>commons-configuration</artifactId>
-        </dependency>
     </dependencies>
 
     <build>

Modified: james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/handler/LifecycleAwareProtocolHandler.java
URL: http://svn.apache.org/viewvc/james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/handler/LifecycleAwareProtocolHandler.java?rev=1220718&r1=1220717&r2=1220718&view=diff
==============================================================================
--- james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/handler/LifecycleAwareProtocolHandler.java
(original)
+++ james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/handler/LifecycleAwareProtocolHandler.java
Mon Dec 19 12:33:48 2011
@@ -18,8 +18,6 @@
  ****************************************************************/
 package org.apache.james.protocols.api.handler;
 
-import org.apache.commons.configuration.Configuration;
-import org.apache.commons.configuration.ConfigurationException;
 
 /**
  * This interface allows to handle lifecycles for handlers and hooks
@@ -29,12 +27,12 @@ public interface LifecycleAwareProtocolH
 
     
     /**
-     * Init with the given {@link Configuration}
+     * Init with the given {@link ProtocolHandlerConfiguration}
      * 
      * @param config
-     * @throws ConfigurationException
+     * @throws ProtocolHandlerConfigurationException
      */
-    public void init(Configuration config) throws ConfigurationException;
+    public void init(ProtocolHandlerConfiguration config) throws ProtocolHandlerConfigurationException;
     
     /**
      * Destroy object

Added: james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/handler/ProtocolHandlerConfiguration.java
URL: http://svn.apache.org/viewvc/james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/handler/ProtocolHandlerConfiguration.java?rev=1220718&view=auto
==============================================================================
--- james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/handler/ProtocolHandlerConfiguration.java
(added)
+++ james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/handler/ProtocolHandlerConfiguration.java
Mon Dec 19 12:33:48 2011
@@ -0,0 +1,45 @@
+/****************************************************************
+ * 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.james.protocols.api.handler;
+
+
+import java.util.Iterator;
+
+
+public interface ProtocolHandlerConfiguration {
+
+    /**
+     * Returns the value of the named initialization parameter,
+     * or null if the parameter does not exist.
+     *
+     * @param name the name of the initialization parameter
+     * @return the value of the initialization parameter, or null
+     */
+    String getInitParameter(String name);
+
+    /**
+     * Returns the names of the mailet's initialization parameters as an
+     * Iterator of String objects, or an empty Iterator if the {@link ProtocolHandler} has
+     * no initialization parameters.
+     *
+     * @return an Iterator of String objects containing the names of the
+     *      mailet's initialization parameters
+     */
+    Iterator<String> getInitParameterNames();
+}

Added: james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/handler/ProtocolHandlerConfigurationException.java
URL: http://svn.apache.org/viewvc/james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/handler/ProtocolHandlerConfigurationException.java?rev=1220718&view=auto
==============================================================================
--- james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/handler/ProtocolHandlerConfigurationException.java
(added)
+++ james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/handler/ProtocolHandlerConfigurationException.java
Mon Dec 19 12:33:48 2011
@@ -0,0 +1,44 @@
+/****************************************************************
+ * 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.james.protocols.api.handler;
+
+public class ProtocolHandlerConfigurationException extends Exception{
+
+    /**
+     * 
+     */
+    private static final long serialVersionUID = -7386172691015762042L;
+
+    public ProtocolHandlerConfigurationException() {
+        super();
+    }
+
+    public ProtocolHandlerConfigurationException(String message, Throwable cause) {
+        super(message, cause);
+    }
+
+    public ProtocolHandlerConfigurationException(String message) {
+        super(message);
+    }
+
+    public ProtocolHandlerConfigurationException(Throwable cause) {
+        super(cause);
+    }
+
+}

Modified: james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/handler/ProtocolHandlerLoader.java
URL: http://svn.apache.org/viewvc/james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/handler/ProtocolHandlerLoader.java?rev=1220718&r1=1220717&r2=1220718&view=diff
==============================================================================
--- james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/handler/ProtocolHandlerLoader.java
(original)
+++ james/protocols/trunk/api/src/main/java/org/apache/james/protocols/api/handler/ProtocolHandlerLoader.java
Mon Dec 19 12:33:48 2011
@@ -18,8 +18,6 @@
  ****************************************************************/
 package org.apache.james.protocols.api.handler;
 
-import org.apache.commons.configuration.Configuration;
-
 /**
  * Implementations of this interface are responsible for loading instances
  * of {@link ProtocolHandler}. This includes to inject all needed resources and 
@@ -39,7 +37,7 @@ public interface ProtocolHandlerLoader {
      * @return handler
      * @throws LoadingException
      */
-    public ProtocolHandler load(String name, Configuration config) throws LoadingException;
+    public ProtocolHandler load(String name, ProtocolHandlerConfiguration config) throws
LoadingException;
     
     
     /**

Modified: james/protocols/trunk/pom.xml
URL: http://svn.apache.org/viewvc/james/protocols/trunk/pom.xml?rev=1220718&r1=1220717&r2=1220718&view=diff
==============================================================================
--- james/protocols/trunk/pom.xml (original)
+++ james/protocols/trunk/pom.xml Mon Dec 19 12:33:48 2011
@@ -90,21 +90,7 @@
                 <version>1.6.3</version>
             </dependency>
 
-            <dependency>
-                <groupId>commons-configuration</groupId>
-                <artifactId>commons-configuration</artifactId>
-                <version>1.7</version>
-                <exclusions>
-                    <exclusion>
-                        <artifactId>commons-digester</artifactId>
-                        <groupId>commons-digester</groupId>
-                    </exclusion>
-                    <exclusion>
-                        <artifactId>commons-beanutils-core</artifactId>
-                        <groupId>commons-beanutils</groupId>
-                    </exclusion>
-                </exclusions>
-            </dependency>
+            
             <dependency>
                 <groupId>org.slf4j</groupId>
                 <artifactId>slf4j-simple</artifactId>



---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message