archiva-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1582720 - /archiva/trunk/archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrRepositorySessionFactory.java
Date Fri, 28 Mar 2014 12:12:41 GMT
Author: olamy
Date: Fri Mar 28 12:12:41 2014
New Revision: 1582720

URL: http://svn.apache.org/r1582720
Log:
initialize not needed if we do not use this impl

Modified:
    archiva/trunk/archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrRepositorySessionFactory.java

Modified: archiva/trunk/archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrRepositorySessionFactory.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrRepositorySessionFactory.java?rev=1582720&r1=1582719&r2=1582720&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrRepositorySessionFactory.java
(original)
+++ archiva/trunk/archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrRepositorySessionFactory.java
Fri Mar 28 12:12:41 2014
@@ -24,6 +24,7 @@ import org.apache.archiva.metadata.repos
 import org.apache.archiva.metadata.repository.MetadataResolver;
 import org.apache.archiva.metadata.repository.RepositorySession;
 import org.apache.archiva.metadata.repository.RepositorySessionFactory;
+import org.apache.archiva.metadata.repository.RepositorySessionFactoryBean;
 import org.apache.commons.lang.StringUtils;
 import org.apache.commons.lang.time.StopWatch;
 import org.slf4j.Logger;
@@ -59,6 +60,9 @@ public class JcrRepositorySessionFactory
     @Inject
     private MetadataResolver metadataResolver;
 
+    @Inject
+    private RepositorySessionFactoryBean repositorySessionFactoryBean;
+
     public RepositorySession createSession()
     {
         try
@@ -83,6 +87,13 @@ public class JcrRepositorySessionFactory
     public void initialize()
         throws Exception
     {
+
+        // skip initialisation if not cassandra
+        if ( !StringUtils.equals( repositorySessionFactoryBean.getId(), "jcr" ) )
+        {
+            return;
+        }
+
         StopWatch stopWatch = new StopWatch();
         stopWatch.start();
 



Mime
View raw message