aboutsummaryrefslogtreecommitdiffstats
path: root/archiva-modules/plugins/metadata-store-jcr
diff options
context:
space:
mode:
authorBrett Porter <brett@apache.org>2010-12-30 08:44:10 +0000
committerBrett Porter <brett@apache.org>2010-12-30 08:44:10 +0000
commit479f10cb7fc099f0faa0c197e5426bfd3777b5e9 (patch)
tree5a13dd66315e0a6d273c2219e6ec525cb8af3772 /archiva-modules/plugins/metadata-store-jcr
parented717a4b5bf19c91539191115d5e81918ca62995 (diff)
downloadarchiva-479f10cb7fc099f0faa0c197e5426bfd3777b5e9.tar.gz
archiva-479f10cb7fc099f0faa0c197e5426bfd3777b5e9.zip
[MRM-1443, MRM-1327] allow repository-statistics module to optimise statistics generation if JCR store is available
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1053820 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules/plugins/metadata-store-jcr')
-rw-r--r--archiva-modules/plugins/metadata-store-jcr/pom.xml4
-rw-r--r--archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrMetadataRepository.java15
2 files changed, 15 insertions, 4 deletions
diff --git a/archiva-modules/plugins/metadata-store-jcr/pom.xml b/archiva-modules/plugins/metadata-store-jcr/pom.xml
index 4874623e6..ebcc3d7c7 100644
--- a/archiva-modules/plugins/metadata-store-jcr/pom.xml
+++ b/archiva-modules/plugins/metadata-store-jcr/pom.xml
@@ -49,21 +49,17 @@
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-spring</artifactId>
</dependency>
- <!-- FIXME: dependency management -->
<dependency>
<groupId>javax.jcr</groupId>
<artifactId>jcr</artifactId>
- <version>2.0</version>
</dependency>
<dependency>
<groupId>org.apache.jackrabbit</groupId>
<artifactId>jackrabbit-jcr-commons</artifactId>
- <version>${jackrabbit.version}</version>
</dependency>
<dependency>
<groupId>org.apache.jackrabbit</groupId>
<artifactId>jackrabbit-core</artifactId>
- <version>${jackrabbit.version}</version>
<scope>test</scope>
<!-- could trim more, but since it's just for test we don't need to worry -->
<exclusions>
diff --git a/archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrMetadataRepository.java b/archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrMetadataRepository.java
index d7117fad0..b1e5f548d 100644
--- a/archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrMetadataRepository.java
+++ b/archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrMetadataRepository.java
@@ -1037,6 +1037,21 @@ public class JcrMetadataRepository
}
}
+ public boolean canObtainAccess( Class<?> aClass )
+ {
+ return aClass == Session.class;
+ }
+
+ public Object obtainAccess( Class<?> aClass )
+ {
+ if ( aClass == Session.class )
+ {
+ return session;
+ }
+ throw new IllegalArgumentException(
+ "Access using " + aClass + " is not supported on the JCR metadata storage" );
+ }
+
public void close()
{
session.logout();