incubator-ivy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gscok...@apache.org
Subject svn commit: r573645 - in /incubator/ivy/core/trunk: src/java/org/apache/ivy/core/cache/ src/java/org/apache/ivy/core/check/ src/java/org/apache/ivy/core/install/ src/java/org/apache/ivy/core/resolve/ src/java/org/apache/ivy/core/retrieve/ src/java/org/...
Date Fri, 07 Sep 2007 17:53:23 GMT
Author: gscokart
Date: Fri Sep  7 10:53:21 2007
New Revision: 573645

URL: http://svn.apache.org/viewvc?rev=573645&view=rev
Log:
Isolate CheckEngineSettings, InstallEngineSettings, CacheSettings, RetrieveEngineSettings,
ResolveEngineSettings and ResolverSettings

Added:
    incubator/ivy/core/trunk/src/java/org/apache/ivy/core/cache/CacheSettings.java   (with
props)
    incubator/ivy/core/trunk/src/java/org/apache/ivy/core/check/CheckEngineSettings.java 
 (with props)
    incubator/ivy/core/trunk/src/java/org/apache/ivy/core/install/InstallEngineSettings.java
  (with props)
    incubator/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/ResolveEngineSettings.java
  (with props)
    incubator/ivy/core/trunk/src/java/org/apache/ivy/core/retrieve/RetrieveEngineSettings.java
  (with props)
    incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/ResolverSettings.java
  (with props)
Modified:
    incubator/ivy/core/trunk/src/java/org/apache/ivy/core/cache/CacheManager.java
    incubator/ivy/core/trunk/src/java/org/apache/ivy/core/check/CheckEngine.java
    incubator/ivy/core/trunk/src/java/org/apache/ivy/core/install/InstallEngine.java
    incubator/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/DownloadOptions.java
    incubator/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/IvyNode.java
    incubator/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/ResolveData.java
    incubator/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/ResolveEngine.java
    incubator/ivy/core/trunk/src/java/org/apache/ivy/core/retrieve/RetrieveEngine.java
    incubator/ivy/core/trunk/src/java/org/apache/ivy/core/settings/IvySettings.java
    incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/AbstractResolver.java
    incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/CacheResolver.java
    incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/DependencyResolver.java
    incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/IBiblioResolver.java
    incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/IvyRepResolver.java
    incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/RepositoryResolver.java
    incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/resolver/URLResolverTest.java

Modified: incubator/ivy/core/trunk/src/java/org/apache/ivy/core/cache/CacheManager.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/core/cache/CacheManager.java?rev=573645&r1=573644&r2=573645&view=diff
==============================================================================
--- incubator/ivy/core/trunk/src/java/org/apache/ivy/core/cache/CacheManager.java (original)
+++ incubator/ivy/core/trunk/src/java/org/apache/ivy/core/cache/CacheManager.java Fri Sep
 7 10:53:21 2007
@@ -27,28 +27,31 @@
 import org.apache.ivy.core.module.id.ModuleRevisionId;
 import org.apache.ivy.core.resolve.DefaultModuleRevision;
 import org.apache.ivy.core.resolve.ResolvedModuleRevision;
