james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b...@apache.org
Subject svn commit: r574277 - in /james/jspf/trunk/src: main/java/org/apache/james/jspf/dns/ main/java/org/apache/james/jspf/executor/ main/java/org/apache/james/jspf/impl/ main/java/org/apache/james/jspf/macro/ main/java/org/apache/james/jspf/parser/ main/jav...
Date Mon, 10 Sep 2007 15:14:19 GMT
Author: bago
Date: Mon Sep 10 08:14:16 2007
New Revision: 574277

URL: http://svn.apache.org/viewvc?rev=574277&view=rev
Log:
Promoted public nested exception classes to top level classes.

Added:
    james/jspf/trunk/src/main/java/org/apache/james/jspf/dns/TimeoutException.java   (with
props)
    james/jspf/trunk/src/main/java/org/apache/james/jspf/wiring/WiringServiceException.java
  (with props)
Modified:
    james/jspf/trunk/src/main/java/org/apache/james/jspf/dns/DNSResponse.java
    james/jspf/trunk/src/main/java/org/apache/james/jspf/dns/DNSService.java
    james/jspf/trunk/src/main/java/org/apache/james/jspf/executor/StagedMultipleSPFExecutor.java
    james/jspf/trunk/src/main/java/org/apache/james/jspf/executor/SynchronousSPFExecutor.java
    james/jspf/trunk/src/main/java/org/apache/james/jspf/impl/DNSJnioAsynchService.java
    james/jspf/trunk/src/main/java/org/apache/james/jspf/impl/DNSServiceAsynchSimulator.java
    james/jspf/trunk/src/main/java/org/apache/james/jspf/impl/DNSServiceXBillImpl.java
    james/jspf/trunk/src/main/java/org/apache/james/jspf/macro/MacroExpand.java
    james/jspf/trunk/src/main/java/org/apache/james/jspf/parser/DefaultTermsFactory.java
    james/jspf/trunk/src/main/java/org/apache/james/jspf/policies/SPFRetriever.java
    james/jspf/trunk/src/main/java/org/apache/james/jspf/policies/SPFStrictCheckerRetriever.java
    james/jspf/trunk/src/main/java/org/apache/james/jspf/terms/AMechanism.java
    james/jspf/trunk/src/main/java/org/apache/james/jspf/terms/ExistsMechanism.java
    james/jspf/trunk/src/main/java/org/apache/james/jspf/terms/ExpModifier.java
    james/jspf/trunk/src/main/java/org/apache/james/jspf/terms/MXMechanism.java
    james/jspf/trunk/src/main/java/org/apache/james/jspf/terms/PTRMechanism.java
    james/jspf/trunk/src/main/java/org/apache/james/jspf/wiring/WiringService.java
    james/jspf/trunk/src/main/java/org/apache/james/jspf/wiring/WiringServiceTable.java
    james/jspf/trunk/src/test/java/org/apache/james/jspf/AbstractYamlTest.java
    james/jspf/trunk/src/test/java/org/apache/james/jspf/LoggingDNSService.java

Modified: james/jspf/trunk/src/main/java/org/apache/james/jspf/dns/DNSResponse.java
URL: http://svn.apache.org/viewvc/james/jspf/trunk/src/main/java/org/apache/james/jspf/dns/DNSResponse.java?rev=574277&r1=574276&r2=574277&view=diff
==============================================================================
--- james/jspf/trunk/src/main/java/org/apache/james/jspf/dns/DNSResponse.java (original)
+++ james/jspf/trunk/src/main/java/org/apache/james/jspf/dns/DNSResponse.java Mon Sep 10 08:14:16
2007
@@ -19,7 +19,6 @@
 
 package org.apache.james.jspf.dns;
 
-import org.apache.james.jspf.dns.DNSService.TimeoutException;
 
 import java.util.List;
 

