You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@archiva.apache.org by ol...@apache.org on 2012/04/06 11:33:56 UTC
svn commit: r1310262 [7/14] - in /archiva/redback/redback-components/trunk:
./ plexus-command-line/ plexus-command-line/src/
plexus-command-line/src/main/ plexus-command-line/src/main/java/
plexus-command-line/src/main/java/org/ plexus-command-line/src...
Propchange: archiva/redback/redback-components/trunk/plexus-xmlrpc/xdocs/index.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: archiva/redback/redback-components/trunk/plexus-xmlrpc/xdocs/index.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: archiva/redback/redback-components/trunk/plexus-xmlrpc/xdocs/navigation.xml
URL: http://svn.apache.org/viewvc/archiva/redback/redback-components/trunk/plexus-xmlrpc/xdocs/navigation.xml?rev=1310262&view=auto
==============================================================================
--- archiva/redback/redback-components/trunk/plexus-xmlrpc/xdocs/navigation.xml (added)
+++ archiva/redback/redback-components/trunk/plexus-xmlrpc/xdocs/navigation.xml Fri Apr 6 09:33:40 2012
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<project
+ name="Xmlrpc"
+ href="http://plexus.codehaus.org/xmlrpc/">
+
+ <body>
+ <links>
+ <item name="Plexus" href="http://plexus.codehaus.org/"/>
+ </links>
+
+ <menu name="Overview">
+ <item name="Main" href="/index.html"/>
+ </menu>
+ </body>
+</project>
Propchange: archiva/redback/redback-components/trunk/plexus-xmlrpc/xdocs/navigation.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: archiva/redback/redback-components/trunk/plexus-xmlrpc/xdocs/navigation.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: archiva/redback/redback-components/trunk/pom.xml
URL: http://svn.apache.org/viewvc/archiva/redback/redback-components/trunk/pom.xml?rev=1310262&view=auto
==============================================================================
--- archiva/redback/redback-components/trunk/pom.xml (added)
+++ archiva/redback/redback-components/trunk/pom.xml Fri Apr 6 09:33:40 2012
@@ -0,0 +1,38 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.codehaus.redback.components</groupId>
+ <artifactId>redback-components-aggregator</artifactId>
+ <packaging>pom</packaging>
+ <version>1.0-SNAPSHOT</version>
+ <name>Redback Components Aggregator Project</name>
+
+ <modules>
+ <module>redback-components-parent</module>
+ <module>spring-cache</module>
+ <module>plexus-command-line</module>
+ <module>plexus-expression-evaluator</module>
+ <module>plexus-jabber</module>
+ <module>spring-jdo2</module>
+ <module>spring-quartz</module>
+ <module>plexus-msn</module>
+ <module>spring-registry</module>
+ <module>spring-taskqueue</module>
+ <module>plexus-spring</module>
+ <module>plexus-xmlrpc</module>
+ <module>spring-apacheds</module>
+ <module>spring-utils</module>
+ </modules>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-deploy-plugin</artifactId>
+ <version>2.6</version>
+ <inherited>false</inherited>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Propchange: archiva/redback/redback-components/trunk/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: archiva/redback/redback-components/trunk/pom.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: archiva/redback/redback-components/trunk/redback-components-parent/pom.xml
URL: http://svn.apache.org/viewvc/archiva/redback/redback-components/trunk/redback-components-parent/pom.xml?rev=1310262&view=auto
==============================================================================
--- archiva/redback/redback-components/trunk/redback-components-parent/pom.xml (added)
+++ archiva/redback/redback-components/trunk/redback-components-parent/pom.xml Fri Apr 6 09:33:40 2012
@@ -0,0 +1,358 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.codehaus.redback.components</groupId>
+ <artifactId>redback-components</artifactId>
+ <packaging>pom</packaging>
+ <version>1.3-SNAPSHOT</version>
+ <name>Redback Components Parent Project</name>
+ <url>http://redback.codehaus.org/components</url>
+ <properties>
+ <slf4jVersion>1.6.4</slf4jVersion>
+ <springVersion>3.1.0.RELEASE</springVersion>
+ <distUrlReleaseRepo>dav:https://dav.codehaus.org/repository/redback</distUrlReleaseRepo>
+ <distUrlSnapshotRepo>dav:https://dav.codehaus.org/snapshots.repository/redback</distUrlSnapshotRepo>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ </properties>
+ <description>Parent Pom for various components used in redback, Apache Archiva and Apache Continuum.</description>
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ <version>2.5</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>${slf4jVersion}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>jcl-over-slf4j</artifactId>
+ <version>${slf4jVersion}</version>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.10</version>
+ </dependency>
+ <!-- spring -->
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-core</artifactId>
+ <version>${springVersion}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-web</artifactId>
+ <version>${springVersion}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-beans</artifactId>
+ <version>${springVersion}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ <version>${springVersion}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context-support</artifactId>
+ <version>${springVersion}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-test</artifactId>
+ <version>${springVersion}</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.inject</groupId>
+ <artifactId>javax.inject</artifactId>
+ <version>1</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.annotation</groupId>
+ <artifactId>jsr250-api</artifactId>
+ <version>1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-component-api</artifactId>
+ <version>1.0-alpha-20</version>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-container-default</artifactId>
+ <version>1.0-alpha-20</version>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ <version>${slf4jVersion}</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <scm>
+ <connection>scm:svn:https://svn.codehaus.org/redback/components/trunk/redback-components-parent</connection>
+ <developerConnection>scm:svn:https://svn.codehaus.org/redback/components/trunk/redback-components-parent</developerConnection>
+ <url>http://fisheye.codehaus.org/browse/redback/components/trunk/redback-components-parent</url>
+ </scm>
+ <distributionManagement>
+ <repository>
+ <id>codehaus.org</id>
+ <name>Plexus Central Repository</name>
+ <url>${distUrlReleaseRepo}</url>
+ </repository>
+ <snapshotRepository>
+ <id>codehaus.org</id>
+ <name>Plexus Central Development Repository</name>
+ <url>${distUrlSnapshotRepo}</url>
+ </snapshotRepository>
+ <site>
+ <id>codehaus.org</id>
+ <url>dav:https://dav.codehaus.org/redback/components</url>
+ </site>
+ </distributionManagement>
+
+ <repositories>
+ <repository>
+ <id>codehaus.snapshots</id>
+ <name>Codehaus Snapshot Development Repository</name>
+ <url>http://snapshots.repository.codehaus.org</url>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ </repository>
+ </repositories>
+
+ <build>
+ <extensions>
+ <extension>
+ <groupId>org.apache.maven.wagon</groupId>
+ <artifactId>wagon-webdav-jackrabbit</artifactId>
+ <version>2.2</version>
+ </extension>
+ </extensions>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-clean-plugin</artifactId>
+ <version>2.4.1</version>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>2.3.2</version>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-release-plugin</artifactId>
+ <version>2.1</version>
+ <configuration>
+ <useReleaseProfile>false</useReleaseProfile>
+ <tagBase>https://svn.codehaus.org/redback/components/tags/</tagBase>
+ <arguments>-Prelease</arguments>
+ <goals>clean deploy</goals>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-resources-plugin</artifactId>
+ <version>2.5</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.11</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-site-plugin</artifactId>
+ <version>3.0</version>
+ </plugin>
+ </plugins>
+ </build>
+ <reporting>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <version>2.8</version>
+ <configuration>
+ <docletArtifact>
+ <groupId>com.google.doclava</groupId>
+ <artifactId>doclava</artifactId>
+ <version>1.0.3</version>
+ </docletArtifact>
+ <doclet>com.google.doclava.Doclava</doclet>
+ <!--
+ | bootclasspath required by Sun's JVM
+ -->
+ <bootclasspath>${sun.boot.class.path}</bootclasspath>
+ <additionalparam>
+ <!-- comment as produce an NPE
+ -federate JDK http://download.oracle.com/javase/6/docs/api/index.html?
+ -federationxml JDK http://doclava.googlecode.com/svn/static/api/openjdk-6.xml -->
+ -hdf project.name "${project.name}"
+ -d ${project.build.directory}/site/apidocs
+ </additionalparam>
+ <useStandardDocletOptions>false</useStandardDocletOptions>
+ <!--
+ | Apple's JVM sometimes requires more memory
+ -->
+ <additionalJOption>-J-Xmx1024m</additionalJOption>
+ </configuration>
+ <reportSets>
+ <reportSet>
+ <reports>
+ <report>javadoc</report>
+ </reports>
+ </reportSet>
+ </reportSets>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-project-info-reports-plugin</artifactId>
+ <version>2.4</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-report-plugin</artifactId>
+ <version>2.11</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ <version>2.5</version>
+ <configuration>
+ <configLocation>config/maven_checks.xml</configLocation>
+ <headerLocation>config/maven-header.txt</headerLocation>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jxr-plugin</artifactId>
+ <version>2.2</version>
+ </plugin>
+
+ </plugins>
+ </reporting>
+
+ <profiles>
+ <profile>
+ <id>maven-3</id>
+ <activation>
+ <file>
+ <!-- This employs that the basedir expression is only recognized by Maven 3.x (see MNG-2363) -->
+ <exists>${basedir}</exists>
+ </file>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-site-plugin</artifactId>
+ <inherited>false</inherited>
+ <executions>
+ <execution>
+ <id>attach-descriptor</id>
+ <goals>
+ <goal>attach-descriptor</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>all</id>
+ <modules>
+ <module>../spring-cache</module>
+ <module>../spring-jdo2</module>
+ <module>../spring-quartz</module>
+ <module>../spring-apacheds</module>
+ <module>../spring-registry</module>
+ <module>../plexus-command-line</module>
+ <module>../plexus-expression-evaluator</module>
+ <module>../plexus-jabber</module>
+ <module>../plexus-msn</module>
+ <module>../plexus-spring</module>
+ <module>../plexus-xmlrpc</module>
+ </modules>
+ <reporting>
+ <plugins>
+ <plugin>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <configuration>
+ <aggregate>true</aggregate>
+ </configuration>
+ </plugin>
+ </plugins>
+ </reporting>
+ </profile>
+ <profile>
+ <id>release</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-gpg-plugin</artifactId>
+ <configuration>
+ <passphrase>${gpg.passphrase}</passphrase>
+ <useAgent>${gpg.useagent}</useAgent>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>sign</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>attach-sources</id>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>attach-javadocs</id>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
+</project>
Propchange: archiva/redback/redback-components/trunk/redback-components-parent/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: archiva/redback/redback-components/trunk/redback-components-parent/pom.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: archiva/redback/redback-components/trunk/redback-components-parent/src/site/site.xml
URL: http://svn.apache.org/viewvc/archiva/redback/redback-components/trunk/redback-components-parent/src/site/site.xml?rev=1310262&view=auto
==============================================================================
--- archiva/redback/redback-components/trunk/redback-components-parent/src/site/site.xml (added)
+++ archiva/redback/redback-components/trunk/redback-components-parent/src/site/site.xml Fri Apr 6 09:33:40 2012
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ ~ 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.
+ -->
+
+<project>
+ <publishDate format="yyyy-MM-dd" position="right" />
+ <version position="right" />
+
+ <skin>
+ <groupId>org.apache.maven.skins</groupId>
+ <artifactId>maven-default-skin</artifactId>
+ <version>1.0</version>
+ </skin>
+
+ <body>
+ <links>
+ <item name="The Codehaus" href="http://codehaus.org" />
+ <item name="Redback" href="http://redback.codehaus.org"/>
+ </links>
+ <menu ref="parent" inherit="top"/>
+ <menu ref="modules" inherit="bottom"/>
+ <menu ref="reports" inherit="bottom"/>
+ </body>
+</project>
Propchange: archiva/redback/redback-components/trunk/redback-components-parent/src/site/site.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: archiva/redback/redback-components/trunk/redback-components-parent/src/site/site.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: archiva/redback/redback-components/trunk/spring-apacheds/pom.xml
URL: http://svn.apache.org/viewvc/archiva/redback/redback-components/trunk/spring-apacheds/pom.xml?rev=1310262&view=auto
==============================================================================
--- archiva/redback/redback-components/trunk/spring-apacheds/pom.xml (added)
+++ archiva/redback/redback-components/trunk/spring-apacheds/pom.xml Fri Apr 6 09:33:40 2012
@@ -0,0 +1,119 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Licensed 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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.codehaus.redback.components</groupId>
+ <artifactId>redback-components</artifactId>
+ <version>1.3-SNAPSHOT</version>
+ <relativePath>../redback-components-parent/pom.xml</relativePath>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>spring-apacheds</artifactId>
+ <name>Spring Apache Directory Server Components</name>
+ <version>1.1-SNAPSHOT</version>
+
+ <url>http://redback.codehaus.org/components/${project.artifactId}</url>
+
+ <distributionManagement>
+ <site>
+ <id>codehaus.org</id>
+ <url>dav:https://dav.codehaus.org/redback/components/${project.artifactId}</url>
+ </site>
+ </distributionManagement>
+
+ <scm>
+ <connection>scm:svn:https://svn.codehaus.org/redback/components/trunk/spring-apacheds</connection>
+ <developerConnection>scm:svn:https://svn.codehaus.org/redback/components/trunk/spring-apacheds</developerConnection>
+ <url>http://fisheye.codehaus.org/browse/redback/components/trunk/spring-apacheds</url>
+ </scm>
+
+ <properties>
+ <apacheds.version>1.5.1</apacheds.version>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.directory.server</groupId>
+ <artifactId>apacheds-core</artifactId>
+ <version>${apacheds.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.directory.server</groupId>
+ <artifactId>apacheds-core-shared</artifactId>
+ <version>${apacheds.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.directory.server</groupId>
+ <artifactId>apacheds-server-jndi</artifactId>
+ <version>${apacheds.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.directory.server</groupId>
+ <artifactId>apacheds-bootstrap-partition</artifactId>
+ <version>${apacheds.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.directory.server</groupId>
+ <artifactId>apacheds-schema-registries</artifactId>
+ <version>${apacheds.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.directory.server</groupId>
+ <artifactId>apacheds-schema-extras</artifactId>
+ <version>${apacheds.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>javax.inject</groupId>
+ <artifactId>javax.inject</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-core</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context-support</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-beans</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-test</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>jcl-over-slf4j</artifactId>
+ <version>${slf4jVersion}</version>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+</project>
Propchange: archiva/redback/redback-components/trunk/spring-apacheds/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: archiva/redback/redback-components/trunk/spring-apacheds/pom.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: archiva/redback/redback-components/trunk/spring-apacheds/src/main/java/org/codehaus/redback/components/apacheds/ApacheDs.java
URL: http://svn.apache.org/viewvc/archiva/redback/redback-components/trunk/spring-apacheds/src/main/java/org/codehaus/redback/components/apacheds/ApacheDs.java?rev=1310262&view=auto
==============================================================================
--- archiva/redback/redback-components/trunk/spring-apacheds/src/main/java/org/codehaus/redback/components/apacheds/ApacheDs.java (added)
+++ archiva/redback/redback-components/trunk/spring-apacheds/src/main/java/org/codehaus/redback/components/apacheds/ApacheDs.java Fri Apr 6 09:33:40 2012
@@ -0,0 +1,69 @@
+package org.codehaus.redback.components.apacheds;
+
+import javax.naming.NamingException;
+import javax.naming.directory.InitialDirContext;
+import javax.naming.directory.Attributes;
+import java.io.File;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:trygvis@inamo.no">Trygve Laugstøl</a>
+ * @version $Id$
+ */
+public interface ApacheDs
+{
+ String ROLE = ApacheDs.class.getName();
+
+ // ----------------------------------------------------------------------
+ // Configuration
+ // ----------------------------------------------------------------------
+
+ void setBasedir( File basedir );
+
+ void setPort( int port );
+
+ int getPort();
+
+ void setEnableNetworking( boolean enableNetworking );
+
+ void addPartition( String name, String root, Set indexedAttributes, Attributes partitionAttributes )
+ throws NamingException;
+
+ void addPartition( Partition partition )
+ throws NamingException;
+
+ /**
+ * Creates a partition usable for testing and other light usage.
+ *
+ * @param name The name of the partition. Will be used as the directory name when persisted.
+ * @param domainComponents E.g. "plexus", "codehaus", "org"
+ * @throws NamingException
+ */
+ Partition addSimplePartition( String name, String[] domainComponents )
+ throws NamingException;
+
+ // ----------------------------------------------------------------------
+ // Server control
+ // ----------------------------------------------------------------------
+
+ void startServer()
+ throws Exception;
+
+ void stopServer()
+ throws Exception;
+
+ void sync()
+ throws Exception;
+
+ boolean isStopped();
+
+ // ----------------------------------------------------------------------
+ //
+ // ----------------------------------------------------------------------
+
+ InitialDirContext getAdminContext()
+ throws NamingException;
+
+ InitialDirContext getSystemContext()
+ throws NamingException;
+}
Propchange: archiva/redback/redback-components/trunk/spring-apacheds/src/main/java/org/codehaus/redback/components/apacheds/ApacheDs.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: archiva/redback/redback-components/trunk/spring-apacheds/src/main/java/org/codehaus/redback/components/apacheds/ApacheDs.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: archiva/redback/redback-components/trunk/spring-apacheds/src/main/java/org/codehaus/redback/components/apacheds/DefaultApacheDs.java
URL: http://svn.apache.org/viewvc/archiva/redback/redback-components/trunk/spring-apacheds/src/main/java/org/codehaus/redback/components/apacheds/DefaultApacheDs.java?rev=1310262&view=auto
==============================================================================
--- archiva/redback/redback-components/trunk/spring-apacheds/src/main/java/org/codehaus/redback/components/apacheds/DefaultApacheDs.java (added)
+++ archiva/redback/redback-components/trunk/spring-apacheds/src/main/java/org/codehaus/redback/components/apacheds/DefaultApacheDs.java Fri Apr 6 09:33:40 2012
@@ -0,0 +1,335 @@
+package org.codehaus.redback.components.apacheds;
+
+/*
+ * Copyright 2001-2007 The Codehaus.
+ *
+ * Licensed 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.
+ */
+
+import org.apache.directory.server.configuration.MutableServerStartupConfiguration;
+import org.apache.directory.server.core.configuration.MutablePartitionConfiguration;
+import org.apache.directory.server.core.configuration.ShutdownConfiguration;
+import org.apache.directory.server.core.configuration.SyncConfiguration;
+import org.apache.directory.server.jndi.ServerContextFactory;
+import org.apache.directory.server.ldap.LdapConfiguration;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.naming.Context;
+import javax.naming.NamingException;
+import javax.naming.directory.Attribute;
+import javax.naming.directory.Attributes;
+import javax.naming.directory.BasicAttribute;
+import javax.naming.directory.BasicAttributes;
+import javax.naming.directory.InitialDirContext;
+import java.io.File;
+import java.util.HashSet;
+import java.util.Hashtable;
+import java.util.Properties;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:trygvis@inamo.no">Trygve Laugstøl</a>
+ * @author Olivier Lamy
+ * @version $Id$
+ */
+public class DefaultApacheDs
+ implements ApacheDs
+{
+
+ private Logger logger = LoggerFactory.getLogger( getClass() );
+
+ // ----------------------------------------------------------------------
+ // Configuration
+ // ----------------------------------------------------------------------
+
+ private boolean enableNetworking;
+
+ private File basedir;
+
+ private int port;
+
+ private String password;
+
+ // ----------------------------------------------------------------------
+ //
+ // ----------------------------------------------------------------------
+
+ private boolean stopped;
+
+ private MutableServerStartupConfiguration configuration;
+
+ private Set partitionConfigurations = new HashSet();
+
+ // ----------------------------------------------------------------------
+ // ApacheDs Implementation
+ // ----------------------------------------------------------------------
+
+ public void setBasedir( File basedir )
+ {
+ this.basedir = basedir;
+ }
+
+ public void setEnableNetworking( boolean enableNetworking )
+ {
+ this.enableNetworking = enableNetworking;
+ }
+
+ public InitialDirContext getAdminContext()
+ throws NamingException
+ {
+ assertIsStarted();
+
+ Hashtable environment = new Hashtable( configuration.toJndiEnvironment() );
+ environment.put( Context.INITIAL_CONTEXT_FACTORY, ServerContextFactory.class.getName() );
+ environment.put( Context.SECURITY_PRINCIPAL, "uid=admin,ou=system" );
+ environment.put( Context.SECURITY_CREDENTIALS, password );
+ environment.put( Context.SECURITY_AUTHENTICATION, "simple" );
+// environment.put( Context.PROVIDER_URL, "dc=hauskeeper,dc=codehaus,dc=org" );
+ return new InitialDirContext( environment );
+ }
+
+ public InitialDirContext getSystemContext()
+ throws NamingException
+ {
+ assertIsStarted();
+
+ Hashtable environment = new Hashtable( configuration.toJndiEnvironment() );
+ environment.put( Context.INITIAL_CONTEXT_FACTORY, ServerContextFactory.class.getName() );
+ environment.put( Context.SECURITY_PRINCIPAL, "uid=admin,ou=system" );
+ environment.put( Context.SECURITY_CREDENTIALS, password );
+ environment.put( Context.SECURITY_AUTHENTICATION, "simple" );
+ environment.put( Context.PROVIDER_URL, "ou=system" );
+ return new InitialDirContext( environment );
+ }
+
+ public void addPartition( String name, String root, Set indexedAttributes, Attributes partitionAttributes )
+ throws NamingException
+ {
+ MutablePartitionConfiguration configuration = new MutablePartitionConfiguration();
+ configuration.setId( name );
+ configuration.setSuffix( root );
+ configuration.setIndexedAttributes( indexedAttributes );
+ configuration.setContextEntry( partitionAttributes );
+ partitionConfigurations.add( configuration );
+ }
+
+ public void addPartition( Partition partition )
+ throws NamingException
+ {
+ MutablePartitionConfiguration configuration = new MutablePartitionConfiguration();
+
+ configuration.setId( partition.getName() );
+ configuration.setSuffix( partition.getSuffix() );
+ configuration.setIndexedAttributes( partition.getIndexedAttributes() );
+ configuration.setContextEntry( partition.getContextAttributes() );
+ //configuration.setSynchOnWrite( true );
+ configuration.setCacheSize( 1 );
+ //configuration.setOptimizerEnabled( false );
+ partitionConfigurations.add( configuration );
+ }
+
+ public Partition addSimplePartition( String name, String[] domainComponents )
+ throws NamingException
+ {
+ if ( domainComponents.length == 0 )
+ {
+ throw new NamingException( "Illegal argument, there has to be at least one domain component." );
+ }
+
+ StringBuilder suffix = new StringBuilder();
+
+ for ( int i = 0; i < domainComponents.length; i++ )
+ {
+ String dc = domainComponents[i];
+
+ suffix.append( "dc=" ).append( dc );
+
+ if ( i != domainComponents.length - 1 )
+ {
+ suffix.append( "," );
+ }
+ }
+
+ // ----------------------------------------------------------------------
+ // The root entry of the partition
+ // ----------------------------------------------------------------------
+
+ Attributes attributes = new BasicAttributes( true );
+ attributes.put( "dc", domainComponents[0] );
+ Attribute objectClass = new BasicAttribute( "objectClass" );
+ objectClass.add( "top" );
+ objectClass.add( "domain" );
+ objectClass.add( "extensibleObject" );
+ attributes.put( objectClass );
+
+ Partition partition = new Partition();
+ partition.setName( name );
+ partition.setSuffix( suffix.toString() );
+ partition.setContextAttributes( attributes );
+ HashSet set = new HashSet();
+ set.add( "uid" );
+ set.add( "cn" );
+ partition.setIndexedAttributes( set );
+
+ addPartition( partition );
+
+ return partition;
+ }
+
+ public void startServer()
+ throws Exception
+ {
+ logger.info( "Starting Apache Directory Server server." );
+
+ logger.info( "ApacheDS basedir: " + basedir.getAbsolutePath() );
+
+ File logs = new File( basedir, "logs" );
+
+ if ( !logs.exists() && !logs.mkdirs() )
+ {
+ throw new Exception( "Could not create logs directory: " + logs.getAbsolutePath() );
+ }
+
+ Properties environment = new Properties();
+ environment.setProperty( "java.naming.security.authentication", "simple" );
+ environment.setProperty( "java.naming.security.principal", "uid=admin,ou=system" );
+ if ( password != null )
+ {
+ environment.setProperty( "java.naming.security.credentials", password );
+ }
+ MutableServerStartupConfiguration configuration = new MutableServerStartupConfiguration();
+ configuration.setWorkingDirectory( basedir );
+ configuration.setAllowAnonymousAccess( true );
+ //configuration.setEnableNtp( false );
+ //configuration.setEnableKerberos( false );
+ //configuration.setEnableChangePassword( false );
+ LdapConfiguration config = new LdapConfiguration();
+ config.setIpPort( port );
+ configuration.setLdapConfiguration( config );
+ configuration.setEnableNetworking( enableNetworking );
+ configuration.setSynchPeriodMillis( 100 );
+
+ if ( configuration.getPartitionConfigurations() == null || ( configuration.getPartitionConfigurations() != null
+ && configuration.getPartitionConfigurations().isEmpty() ) )
+ {
+ configuration.setPartitionConfigurations( partitionConfigurations );
+ }
+ Properties env = new Properties();
+ env.setProperty( Context.SECURITY_PRINCIPAL, "uid=admin,ou=system" );
+ if ( password != null )
+ {
+ env.setProperty( Context.SECURITY_CREDENTIALS, password );
+ }
+ env.setProperty( Context.SECURITY_AUTHENTICATION, "simple" );
+ env.setProperty( Context.PROVIDER_URL, "ou=system" );
+ env.setProperty( Context.INITIAL_CONTEXT_FACTORY, ServerContextFactory.class.getName() );
+ env.putAll( configuration.toJndiEnvironment() );
+ InitialDirContext context = new InitialDirContext( env );
+
+ //Attributes inetAttributes = context.getAttributes( "cn=inetorgperson,ou=schema" );
+
+ //inetAttributes.remove( "m-disabled" );
+
+ this.configuration = configuration;
+
+ logger.info( "Started Apache Directory Server server." );
+
+ stopped = false;
+ }
+
+ public void stopServer()
+ throws Exception
+ {
+ if ( stopped )
+ {
+ throw new Exception( "Already stopped." );
+ }
+
+ logger.info( "Stopping Apache Directory Server server." );
+
+ sync();
+
+ stopped = true;
+
+ Hashtable env = new Hashtable();
+ env.putAll( new ShutdownConfiguration().toJndiEnvironment() );
+ new InitialDirContext( env );
+
+ logger.info( "Apache Directory Server server stopped." );
+ }
+
+ public boolean isStopped()
+ {
+ return stopped;
+ }
+
+ public void sync()
+ throws Exception
+ {
+ logger.info( "Sync'ing Apache Directory Server server." );
+
+ Hashtable env = new Hashtable();
+ env.putAll( new SyncConfiguration().toJndiEnvironment() );
+ new InitialDirContext( env );
+ }
+
+
+ public void stop()
+ {
+ try
+ {
+ if ( !stopped )
+ {
+ stopServer();
+ }
+ }
+ catch ( Exception e )
+ {
+ throw new RuntimeException( "Error while stopping Apache Directory Server server.", e );
+ }
+ }
+
+ // ----------------------------------------------------------------------
+ //
+ // ----------------------------------------------------------------------
+
+ private void assertIsStarted()
+ throws NamingException
+ {
+ if ( configuration == null )
+ {
+ throw new NamingException( "The server has to be started before used." );
+ }
+ }
+
+ public int getPort()
+ {
+ return port;
+ }
+
+ public void setPort( int port )
+ {
+ this.port = port;
+ }
+
+ public String getPassword()
+ {
+ return password;
+ }
+
+ public void setPassword( String password )
+ {
+ this.password = password;
+ }
+}
Propchange: archiva/redback/redback-components/trunk/spring-apacheds/src/main/java/org/codehaus/redback/components/apacheds/DefaultApacheDs.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: archiva/redback/redback-components/trunk/spring-apacheds/src/main/java/org/codehaus/redback/components/apacheds/DefaultApacheDs.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: archiva/redback/redback-components/trunk/spring-apacheds/src/main/java/org/codehaus/redback/components/apacheds/Partition.java
URL: http://svn.apache.org/viewvc/archiva/redback/redback-components/trunk/spring-apacheds/src/main/java/org/codehaus/redback/components/apacheds/Partition.java?rev=1310262&view=auto
==============================================================================
--- archiva/redback/redback-components/trunk/spring-apacheds/src/main/java/org/codehaus/redback/components/apacheds/Partition.java (added)
+++ archiva/redback/redback-components/trunk/spring-apacheds/src/main/java/org/codehaus/redback/components/apacheds/Partition.java Fri Apr 6 09:33:40 2012
@@ -0,0 +1,71 @@
+package org.codehaus.redback.components.apacheds;
+
+import javax.naming.directory.Attributes;
+import javax.naming.directory.BasicAttributes;
+import java.util.Set;
+import java.util.HashSet;
+
+/**
+ * @author <a href="mailto:trygvis@inamo.no">Trygve Laugstøl</a>
+ * @version $Id$
+ */
+public class Partition
+{
+ private String name;
+
+ private String suffix;
+
+ private Set indexedAttributes;
+
+ private Attributes contextAttributes;
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public void setName( String name )
+ {
+ this.name = name;
+ }
+
+ public String getSuffix()
+ {
+ return suffix;
+ }
+
+ public void setSuffix( String suffix )
+ {
+ this.suffix = suffix;
+ }
+
+ public Set getIndexedAttributes()
+ {
+ if ( indexedAttributes == null )
+ {
+ indexedAttributes = new HashSet();
+ }
+
+ return indexedAttributes;
+ }
+
+ public void setIndexedAttributes( Set indexedAttributes )
+ {
+ this.indexedAttributes = indexedAttributes;
+ }
+
+ public Attributes getContextAttributes()
+ {
+ if ( contextAttributes == null )
+ {
+ contextAttributes = new BasicAttributes();
+ }
+
+ return contextAttributes;
+ }
+
+ public void setContextAttributes( Attributes contextAttributes )
+ {
+ this.contextAttributes = contextAttributes;
+ }
+}
Propchange: archiva/redback/redback-components/trunk/spring-apacheds/src/main/java/org/codehaus/redback/components/apacheds/Partition.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: archiva/redback/redback-components/trunk/spring-apacheds/src/main/java/org/codehaus/redback/components/apacheds/Partition.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: archiva/redback/redback-components/trunk/spring-apacheds/src/test/java/org/codehaus/redback/components/apacheds/ApacheDsTest.java
URL: http://svn.apache.org/viewvc/archiva/redback/redback-components/trunk/spring-apacheds/src/test/java/org/codehaus/redback/components/apacheds/ApacheDsTest.java?rev=1310262&view=auto
==============================================================================
--- archiva/redback/redback-components/trunk/spring-apacheds/src/test/java/org/codehaus/redback/components/apacheds/ApacheDsTest.java (added)
+++ archiva/redback/redback-components/trunk/spring-apacheds/src/test/java/org/codehaus/redback/components/apacheds/ApacheDsTest.java Fri Apr 6 09:33:40 2012
@@ -0,0 +1,165 @@
+package org.codehaus.redback.components.apacheds;
+
+/*
+ * Copyright 2001-2007 The Codehaus.
+ *
+ * Licensed 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.
+ */
+
+import junit.framework.TestCase;
+import org.apache.directory.shared.ldap.util.AttributeUtils;
+import org.codehaus.redback.components.apacheds.ApacheDs;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+
+import javax.inject.Inject;
+import javax.naming.NamingEnumeration;
+import javax.naming.NamingException;
+import javax.naming.directory.Attribute;
+import javax.naming.directory.Attributes;
+import javax.naming.directory.BasicAttribute;
+import javax.naming.directory.BasicAttributes;
+import javax.naming.directory.DirContext;
+import javax.naming.directory.InitialDirContext;
+import javax.naming.directory.SearchControls;
+import javax.naming.directory.SearchResult;
+import java.io.File;
+
+/**
+ * @author <a href="mailto:trygvis@inamo.no">Trygve Laugstøl</a>
+ * @author Olivier Lamy
+ * @version $Id$
+ */
+
+@RunWith( SpringJUnit4ClassRunner.class )
+@ContextConfiguration( locations = { "classpath*:/META-INF/spring-context.xml", "classpath*:/spring-context.xml" } )
+public class ApacheDsTest
+ extends TestCase
+{
+ private String suffix = "dc=plexus,dc=codehaus,dc=org";
+
+ @Inject
+ private ApacheDs apacheDs;
+
+ protected void setUp()
+ throws Exception
+ {
+ super.setUp();
+
+
+
+ }
+
+ @Test
+ public void testBasic()
+ throws Exception
+ {
+
+ apacheDs.setBasedir( new File( "./target/plexus-home" ) );
+
+ apacheDs.addSimplePartition( "test", new String[]{"plexus", "codehaus", "org"} ).getSuffix();
+ apacheDs.startServer();
+
+ InitialDirContext context = apacheDs.getAdminContext();
+
+ String cn = "trygvis";
+ createUser( context, cn, createDn( cn ) );
+ assertExist( context, createDn( cn ), "cn", cn );
+
+ cn = "bolla";
+ createUser( context, cn, createDn( cn ) );
+ assertExist( context, createDn( cn ), "cn", cn );
+
+ SearchControls ctls = new SearchControls();
+
+ ctls.setDerefLinkFlag( true );
+ ctls.setSearchScope( SearchControls.ONELEVEL_SCOPE );
+ ctls.setReturningAttributes( new String[] { "*" } );
+
+ String filter = "(&(objectClass=inetOrgPerson)(cn=trygvis))";
+
+ NamingEnumeration<SearchResult> results = context.search( suffix, filter, ctls );
+
+ assertTrue( "a result should have been returned", results.hasMoreElements() );
+
+ SearchResult result = results.nextElement();
+
+ Attributes attrs = result.getAttributes();
+
+ System.out.println( AttributeUtils.toString( attrs ) );
+
+ assertFalse( "should only have one result returned", results.hasMoreElements() );
+
+ apacheDs.stopServer();
+
+
+
+ // ----------------------------------------------------------------------
+ // Start it again
+ // ----------------------------------------------------------------------
+
+ apacheDs.startServer();
+
+ context = apacheDs.getAdminContext();
+
+ assertExist( context, createDn( "trygvis" ), "cn", "trygvis" );
+ context.unbind( createDn( "trygvis" ) );
+ assertExist( context, createDn( "bolla" ), "cn", "bolla" );
+ context.unbind( createDn( "bolla" ) );
+
+ apacheDs.stopServer();
+ }
+
+ private void createUser( DirContext context, String cn, String dn )
+ throws NamingException
+ {
+ Attributes attributes = new BasicAttributes();
+ BasicAttribute objectClass = new BasicAttribute( "objectClass" );
+ objectClass.add( "top" );
+ objectClass.add( "inetOrgPerson" );
+ attributes.put( objectClass );
+ attributes.put( "cn", cn );
+ attributes.put( "sn", cn );
+ context.createSubcontext( dn, attributes );
+ }
+
+ private String createDn( String cn )
+ {
+ return "cn=" + cn + "," + suffix;
+ }
+
+ private void assertExist( DirContext context, String dn, String attribute, String value )
+ throws NamingException
+ {
+ SearchControls ctls = new SearchControls();
+
+ ctls.setDerefLinkFlag( true );
+ ctls.setSearchScope( SearchControls.ONELEVEL_SCOPE );
+ ctls.setReturningAttributes( new String[] { "*" } );
+
+ BasicAttributes matchingAttributes = new BasicAttributes();
+ matchingAttributes.put( attribute, value );
+
+ NamingEnumeration<SearchResult> results = context.search( suffix, matchingAttributes );
+ //NamingEnumeration<SearchResult> results = context.search( suffix, "(" + attribute + "=" + value + ")", ctls );
+
+ assertTrue( results.hasMoreElements() );
+ SearchResult result = results.nextElement();
+ Attributes attrs = result.getAttributes();
+ Attribute testAttr = attrs.get( attribute );
+ assertEquals( value, testAttr.get() );
+
+ }
+}
Propchange: archiva/redback/redback-components/trunk/spring-apacheds/src/test/java/org/codehaus/redback/components/apacheds/ApacheDsTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: archiva/redback/redback-components/trunk/spring-apacheds/src/test/java/org/codehaus/redback/components/apacheds/ApacheDsTest.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: archiva/redback/redback-components/trunk/spring-apacheds/src/test/resources/spring-context.xml
URL: http://svn.apache.org/viewvc/archiva/redback/redback-components/trunk/spring-apacheds/src/test/resources/spring-context.xml?rev=1310262&view=auto
==============================================================================
--- archiva/redback/redback-components/trunk/spring-apacheds/src/test/resources/spring-context.xml (added)
+++ archiva/redback/redback-components/trunk/spring-apacheds/src/test/resources/spring-context.xml Fri Apr 6 09:33:40 2012
@@ -0,0 +1,35 @@
+<?xml version="1.0"?>
+
+<!--
+ ~ 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.
+ -->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:context="http://www.springframework.org/schema/context"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans
+ http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+ http://www.springframework.org/schema/context
+ http://www.springframework.org/schema/context/spring-context-2.5.xsd">
+
+ <bean name="apacheDS" class="org.codehaus.redback.components.apacheds.DefaultApacheDs">
+ <property name="basedir" value="./target/apacheds"/>
+ <property name="port" value="10390"/>
+ <property name="enableNetworking" value="true"/>
+ <property name="password" value="secret"/>
+ </bean>
+</beans>
\ No newline at end of file
Propchange: archiva/redback/redback-components/trunk/spring-apacheds/src/test/resources/spring-context.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: archiva/redback/redback-components/trunk/spring-apacheds/src/test/resources/spring-context.xml
------------------------------------------------------------------------------
svn:executable =
Propchange: archiva/redback/redback-components/trunk/spring-apacheds/src/test/resources/spring-context.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: archiva/redback/redback-components/trunk/spring-cache/pom.xml
URL: http://svn.apache.org/viewvc/archiva/redback/redback-components/trunk/spring-cache/pom.xml?rev=1310262&view=auto
==============================================================================
--- archiva/redback/redback-components/trunk/spring-cache/pom.xml (added)
+++ archiva/redback/redback-components/trunk/spring-cache/pom.xml Fri Apr 6 09:33:40 2012
@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Licensed 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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.codehaus.redback.components</groupId>
+ <artifactId>redback-components</artifactId>
+ <version>1.3-SNAPSHOT</version>
+ <relativePath>../redback-components-parent/pom.xml</relativePath>
+ </parent>
+ <groupId>org.codehaus.redback.components.cache</groupId>
+ <artifactId>spring-cache</artifactId>
+ <name>Spring Cache Component</name>
+ <version>2.0-SNAPSHOT</version>
+ <packaging>pom</packaging>
+
+ <description>Cache API with various implementations : simple HashMap, ehcache, oscache. Based on Spring container.</description>
+
+ <url>http://redback.codehaus.org/components/${project.artifactId}</url>
+
+ <distributionManagement>
+ <site>
+ <id>codehaus.org</id>
+ <url>dav:https://dav.codehaus.org/redback/components/${project.artifactId}</url>
+ </site>
+ </distributionManagement>
+
+ <scm>
+ <connection>scm:svn:https://svn.codehaus.org/redback/components/trunk/spring-cache</connection>
+ <developerConnection>scm:svn:https://svn.codehaus.org/redback/components/trunk/spring-cache</developerConnection>
+ <url>http://fisheye.codehaus.org/browse/redback/components/trunk/spring-cache</url>
+ </scm>
+
+ <modules>
+ <module>spring-cache-api</module>
+ <module>spring-cache-test</module>
+ <module>spring-cache-providers</module>
+ </modules>
+ <dependencies>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </dependency>
+ </dependencies>
+
+
+ <reporting>
+ <plugins>
+ <plugin>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <configuration>
+ <aggregate>true</aggregate>
+ <!--
+ for doclava with javadoc SNAPSHOT version 2.8.1
+ <additionnalDependencies>
+ <additionnalDependency>
+ <groupId>geronimo-spec</groupId>
+ <artifactId>geronimo-spec-jta</artifactId>
+ <version>1.0.1B-rc4</version>
+ </additionnalDependency>
+ </additionnalDependencies>
+ -->
+ </configuration>
+ </plugin>
+ </plugins>
+ </reporting>
+
+</project>
Propchange: archiva/redback/redback-components/trunk/spring-cache/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: archiva/redback/redback-components/trunk/spring-cache/pom.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: archiva/redback/redback-components/trunk/spring-cache/spring-cache-api/pom.xml
URL: http://svn.apache.org/viewvc/archiva/redback/redback-components/trunk/spring-cache/spring-cache-api/pom.xml?rev=1310262&view=auto
==============================================================================
--- archiva/redback/redback-components/trunk/spring-cache/spring-cache-api/pom.xml (added)
+++ archiva/redback/redback-components/trunk/spring-cache/spring-cache-api/pom.xml Fri Apr 6 09:33:40 2012
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Licensed 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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.codehaus.redback.components.cache</groupId>
+ <artifactId>spring-cache</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>spring-cache-api</artifactId>
+ <name>Spring Cache API</name>
+
+ <description>Common Cache API.</description>
+
+ <dependencies>
+ <dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>javax.inject</groupId>
+ <artifactId>javax.inject</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>javax.annotation</groupId>
+ <artifactId>jsr250-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context-support</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-beans</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-test</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+</project>
Propchange: archiva/redback/redback-components/trunk/spring-cache/spring-cache-api/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: archiva/redback/redback-components/trunk/spring-cache/spring-cache-api/pom.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: archiva/redback/redback-components/trunk/spring-cache/spring-cache-api/src/main/java/org/codehaus/plexus/cache/AbstractCacheStatistics.java
URL: http://svn.apache.org/viewvc/archiva/redback/redback-components/trunk/spring-cache/spring-cache-api/src/main/java/org/codehaus/plexus/cache/AbstractCacheStatistics.java?rev=1310262&view=auto
==============================================================================
--- archiva/redback/redback-components/trunk/spring-cache/spring-cache-api/src/main/java/org/codehaus/plexus/cache/AbstractCacheStatistics.java (added)
+++ archiva/redback/redback-components/trunk/spring-cache/spring-cache-api/src/main/java/org/codehaus/plexus/cache/AbstractCacheStatistics.java Fri Apr 6 09:33:40 2012
@@ -0,0 +1,69 @@
+package org.codehaus.plexus.cache;
+
+/*
+ * Copyright 2001-2007 The Codehaus.
+ *
+ * Licensed 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.
+ */
+/**
+ * @version $Id$
+ * @author <a href="mailto:Olivier.LAMY@accor.com">Olivier Lamy</a>
+ */
+public abstract class AbstractCacheStatistics
+ implements CacheStatistics
+{
+
+ private long cacheHits;
+
+ private long cacheMiss;
+
+ public AbstractCacheStatistics()
+ {
+ this.cacheHits = 0;
+ this.cacheMiss = 0;
+ }
+
+ public long getCacheHits()
+ {
+ return this.cacheHits;
+ }
+
+ public long getCacheMiss()
+ {
+ return this.cacheMiss;
+ }
+
+ public double getCacheHitRate()
+ {
+ return cacheHits == 0 && cacheMiss == 0 ? 0 : (double) cacheHits / (double) ( cacheHits + cacheMiss );
+ }
+
+ public abstract long getSize();
+
+ public void hit()
+ {
+ this.cacheHits++;
+ }
+
+ public void miss()
+ {
+ this.cacheMiss++;
+ }
+
+ public void clear()
+ {
+ this.cacheHits = 0;
+ this.cacheMiss = 0;
+ }
+
+}
Propchange: archiva/redback/redback-components/trunk/spring-cache/spring-cache-api/src/main/java/org/codehaus/plexus/cache/AbstractCacheStatistics.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: archiva/redback/redback-components/trunk/spring-cache/spring-cache-api/src/main/java/org/codehaus/plexus/cache/AbstractCacheStatistics.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: archiva/redback/redback-components/trunk/spring-cache/spring-cache-api/src/main/java/org/codehaus/plexus/cache/Cache.java
URL: http://svn.apache.org/viewvc/archiva/redback/redback-components/trunk/spring-cache/spring-cache-api/src/main/java/org/codehaus/plexus/cache/Cache.java?rev=1310262&view=auto
==============================================================================
--- archiva/redback/redback-components/trunk/spring-cache/spring-cache-api/src/main/java/org/codehaus/plexus/cache/Cache.java (added)
+++ archiva/redback/redback-components/trunk/spring-cache/spring-cache-api/src/main/java/org/codehaus/plexus/cache/Cache.java Fri Apr 6 09:33:40 2012
@@ -0,0 +1,88 @@
+package org.codehaus.plexus.cache;
+
+/*
+ * Copyright 2001-2007 The Codehaus.
+ *
+ * Licensed 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.
+ */
+
+/**
+ * Cache interface.
+ *
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ */
+public interface Cache
+{
+ /**
+ * Tests to see if the provided key exists within the cache.
+ *
+ * NOTE: Due to synchronization issues, if this method returns true, a subsequent request
+ * to the {@link #get(Object)} method on the same key might return null as the period of time
+ * between the 2 request might have been long enough for the underlying Cache implementation
+ * to remove the key.
+ *
+ * @param key the key to test.
+ * @return true if the key exists.
+ */
+ public boolean hasKey( Object key );
+
+ /**
+ * Get the value of the specified key, if it exists in the cache.
+ *
+ * @param key the key to fetch the contents of.
+ * @return the value of the key, or null if not found.
+ */
+ public Object get( Object key );
+
+ /**
+ * Put the specified value into the cache under the provided key.
+ *
+ * @param key the key to put the value into
+ * @param value the object to place into the cache.
+ * @return the previous value for the key, or null if the key contained no value.
+ */
+ public Object put( Object key, Object value );
+
+ /**
+ * Register the specified value into the cache under the provided key.
+ *
+ * This {@link #register(Object, Object)} method is just an optimized version of the {@link #put(Object, Object)}
+ * method, but does not return the previous value contained with the specified key.
+ *
+ * @param key the key to put the value into
+ * @param value the object to place into the cache.
+ */
+ public void register( Object key, Object value );
+
+ /**
+ * Remove the specified key and value from the cache.
+ *
+ * @param key the key to the value to remove.
+ * @return the value of the key that was removed.
+ */
+ public Object remove( Object key );
+
+ /**
+ * Clear the cache of all entries.
+ */
+ public void clear();
+
+ /**
+ * Obtain a set of Statistics about the performance of the cache.
+ *
+ * @return the cache statistics.
+ */
+ public CacheStatistics getStatistics();
+
+}
Propchange: archiva/redback/redback-components/trunk/spring-cache/spring-cache-api/src/main/java/org/codehaus/plexus/cache/Cache.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: archiva/redback/redback-components/trunk/spring-cache/spring-cache-api/src/main/java/org/codehaus/plexus/cache/Cache.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: archiva/redback/redback-components/trunk/spring-cache/spring-cache-api/src/main/java/org/codehaus/plexus/cache/CacheException.java
URL: http://svn.apache.org/viewvc/archiva/redback/redback-components/trunk/spring-cache/spring-cache-api/src/main/java/org/codehaus/plexus/cache/CacheException.java?rev=1310262&view=auto
==============================================================================
--- archiva/redback/redback-components/trunk/spring-cache/spring-cache-api/src/main/java/org/codehaus/plexus/cache/CacheException.java (added)
+++ archiva/redback/redback-components/trunk/spring-cache/spring-cache-api/src/main/java/org/codehaus/plexus/cache/CacheException.java Fri Apr 6 09:33:40 2012
@@ -0,0 +1,49 @@
+package org.codehaus.plexus.cache;
+
+/*
+ * Copyright 2001-2007 The Codehaus.
+ *
+ * Licensed 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.
+ */
+
+/**
+ * CacheException
+ *
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ */
+public class CacheException
+ extends Exception
+{
+
+ public CacheException()
+ {
+ super();
+ }
+
+ public CacheException( String message, Throwable cause )
+ {
+ super( message, cause );
+ }
+
+ public CacheException( String message )
+ {
+ super( message );
+ }
+
+ public CacheException( Throwable cause )
+ {
+ super( cause );
+ }
+
+}
Propchange: archiva/redback/redback-components/trunk/spring-cache/spring-cache-api/src/main/java/org/codehaus/plexus/cache/CacheException.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: archiva/redback/redback-components/trunk/spring-cache/spring-cache-api/src/main/java/org/codehaus/plexus/cache/CacheException.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: archiva/redback/redback-components/trunk/spring-cache/spring-cache-api/src/main/java/org/codehaus/plexus/cache/CacheHints.java
URL: http://svn.apache.org/viewvc/archiva/redback/redback-components/trunk/spring-cache/spring-cache-api/src/main/java/org/codehaus/plexus/cache/CacheHints.java?rev=1310262&view=auto
==============================================================================
--- archiva/redback/redback-components/trunk/spring-cache/spring-cache-api/src/main/java/org/codehaus/plexus/cache/CacheHints.java (added)
+++ archiva/redback/redback-components/trunk/spring-cache/spring-cache-api/src/main/java/org/codehaus/plexus/cache/CacheHints.java Fri Apr 6 09:33:40 2012
@@ -0,0 +1,144 @@
+package org.codehaus.plexus.cache;
+
+import org.apache.commons.lang.CharSet;
+
+import java.io.File;
+
+/*
+ * 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.
+ */
+
+/**
+ * CacheHints
+ *
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ */
+public class CacheHints
+{
+ /* To Other Plexus Cache Developers.
+ *
+ * When considering if there is an appropriate value to put into this hints object,
+ * consider if it is available in 2 or more cache providers.
+ */
+
+ /**
+ * The name of the cache.
+ */
+ private String name;
+
+ /**
+ * To allow the cache to use the disk (or not)
+ */
+ private boolean overflowToDisk = false;
+
+ /**
+ * The path on disk to overflow cache into.
+ */
+ private File diskOverflowPath = null;
+
+ /**
+ * To set the maximum number of elements that the cache tracks.
+ */
+ private int maxElements = 1000;
+
+ /**
+ * To set the maximum number of seconds that the element can exist in the cache, regardless of how
+ * popular and active it may be.
+ */
+ private int maxSecondsInCache = 0;
+
+ /**
+ * To set the maximum number of seconds that the element can exist idle in the cache.
+ */
+ private int idleExpirationSeconds = 600;
+
+ public CacheHints()
+ {
+ super();
+ }
+
+ public File getDiskOverflowPath()
+ {
+ return diskOverflowPath;
+ }
+
+ public int getIdleExpirationSeconds()
+ {
+ return idleExpirationSeconds;
+ }
+
+ public int getMaxElements()
+ {
+ return maxElements;
+ }
+
+ public int getMaxSecondsInCache()
+ {
+ return maxSecondsInCache;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public boolean isOverflowToDisk()
+ {
+ return overflowToDisk;
+ }
+
+ public void setDiskOverflowPath( File diskOverflowPath )
+ {
+ this.diskOverflowPath = diskOverflowPath;
+ }
+
+ public void setIdleExpirationSeconds( int idleExpirationSeconds )
+ {
+ this.idleExpirationSeconds = idleExpirationSeconds;
+ }
+
+ public void setMaxElements( int maxElements )
+ {
+ this.maxElements = maxElements;
+ }
+
+ public void setMaxSecondsInCache( int maxSecondsInCache )
+ {
+ this.maxSecondsInCache = maxSecondsInCache;
+ }
+
+ public void setName( String name )
+ {
+ CharSet illegal = CharSet.getInstance( ":/\\\"' " );
+ for ( int i = 0; i < name.length(); i++ )
+ {
+ char c = name.charAt( i );
+ if ( illegal.contains( c ) )
+ {
+ throw new IllegalArgumentException( "Name cannot contain characters from the set [" + illegal + "]" );
+ }
+ }
+ this.name = name;
+ }
+
+ public void setOverflowToDisk( boolean overflowToDisk )
+ {
+ this.overflowToDisk = overflowToDisk;
+ }
+}
Propchange: archiva/redback/redback-components/trunk/spring-cache/spring-cache-api/src/main/java/org/codehaus/plexus/cache/CacheHints.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: archiva/redback/redback-components/trunk/spring-cache/spring-cache-api/src/main/java/org/codehaus/plexus/cache/CacheHints.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: archiva/redback/redback-components/trunk/spring-cache/spring-cache-api/src/main/java/org/codehaus/plexus/cache/CacheStatistics.java
URL: http://svn.apache.org/viewvc/archiva/redback/redback-components/trunk/spring-cache/spring-cache-api/src/main/java/org/codehaus/plexus/cache/CacheStatistics.java?rev=1310262&view=auto
==============================================================================
--- archiva/redback/redback-components/trunk/spring-cache/spring-cache-api/src/main/java/org/codehaus/plexus/cache/CacheStatistics.java (added)
+++ archiva/redback/redback-components/trunk/spring-cache/spring-cache-api/src/main/java/org/codehaus/plexus/cache/CacheStatistics.java Fri Apr 6 09:33:40 2012
@@ -0,0 +1,59 @@
+package org.codehaus.plexus.cache;
+
+/*
+ * Copyright 2001-2007 The Codehaus.
+ *
+ * Licensed 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.
+ */
+
+/**
+ * CacheStatistics
+ *
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ */
+public interface CacheStatistics
+{
+ /**
+ * Return the number of hits to content present in the cache.
+ *
+ * @return the number of hits to content present in the cache.
+ */
+ public long getCacheHits();
+
+ /**
+ * Return the number of hits to keys that are not (yet) in the cache.
+ *
+ * @return the number of requests for content missing from the cache.
+ */
+ public long getCacheMiss();
+
+ /**
+ * Compute for the efficiency of this cache.
+ *
+ * @return the ratio of cache hits to the cache misses to queries for cache objects
+ */
+ public double getCacheHitRate();
+
+ /**
+ * Return the size of the current cache.
+ *
+ * @return the size of the current cache.
+ */
+ public long getSize();
+
+ /**
+ * Clear the statistics of the cache.
+ */
+ public void clear();
+}
Propchange: archiva/redback/redback-components/trunk/spring-cache/spring-cache-api/src/main/java/org/codehaus/plexus/cache/CacheStatistics.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: archiva/redback/redback-components/trunk/spring-cache/spring-cache-api/src/main/java/org/codehaus/plexus/cache/CacheStatistics.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: archiva/redback/redback-components/trunk/spring-cache/spring-cache-api/src/main/java/org/codehaus/plexus/cache/CacheableWrapper.java
URL: http://svn.apache.org/viewvc/archiva/redback/redback-components/trunk/spring-cache/spring-cache-api/src/main/java/org/codehaus/plexus/cache/CacheableWrapper.java?rev=1310262&view=auto
==============================================================================
--- archiva/redback/redback-components/trunk/spring-cache/spring-cache-api/src/main/java/org/codehaus/plexus/cache/CacheableWrapper.java (added)
+++ archiva/redback/redback-components/trunk/spring-cache/spring-cache-api/src/main/java/org/codehaus/plexus/cache/CacheableWrapper.java Fri Apr 6 09:33:40 2012
@@ -0,0 +1,59 @@
+package org.codehaus.plexus.cache;
+
+/*
+ * Copyright 2007 The Codehaus Foundation.
+ *
+ * Licensed 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.
+ */
+
+import java.io.Serializable;
+
+/**
+ * CacheableWrapper
+ *
+ * @author <a href="mailto:Olivier.LAMY@accor.com">Olivier Lamy</a>
+ * @version $Id$
+ */
+public class CacheableWrapper
+ implements Serializable
+{
+ private Object value;
+
+ private long storedTime;
+
+ public CacheableWrapper( Object value, long storedTime )
+ {
+ this.value = value;
+ this.storedTime = storedTime;
+ }
+
+ public Object getValue()
+ {
+ return value;
+ }
+
+ public void setValue( Object value )
+ {
+ this.value = value;
+ }
+
+ public long getStoredTime()
+ {
+ return storedTime;
+ }
+
+ public void setStoredTime( long storedTime )
+ {
+ this.storedTime = storedTime;
+ }
+}
Propchange: archiva/redback/redback-components/trunk/spring-cache/spring-cache-api/src/main/java/org/codehaus/plexus/cache/CacheableWrapper.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: archiva/redback/redback-components/trunk/spring-cache/spring-cache-api/src/main/java/org/codehaus/plexus/cache/CacheableWrapper.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: archiva/redback/redback-components/trunk/spring-cache/spring-cache-api/src/main/java/org/codehaus/plexus/cache/builder/CacheBuilder.java
URL: http://svn.apache.org/viewvc/archiva/redback/redback-components/trunk/spring-cache/spring-cache-api/src/main/java/org/codehaus/plexus/cache/builder/CacheBuilder.java?rev=1310262&view=auto
==============================================================================
--- archiva/redback/redback-components/trunk/spring-cache/spring-cache-api/src/main/java/org/codehaus/plexus/cache/builder/CacheBuilder.java (added)
+++ archiva/redback/redback-components/trunk/spring-cache/spring-cache-api/src/main/java/org/codehaus/plexus/cache/builder/CacheBuilder.java Fri Apr 6 09:33:40 2012
@@ -0,0 +1,44 @@
+package org.codehaus.plexus.cache.builder;
+
+import org.codehaus.plexus.cache.Cache;
+
+/*
+ * Copyright 2001-2007 The Codehaus.
+ *
+ * Licensed 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.
+ */
+
+/**
+ * CacheBuilder Interface, for obtaining caches from plexus using hints or clazz names.
+ *
+ * @author <a href="mailto:Olivier.LAMY@accor.com">Olivier Lamy</a>
+ * @version $Id$
+ * @since 3 February, 2007
+ */
+public interface CacheBuilder
+{
+ String ROLE = CacheBuilder.class.getName();
+
+ /**
+ * @param roleHint
+ * @return
+ */
+ public Cache getCache( String roleHint );
+
+ /**
+ * @param clazz
+ * @return
+ */
+ public Cache getCache( Class clazz );
+
+}
Propchange: archiva/redback/redback-components/trunk/spring-cache/spring-cache-api/src/main/java/org/codehaus/plexus/cache/builder/CacheBuilder.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: archiva/redback/redback-components/trunk/spring-cache/spring-cache-api/src/main/java/org/codehaus/plexus/cache/builder/CacheBuilder.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: archiva/redback/redback-components/trunk/spring-cache/spring-cache-api/src/main/java/org/codehaus/plexus/cache/builder/DefaultCacheBuilder.java
URL: http://svn.apache.org/viewvc/archiva/redback/redback-components/trunk/spring-cache/spring-cache-api/src/main/java/org/codehaus/plexus/cache/builder/DefaultCacheBuilder.java?rev=1310262&view=auto
==============================================================================
--- archiva/redback/redback-components/trunk/spring-cache/spring-cache-api/src/main/java/org/codehaus/plexus/cache/builder/DefaultCacheBuilder.java (added)
+++ archiva/redback/redback-components/trunk/spring-cache/spring-cache-api/src/main/java/org/codehaus/plexus/cache/builder/DefaultCacheBuilder.java Fri Apr 6 09:33:40 2012
@@ -0,0 +1,91 @@
+package org.codehaus.plexus.cache.builder;
+
+/*
+ * Copyright 2001-2007 The Codehaus.
+ *
+ * Licensed 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.
+ */
+
+import org.codehaus.plexus.cache.Cache;
+import org.codehaus.plexus.cache.impl.NoCacheCache;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.context.ApplicationContext;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
+import javax.inject.Inject;
+
+/**
+ * Ability to obtain cache
+ *
+ * @author Olivier Lamy
+ * @version $Id$
+ * @plexus.component role="org.codehaus.plexus.cache.builder.CacheBuilder" role-hint="default"
+ */
+@Service
+public class DefaultCacheBuilder
+ implements CacheBuilder
+{
+
+ private Logger log = LoggerFactory.getLogger( getClass() );
+
+ private Cache defaultCache;
+
+ private Cache noCache = new NoCacheCache();
+
+ @Inject
+ private ApplicationContext applicationContext;
+
+ @PostConstruct
+ public void initialize()
+ {
+ if ( this.applicationContext.containsBean( "cache#default" ) )
+ {
+ this.defaultCache = this.applicationContext.getBean( "cache#default", Cache.class );
+
+ }
+ else
+ {
+ log.info( "Cache with role-hint default doesn't exists, default will be no cache" );
+ this.defaultCache = new NoCacheCache();
+ }
+ }
+
+ public Cache getCache( String roleHint )
+ {
+ if ( this.applicationContext.containsBean( "cache#" + roleHint ) )
+ {
+ return this.applicationContext.getBean( "cache#" + roleHint, Cache.class );
+ }
+
+ return this.getDefaultCache();
+ }
+
+ public Cache getCache( Class clazz )
+ {
+ return this.getCache( clazz.getName() );
+ }
+
+ @PreDestroy
+ public void dispose()
+ {
+ // TODO dispose default ?
+ }
+
+ public Cache getDefaultCache()
+ {
+ return defaultCache == null ? this.noCache : this.defaultCache;
+ }
+}
Propchange: archiva/redback/redback-components/trunk/spring-cache/spring-cache-api/src/main/java/org/codehaus/plexus/cache/builder/DefaultCacheBuilder.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: archiva/redback/redback-components/trunk/spring-cache/spring-cache-api/src/main/java/org/codehaus/plexus/cache/builder/DefaultCacheBuilder.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: archiva/redback/redback-components/trunk/spring-cache/spring-cache-api/src/main/java/org/codehaus/plexus/cache/factory/CacheCreator.java
URL: http://svn.apache.org/viewvc/archiva/redback/redback-components/trunk/spring-cache/spring-cache-api/src/main/java/org/codehaus/plexus/cache/factory/CacheCreator.java?rev=1310262&view=auto
==============================================================================
--- archiva/redback/redback-components/trunk/spring-cache/spring-cache-api/src/main/java/org/codehaus/plexus/cache/factory/CacheCreator.java (added)
+++ archiva/redback/redback-components/trunk/spring-cache/spring-cache-api/src/main/java/org/codehaus/plexus/cache/factory/CacheCreator.java Fri Apr 6 09:33:40 2012
@@ -0,0 +1,39 @@
+package org.codehaus.plexus.cache.factory;
+
+/*
+ * Copyright 2001-2007 The Codehaus.
+ *
+ * Licensed 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.
+ */
+
+import org.codehaus.plexus.cache.Cache;
+import org.codehaus.plexus.cache.CacheException;
+import org.codehaus.plexus.cache.CacheHints;
+
+/**
+ * CacheCreator - an interface for CacheCreators
+ *
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ */
+public interface CacheCreator
+{
+ /**
+ * Create a Cache, initialize it, and return it.
+ *
+ * @param cacheHint the cache hints to use.
+ * @return the created cache.
+ * @throws CacheException if there was a cache creation error.
+ */
+ public Cache createCache( CacheHints hints ) throws CacheException;
+}
Propchange: archiva/redback/redback-components/trunk/spring-cache/spring-cache-api/src/main/java/org/codehaus/plexus/cache/factory/CacheCreator.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: archiva/redback/redback-components/trunk/spring-cache/spring-cache-api/src/main/java/org/codehaus/plexus/cache/factory/CacheCreator.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision