Improve initialization of Jackrabbit container
authorMathieu Baudier <mbaudier@argeo.org>
Fri, 6 May 2011 15:55:23 +0000 (15:55 +0000)
committerMathieu Baudier <mbaudier@argeo.org>
Fri, 6 May 2011 15:55:23 +0000 (15:55 +0000)
NEW - bug 31: Add Swing based map viewer in RCP
https://bugzilla.argeo.org/show_bug.cgi?id=31

git-svn-id: https://svn.argeo.org/commons/trunk@4519 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc

server/runtime/org.argeo.server.jackrabbit/src/main/java/org/argeo/jackrabbit/JackrabbitContainer.java

index 3dab19312dd57dd3ba8fe1d58055976400b9623b..294fdd5a3ec6d01f667bb1e360f73a7d868e6ca0 100644 (file)
@@ -95,10 +95,11 @@ public class JackrabbitContainer implements InitializingBean, DisposableBean,
 
        /** @deprecated explicitly declare {@link #init()} as init-method instead. */
        public void afterPropertiesSet() throws Exception {
-               log.warn("## This initialization approach is deprecated and will be removed,"
-                               + " declare init-method=\"init\" instead.");
-               if (!alreadyInitialized)
+               if (!alreadyInitialized) {
+                       log.warn("## If not already done,"
+                                       + " declare init-method=\"init\".");
                        initImpl();
+               }
        }
 
        public void init() throws Exception {
@@ -165,10 +166,11 @@ public class JackrabbitContainer implements InitializingBean, DisposableBean,
         *             instead.
         */
        public void destroy() throws Exception {
-               log.warn("## This dispose approach is deprecated and will be removed,"
-                               + " declare destroy-method=\"dispose\" instead.");
-               if (!alreadyDisposed)
+               if (!alreadyDisposed) {
+                       log.warn("## If not already done,"
+                                       + " declare destroy-method=\"dispose\".");
                        disposeImpl();
+               }
        }
 
        public void dispose() throws Exception {
@@ -233,17 +235,17 @@ public class JackrabbitContainer implements InitializingBean, DisposableBean,
         * will be thrown.
         */
        protected void importNodeTypeDefinitions(final Repository repository) {
-               final Credentials credentialsToUse;
-               if (systemExecutor == null) {
-                       if (adminCredentials == null) {
-                               log.error("No system executor or admin credentials found,"
-                                               + " cannot import node types");
-                               return;
-                       }
-                       credentialsToUse = adminCredentials;
-               } else {
-                       credentialsToUse = null;
-               }
+               final Credentials credentialsToUse = null;
+               // if (systemExecutor == null) {
+               // if (adminCredentials == null) {
+               // log.error("No system executor or admin credentials found,"
+               // + " cannot import node types");
+               // return;
+               // }
+               // credentialsToUse = adminCredentials;
+               // } else {
+               // credentialsToUse = null;
+               // }
 
                Runnable action = new Runnable() {
                        public void run() {