Modified: james/jspf/trunk/src/main/java/org/apache/james/jspf/dns/DNSService.java
URL: http://svn.apache.org/viewvc/james/jspf/trunk/src/main/java/org/apache/james/jspf/dns/DNSService.java?rev=574277&r1=574276&r2=574277&view=diff
==============================================================================
--- james/jspf/trunk/src/main/java/org/apache/james/jspf/dns/DNSService.java (original)
+++ james/jspf/trunk/src/main/java/org/apache/james/jspf/dns/DNSService.java Mon Sep 10 08:14:16
2007
@@ -28,13 +28,6 @@
 public interface DNSService {
     
     /**
-     * The exception thrown on timeout.
-     */
-    public static class TimeoutException extends Exception {
-        
-    }
-
-    /**
      * Retrieve dns records for the given host
      * 
      * @param request the dns request

Added: james/jspf/trunk/src/main/java/org/apache/james/jspf/dns/TimeoutException.java
URL: http://svn.apache.org/viewvc/james/jspf/trunk/src/main/java/org/apache/james/jspf/dns/TimeoutException.java?rev=574277&view=auto
==============================================================================
--- james/jspf/trunk/src/main/java/org/apache/james/jspf/dns/TimeoutException.java (added)
+++ james/jspf/trunk/src/main/java/org/apache/james/jspf/dns/TimeoutException.java Mon Sep
10 08:14:16 2007
@@ -0,0 +1,34 @@
+/****************************************************************
+ * 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.jspf.dns;
+
+/**
+ * The exception thrown on lookup timeout
+ */
+public class TimeoutException extends Exception {
+
+    /**
+     * @param message cause
+     */
+    public TimeoutException(String message) {
+        super(message);
+    }
+   
+}
\ No newline at end of file

Propchange: james/jspf/trunk/src/main/java/org/apache/james/jspf/dns/TimeoutException.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: james/jspf/trunk/src/main/java/org/apache/james/jspf/executor/StagedMultipleSPFExecutor.java
URL: http://svn.apache.org/viewvc/james/jspf/trunk/src/main/java/org/apache/james/jspf/executor/StagedMultipleSPFExecutor.java?rev=574277&r1=574276&r2=574277&view=diff
==============================================================================
--- james/jspf/trunk/src/main/java/org/apache/james/jspf/executor/StagedMultipleSPFExecutor.java
(original)
+++ james/jspf/trunk/src/main/java/org/apache/james/jspf/executor/StagedMultipleSPFExecutor.java
Mon Sep 10 08:14:16 2007
@@ -29,7 +29,7 @@
 import org.apache.james.jspf.dns.DNSResponse;
 import org.apache.james.jspf.dns.IResponse;
 import org.apache.james.jspf.dns.IResponseQueue;
-import org.apache.james.jspf.dns.DNSService.TimeoutException;
+import org.apache.james.jspf.dns.TimeoutException;
 import org.apache.james.jspf.exceptions.SPFResultException;
 
 import java.util.Collections;

Modified: james/jspf/trunk/src/main/java/org/apache/james/jspf/executor/SynchronousSPFExecutor.java
URL: http://svn.apache.org/viewvc/james/jspf/trunk/src/main/java/org/apache/james/jspf/executor/SynchronousSPFExecutor.java?rev=574277&r1=574276&r2=574277&view=diff
==============================================================================
--- james/jspf/trunk/src/main/java/org/apache/james/jspf/executor/SynchronousSPFExecutor.java
(original)
+++ james/jspf/trunk/src/main/java/org/apache/james/jspf/executor/SynchronousSPFExecutor.java
Mon Sep 10 08:14:16 2007
@@ -27,7 +27,7 @@
 import org.apache.james.jspf.core.SPFSession;
 import org.apache.james.jspf.dns.DNSResponse;
 import org.apache.james.jspf.dns.DNSService;
-import org.apache.james.jspf.dns.DNSService.TimeoutException;
+import org.apache.james.jspf.dns.TimeoutException;
 import org.apache.james.jspf.exceptions.SPFResultException;
 
 /**

Modified: james/jspf/trunk/src/main/java/org/apache/james/jspf/impl/DNSJnioAsynchService.java
URL: http://svn.apache.org/viewvc/james/jspf/trunk/src/main/java/org/apache/james/jspf/impl/DNSJnioAsynchService.java?rev=574277&r1=574276&r2=574277&view=diff
==============================================================================
--- james/jspf/trunk/src/main/java/org/apache/james/jspf/impl/DNSJnioAsynchService.java (original)
+++ james/jspf/trunk/src/main/java/org/apache/james/jspf/impl/DNSJnioAsynchService.java Mon
Sep 10 08:14:16 2007
@@ -21,9 +21,9 @@
 
 import org.apache.james.jspf.dns.DNSAsynchLookupService;
 import org.apache.james.jspf.dns.DNSRequest;
-import org.apache.james.jspf.dns.DNSService;
 import org.apache.james.jspf.dns.IResponse;
 import org.apache.james.jspf.dns.IResponseQueue;
+import org.apache.james.jspf.dns.TimeoutException;
 import org.xbill.DNS.DClass;
 import org.xbill.DNS.ExtendedNonblockingResolver;
 import org.xbill.DNS.LookupAsynch;
@@ -136,8 +136,7 @@
 
                         public Exception getException() {
                             if (lookup.getResult() == LookupAsynch.TRY_AGAIN) {
-                                System.err.println("######## "+lookup.getErrorString());
-                                return new DNSService.TimeoutException();
+                                return new TimeoutException(lookup.getErrorString());
                             } else {
                                 return null;
                             }

Modified: james/jspf/trunk/src/main/java/org/apache/james/jspf/impl/DNSServiceAsynchSimulator.java
URL: http://svn.apache.org/viewvc/james/jspf/trunk/src/main/java/org/apache/james/jspf/impl/DNSServiceAsynchSimulator.java?rev=574277&r1=574276&r2=574277&view=diff
==============================================================================
--- james/jspf/trunk/src/main/java/org/apache/james/jspf/impl/DNSServiceAsynchSimulator.java
(original)
+++ james/jspf/trunk/src/main/java/org/apache/james/jspf/impl/DNSServiceAsynchSimulator.java
Mon Sep 10 08:14:16 2007
@@ -24,7 +24,7 @@
 import org.apache.james.jspf.dns.DNSService;
 import org.apache.james.jspf.dns.IResponseImpl;
 import org.apache.james.jspf.dns.IResponseQueue;
-import org.apache.james.jspf.dns.DNSService.TimeoutException;
+import org.apache.james.jspf.dns.TimeoutException;
 
 import java.util.LinkedList;
 

Modified: james/jspf/trunk/src/main/java/org/apache/james/jspf/impl/DNSServiceXBillImpl.java
URL: http://svn.apache.org/viewvc/james/jspf/trunk/src/main/java/org/apache/james/jspf/impl/DNSServiceXBillImpl.java?rev=574277&r1=574276&r2=574277&view=diff
==============================================================================
--- james/jspf/trunk/src/main/java/org/apache/james/jspf/impl/DNSServiceXBillImpl.java (original)
+++ james/jspf/trunk/src/main/java/org/apache/james/jspf/impl/DNSServiceXBillImpl.java Mon
Sep 10 08:14:16 2007
@@ -23,6 +23,7 @@
 import org.apache.james.jspf.core.Logger;
 import org.apache.james.jspf.dns.DNSRequest;
 import org.apache.james.jspf.dns.DNSService;
+import org.apache.james.jspf.dns.TimeoutException;
 import org.xbill.DNS.AAAARecord;
 import org.xbill.DNS.ARecord;
 import org.xbill.DNS.Lookup;
@@ -138,7 +139,7 @@
             
 
             if (queryResult == Lookup.TRY_AGAIN) {
-                throw new TimeoutException();
+                throw new TimeoutException(query.getErrorString());
             }
             
             List records = convertRecordsToList(rr);

Modified: james/jspf/trunk/src/main/java/org/apache/james/jspf/macro/MacroExpand.java
URL: http://svn.apache.org/viewvc/james/jspf/trunk/src/main/java/org/apache/james/jspf/macro/MacroExpand.java?rev=574277&r1=574276&r2=574277&view=diff
==============================================================================
--- james/jspf/trunk/src/main/java/org/apache/james/jspf/macro/MacroExpand.java (original)
+++ james/jspf/trunk/src/main/java/org/apache/james/jspf/macro/MacroExpand.java Mon Sep 10
08:14:16 2007
@@ -36,7 +36,7 @@
 import org.apache.james.jspf.dns.DNSRequest;
 import org.apache.james.jspf.dns.DNSResponse;
 import org.apache.james.jspf.dns.DNSService;
-import org.apache.james.jspf.dns.DNSService.TimeoutException;
+import org.apache.james.jspf.dns.TimeoutException;
 import org.apache.james.jspf.exceptions.NeutralException;
 import org.apache.james.jspf.exceptions.NoneException;
 import org.apache.james.jspf.exceptions.PermErrorException;

Modified: james/jspf/trunk/src/main/java/org/apache/james/jspf/parser/DefaultTermsFactory.java
URL: http://svn.apache.org/viewvc/james/jspf/trunk/src/main/java/org/apache/james/jspf/parser/DefaultTermsFactory.java?rev=574277&r1=574276&r2=574277&view=diff
==============================================================================
--- james/jspf/trunk/src/main/java/org/apache/james/jspf/parser/DefaultTermsFactory.java (original)
+++ james/jspf/trunk/src/main/java/org/apache/james/jspf/parser/DefaultTermsFactory.java Mon
Sep 10 08:14:16 2007
@@ -25,6 +25,7 @@
 import org.apache.james.jspf.exceptions.PermErrorException;
 import org.apache.james.jspf.wiring.LogEnabled;
 import org.apache.james.jspf.wiring.WiringService;
+import org.apache.james.jspf.wiring.WiringServiceException;
 import org.apache.james.jspf.wiring.WiringServiceTable;
 
 import java.io.IOException;
@@ -136,7 +137,7 @@
             
             try {
                 wiringService.wire(term);
-            } catch (WiringService.WiringServiceException e) {
+            } catch (WiringServiceException e) {
                 throw new InstantiationException(
                         "Unexpected error adding dependencies to term: " + e.getMessage());
             }

Modified: james/jspf/trunk/src/main/java/org/apache/james/jspf/policies/SPFRetriever.java
URL: http://svn.apache.org/viewvc/james/jspf/trunk/src/main/java/org/apache/james/jspf/policies/SPFRetriever.java?rev=574277&r1=574276&r2=574277&view=diff
==============================================================================
--- james/jspf/trunk/src/main/java/org/apache/james/jspf/policies/SPFRetriever.java (original)
+++ james/jspf/trunk/src/main/java/org/apache/james/jspf/policies/SPFRetriever.java Mon Sep
10 08:14:16 2007
@@ -9,8 +9,7 @@
 import org.apache.james.jspf.core.SPFSession;
 import org.apache.james.jspf.dns.DNSRequest;
 import org.apache.james.jspf.dns.DNSResponse;
-import org.apache.james.jspf.dns.DNSService;
-import org.apache.james.jspf.dns.DNSService.TimeoutException;
+import org.apache.james.jspf.dns.TimeoutException;
 import org.apache.james.jspf.exceptions.NeutralException;
 import org.apache.james.jspf.exceptions.NoneException;
 import org.apache.james.jspf.exceptions.PermErrorException;
@@ -79,7 +78,7 @@
                 
                 return null;
                 
-            } catch (DNSService.TimeoutException e) {
+            } catch (TimeoutException e) {
                 throw new TempErrorException("Timeout querying dns");
             }
         }

Modified: james/jspf/trunk/src/main/java/org/apache/james/jspf/policies/SPFStrictCheckerRetriever.java
URL: http://svn.apache.org/viewvc/james/jspf/trunk/src/main/java/org/apache/james/jspf/policies/SPFStrictCheckerRetriever.java?rev=574277&r1=574276&r2=574277&view=diff
==============================================================================
--- james/jspf/trunk/src/main/java/org/apache/james/jspf/policies/SPFStrictCheckerRetriever.java
(original)
+++ james/jspf/trunk/src/main/java/org/apache/james/jspf/policies/SPFStrictCheckerRetriever.java
Mon Sep 10 08:14:16 2007
@@ -7,8 +7,7 @@
 import org.apache.james.jspf.core.SPFSession;
 import org.apache.james.jspf.dns.DNSRequest;
 import org.apache.james.jspf.dns.DNSResponse;
-import org.apache.james.jspf.dns.DNSService;
-import org.apache.james.jspf.dns.DNSService.TimeoutException;
+import org.apache.james.jspf.dns.TimeoutException;
 import org.apache.james.jspf.exceptions.NeutralException;
 import org.apache.james.jspf.exceptions.NoneException;
 import org.apache.james.jspf.exceptions.PermErrorException;
@@ -73,7 +72,7 @@
                 String currentDomain = session.getCurrentDomain();
                 return new DNSLookupContinuation(new DNSRequest(currentDomain, DNSRequest.TXT),
new SPFStrictSPFRecordsDNSResponseListener());
                     
-            } catch (DNSService.TimeoutException e) {
+            } catch (TimeoutException e) {
                 throw new TempErrorException("Timeout querying dns");
             }
         }

Modified: james/jspf/trunk/src/main/java/org/apache/james/jspf/terms/AMechanism.java
URL: http://svn.apache.org/viewvc/james/jspf/trunk/src/main/java/org/apache/james/jspf/terms/AMechanism.java?rev=574277&r1=574276&r2=574277&view=diff
==============================================================================
--- james/jspf/trunk/src/main/java/org/apache/james/jspf/terms/AMechanism.java (original)
+++ james/jspf/trunk/src/main/java/org/apache/james/jspf/terms/AMechanism.java Mon Sep 10
08:14:16 2007
@@ -29,7 +29,7 @@
 import org.apache.james.jspf.core.SPFSession;
 import org.apache.james.jspf.dns.DNSRequest;
 import org.apache.james.jspf.dns.DNSResponse;
-import org.apache.james.jspf.dns.DNSService;
+import org.apache.james.jspf.dns.TimeoutException;
 import org.apache.james.jspf.exceptions.NeutralException;
 import org.apache.james.jspf.exceptions.NoneException;
 import org.apache.james.jspf.exceptions.PermErrorException;
@@ -258,7 +258,7 @@
         List listAData = null;
         try {
             listAData = response.getResponse();
-        } catch (DNSService.TimeoutException e) {
+        } catch (TimeoutException e) {
             throw new TempErrorException("Timeout querying dns server");
         }
         // no a records just return null

Modified: james/jspf/trunk/src/main/java/org/apache/james/jspf/terms/ExistsMechanism.java
URL: http://svn.apache.org/viewvc/james/jspf/trunk/src/main/java/org/apache/james/jspf/terms/ExistsMechanism.java?rev=574277&r1=574276&r2=574277&view=diff
==============================================================================
--- james/jspf/trunk/src/main/java/org/apache/james/jspf/terms/ExistsMechanism.java (original)
+++ james/jspf/trunk/src/main/java/org/apache/james/jspf/terms/ExistsMechanism.java Mon Sep
10 08:14:16 2007
@@ -27,7 +27,7 @@
 import org.apache.james.jspf.core.SPFSession;
 import org.apache.james.jspf.dns.DNSRequest;
 import org.apache.james.jspf.dns.DNSResponse;
-import org.apache.james.jspf.dns.DNSService;
+import org.apache.james.jspf.dns.TimeoutException;
 import org.apache.james.jspf.exceptions.NeutralException;
 import org.apache.james.jspf.exceptions.NoneException;
 import org.apache.james.jspf.exceptions.PermErrorException;
@@ -83,7 +83,7 @@
         
         try {
             aRecords = response.getResponse();
-        } catch (DNSService.TimeoutException e) {
+        } catch (TimeoutException e) {
             spfSession.setAttribute(Directive.ATTRIBUTE_MECHANISM_RESULT, Boolean.FALSE);
             return null;
         }

Modified: james/jspf/trunk/src/main/java/org/apache/james/jspf/terms/ExpModifier.java
URL: http://svn.apache.org/viewvc/james/jspf/trunk/src/main/java/org/apache/james/jspf/terms/ExpModifier.java?rev=574277&r1=574276&r2=574277&view=diff
==============================================================================
--- james/jspf/trunk/src/main/java/org/apache/james/jspf/terms/ExpModifier.java (original)
+++ james/jspf/trunk/src/main/java/org/apache/james/jspf/terms/ExpModifier.java Mon Sep 10
08:14:16 2007
@@ -27,7 +27,7 @@
 import org.apache.james.jspf.core.SPFSession;
 import org.apache.james.jspf.dns.DNSRequest;
 import org.apache.james.jspf.dns.DNSResponse;
-import org.apache.james.jspf.dns.DNSService;
+import org.apache.james.jspf.dns.TimeoutException;
 import org.apache.james.jspf.exceptions.NeutralException;
 import org.apache.james.jspf.exceptions.NoneException;
 import org.apache.james.jspf.exceptions.PermErrorException;
@@ -187,7 +187,7 @@
             }
             
 
-        } catch (DNSService.TimeoutException e) {
+        } catch (TimeoutException e) {
             // Nothing todo here.. just return null
         }
         return null;

Modified: james/jspf/trunk/src/main/java/org/apache/james/jspf/terms/MXMechanism.java
URL: http://svn.apache.org/viewvc/james/jspf/trunk/src/main/java/org/apache/james/jspf/terms/MXMechanism.java?rev=574277&r1=574276&r2=574277&view=diff
==============================================================================
--- james/jspf/trunk/src/main/java/org/apache/james/jspf/terms/MXMechanism.java (original)
+++ james/jspf/trunk/src/main/java/org/apache/james/jspf/terms/MXMechanism.java Mon Sep 10
08:14:16 2007
@@ -28,7 +28,7 @@
 import org.apache.james.jspf.core.SPFSession;
 import org.apache.james.jspf.dns.DNSRequest;
 import org.apache.james.jspf.dns.DNSResponse;
-import org.apache.james.jspf.dns.DNSService;
+import org.apache.james.jspf.dns.TimeoutException;
 import org.apache.james.jspf.exceptions.NeutralException;
 import org.apache.james.jspf.exceptions.NoneException;
 import org.apache.james.jspf.exceptions.PermErrorException;
@@ -147,7 +147,7 @@
             spfSession.setAttribute(Directive.ATTRIBUTE_MECHANISM_RESULT, Boolean.valueOf(checkAddressList(checkAddress,
mxR, getIp4cidr())));
             return null;
             
-        } catch (DNSService.TimeoutException e) {
+        } catch (TimeoutException e) {
             spfSession.setAttribute(ATTRIBUTE_CHECK_RECORDS, null);
             spfSession.setAttribute(ATTRIBUTE_MX_RECORDS, null);
             throw new TempErrorException("Timeout querying the dns server");

Modified: james/jspf/trunk/src/main/java/org/apache/james/jspf/terms/PTRMechanism.java
URL: http://svn.apache.org/viewvc/james/jspf/trunk/src/main/java/org/apache/james/jspf/terms/PTRMechanism.java?rev=574277&r1=574276&r2=574277&view=diff
==============================================================================
--- james/jspf/trunk/src/main/java/org/apache/james/jspf/terms/PTRMechanism.java (original)
+++ james/jspf/trunk/src/main/java/org/apache/james/jspf/terms/PTRMechanism.java Mon Sep 10
08:14:16 2007
@@ -29,6 +29,7 @@
 import org.apache.james.jspf.dns.DNSRequest;
 import org.apache.james.jspf.dns.DNSResponse;
 import org.apache.james.jspf.dns.DNSService;
+import org.apache.james.jspf.dns.TimeoutException;
 import org.apache.james.jspf.exceptions.NeutralException;
 import org.apache.james.jspf.exceptions.NoneException;
 import org.apache.james.jspf.exceptions.PermErrorException;
@@ -168,7 +169,7 @@
                 }
             
             }
-        } catch (DNSService.TimeoutException e) {
+        } catch (TimeoutException e) {
             throw new TempErrorException("Timeout querying the dns server");
         }
         

Modified: james/jspf/trunk/src/main/java/org/apache/james/jspf/wiring/WiringService.java
URL: http://svn.apache.org/viewvc/james/jspf/trunk/src/main/java/org/apache/james/jspf/wiring/WiringService.java?rev=574277&r1=574276&r2=574277&view=diff
==============================================================================
--- james/jspf/trunk/src/main/java/org/apache/james/jspf/wiring/WiringService.java (original)
+++ james/jspf/trunk/src/main/java/org/apache/james/jspf/wiring/WiringService.java Mon Sep
10 08:14:16 2007
@@ -25,14 +25,6 @@
  */
 public interface WiringService {
     
-    public static class WiringServiceException extends Exception {
-
-        public WiringServiceException(String string) {
-            super(string);
-        }
-
-    }
-
     /**
      * Called to wire a component
      * 

Added: james/jspf/trunk/src/main/java/org/apache/james/jspf/wiring/WiringServiceException.java
URL: http://svn.apache.org/viewvc/james/jspf/trunk/src/main/java/org/apache/james/jspf/wiring/WiringServiceException.java?rev=574277&view=auto
==============================================================================
--- james/jspf/trunk/src/main/java/org/apache/james/jspf/wiring/WiringServiceException.java
(added)
+++ james/jspf/trunk/src/main/java/org/apache/james/jspf/wiring/WiringServiceException.java
Mon Sep 10 08:14:16 2007
@@ -0,0 +1,35 @@
+/****************************************************************
+ * 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.jspf.wiring;
+
+/**
+ * Exception raised when something goes wrong with wiring
+ */
+public class WiringServiceException extends Exception {
+
+    public WiringServiceException(String string) {
+        super(string);
+    }
+
+    public WiringServiceException(String string, Exception nested) {
+        super(string, nested);
+    }
+
+}
\ No newline at end of file

Propchange: james/jspf/trunk/src/main/java/org/apache/james/jspf/wiring/WiringServiceException.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: james/jspf/trunk/src/main/java/org/apache/james/jspf/wiring/WiringServiceTable.java
URL: http://svn.apache.org/viewvc/james/jspf/trunk/src/main/java/org/apache/james/jspf/wiring/WiringServiceTable.java?rev=574277&r1=574276&r2=574277&view=diff
==============================================================================
--- james/jspf/trunk/src/main/java/org/apache/james/jspf/wiring/WiringServiceTable.java (original)
+++ james/jspf/trunk/src/main/java/org/apache/james/jspf/wiring/WiringServiceTable.java Mon
Sep 10 08:14:16 2007
@@ -25,10 +25,13 @@
 import java.util.Hashtable;
 import java.util.Iterator;
 
+/**
+ * This class associates "Enabling interfaces" to the service that provides the
+ * dependency.
+ */
 public class WiringServiceTable extends Hashtable implements WiringService {
 
-    /*
-     * (non-Javadoc)
+    /**
      * @see org.apache.james.jspf.wiring.WiringService#wire(java.lang.Object)
      */
     public void wire(Object component) throws WiringServiceException {
@@ -41,11 +44,11 @@
                     try {
                         m[0].invoke(component, new Object[] {get(enablingClass)});
                     } catch (IllegalArgumentException e) {
-                        throw new WiringServiceException("Illegal argument invoking enabled
service: "+enablingClass.toString());
+                        throw new WiringServiceException("Illegal argument invoking enabled
service: "+enablingClass.toString(), e);
                     } catch (InvocationTargetException e) {
-                        throw new WiringServiceException("Unable to invoke enabled service:
"+enablingClass.toString());
+                        throw new WiringServiceException("Unable to invoke enabled service:
"+enablingClass.toString(), e);
                     } catch (IllegalAccessException e) {
-                        throw new WiringServiceException("Unable to invoke enabled service:
"+enablingClass.toString());
+                        throw new WiringServiceException("Unable to invoke enabled service:
"+enablingClass.toString(), e);
                     }
                 }
             }

Modified: james/jspf/trunk/src/test/java/org/apache/james/jspf/AbstractYamlTest.java
URL: http://svn.apache.org/viewvc/james/jspf/trunk/src/test/java/org/apache/james/jspf/AbstractYamlTest.java?rev=574277&r1=574276&r2=574277&view=diff
==============================================================================
--- james/jspf/trunk/src/test/java/org/apache/james/jspf/AbstractYamlTest.java (original)
+++ james/jspf/trunk/src/test/java/org/apache/james/jspf/AbstractYamlTest.java Mon Sep 10
08:14:16 2007
@@ -24,6 +24,7 @@
 import org.apache.james.jspf.core.SPFResult;
 import org.apache.james.jspf.dns.DNSRequest;
 import org.apache.james.jspf.dns.DNSService;
+import org.apache.james.jspf.dns.TimeoutException;
 import org.apache.james.jspf.dnsserver.DNSTestingServer;
 import org.apache.james.jspf.executor.SPFExecutor;
 import org.apache.james.jspf.executor.StagedMultipleSPFExecutor;
@@ -39,6 +40,7 @@
 import org.apache.james.jspf.wiring.MacroExpandEnabled;
 import org.apache.james.jspf.wiring.SPFCheckEnabled;
 import org.apache.james.jspf.wiring.WiringService;
+import org.apache.james.jspf.wiring.WiringServiceException;
 import org.jvyaml.Constructor;
 import org.jvyaml.DefaultYAMLFactory;
 import org.jvyaml.YAMLFactory;
@@ -486,7 +488,7 @@
                             return getRecords((String) hm.get("CNAME"), recordType, depth
- 1);
                         }
                     } else if ("TIMEOUT".equals(o)) {
-                        throw new TimeoutException();
+                        throw new TimeoutException("TIMEOUT");
                     } else {
                         throw new IllegalStateException("getRecord found an unexpected data");
                     }

Modified: james/jspf/trunk/src/test/java/org/apache/james/jspf/LoggingDNSService.java
URL: http://svn.apache.org/viewvc/james/jspf/trunk/src/test/java/org/apache/james/jspf/LoggingDNSService.java?rev=574277&r1=574276&r2=574277&view=diff
==============================================================================
--- james/jspf/trunk/src/test/java/org/apache/james/jspf/LoggingDNSService.java (original)
+++ james/jspf/trunk/src/test/java/org/apache/james/jspf/LoggingDNSService.java Mon Sep 10
08:14:16 2007
@@ -22,6 +22,7 @@
 import org.apache.james.jspf.core.Logger;
 import org.apache.james.jspf.dns.DNSRequest;
 import org.apache.james.jspf.dns.DNSService;
+import org.apache.james.jspf.dns.TimeoutException;
 
 import java.util.List;
 



---------------------------------------------------------------------
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