jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r805686 - in /jackrabbit/trunk/jackrabbit-core/src/main: java/org/apache/jackrabbit/core/config/BeanConfig.java resources/org/apache/jackrabbit/core/config/deprecated-classes.properties
Date Wed, 19 Aug 2009 07:07:23 GMT
Author: mreutegg
Date: Wed Aug 19 07:07:23 2009
New Revision: 805686

URL: http://svn.apache.org/viewvc?rev=805686&view=rev
Log:
JCR-2147: Remove deprecated classes in jackrabbit-core

Added:
    jackrabbit/trunk/jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/config/deprecated-classes.properties
  (with props)
Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/BeanConfig.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/BeanConfig.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/BeanConfig.java?rev=805686&r1=805685&r2=805686&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/BeanConfig.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/BeanConfig.java
Wed Aug 19 07:07:23 2009
@@ -22,6 +22,11 @@
 
 import java.util.Iterator;
 import java.util.Properties;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.Collections;
+import java.io.InputStream;
+import java.io.IOException;
 
 /**
  * Bean configuration class. BeanConfig instances contain the class name
@@ -32,6 +37,27 @@
 
     private static Logger log = LoggerFactory.getLogger(BeanConfig.class);
 
+    private static final Map<String, String> DEPRECATIONS;
+
+    static {
+        try {
+            Map<String, String> temp = new HashMap<String, String>();
+            Properties props = new Properties();
+            InputStream in = BeanConfig.class.getResourceAsStream("deprecated-classes.properties");
+            try {
+                props.load(in);
+            } finally {
+                in.close();
+            }
+            for (Map.Entry<Object, Object> entry : props.entrySet()) {
+                temp.put(entry.getKey().toString(), entry.getValue().toString());
+            }
+            DEPRECATIONS = Collections.unmodifiableMap(temp);
+        } catch (IOException e) {
+            throw new InternalError("failed to read deprecated classes");
+        }
+    }
+
     /** The default class loader used by all instances of this class */
     private static ClassLoader defaultClassLoader =
         BeanConfig.class.getClassLoader();
@@ -74,6 +100,11 @@
      * @param properties initial properties of the bean
      */
     public BeanConfig(String className, Properties properties) {
+        if (DEPRECATIONS.containsKey(className)) {
+            String replacement = DEPRECATIONS.get(className);
+            log.info("{} is deprecated. Please use {} instead", className, replacement);
+            className = replacement;
+        }
         this.className = className;
         this.properties = (Properties) properties.clone();
     }

Added: jackrabbit/trunk/jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/config/deprecated-classes.properties
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/config/deprecated-classes.properties?rev=805686&view=auto
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/config/deprecated-classes.properties
(added)
+++ jackrabbit/trunk/jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/config/deprecated-classes.properties
Wed Aug 19 07:07:23 2009
@@ -0,0 +1,37 @@
+#  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.
+
+# This file contains a mapping of deprecated classes to their replacement.
+# When a BeanConfig reads the class attribute it will automatically replace
+# the deprecated class name with its replacement and log an info message.
+
+# Security
+org.apache.jackrabbit.core.security.SimpleAccessManager=org.apache.jackrabbit.core.security.simple.SimpleAccessManager
+org.apache.jackrabbit.core.security.SimpleLoginModule=org.apache.jackrabbit.core.security.simple.SimpleLoginModule
+
+# DB persistence managers
+org.apache.jackrabbit.core.state.db.DerbyPersistenceManager=org.apache.jackrabbit.core.persistence.db.DerbyPersistenceManager
+org.apache.jackrabbit.core.state.db.JNDIDatabasePersistenceManager=org.apache.jackrabbit.core.persistence.db.JNDIDatabasePersistenceManager
+org.apache.jackrabbit.core.state.db.OraclePersistenceManager=org.apache.jackrabbit.core.persistence.db.OraclePersistenceManager
+org.apache.jackrabbit.core.state.db.SimpleDbPersistenceManager=org.apache.jackrabbit.core.persistence.db.SimpleDbPersistenceManager
+
+# In memory persistence manager
+org.apache.jackrabbit.core.state.mem.InMemPersistenceManager=org.apache.jackrabbit.core.persistence.mem.InMemPersistenceManager
+
+# Object persistence manager
+org.apache.jackrabbit.core.state.obj.ObjectPersistenceManager=org.apache.jackrabbit.core.persistence.obj.ObjectPersistenceManager
+
+# XML persistence manager
+org.apache.jackrabbit.core.state.xml.XMLPersistenceManager=org.apache.jackrabbit.core.persistence.xml.XMLPersistenceManager

Propchange: jackrabbit/trunk/jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/config/deprecated-classes.properties
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message