From continuum-commits-return-3188-apmail-maven-continuum-commits-archive=maven.apache.org@maven.apache.org Tue Jun 12 18:34:31 2007 Return-Path: Delivered-To: apmail-maven-continuum-commits-archive@www.apache.org Received: (qmail 93674 invoked from network); 12 Jun 2007 18:34:29 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 12 Jun 2007 18:34:29 -0000 Received: (qmail 29432 invoked by uid 500); 12 Jun 2007 18:34:32 -0000 Delivered-To: apmail-maven-continuum-commits-archive@maven.apache.org Received: (qmail 29384 invoked by uid 500); 12 Jun 2007 18:34:32 -0000 Mailing-List: contact continuum-commits-help@maven.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: continuum-dev@maven.apache.org Delivered-To: mailing list continuum-commits@maven.apache.org Received: (qmail 29203 invoked by uid 99); 12 Jun 2007 18:34:32 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Jun 2007 11:34:32 -0700 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Jun 2007 11:34:27 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id ACB641A981A; Tue, 12 Jun 2007 11:34:07 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r546587 - in /maven/continuum/trunk/continuum-data-management: data-management-api/src/main/java/org/apache/maven/continuum/management/ data-management-cli/src/main/java/org/apache/maven/continuum/management/ data-management-jdo/ data-manag... Date: Tue, 12 Jun 2007 18:34:07 -0000 To: continuum-commits@maven.apache.org From: brett@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070612183407.ACB641A981A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: brett Date: Tue Jun 12 11:34:06 2007 New Revision: 546587 URL: http://svn.apache.org/viewvc?view=rev&rev=546587 Log: put in an alternate cache to work around one aspect of CORE-3297 Added: maven/continuum/trunk/continuum-data-management/data-management-jdo/src/main/java/org/apache/maven/continuum/management/jpox/ maven/continuum/trunk/continuum-data-management/data-management-jdo/src/main/java/org/apache/maven/continuum/management/jpox/SafeguardCache.java (with props) maven/continuum/trunk/continuum-data-management/data-management-jdo/src/main/java/org/jpox/ maven/continuum/trunk/continuum-data-management/data-management-jdo/src/main/java/org/jpox/store/ maven/continuum/trunk/continuum-data-management/data-management-jdo/src/main/resources/ maven/continuum/trunk/continuum-data-management/data-management-jdo/src/main/resources/META-INF/ maven/continuum/trunk/continuum-data-management/data-management-jdo/src/main/resources/META-INF/plugins/ maven/continuum/trunk/continuum-data-management/data-management-jdo/src/main/resources/META-INF/plugins/plugin.xml (with props) Modified: maven/continuum/trunk/continuum-data-management/data-management-api/src/main/java/org/apache/maven/continuum/management/DatabaseParams.java maven/continuum/trunk/continuum-data-management/data-management-cli/src/main/java/org/apache/maven/continuum/management/DataManagementCli.java maven/continuum/trunk/continuum-data-management/data-management-jdo/pom.xml maven/continuum/trunk/continuum-data-management/data-management-jdo/src/main/java/org/apache/maven/continuum/management/JdoDatabaseManager.java Modified: maven/continuum/trunk/continuum-data-management/data-management-api/src/main/java/org/apache/maven/continuum/management/DatabaseParams.java URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-data-management/data-management-api/src/main/java/org/apache/maven/continuum/management/DatabaseParams.java?view=diff&rev=546587&r1=546586&r2=546587 ============================================================================== --- maven/continuum/trunk/continuum-data-management/data-management-api/src/main/java/org/apache/maven/continuum/management/DatabaseParams.java (original) +++ maven/continuum/trunk/continuum-data-management/data-management-api/src/main/java/org/apache/maven/continuum/management/DatabaseParams.java Tue Jun 12 11:34:06 2007 @@ -19,6 +19,8 @@ * under the License. */ +import java.util.Properties; + /** * Bean for storing database parameters. */ @@ -38,6 +40,8 @@ private String password; + private final Properties properties = new Properties(); + DatabaseParams( String driverClass, String groupId, String artifactId, String version, String username, String password ) { @@ -109,5 +113,10 @@ public void setUrl( String url ) { this.url = url; + } + + public Properties getProperties() + { + return properties; } } Modified: maven/continuum/trunk/continuum-data-management/data-management-cli/src/main/java/org/apache/maven/continuum/management/DataManagementCli.java URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-data-management/data-management-cli/src/main/java/org/apache/maven/continuum/management/DataManagementCli.java?view=diff&rev=546587&r1=546586&r2=546587 ============================================================================== --- maven/continuum/trunk/continuum-data-management/data-management-cli/src/main/java/org/apache/maven/continuum/management/DataManagementCli.java (original) +++ maven/continuum/trunk/continuum-data-management/data-management-cli/src/main/java/org/apache/maven/continuum/management/DataManagementCli.java Tue Jun 12 11:34:06 2007 @@ -104,6 +104,7 @@ DatabaseParams params = new DatabaseParams( databaseType.defaultParams ); params.setUrl( command.jdbcUrl ); + params.getProperties().setProperty( "org.jpox.cache.level1.type", "SafeguardCache" ); DefaultPlexusContainer container = new DefaultPlexusContainer(); List artifacts = new ArrayList(); @@ -144,7 +145,14 @@ for ( Artifact a : artifacts ) { - if ( filter.include( a ) ) + if ( "jpox".equals( a.getGroupId() ) && "jpox".equals( a.getArtifactId() ) ) + { + if ( a.getVersion().equals( databaseFormat.getJpoxVersion() ) ) + { + jars.add( a.getFile() ); + } + } + else if ( filter.include( a ) ) { jars.add( a.getFile() ); } Modified: maven/continuum/trunk/continuum-data-management/data-management-jdo/pom.xml URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-data-management/data-management-jdo/pom.xml?view=diff&rev=546587&r1=546586&r2=546587 ============================================================================== --- maven/continuum/trunk/continuum-data-management/data-management-jdo/pom.xml (original) +++ maven/continuum/trunk/continuum-data-management/data-management-jdo/pom.xml Tue Jun 12 11:34:06 2007 @@ -66,7 +66,9 @@ jpox jpox 1.1.6 - test + hsqldb Modified: maven/continuum/trunk/continuum-data-management/data-management-jdo/src/main/java/org/apache/maven/continuum/management/JdoDatabaseManager.java URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-data-management/data-management-jdo/src/main/java/org/apache/maven/continuum/management/JdoDatabaseManager.java?view=diff&rev=546587&r1=546586&r2=546587 ============================================================================== --- maven/continuum/trunk/continuum-data-management/data-management-jdo/src/main/java/org/apache/maven/continuum/management/JdoDatabaseManager.java (original) +++ maven/continuum/trunk/continuum-data-management/data-management-jdo/src/main/java/org/apache/maven/continuum/management/JdoDatabaseManager.java Tue Jun 12 11:34:06 2007 @@ -1,25 +1,28 @@ package org.apache.maven.continuum.management; +/* +* 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. +*/ + import org.codehaus.plexus.jdo.DefaultConfigurableJdoFactory; -/* - * 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. - */ +import java.util.Iterator; +import java.util.Properties; /** * Initialization helper. @@ -41,5 +44,12 @@ factory.setUserName( params.getUsername() ); factory.setPassword( params.getPassword() ); factory.setUrl( params.getUrl() ); + + Properties properties = params.getProperties(); + for ( Iterator i = properties.keySet().iterator(); i.hasNext(); ) + { + String key = (String) i.next(); + factory.setProperty( key, properties.getProperty( key ) ); + } } } Added: maven/continuum/trunk/continuum-data-management/data-management-jdo/src/main/java/org/apache/maven/continuum/management/jpox/SafeguardCache.java URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-data-management/data-management-jdo/src/main/java/org/apache/maven/continuum/management/jpox/SafeguardCache.java?view=auto&rev=546587 ============================================================================== --- maven/continuum/trunk/continuum-data-management/data-management-jdo/src/main/java/org/apache/maven/continuum/management/jpox/SafeguardCache.java (added) +++ maven/continuum/trunk/continuum-data-management/data-management-jdo/src/main/java/org/apache/maven/continuum/management/jpox/SafeguardCache.java Tue Jun 12 11:34:06 2007 @@ -0,0 +1,45 @@ +package org.apache.maven.continuum.management.jpox; + +/* + * 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. + */ + +import org.jpox.StateManager; +import org.jpox.cache.WeakRefCache; + +/** + * Hack around CORE-3297 + */ +public class SafeguardCache + extends WeakRefCache +{ + public Object get( Object key ) + { + Object value = super.get( key ); + + if ( value instanceof StateManager ) + { + StateManager sm = (StateManager) value; + if ( !sm.getInternalObjectId().toString().equals( key.toString() ) ) + { + return null; + } + } + return value; + } +} Propchange: maven/continuum/trunk/continuum-data-management/data-management-jdo/src/main/java/org/apache/maven/continuum/management/jpox/SafeguardCache.java ------------------------------------------------------------------------------ svn:eol-style = native Added: maven/continuum/trunk/continuum-data-management/data-management-jdo/src/main/resources/META-INF/plugins/plugin.xml URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-data-management/data-management-jdo/src/main/resources/META-INF/plugins/plugin.xml?view=auto&rev=546587 ============================================================================== --- maven/continuum/trunk/continuum-data-management/data-management-jdo/src/main/resources/META-INF/plugins/plugin.xml (added) +++ maven/continuum/trunk/continuum-data-management/data-management-jdo/src/main/resources/META-INF/plugins/plugin.xml Tue Jun 12 11:34:06 2007 @@ -0,0 +1,6 @@ + + + + + + Propchange: maven/continuum/trunk/continuum-data-management/data-management-jdo/src/main/resources/META-INF/plugins/plugin.xml ------------------------------------------------------------------------------ svn:eol-style = native