maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ogusa...@apache.org
Subject svn commit: r709794 - in /maven/mercury/trunk: mercury-md/mercury-md-sat/src/main/java/org/apache/maven/mercury/metadata/sat/ mercury-repo/mercury-repo-api/src/main/java/org/apache/maven/mercury/repository/api/ mercury-repo/mercury-repo-local-flat/src/...
Date Sat, 01 Nov 2008 22:37:03 GMT
Author: ogusakov
Date: Sat Nov  1 15:37:02 2008
New Revision: 709794

URL: http://svn.apache.org/viewvc?rev=709794&view=rev
Log:
http://jira.codehaus.org/browse/MERCURY-15

Added:
    maven/mercury/trunk/mercury-repo/mercury-repo-local-flat/src/main/java/org/apache/maven/mercury/repository/local/flat/LocalRepositoryFlat.java
  (contents, props changed)
      - copied, changed from r709632, maven/mercury/trunk/mercury-repo/mercury-repo-local-flat/src/main/java/org/apache/maven/mercury/repository/local/flat/LocalRepositoryM2.java
    maven/mercury/trunk/mercury-repo/mercury-repo-local-flat/src/main/java/org/apache/maven/mercury/repository/local/flat/LocalRepositoryReaderFlat.java
  (contents, props changed)
      - copied, changed from r709632, maven/mercury/trunk/mercury-repo/mercury-repo-local-flat/src/main/java/org/apache/maven/mercury/repository/local/flat/LocalRepositoryReaderM2.java
    maven/mercury/trunk/mercury-repo/mercury-repo-local-flat/src/main/java/org/apache/maven/mercury/repository/local/flat/LocalRepositoryReaderFlatFactory.java
  (contents, props changed)
      - copied, changed from r709632, maven/mercury/trunk/mercury-repo/mercury-repo-local-flat/src/main/java/org/apache/maven/mercury/repository/local/flat/LocalRepositoryReaderM2Factory.java
    maven/mercury/trunk/mercury-repo/mercury-repo-local-flat/src/main/java/org/apache/maven/mercury/repository/local/flat/LocalRepositoryWriterFlat.java
  (contents, props changed)
      - copied, changed from r709632, maven/mercury/trunk/mercury-repo/mercury-repo-local-flat/src/main/java/org/apache/maven/mercury/repository/local/flat/LocalRepositoryWriterM2.java
    maven/mercury/trunk/mercury-repo/mercury-repo-local-flat/src/main/java/org/apache/maven/mercury/repository/local/flat/LocalRepositoryWriterFlatFactory.java
  (contents, props changed)
      - copied, changed from r709632, maven/mercury/trunk/mercury-repo/mercury-repo-local-flat/src/main/java/org/apache/maven/mercury/repository/local/flat/LocalRepositoryWriterM2Factory.java
    maven/mercury/trunk/mercury-util/src/main/java/org/apache/maven/mercury/util/MercuryMonitor.java
Removed:
    maven/mercury/trunk/mercury-repo/mercury-repo-local-flat/src/main/java/org/apache/maven/mercury/repository/local/flat/LocalRepositoryM2.java
    maven/mercury/trunk/mercury-repo/mercury-repo-local-flat/src/main/java/org/apache/maven/mercury/repository/local/flat/LocalRepositoryReaderM2.java
    maven/mercury/trunk/mercury-repo/mercury-repo-local-flat/src/main/java/org/apache/maven/mercury/repository/local/flat/LocalRepositoryReaderM2Factory.java
    maven/mercury/trunk/mercury-repo/mercury-repo-local-flat/src/main/java/org/apache/maven/mercury/repository/local/flat/LocalRepositoryWriterM2.java
    maven/mercury/trunk/mercury-repo/mercury-repo-local-flat/src/main/java/org/apache/maven/mercury/repository/local/flat/LocalRepositoryWriterM2Factory.java
Modified:
    maven/mercury/trunk/mercury-md/mercury-md-sat/src/main/java/org/apache/maven/mercury/metadata/sat/DefaultSatSolver.java
    maven/mercury/trunk/mercury-md/mercury-md-sat/src/main/java/org/apache/maven/mercury/metadata/sat/SatContext.java
    maven/mercury/trunk/mercury-repo/mercury-repo-api/src/main/java/org/apache/maven/mercury/repository/api/AbstractRepository.java
    maven/mercury/trunk/mercury-repo/mercury-repo-api/src/main/java/org/apache/maven/mercury/repository/api/Repository.java
    maven/mercury/trunk/mercury-repo/mercury-repo-local-flat/src/main/java/org/apache/maven/mercury/repository/local/flat/ArtifactLocation.java
    maven/mercury/trunk/mercury-repo/mercury-repo-local-flat/src/test/java/org/apache/maven/mercury/repository/local/flat/MetadataProcessorMock.java
    maven/mercury/trunk/mercury-repo/mercury-repo-local-m2/src/main/java/org/apache/maven/mercury/repository/local/m2/LocalRepositoryM2.java

Modified: maven/mercury/trunk/mercury-md/mercury-md-sat/src/main/java/org/apache/maven/mercury/metadata/sat/DefaultSatSolver.java
URL: http://svn.apache.org/viewvc/maven/mercury/trunk/mercury-md/mercury-md-sat/src/main/java/org/apache/maven/mercury/metadata/sat/DefaultSatSolver.java?rev=709794&r1=709793&r2=709794&view=diff
==============================================================================
--- maven/mercury/trunk/mercury-md/mercury-md-sat/src/main/java/org/apache/maven/mercury/metadata/sat/DefaultSatSolver.java
(original)
+++ maven/mercury/trunk/mercury-md/mercury-md-sat/src/main/java/org/apache/maven/mercury/metadata/sat/DefaultSatSolver.java
Sat Nov  1 15:37:02 2008
@@ -8,7 +8,6 @@
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-import java.util.TreeSet;
 
 import org.apache.maven.mercury.artifact.ArtifactBasicMetadata;
 import org.apache.maven.mercury.artifact.ArtifactMetadata;
@@ -16,6 +15,8 @@
 import org.apache.maven.mercury.metadata.MetadataTreeNode;
 import org.apache.maven.mercury.metadata.MetadataTreeNodeGAComparator;
 import org.apache.maven.mercury.metadata.MetadataTreeNodeGAVComparator;
+import org.codehaus.plexus.lang.DefaultLanguage;
+import org.codehaus.plexus.lang.Language;
 import org.sat4j.core.Vec;
 import org.sat4j.core.VecInt;
 import org.sat4j.pb.IPBSolver;
@@ -35,7 +36,8 @@
 public class DefaultSatSolver
 implements SatSolver
 {
-//  private static final Log _log = LogFactoryImpl.getLog( DefaultSatSolver.class );
+  private static final org.slf4j.Logger _log = org.slf4j.LoggerFactory.getLogger( DefaultSatSolver.class
); 
+  private static final Language _lang = new DefaultLanguage( DefaultSatSolver.class );
   
   protected SatContext _context;
   protected IPBSolver _solver = SolverFactory.newEclipseP2();
@@ -281,7 +283,9 @@
   {
     _solver.addPseudoBoolean( lits, coeff, ge, cardinality );
     
-    System.out.print("PB: ");
+if( _log.isDebugEnabled() )
+  _log.debug("PB: ");
+    
     for( int i=0; i<lits.size(); i++ )
     {
       int co = Integer.parseInt( ""+coeff.get(i) );
@@ -289,9 +293,11 @@
       int    val = Math.abs(co);
       String space = val == 1 ? "" : " ";
       
-      System.out.print( " " + sign + (val==1?"":val) + space  + "x"+lits.get(i) );
+if( _log.isDebugEnabled() )
+  _log.debug( " " + sign + (val==1?"":val) + space  + "x"+lits.get(i) );
     }
-    System.out.println(( ge ? " >= " : " < ")+" "+cardinality );
+if( _log.isDebugEnabled() )
+  _log.debug(( ge ? " >= " : " < ")+" "+cardinality );
   }
   //-----------------------------------------------------------------------
   private final Map<ArtifactBasicMetadata, List<MetadataTreeNode>> processChildren(

Modified: maven/mercury/trunk/mercury-md/mercury-md-sat/src/main/java/org/apache/maven/mercury/metadata/sat/SatContext.java
URL: http://svn.apache.org/viewvc/maven/mercury/trunk/mercury-md/mercury-md-sat/src/main/java/org/apache/maven/mercury/metadata/sat/SatContext.java?rev=709794&r1=709793&r2=709794&view=diff
==============================================================================
--- maven/mercury/trunk/mercury-md/mercury-md-sat/src/main/java/org/apache/maven/mercury/metadata/sat/SatContext.java
(original)
+++ maven/mercury/trunk/mercury-md/mercury-md-sat/src/main/java/org/apache/maven/mercury/metadata/sat/SatContext.java
Sat Nov  1 15:37:02 2008
@@ -13,6 +13,8 @@
   */
 class SatContext
 {
+  private static final org.slf4j.Logger _log = org.slf4j.LoggerFactory.getLogger( SatContext.class
);
+
   List<SatVar> variables;
   int varCount = 0;
   //-----------------------------------------------------------------------
@@ -32,7 +34,8 @@
       {
         if( var._md.sameGAV(md) )
         {
-System.out.println(md+" -> x"+var._literal);
+if( _log.isDebugEnabled() )
+  _log.debug(md+" -> x"+var._literal);
           return var;
         }
       }
@@ -41,7 +44,9 @@
     SatVar var = new SatVar( md, ++varCount );
     variables.add( var );
     
-System.out.println(md+" -> x"+var._literal);
+if( _log.isDebugEnabled() )
+  _log.debug(md+" -> x"+var._literal);
+
     return var; 
   }
   //-----------------------------------------------------------------------

Modified: maven/mercury/trunk/mercury-repo/mercury-repo-api/src/main/java/org/apache/maven/mercury/repository/api/AbstractRepository.java
URL: http://svn.apache.org/viewvc/maven/mercury/trunk/mercury-repo/mercury-repo-api/src/main/java/org/apache/maven/mercury/repository/api/AbstractRepository.java?rev=709794&r1=709793&r2=709794&view=diff
==============================================================================
--- maven/mercury/trunk/mercury-repo/mercury-repo-api/src/main/java/org/apache/maven/mercury/repository/api/AbstractRepository.java
(original)
+++ maven/mercury/trunk/mercury-repo/mercury-repo-api/src/main/java/org/apache/maven/mercury/repository/api/AbstractRepository.java
Sat Nov  1 15:37:02 2008
@@ -60,6 +60,7 @@
   
   protected QualityRange       versionRangeQualityRange = QualityRange.ALL;
 
+  protected DependencyProcessor dependencyProcessor;
   protected RepositoryReader   reader;
   protected RepositoryWriter   writer;
   
@@ -225,5 +226,18 @@
     return metadataName;
   }
   //---------------------------------------------------------------------------
+  public boolean hasDependencyProcessor()
+  {
+    return dependencyProcessor == null;
+  }
+  public DependencyProcessor getDependencyProcessor()
+  {
+    return dependencyProcessor;
+  }
+  public void setDependencyProcessor( DependencyProcessor dependencyProcessor )
+  {
+    this.dependencyProcessor = dependencyProcessor;
+  }
+  //---------------------------------------------------------------------------
   //---------------------------------------------------------------------------
 }

