continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
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 GMT
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<Artifact> artifacts = new ArrayList<Artifact>();
@@ -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 @@
       <groupId>jpox</groupId>
       <artifactId>jpox</artifactId>
       <version>1.1.6</version>
-      <scope>test</scope>
+      <!-- Temporary while we have the cache in there
+            <scope>test</scope>
+      -->
     </dependency>
     <dependency>
       <groupId>hsqldb</groupId>

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 @@
+<?xml version="1.0"?>
+<plugin id="org.apache.maven.continuum.management.jpox.SafeguardCache" name="JPOX plug-ins"
provider-name="Maven">
+  <extension point="org.jpox.cache_level1">
+    <cache name="SafeguardCache" class-name="org.apache.maven.continuum.management.jpox.SafeguardCache"/>
+  </extension>
+</plugin>

Propchange: maven/continuum/trunk/continuum-data-management/data-management-jdo/src/main/resources/META-INF/plugins/plugin.xml
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message