-import org.apache.ivy.core.settings.IvySettings;
 import org.apache.ivy.plugins.parser.xml.XmlModuleDescriptorParser;
 import org.apache.ivy.plugins.resolver.DependencyResolver;
 import org.apache.ivy.util.Message;
 import org.apache.ivy.util.PropertiesFile;
 
 public class CacheManager {
-    public static CacheManager getInstance(IvySettings settings, File cache) {
+    public static CacheManager getInstance(CacheSettings settings, File cache) {
         return new CacheManager(settings, cache);
     }
 
-    public static CacheManager getInstance(IvySettings settings) {
+    public static CacheManager getInstance(CacheSettings settings) {
         return getInstance(settings, settings.getDefaultCache());
     }
 
-    private IvySettings settings;
+    private CacheSettings settings;
 
     private File cache;
 
-    public CacheManager(IvySettings settings, File cache) {
+    public CacheManager(CacheSettings settings, File cache) {
         this.settings = settings;
-        this.cache = cache;
+        if (cache==null) {
+            this.cache=settings.getDefaultCache();
+        } else {
+            this.cache = cache;
+        }
     }
 
     public File getResolvedIvyFileInCache(ModuleRevisionId mrid) {

Added: incubator/ivy/core/trunk/src/java/org/apache/ivy/core/cache/CacheSettings.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/core/cache/CacheSettings.java?rev=573645&view=auto
==============================================================================
--- incubator/ivy/core/trunk/src/java/org/apache/ivy/core/cache/CacheSettings.java (added)
+++ incubator/ivy/core/trunk/src/java/org/apache/ivy/core/cache/CacheSettings.java Fri Sep
 7 10:53:21 2007
@@ -0,0 +1,47 @@
+/*
+ *  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.ivy.core.cache;
+
+import java.io.File;
+
+import org.apache.ivy.core.module.id.ModuleId;
+import org.apache.ivy.plugins.parser.ParserSettings;
+import org.apache.ivy.plugins.resolver.DependencyResolver;
+import org.apache.ivy.plugins.version.VersionMatcher;
+
+public interface CacheSettings extends ParserSettings {
+
+    File getDefaultCache();
+
+    String getCacheResolvedIvyPattern();
+
+    String getCacheResolvedIvyPropertiesPattern();
+
+    String getCacheIvyPattern();
+
+    String getCacheArtifactPattern();
+
+    String getCacheDataFilePattern();
+
+    VersionMatcher getVersionMatcher();
+
+    DependencyResolver getResolver(ModuleId moduleId);
+
+    DependencyResolver getResolver(String artResolverName);
+
+}

Propchange: incubator/ivy/core/trunk/src/java/org/apache/ivy/core/cache/CacheSettings.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/ivy/core/trunk/src/java/org/apache/ivy/core/check/CheckEngine.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/core/check/CheckEngine.java?rev=573645&r1=573644&r2=573645&view=diff
==============================================================================
--- incubator/ivy/core/trunk/src/java/org/apache/ivy/core/check/CheckEngine.java (original)
+++ incubator/ivy/core/trunk/src/java/org/apache/ivy/core/check/CheckEngine.java Fri Sep 
7 10:53:21 2007
@@ -33,17 +33,16 @@
 import org.apache.ivy.core.resolve.ResolveEngine;
 import org.apache.ivy.core.resolve.ResolveOptions;
 import org.apache.ivy.core.resolve.ResolvedModuleRevision;
-import org.apache.ivy.core.settings.IvySettings;
 import org.apache.ivy.plugins.parser.ModuleDescriptorParserRegistry;
 import org.apache.ivy.plugins.resolver.DependencyResolver;
 import org.apache.ivy.util.Message;
 
 public class CheckEngine {
-    private IvySettings settings;
+    private CheckEngineSettings settings;
 
     private ResolveEngine resolveEngine;
 
-    public CheckEngine(IvySettings settings, ResolveEngine resolveEngine) {
+    public CheckEngine(CheckEngineSettings settings, ResolveEngine resolveEngine) {
         this.settings = settings;
         this.resolveEngine = resolveEngine;
     }

Added: incubator/ivy/core/trunk/src/java/org/apache/ivy/core/check/CheckEngineSettings.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/core/check/CheckEngineSettings.java?rev=573645&view=auto
==============================================================================
--- incubator/ivy/core/trunk/src/java/org/apache/ivy/core/check/CheckEngineSettings.java (added)
+++ incubator/ivy/core/trunk/src/java/org/apache/ivy/core/check/CheckEngineSettings.java Fri
Sep  7 10:53:21 2007
@@ -0,0 +1,33 @@
+/*
+ *  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.ivy.core.check;
+
+import org.apache.ivy.core.cache.CacheSettings;
+import org.apache.ivy.core.module.id.ModuleId;
+import org.apache.ivy.plugins.parser.ParserSettings;
+import org.apache.ivy.plugins.resolver.DependencyResolver;
+
+public interface CheckEngineSettings extends CacheSettings , ParserSettings {
+
+    boolean doValidate();
+
+    DependencyResolver getResolver(String resolvername);
+
+    DependencyResolver getResolver(ModuleId dependencyId);
+
+}

Propchange: incubator/ivy/core/trunk/src/java/org/apache/ivy/core/check/CheckEngineSettings.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/ivy/core/trunk/src/java/org/apache/ivy/core/install/InstallEngine.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/core/install/InstallEngine.java?rev=573645&r1=573644&r2=573645&view=diff
==============================================================================
--- incubator/ivy/core/trunk/src/java/org/apache/ivy/core/install/InstallEngine.java (original)
+++ incubator/ivy/core/trunk/src/java/org/apache/ivy/core/install/InstallEngine.java Fri Sep
 7 10:53:21 2007
@@ -39,7 +39,6 @@
 import org.apache.ivy.core.resolve.ResolveEngine;
 import org.apache.ivy.core.resolve.ResolveOptions;
 import org.apache.ivy.core.search.SearchEngine;
-import org.apache.ivy.core.settings.IvySettings;
 import org.apache.ivy.plugins.conflict.NoConflictManager;
 import org.apache.ivy.plugins.matcher.ExactPatternMatcher;
 import org.apache.ivy.plugins.matcher.MatcherHelper;
@@ -50,7 +49,7 @@
 import org.apache.ivy.util.filter.FilterHelper;
 
 public class InstallEngine {
-    private IvySettings settings;
+    private InstallEngineSettings settings;
 
     private ResolveEngine resolveEngine;
 
@@ -58,7 +57,7 @@
 
     private SearchEngine searchEngine;
 
-    public InstallEngine(IvySettings settings, SearchEngine searchEngine,
+    public InstallEngine(InstallEngineSettings settings, SearchEngine searchEngine,
             ResolveEngine resolveEngine, PublishEngine publishEngine) {
         this.settings = settings;
         this.searchEngine = searchEngine;

Added: incubator/ivy/core/trunk/src/java/org/apache/ivy/core/install/InstallEngineSettings.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/core/install/InstallEngineSettings.java?rev=573645&view=auto
==============================================================================
--- incubator/ivy/core/trunk/src/java/org/apache/ivy/core/install/InstallEngineSettings.java
(added)
+++ incubator/ivy/core/trunk/src/java/org/apache/ivy/core/install/InstallEngineSettings.java
Fri Sep  7 10:53:21 2007
@@ -0,0 +1,46 @@
+/*
+ *  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.ivy.core.install;
+
+import java.util.Collection;
+
+import org.apache.ivy.core.cache.CacheSettings;
+import org.apache.ivy.core.module.status.StatusManager;
+import org.apache.ivy.plugins.matcher.PatternMatcher;
+import org.apache.ivy.plugins.report.ReportOutputter;
+import org.apache.ivy.plugins.resolver.DependencyResolver;
+
+public interface InstallEngineSettings extends CacheSettings {
+
+    DependencyResolver getResolver(String from);
+
+    Collection getResolverNames();
+
+    ReportOutputter[] getReportOutputters();
+
+    void setLogNotConvertedExclusionRule(boolean log);
+
+    StatusManager getStatusManager();
+
+    boolean logNotConvertedExclusionRule();
+
+    PatternMatcher getMatcher(String matcherName);
+
+    Collection getMatcherNames();
+
+}

Propchange: incubator/ivy/core/trunk/src/java/org/apache/ivy/core/install/InstallEngineSettings.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/DownloadOptions.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/DownloadOptions.java?rev=573645&r1=573644&r2=573645&view=diff
==============================================================================
--- incubator/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/DownloadOptions.java (original)
+++ incubator/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/DownloadOptions.java Fri
Sep  7 10:53:21 2007
@@ -24,8 +24,6 @@
 import org.apache.ivy.core.settings.IvySettings;
 
 public class DownloadOptions {
-    private IvySettings settings;
-
     private CacheManager cacheManager;
 
     private EventManager eventManager = null; // can be null
@@ -33,23 +31,18 @@
     private boolean useOrigin = false;
 
     public DownloadOptions(IvySettings settings, File cache) {
-        this(settings, new CacheManager(settings, cache));
+        this(new CacheManager(settings, cache));
     }
 
-    public DownloadOptions(IvySettings settings, CacheManager cacheManager) {
-        this(settings, cacheManager, null, false);
+    public DownloadOptions(CacheManager cacheManager) {
+        this(cacheManager, null, false);
     }
 
-    public DownloadOptions(IvySettings settings, CacheManager cacheManager,
-            EventManager eventManager, boolean useOrigin) {
-        this.settings = settings;
+    public DownloadOptions(CacheManager cacheManager, EventManager eventManager,
+            boolean useOrigin) {
         this.cacheManager = cacheManager;
         this.eventManager = eventManager;
         this.useOrigin = useOrigin;
-    }
-
-    public IvySettings getSettings() {
-        return settings;
     }
 
     public boolean isUseOrigin() {

Modified: incubator/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/IvyNode.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/IvyNode.java?rev=573645&r1=573644&r2=573645&view=diff
==============================================================================
--- incubator/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/IvyNode.java (original)
+++ incubator/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/IvyNode.java Fri Sep  7
10:53:21 2007
@@ -48,7 +48,6 @@
 import org.apache.ivy.core.module.id.ModuleRevisionId;
 import org.apache.ivy.core.resolve.IvyNodeCallers.Caller;
 import org.apache.ivy.core.resolve.IvyNodeEviction.EvictionData;
-import org.apache.ivy.core.settings.IvySettings;
 import org.apache.ivy.plugins.conflict.ConflictManager;
 import org.apache.ivy.plugins.matcher.MatcherHelper;
 import org.apache.ivy.plugins.resolver.DependencyResolver;
@@ -104,7 +103,7 @@
     // //////// CONTEXT
     private ResolveData data;
 
-    private IvySettings settings;
+    private ResolveEngineSettings settings;
 
     // //////// DELEGATES
     private IvyNodeCallers callers;

Modified: incubator/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/ResolveData.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/ResolveData.java?rev=573645&r1=573644&r2=573645&view=diff
==============================================================================
--- incubator/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/ResolveData.java (original)
+++ incubator/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/ResolveData.java Fri Sep
 7 10:53:21 2007
@@ -28,7 +28,6 @@
 import org.apache.ivy.core.event.EventManager;
 import org.apache.ivy.core.module.id.ModuleRevisionId;
 import org.apache.ivy.core.report.ConfigurationResolveReport;
-import org.apache.ivy.core.settings.IvySettings;
 
 public class ResolveData {
     private ResolveEngine engine;
@@ -164,7 +163,7 @@
         return options.getCache();
     }
 
-    public IvySettings getSettings() {
+    public ResolveEngineSettings getSettings() {
         return engine.getSettings();
     }
 

Modified: incubator/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/ResolveEngine.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/ResolveEngine.java?rev=573645&r1=573644&r2=573645&view=diff
==============================================================================
--- incubator/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/ResolveEngine.java (original)
+++ incubator/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/ResolveEngine.java Fri Sep
 7 10:53:21 2007
@@ -76,7 +76,7 @@
  * @see ResolveOptions
  */
 public class ResolveEngine {
-    private IvySettings settings;
+    private ResolveEngineSettings settings;
 
     private EventManager eventManager;
 
@@ -98,7 +98,7 @@
      *            the sort engine to use to sort modules before producing the dependency
resolution
      *            report. Must not be null.
      */
-    public ResolveEngine(IvySettings settings, EventManager eventManager, SortEngine sortEngine)
{
+    public ResolveEngine(ResolveEngineSettings settings, EventManager eventManager, SortEngine
sortEngine) {
         this.settings = settings;
         this.eventManager = eventManager;
         this.sortEngine = sortEngine;
@@ -311,7 +311,7 @@
                         .getArtifactResolver();
                 Artifact[] selectedArtifacts = dependencies[i].getSelectedArtifacts(artifactFilter);
                 DownloadReport dReport = resolver.download(selectedArtifacts, new DownloadOptions(
-                        settings, cacheManager, eventManager, useOrigin));
+                        cacheManager, eventManager, useOrigin));
                 ArtifactDownloadReport[] adrs = dReport.getArtifactsReports();
                 for (int j = 0; j < adrs.length; j++) {
                     if (adrs[j].getDownloadStatus() == DownloadStatus.FAILED) {
@@ -355,7 +355,7 @@
         DependencyResolver resolver = settings.getResolver(artifact.getModuleRevisionId()
                 .getModuleId());
         DownloadReport r = resolver.download(new Artifact[] {artifact}, new DownloadOptions(
-                settings, cacheManager, eventManager, useOrigin));
+                cacheManager, eventManager, useOrigin));
         return r.getArtifactReport(artifact);
     }
 
@@ -905,7 +905,7 @@
         return eventManager;
     }
 
-    public IvySettings getSettings() {
+    public ResolveEngineSettings getSettings() {
         return settings;
     }
 

Added: incubator/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/ResolveEngineSettings.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/ResolveEngineSettings.java?rev=573645&view=auto
==============================================================================
--- incubator/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/ResolveEngineSettings.java
(added)
+++ incubator/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/ResolveEngineSettings.java
Fri Sep  7 10:53:21 2007
@@ -0,0 +1,46 @@
+/*
+ *  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.ivy.core.resolve;
+
+import org.apache.ivy.core.module.id.ModuleId;
+import org.apache.ivy.plugins.conflict.ConflictManager;
+import org.apache.ivy.plugins.report.ReportOutputter;
+import org.apache.ivy.plugins.resolver.DependencyResolver;
+import org.apache.ivy.plugins.resolver.ResolverSettings;
+
+public interface ResolveEngineSettings extends ResolverSettings {
+
+    void setDictatorResolver(DependencyResolver dictatorResolver);
+
+    boolean debugConflictResolution();
+
+    ReportOutputter[] getReportOutputters();
+
+    DependencyResolver getResolver(ModuleId moduleId);
+
+    String getResolverName(ModuleId mid);
+
+    boolean logNotConvertedExclusionRule();
+
+    ConflictManager getConflictManager(ModuleId mid);
+
+    boolean logModuleWhenFound();
+
+    boolean logResolvedRevision();
+
+}

Propchange: incubator/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/ResolveEngineSettings.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/ivy/core/trunk/src/java/org/apache/ivy/core/retrieve/RetrieveEngine.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/core/retrieve/RetrieveEngine.java?rev=573645&r1=573644&r2=573645&view=diff
==============================================================================
--- incubator/ivy/core/trunk/src/java/org/apache/ivy/core/retrieve/RetrieveEngine.java (original)
+++ incubator/ivy/core/trunk/src/java/org/apache/ivy/core/retrieve/RetrieveEngine.java Fri
Sep  7 10:53:21 2007
@@ -42,7 +42,6 @@
 import org.apache.ivy.core.module.id.ModuleId;
 import org.apache.ivy.core.module.id.ModuleRevisionId;
 import org.apache.ivy.core.resolve.ResolveOptions;
-import org.apache.ivy.core.settings.IvySettings;
 import org.apache.ivy.plugins.parser.ModuleDescriptorParser;
 import org.apache.ivy.plugins.parser.ModuleDescriptorParserRegistry;
 import org.apache.ivy.plugins.report.XmlReportParser;
@@ -51,9 +50,9 @@
 import org.apache.ivy.util.Message;
 
 public class RetrieveEngine {
-    private IvySettings settings;
+    private RetrieveEngineSettings settings;
 
-    public RetrieveEngine(IvySettings settings) {
+    public RetrieveEngine(RetrieveEngineSettings settings) {
         this.settings = settings;
     }
 

Added: incubator/ivy/core/trunk/src/java/org/apache/ivy/core/retrieve/RetrieveEngineSettings.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/core/retrieve/RetrieveEngineSettings.java?rev=573645&view=auto
==============================================================================
--- incubator/ivy/core/trunk/src/java/org/apache/ivy/core/retrieve/RetrieveEngineSettings.java
(added)
+++ incubator/ivy/core/trunk/src/java/org/apache/ivy/core/retrieve/RetrieveEngineSettings.java
Fri Sep  7 10:53:21 2007
@@ -0,0 +1,30 @@
+/*
+ *  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.ivy.core.retrieve;
+
+import java.util.Map;
+
+import org.apache.ivy.plugins.parser.ParserSettings;
+
+public interface RetrieveEngineSettings extends ParserSettings {
+
+    boolean isCheckUpToDate();
+
+    Map getVariables();
+
+}

Propchange: incubator/ivy/core/trunk/src/java/org/apache/ivy/core/retrieve/RetrieveEngineSettings.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/ivy/core/trunk/src/java/org/apache/ivy/core/settings/IvySettings.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/core/settings/IvySettings.java?rev=573645&r1=573644&r2=573645&view=diff
==============================================================================
--- incubator/ivy/core/trunk/src/java/org/apache/ivy/core/settings/IvySettings.java (original)
+++ incubator/ivy/core/trunk/src/java/org/apache/ivy/core/settings/IvySettings.java Fri Sep
 7 10:53:21 2007
@@ -40,10 +40,15 @@
 import org.apache.ivy.core.IvyPatternHelper;
 import org.apache.ivy.core.NormalRelativeUrlResolver;
 import org.apache.ivy.core.RelativeUrlResolver;
+import org.apache.ivy.core.cache.CacheSettings;
+import org.apache.ivy.core.check.CheckEngineSettings;
 import org.apache.ivy.core.deliver.DeliverEngineSettings;
+import org.apache.ivy.core.install.InstallEngineSettings;
 import org.apache.ivy.core.module.id.ModuleId;
 import org.apache.ivy.core.module.status.StatusManager;
 import org.apache.ivy.core.publish.PublishEngineSettings;
+import org.apache.ivy.core.resolve.ResolveEngineSettings;
+import org.apache.ivy.core.retrieve.RetrieveEngineSettings;
 import org.apache.ivy.core.sort.SortEngineSettings;
 import org.apache.ivy.plugins.IvyAware;
 import org.apache.ivy.plugins.IvySettingsAware;
@@ -74,6 +79,7 @@
 import org.apache.ivy.plugins.resolver.ChainResolver;
 import org.apache.ivy.plugins.resolver.DependencyResolver;
 import org.apache.ivy.plugins.resolver.DualResolver;
+import org.apache.ivy.plugins.resolver.ResolverSettings;
 import org.apache.ivy.plugins.trigger.Trigger;
 import org.apache.ivy.plugins.version.ChainVersionMatcher;
 import org.apache.ivy.plugins.version.ExactVersionMatcher;
@@ -84,7 +90,9 @@
 import org.apache.ivy.util.Message;
 import org.apache.ivy.util.url.URLHandlerRegistry;
 
-public class IvySettings implements SortEngineSettings , PublishEngineSettings , ParserSettings
, DeliverEngineSettings {
+public class IvySettings implements SortEngineSettings, PublishEngineSettings, ParserSettings,
+        DeliverEngineSettings, CacheSettings, CheckEngineSettings, InstallEngineSettings,

+        ResolverSettings, ResolveEngineSettings, RetrieveEngineSettings {
     private static final String DEFAULT_CACHE_ARTIFACT_PATTERN =
         "[organisation]/[module]/[type]s/[artifact]-[revision](.[ext])";
 
@@ -1085,6 +1093,8 @@
     private void init(Object obj) {
         if (obj instanceof IvySettingsAware) {
             ((IvySettingsAware) obj).setSettings(this);
+        } else if (obj instanceof DependencyResolver){
+            ((DependencyResolver) obj).setSettings(this);
         }
         if (obj instanceof IvyAware) {
             // TODO

Modified: incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/AbstractResolver.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/AbstractResolver.java?rev=573645&r1=573644&r2=573645&view=diff
==============================================================================
--- incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/AbstractResolver.java
(original)
+++ incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/AbstractResolver.java
Fri Sep  7 10:53:21 2007
@@ -35,8 +35,6 @@
 import org.apache.ivy.core.search.ModuleEntry;
 import org.apache.ivy.core.search.OrganisationEntry;
 import org.apache.ivy.core.search.RevisionEntry;
-import org.apache.ivy.core.settings.IvySettings;
-import org.apache.ivy.plugins.IvySettingsAware;
 import org.apache.ivy.plugins.latest.LatestStrategy;
 import org.apache.ivy.plugins.matcher.Matcher;
 import org.apache.ivy.plugins.matcher.NoMatcher;
@@ -49,8 +47,7 @@
 /**
  * This abstract resolver only provides handling for resolver name
  */
-public abstract class AbstractResolver implements DependencyResolver, IvySettingsAware,
-        HasLatestStrategy {
+public abstract class AbstractResolver implements DependencyResolver, HasLatestStrategy {
 
     /**
      * True if parsed ivy files should be validated against xsd, false if they should not,
null if
@@ -64,7 +61,7 @@
 
     private String changingMatcherName = PatternMatcher.EXACT_OR_REGEXP;
 
-    private IvySettings settings;
+    private ResolverSettings settings;
 
     /**
      * The latest strategy to use to find latest among several artifacts
@@ -80,11 +77,11 @@
 
     private String namespaceName;
 
-    public IvySettings getSettings() {
+    public ResolverSettings getSettings() {
         return settings;
     }
 
-    public void setSettings(IvySettings ivy) {
+    public void setSettings(ResolverSettings ivy) {
         settings = ivy;
     }
 
@@ -170,7 +167,7 @@
      * avoid the download
      */
     public boolean exists(Artifact artifact) {
-        DownloadReport dr = download(new Artifact[] {artifact}, new DownloadOptions(getSettings(),
+        DownloadReport dr = download(new Artifact[] {artifact}, new DownloadOptions(
                 new CacheManager(getSettings(), getSettings().getDefaultCache()), null, true));
         ArtifactDownloadReport adr = dr.getArtifactReport(artifact);
         return adr.getDownloadStatus() != DownloadStatus.FAILED;

Modified: incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/CacheResolver.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/CacheResolver.java?rev=573645&r1=573644&r2=573645&view=diff
==============================================================================
--- incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/CacheResolver.java (original)
+++ incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/CacheResolver.java Fri
Sep  7 10:53:21 2007
@@ -37,7 +37,6 @@
 import org.apache.ivy.core.search.ModuleEntry;
 import org.apache.ivy.core.search.OrganisationEntry;
 import org.apache.ivy.core.search.RevisionEntry;
-import org.apache.ivy.core.settings.IvySettings;
 import org.apache.ivy.plugins.resolver.util.ResolvedResource;
 import org.apache.ivy.util.Message;
 
@@ -45,7 +44,7 @@
     public CacheResolver() {
     }
 
-    public CacheResolver(IvySettings settings) {
+    public CacheResolver(ResolverSettings settings) {
         setSettings(settings);
         setName("cache");
     }
@@ -158,7 +157,7 @@
         }
     }
 
-    private void ensureConfigured(IvySettings settings, File cache) {
+    private void ensureConfigured(ResolverSettings settings, File cache) {
         if (settings == null || cache == null) {
             return;
         }

Modified: incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/DependencyResolver.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/DependencyResolver.java?rev=573645&r1=573644&r2=573645&view=diff
==============================================================================
--- incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/DependencyResolver.java
(original)
+++ incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/DependencyResolver.java
Fri Sep  7 10:53:21 2007
@@ -95,4 +95,6 @@
     RevisionEntry[] listRevisions(ModuleEntry module);
 
     void dumpSettings();
+    
+    void setSettings(ResolverSettings settings);
 }

Modified: incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/IBiblioResolver.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/IBiblioResolver.java?rev=573645&r1=573644&r2=573645&view=diff
==============================================================================
--- incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/IBiblioResolver.java
(original)
+++ incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/IBiblioResolver.java
Fri Sep  7 10:53:21 2007
@@ -36,7 +36,6 @@
 import org.apache.ivy.core.search.ModuleEntry;
 import org.apache.ivy.core.search.OrganisationEntry;
 import org.apache.ivy.core.search.RevisionEntry;
-import org.apache.ivy.core.settings.IvySettings;
 import org.apache.ivy.plugins.resolver.util.ResolvedResource;
 import org.apache.ivy.util.Message;
 
@@ -89,7 +88,7 @@
         }
     }
 
-    public void ensureConfigured(IvySettings settings) {
+    public void ensureConfigured(ResolverSettings settings) {
         if (settings != null && (root == null || pattern == null)) {
             if (root == null) {
                 String root = settings.getVariable("ivy.ibiblio.default.artifact.root");
@@ -213,7 +212,7 @@
     }
 
     public DownloadReport download(Artifact[] artifacts, DownloadOptions options) {
-        ensureConfigured(options.getSettings());
+        ensureConfigured(getSettings());
         return super.download(artifacts, options);
     }
 

Modified: incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/IvyRepResolver.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/IvyRepResolver.java?rev=573645&r1=573644&r2=573645&view=diff
==============================================================================
--- incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/IvyRepResolver.java
(original)
+++ incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/IvyRepResolver.java
Fri Sep  7 10:53:21 2007
@@ -40,7 +40,6 @@
 import org.apache.ivy.core.search.ModuleEntry;
 import org.apache.ivy.core.search.OrganisationEntry;
 import org.apache.ivy.core.search.RevisionEntry;
-import org.apache.ivy.core.settings.IvySettings;
 import org.apache.ivy.plugins.resolver.util.ResolvedResource;
 import org.apache.ivy.util.Message;
 import org.apache.ivy.util.XMLHelper;
@@ -69,7 +68,7 @@
     public IvyRepResolver() {
     }
 
-    private void ensureArtifactConfigured(IvySettings settings) {
+    private void ensureArtifactConfigured(ResolverSettings settings) {
         if (settings != null && (artroot == null || artpattern == null)) {
             if (artroot == null) {
                 String root = settings.getVariable("ivy.ivyrep.default.artifact.root");
@@ -93,7 +92,7 @@
         }
     }
 
-    private void ensureIvyConfigured(IvySettings settings) {
+    private void ensureIvyConfigured(ResolverSettings settings) {
         if (settings != null && (ivyroot == null || ivypattern == null)) {
             if (ivyroot == null) {
                 String root = settings.getVariable("ivy.ivyrep.default.ivy.root");
@@ -281,7 +280,7 @@
     }
 
     public DownloadReport download(Artifact[] artifacts, DownloadOptions options) {
-        ensureArtifactConfigured(options.getSettings());
+        ensureArtifactConfigured(getSettings());
         return super.download(artifacts, options);
     }
 

Modified: incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/RepositoryResolver.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/RepositoryResolver.java?rev=573645&r1=573644&r2=573645&view=diff
==============================================================================
--- incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/RepositoryResolver.java
(original)
+++ incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/RepositoryResolver.java
Fri Sep  7 10:53:21 2007
@@ -34,7 +34,6 @@
 import org.apache.ivy.core.module.id.ModuleRevisionId;
 import org.apache.ivy.core.report.DownloadReport;
 import org.apache.ivy.core.resolve.DownloadOptions;
-import org.apache.ivy.core.settings.IvySettings;
 import org.apache.ivy.plugins.latest.LatestStrategy;
 import org.apache.ivy.plugins.repository.AbstractRepository;
 import org.apache.ivy.plugins.repository.Repository;
@@ -226,7 +225,7 @@
         Message.debug("\t\trepository: " + getRepository());
     }
 
-    public void setSettings(IvySettings settings) {
+    public void setSettings(ResolverSettings settings) {
         super.setSettings(settings);
         if (settings != null) {
             if (_alwaysCheckExactRevision == null) {

Added: incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/ResolverSettings.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/ResolverSettings.java?rev=573645&view=auto
==============================================================================
--- incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/ResolverSettings.java
(added)
+++ incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/ResolverSettings.java
Fri Sep  7 10:53:21 2007
@@ -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.ivy.plugins.resolver;
+
+import java.util.Collection;
+
+import org.apache.ivy.core.cache.CacheSettings;
+import org.apache.ivy.plugins.latest.LatestStrategy;
+import org.apache.ivy.plugins.namespace.Namespace;
+import org.apache.ivy.plugins.version.VersionMatcher;
+
+public interface ResolverSettings extends CacheSettings {
+
+    LatestStrategy getLatestStrategy(String latestStrategyName);
+
+    LatestStrategy getDefaultLatestStrategy();
+
+    Namespace getNamespace(String namespaceName);
+
+    Namespace getSystemNamespace();
+
+    String getVariable(String string);
+
+    void configureRepositories(boolean b);
+
+    VersionMatcher getVersionMatcher();
+
+    void filterIgnore(Collection names);
+
+}

Propchange: incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/resolver/ResolverSettings.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/resolver/URLResolverTest.java
URL: http://svn.apache.org/viewvc/incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/resolver/URLResolverTest.java?rev=573645&r1=573644&r2=573645&view=diff
==============================================================================
--- incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/resolver/URLResolverTest.java
(original)
+++ incubator/ivy/core/trunk/test/java/org/apache/ivy/plugins/resolver/URLResolverTest.java
Fri Sep  7 10:53:21 2007
@@ -335,7 +335,7 @@
         // test to ask to download
         DefaultArtifact artifact = new DefaultArtifact(mrid, pubdate, "mod1.1", "jar", "jar");
         DownloadReport report = resolver.download(new Artifact[] {artifact}, new DownloadOptions(
-                _settings, new CacheManager(_settings, _cache), null, true));
+                new CacheManager(_settings, _cache), null, true));
         assertNotNull(report);
 
         assertEquals(1, report.getArtifactsReports().length);



Mime
View raw message