Modified: maven/mercury/trunk/mercury-repo/mercury-repo-api/src/main/java/org/apache/maven/mercury/repository/api/Repository.java
URL: http://svn.apache.org/viewvc/maven/mercury/trunk/mercury-repo/mercury-repo-api/src/main/java/org/apache/maven/mercury/repository/api/Repository.java?rev=709794&r1=709793&r2=709794&view=diff
==============================================================================
--- maven/mercury/trunk/mercury-repo/mercury-repo-api/src/main/java/org/apache/maven/mercury/repository/api/Repository.java
(original)
+++ maven/mercury/trunk/mercury-repo/mercury-repo-api/src/main/java/org/apache/maven/mercury/repository/api/Repository.java
Sat Nov  1 15:37:02 2008
@@ -118,6 +118,15 @@
      */
     boolean hasServer();
     Server getServer();
+    
+    /**
+     * DependencyProcessor used by this repo resides
+     * 
+     * @return server
+     */
+    boolean hasDependencyProcessor();
+    DependencyProcessor getDependencyProcessor();
+    void setDependencyProcessor( DependencyProcessor dependencyProcessor );
 
     /**
      * maven-metadata.xml file name for this repository. This is internal to repository and
should never be used 

Modified: maven/mercury/trunk/mercury-repo/mercury-repo-local-flat/src/main/java/org/apache/maven/mercury/repository/local/flat/ArtifactLocation.java
URL: http://svn.apache.org/viewvc/maven/mercury/trunk/mercury-repo/mercury-repo-local-flat/src/main/java/org/apache/maven/mercury/repository/local/flat/ArtifactLocation.java?rev=709794&r1=709793&r2=709794&view=diff
==============================================================================
--- maven/mercury/trunk/mercury-repo/mercury-repo-local-flat/src/main/java/org/apache/maven/mercury/repository/local/flat/ArtifactLocation.java
(original)
+++ maven/mercury/trunk/mercury-repo/mercury-repo-local-flat/src/main/java/org/apache/maven/mercury/repository/local/flat/ArtifactLocation.java
Sat Nov  1 15:37:02 2008
@@ -1,4 +1,4 @@
-package org.apache.maven.mercury.repository.local.m2;
+package org.apache.maven.mercury.repository.local.flat;
 
 import org.apache.maven.mercury.artifact.ArtifactBasicMetadata;
 import org.apache.maven.mercury.artifact.version.DefaultArtifactVersion;

Copied: maven/mercury/trunk/mercury-repo/mercury-repo-local-flat/src/main/java/org/apache/maven/mercury/repository/local/flat/LocalRepositoryFlat.java
(from r709632, maven/mercury/trunk/mercury-repo/mercury-repo-local-flat/src/main/java/org/apache/maven/mercury/repository/local/flat/LocalRepositoryM2.java)
URL: http://svn.apache.org/viewvc/maven/mercury/trunk/mercury-repo/mercury-repo-local-flat/src/main/java/org/apache/maven/mercury/repository/local/flat/LocalRepositoryFlat.java?p2=maven/mercury/trunk/mercury-repo/mercury-repo-local-flat/src/main/java/org/apache/maven/mercury/repository/local/flat/LocalRepositoryFlat.java&p1=maven/mercury/trunk/mercury-repo/mercury-repo-local-flat/src/main/java/org/apache/maven/mercury/repository/local/flat/LocalRepositoryM2.java&r1=709632&r2=709794&rev=709794&view=diff
==============================================================================
--- maven/mercury/trunk/mercury-repo/mercury-repo-local-flat/src/main/java/org/apache/maven/mercury/repository/local/flat/LocalRepositoryM2.java
(original)
+++ maven/mercury/trunk/mercury-repo/mercury-repo-local-flat/src/main/java/org/apache/maven/mercury/repository/local/flat/LocalRepositoryFlat.java
Sat Nov  1 15:37:02 2008
@@ -1,4 +1,4 @@
-package org.apache.maven.mercury.repository.local.m2;
+package org.apache.maven.mercury.repository.local.flat;
 
 import java.io.File;
 
@@ -10,35 +10,21 @@
 import org.apache.maven.mercury.repository.api.RepositoryWriter;
 import org.apache.maven.mercury.transport.api.Server;
 
-public class LocalRepositoryM2
+public class LocalRepositoryFlat
 extends AbstractRepository
 implements LocalRepository
 {
+  public static final String FLAT_REPOSITORY_TYPE = "flat";
+  
     private File directory;
     
     private static final String METADATA_NAME = "maven-metadata-local.xml";
 
     //----------------------------------------------------------------------------------
-    public LocalRepositoryM2( Server server )
+    public LocalRepositoryFlat( String id, File directory )
     {
-        super( server.getId(), DEFAULT_REPOSITORY_TYPE );
-        this.directory = new File( server.getURL().getFile() );
-        this.server = server;
-        this.metadataName = METADATA_NAME;
-    }
-    //----------------------------------------------------------------------------------
-    public LocalRepositoryM2( String id, File directory )
-    {
-        super( id, DEFAULT_REPOSITORY_TYPE );
-        this.directory = directory;
-        this.metadataName = METADATA_NAME;
-    }
-    //----------------------------------------------------------------------------------
-    public LocalRepositoryM2( String id, File directory, String type )
-    {
-        super( id, type );
+        super( id, FLAT_REPOSITORY_TYPE );
         this.directory = directory;
-        this.metadataName = METADATA_NAME;
     }
     //----------------------------------------------------------------------------------
     public File getDirectory()
@@ -49,7 +35,7 @@
     public RepositoryReader getReader( DependencyProcessor processor ) 
     {
       if( reader == null )
-        reader = new LocalRepositoryReaderM2( this, processor );
+        reader = new LocalRepositoryReaderFlat( this, processor );
 
       return reader;
     }
@@ -64,7 +50,7 @@
     public RepositoryWriter getWriter()
     {
       if( writer == null )
-        writer = new LocalRepositoryWriterM2(this);
+        writer = new LocalRepositoryWriterFlat(this);
       
       return writer;
     }

Propchange: maven/mercury/trunk/mercury-repo/mercury-repo-local-flat/src/main/java/org/apache/maven/mercury/repository/local/flat/LocalRepositoryFlat.java
------------------------------------------------------------------------------
    svn:mergeinfo = 

Copied: maven/mercury/trunk/mercury-repo/mercury-repo-local-flat/src/main/java/org/apache/maven/mercury/repository/local/flat/LocalRepositoryReaderFlat.java
(from r709632, maven/mercury/trunk/mercury-repo/mercury-repo-local-flat/src/main/java/org/apache/maven/mercury/repository/local/flat/LocalRepositoryReaderM2.java)
URL: http://svn.apache.org/viewvc/maven/mercury/trunk/mercury-repo/mercury-repo-local-flat/src/main/java/org/apache/maven/mercury/repository/local/flat/LocalRepositoryReaderFlat.java?p2=maven/mercury/trunk/mercury-repo/mercury-repo-local-flat/src/main/java/org/apache/maven/mercury/repository/local/flat/LocalRepositoryReaderFlat.java&p1=maven/mercury/trunk/mercury-repo/mercury-repo-local-flat/src/main/java/org/apache/maven/mercury/repository/local/flat/LocalRepositoryReaderM2.java&r1=709632&r2=709794&rev=709794&view=diff
==============================================================================
--- maven/mercury/trunk/mercury-repo/mercury-repo-local-flat/src/main/java/org/apache/maven/mercury/repository/local/flat/LocalRepositoryReaderM2.java
(original)
+++ maven/mercury/trunk/mercury-repo/mercury-repo-local-flat/src/main/java/org/apache/maven/mercury/repository/local/flat/LocalRepositoryReaderFlat.java
Sat Nov  1 15:37:02 2008
@@ -1,4 +1,4 @@
-package org.apache.maven.mercury.repository.local.m2;
+package org.apache.maven.mercury.repository.local.flat;
 
 import java.io.File;
 import java.io.FileInputStream;
@@ -36,19 +36,19 @@
 import org.codehaus.plexus.lang.DefaultLanguage;
 import org.codehaus.plexus.lang.Language;
 
-public class LocalRepositoryReaderM2
+public class LocalRepositoryReaderFlat
 extends AbstracRepositoryReader
 implements RepositoryReader, MetadataReader
 {
-  private static final org.slf4j.Logger _log = org.slf4j.LoggerFactory.getLogger( LocalRepositoryReaderM2.class
); 
-  private static final Language _lang = new DefaultLanguage( LocalRepositoryReaderM2.class
);
+  private static final org.slf4j.Logger _log = org.slf4j.LoggerFactory.getLogger( LocalRepositoryReaderFlat.class
); 
+  private static final Language _lang = new DefaultLanguage( LocalRepositoryReaderFlat.class
);
   //---------------------------------------------------------------------------------------------------------------
   private static final String [] _protocols = new String [] { "file" };
   
   LocalRepository _repo;
   File _repoDir;
   //---------------------------------------------------------------------------------------------------------------
-  public LocalRepositoryReaderM2( LocalRepository repo, DependencyProcessor mdProcessor )
+  public LocalRepositoryReaderFlat( LocalRepository repo, DependencyProcessor mdProcessor
)
   {
     if( repo == null )
       throw new IllegalArgumentException("localRepo cannot be null");

Propchange: maven/mercury/trunk/mercury-repo/mercury-repo-local-flat/src/main/java/org/apache/maven/mercury/repository/local/flat/LocalRepositoryReaderFlat.java
------------------------------------------------------------------------------
    svn:mergeinfo = 

Copied: maven/mercury/trunk/mercury-repo/mercury-repo-local-flat/src/main/java/org/apache/maven/mercury/repository/local/flat/LocalRepositoryReaderFlatFactory.java
(from r709632, maven/mercury/trunk/mercury-repo/mercury-repo-local-flat/src/main/java/org/apache/maven/mercury/repository/local/flat/LocalRepositoryReaderM2Factory.java)
URL: http://svn.apache.org/viewvc/maven/mercury/trunk/mercury-repo/mercury-repo-local-flat/src/main/java/org/apache/maven/mercury/repository/local/flat/LocalRepositoryReaderFlatFactory.java?p2=maven/mercury/trunk/mercury-repo/mercury-repo-local-flat/src/main/java/org/apache/maven/mercury/repository/local/flat/LocalRepositoryReaderFlatFactory.java&p1=maven/mercury/trunk/mercury-repo/mercury-repo-local-flat/src/main/java/org/apache/maven/mercury/repository/local/flat/LocalRepositoryReaderM2Factory.java&r1=709632&r2=709794&rev=709794&view=diff
==============================================================================
--- maven/mercury/trunk/mercury-repo/mercury-repo-local-flat/src/main/java/org/apache/maven/mercury/repository/local/flat/LocalRepositoryReaderM2Factory.java
(original)
+++ maven/mercury/trunk/mercury-repo/mercury-repo-local-flat/src/main/java/org/apache/maven/mercury/repository/local/flat/LocalRepositoryReaderFlatFactory.java
Sat Nov  1 15:37:02 2008
@@ -1,4 +1,4 @@
-package org.apache.maven.mercury.repository.local.m2;
+package org.apache.maven.mercury.repository.local.flat;
 
 import org.apache.maven.mercury.builder.api.DependencyProcessor;
 import org.apache.maven.mercury.repository.api.AbstractRepository;
@@ -10,11 +10,11 @@
 import org.codehaus.plexus.lang.DefaultLanguage;
 import org.codehaus.plexus.lang.Language;
 
-public class LocalRepositoryReaderM2Factory
+public class LocalRepositoryReaderFlatFactory
 implements RepositoryReaderFactory
 {
-  private static final Language lang = new DefaultLanguage( LocalRepositoryReaderM2Factory.class
);
-  private static final LocalRepositoryReaderM2Factory factory = new LocalRepositoryReaderM2Factory();
+  private static final Language lang = new DefaultLanguage( LocalRepositoryReaderFlatFactory.class
);
+  private static final LocalRepositoryReaderFlatFactory factory = new LocalRepositoryReaderFlatFactory();
   
   static 
   {
@@ -27,7 +27,7 @@
     if( repo == null || !(repo instanceof LocalRepository) )
       throw new RepositoryException( lang.getMessage( "bad.repository.type", repo == null
? "null" : repo.getClass().getName() ) );
     
-    return new LocalRepositoryReaderM2( (LocalRepository)repo, mdProcessor );
+    return new LocalRepositoryReaderFlat( (LocalRepository)repo, mdProcessor );
   }
 
 }

Propchange: maven/mercury/trunk/mercury-repo/mercury-repo-local-flat/src/main/java/org/apache/maven/mercury/repository/local/flat/LocalRepositoryReaderFlatFactory.java
------------------------------------------------------------------------------
    svn:mergeinfo = 

Copied: maven/mercury/trunk/mercury-repo/mercury-repo-local-flat/src/main/java/org/apache/maven/mercury/repository/local/flat/LocalRepositoryWriterFlat.java
(from r709632, maven/mercury/trunk/mercury-repo/mercury-repo-local-flat/src/main/java/org/apache/maven/mercury/repository/local/flat/LocalRepositoryWriterM2.java)
URL: http://svn.apache.org/viewvc/maven/mercury/trunk/mercury-repo/mercury-repo-local-flat/src/main/java/org/apache/maven/mercury/repository/local/flat/LocalRepositoryWriterFlat.java?p2=maven/mercury/trunk/mercury-repo/mercury-repo-local-flat/src/main/java/org/apache/maven/mercury/repository/local/flat/LocalRepositoryWriterFlat.java&p1=maven/mercury/trunk/mercury-repo/mercury-repo-local-flat/src/main/java/org/apache/maven/mercury/repository/local/flat/LocalRepositoryWriterM2.java&r1=709632&r2=709794&rev=709794&view=diff
==============================================================================
--- maven/mercury/trunk/mercury-repo/mercury-repo-local-flat/src/main/java/org/apache/maven/mercury/repository/local/flat/LocalRepositoryWriterM2.java
(original)
+++ maven/mercury/trunk/mercury-repo/mercury-repo-local-flat/src/main/java/org/apache/maven/mercury/repository/local/flat/LocalRepositoryWriterFlat.java
Sat Nov  1 15:37:02 2008
@@ -1,4 +1,4 @@
-package org.apache.maven.mercury.repository.local.m2;
+package org.apache.maven.mercury.repository.local.flat;
 
 import java.io.ByteArrayInputStream;
 import java.io.File;
@@ -39,7 +39,7 @@
 import org.codehaus.plexus.lang.DefaultLanguage;
 import org.codehaus.plexus.lang.Language;
 
-public class LocalRepositoryWriterM2
+public class LocalRepositoryWriterFlat
 extends AbstractRepositoryWriter
 implements RepositoryWriter
 {
@@ -53,8 +53,8 @@
   
   public static final long SLEEP_FOR_LOCK_TICK = 5l;
 
-  private static final org.slf4j.Logger _log = org.slf4j.LoggerFactory.getLogger( LocalRepositoryWriterM2.class
); 
-  private static final Language _lang = new DefaultLanguage( LocalRepositoryWriterM2.class
);
+  private static final org.slf4j.Logger _log = org.slf4j.LoggerFactory.getLogger( LocalRepositoryWriterFlat.class
); 
+  private static final Language _lang = new DefaultLanguage( LocalRepositoryWriterFlat.class
);
   //---------------------------------------------------------------------------------------------------------------
   private static final String [] _protocols = new String [] { "file" };
   
@@ -64,7 +64,7 @@
 
   private static final ArifactWriteData LAST_ARTIFACT = new ArifactWriteData( null, null
);
   //---------------------------------------------------------------------------------------------------------------
-  public LocalRepositoryWriterM2( LocalRepository repo )
+  public LocalRepositoryWriterFlat( LocalRepository repo )
   {
     if( repo == null )
       throw new IllegalArgumentException("localRepo cannot be null");
@@ -80,7 +80,7 @@
     _aq = null;
   }
   //---------------------------------------------------------------------------------------------------------------
-  private LocalRepositoryWriterM2( LocalRepository repo, File repoDir, ArtifactQueue aq )
+  private LocalRepositoryWriterFlat( LocalRepository repo, File repoDir, ArtifactQueue aq
)
   {
     _repo = repo;
     _repoDir = repoDir;
@@ -117,11 +117,11 @@
       nWorkers = artifacts.size();
     
     ArtifactQueue aq = new ArtifactQueue();
-    LocalRepositoryWriterM2 [] workers = new LocalRepositoryWriterM2[ nWorkers ];
+    LocalRepositoryWriterFlat [] workers = new LocalRepositoryWriterFlat[ nWorkers ];
     
     for( int i=0; i<nWorkers; i++ )
     {
-      workers[ i ] = new LocalRepositoryWriterM2( _repo, _repoDir, aq );
+      workers[ i ] = new LocalRepositoryWriterFlat( _repo, _repoDir, aq );
       workers[ i ].start();
     }
     

Propchange: maven/mercury/trunk/mercury-repo/mercury-repo-local-flat/src/main/java/org/apache/maven/mercury/repository/local/flat/LocalRepositoryWriterFlat.java
------------------------------------------------------------------------------
    svn:mergeinfo = 

Copied: maven/mercury/trunk/mercury-repo/mercury-repo-local-flat/src/main/java/org/apache/maven/mercury/repository/local/flat/LocalRepositoryWriterFlatFactory.java
(from r709632, maven/mercury/trunk/mercury-repo/mercury-repo-local-flat/src/main/java/org/apache/maven/mercury/repository/local/flat/LocalRepositoryWriterM2Factory.java)
URL: http://svn.apache.org/viewvc/maven/mercury/trunk/mercury-repo/mercury-repo-local-flat/src/main/java/org/apache/maven/mercury/repository/local/flat/LocalRepositoryWriterFlatFactory.java?p2=maven/mercury/trunk/mercury-repo/mercury-repo-local-flat/src/main/java/org/apache/maven/mercury/repository/local/flat/LocalRepositoryWriterFlatFactory.java&p1=maven/mercury/trunk/mercury-repo/mercury-repo-local-flat/src/main/java/org/apache/maven/mercury/repository/local/flat/LocalRepositoryWriterM2Factory.java&r1=709632&r2=709794&rev=709794&view=diff
==============================================================================
--- maven/mercury/trunk/mercury-repo/mercury-repo-local-flat/src/main/java/org/apache/maven/mercury/repository/local/flat/LocalRepositoryWriterM2Factory.java
(original)
+++ maven/mercury/trunk/mercury-repo/mercury-repo-local-flat/src/main/java/org/apache/maven/mercury/repository/local/flat/LocalRepositoryWriterFlatFactory.java
Sat Nov  1 15:37:02 2008
@@ -1,4 +1,4 @@
-package org.apache.maven.mercury.repository.local.m2;
+package org.apache.maven.mercury.repository.local.flat;
 
 import org.apache.maven.mercury.repository.api.AbstractRepository;
 import org.apache.maven.mercury.repository.api.LocalRepository;
@@ -9,15 +9,15 @@
 import org.codehaus.plexus.lang.DefaultLanguage;
 import org.codehaus.plexus.lang.Language;
 
-public class LocalRepositoryWriterM2Factory
+public class LocalRepositoryWriterFlatFactory
 implements RepositoryWriterFactory
 {
-  private static final Language lang = new DefaultLanguage( LocalRepositoryWriterM2Factory.class
);
-  private static final LocalRepositoryWriterM2Factory factory = new LocalRepositoryWriterM2Factory();
+  private static final Language lang = new DefaultLanguage( LocalRepositoryWriterFlatFactory.class
);
+  private static final LocalRepositoryWriterFlatFactory factory = new LocalRepositoryWriterFlatFactory();
   
   static 
   {
-    AbstractRepository.register( AbstractRepository.DEFAULT_REPOSITORY_TYPE, factory  );
+    AbstractRepository.register( LocalRepositoryFlat.FLAT_REPOSITORY_TYPE, factory  );
   }
   
   public RepositoryWriter getWriter( Repository repo )
@@ -26,7 +26,7 @@
     if( repo == null || !(repo instanceof LocalRepository) )
       throw new RepositoryException( lang.getMessage( "bad.repository.type", repo == null
? "null" : repo.getClass().getName() ) );
     
-    return new LocalRepositoryWriterM2( (LocalRepository)repo );
+    return new LocalRepositoryWriterFlat( (LocalRepository)repo );
   }
 
 }

Propchange: maven/mercury/trunk/mercury-repo/mercury-repo-local-flat/src/main/java/org/apache/maven/mercury/repository/local/flat/LocalRepositoryWriterFlatFactory.java
------------------------------------------------------------------------------
    svn:mergeinfo = 

Modified: maven/mercury/trunk/mercury-repo/mercury-repo-local-flat/src/test/java/org/apache/maven/mercury/repository/local/flat/MetadataProcessorMock.java
URL: http://svn.apache.org/viewvc/maven/mercury/trunk/mercury-repo/mercury-repo-local-flat/src/test/java/org/apache/maven/mercury/repository/local/flat/MetadataProcessorMock.java?rev=709794&r1=709793&r2=709794&view=diff
==============================================================================
--- maven/mercury/trunk/mercury-repo/mercury-repo-local-flat/src/test/java/org/apache/maven/mercury/repository/local/flat/MetadataProcessorMock.java
(original)
+++ maven/mercury/trunk/mercury-repo/mercury-repo-local-flat/src/test/java/org/apache/maven/mercury/repository/local/flat/MetadataProcessorMock.java
Sat Nov  1 15:37:02 2008
@@ -1,4 +1,4 @@
-package org.apache.maven.mercury.repository.local.m2;
+package org.apache.maven.mercury.repository.local.flat;
 
 import java.io.ByteArrayInputStream;
 import java.io.IOException;

Modified: maven/mercury/trunk/mercury-repo/mercury-repo-local-m2/src/main/java/org/apache/maven/mercury/repository/local/m2/LocalRepositoryM2.java
URL: http://svn.apache.org/viewvc/maven/mercury/trunk/mercury-repo/mercury-repo-local-m2/src/main/java/org/apache/maven/mercury/repository/local/m2/LocalRepositoryM2.java?rev=709794&r1=709793&r2=709794&view=diff
==============================================================================
--- maven/mercury/trunk/mercury-repo/mercury-repo-local-m2/src/main/java/org/apache/maven/mercury/repository/local/m2/LocalRepositoryM2.java
(original)
+++ maven/mercury/trunk/mercury-repo/mercury-repo-local-m2/src/main/java/org/apache/maven/mercury/repository/local/m2/LocalRepositoryM2.java
Sat Nov  1 15:37:02 2008
@@ -19,10 +19,21 @@
     private static final String METADATA_NAME = "maven-metadata-local.xml";
 
     //----------------------------------------------------------------------------------
+    private void setDirectory( File directory )
+    {
+      if( directory == null )
+        throw new IllegalArgumentException( "null.directory" );
+      
+      if( !directory.exists() )
+        directory.mkdirs();
+
+      this.directory = directory;
+    }
+    //----------------------------------------------------------------------------------
     public LocalRepositoryM2( Server server )
     {
         super( server.getId(), DEFAULT_REPOSITORY_TYPE );
-        this.directory = new File( server.getURL().getFile() );
+        setDirectory( new File( server.getURL().getFile() ) );
         this.server = server;
         this.metadataName = METADATA_NAME;
     }
@@ -30,14 +41,14 @@
     public LocalRepositoryM2( String id, File directory )
     {
         super( id, DEFAULT_REPOSITORY_TYPE );
-        this.directory = directory;
+        setDirectory( directory );
         this.metadataName = METADATA_NAME;
     }
     //----------------------------------------------------------------------------------
     public LocalRepositoryM2( String id, File directory, String type )
     {
         super( id, type );
-        this.directory = directory;
+        setDirectory( directory );
         this.metadataName = METADATA_NAME;
     }
     //----------------------------------------------------------------------------------

Added: maven/mercury/trunk/mercury-util/src/main/java/org/apache/maven/mercury/util/MercuryMonitor.java
URL: http://svn.apache.org/viewvc/maven/mercury/trunk/mercury-util/src/main/java/org/apache/maven/mercury/util/MercuryMonitor.java?rev=709794&view=auto
==============================================================================
--- maven/mercury/trunk/mercury-util/src/main/java/org/apache/maven/mercury/util/MercuryMonitor.java
(added)
+++ maven/mercury/trunk/mercury-util/src/main/java/org/apache/maven/mercury/util/MercuryMonitor.java
Sat Nov  1 15:37:02 2008
@@ -0,0 +1,69 @@
+package org.apache.maven.mercury.util;
+
+/**
+ *
+ *
+ * @author Oleg Gusakov
+ * @version $Id$
+ *
+ */
+public class MercuryMonitor
+{
+  private final org.slf4j.Logger _log;
+
+  public MercuryMonitor( Class clazz )
+  {
+    _log = org.slf4j.LoggerFactory.getLogger( clazz ); 
+  }
+  
+  public void info( String msg )
+  {
+    _log.info( msg );
+  }
+  
+  public boolean isInfoEnabled()
+  {
+    return _log.isInfoEnabled();
+  }
+  
+  public void warn( String msg )
+  {
+    _log.warn( msg );
+  }
+  
+  public boolean isWarnEnabled()
+  {
+    return _log.isWarnEnabled();
+  }
+  
+  public void error( String msg )
+  {
+    _log.error( msg );
+  }
+  
+  public boolean isErrorEnabled()
+  {
+    return _log.isErrorEnabled();
+  }
+  
+  public void debug( String msg )
+  {
+    _log.debug( msg );
+  }
+  
+  public boolean isDebugEnabled()
+  {
+    return _log.isInfoEnabled();
+  }
+  
+  public void trace( String msg )
+  {
+    _log.trace( msg );
+  }
+  
+  public boolean isTraceEnabled()
+  {
+    return _log.isTraceEnabled();
+  }
+
+}



Mime
View raw message