incubator-adffaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From awi...@apache.org
Subject svn commit: r409718 - /incubator/adffaces/trunk/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/context/AdfFacesContextImpl.java
Date Fri, 26 May 2006 18:33:42 GMT
Author: awiner
Date: Fri May 26 11:33:41 2006
New Revision: 409718

URL: http://svn.apache.org/viewvc?rev=409718&view=rev
Log:
Remove references to ChangeManager implementations that don't exist in the Apache repos; 
support registering a ChanageManager by class name

Modified:
    incubator/adffaces/trunk/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/context/AdfFacesContextImpl.java

Modified: incubator/adffaces/trunk/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/context/AdfFacesContextImpl.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/trunk/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/context/AdfFacesContextImpl.java?rev=409718&r1=409717&r2=409718&view=diff
==============================================================================
--- incubator/adffaces/trunk/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/context/AdfFacesContextImpl.java
(original)
+++ incubator/adffaces/trunk/adf-faces/adf-faces-impl/src/main/java/org/apache/myfaces/adfinternal/context/AdfFacesContextImpl.java
Fri May 26 11:33:41 2006
@@ -284,25 +284,16 @@
         _CHANGE_PERSISTENCE_INIT_PARAM);
     if (changeManager != null)
     {
+      // Support the "session" token
       if ("session".equalsIgnoreCase(changeManager))
       {
         _LOG.info("ADF Faces is using HTTPSession for change persistence");
         return new SessionChangeManager();
       }
-      else if ("mds".equalsIgnoreCase(changeManager))
-      {
-        _LOG.info("ADF Faces is using MDS for change persistence");
-        return _createChangeManager("org.apache.myfaces.adfinternal.change.MDSDocumentChangeManager");
-      }
-      else if ("test".equalsIgnoreCase(changeManager))
-      {
-        _LOG.info("ADF Faces is using TestDocumentChangeManager for change persistence");
-        return _createChangeManager("org.apache.myfaces.adfinternal.change.TestDocumentChangeManager");
-      }
+      // Otherwise, just assume its a class name.
       else
       {
-        _LOG.warning("Unknown value:{0} for web.xml init parameter:{1}",
-          new Object[] {changeManager, _CHANGE_PERSISTENCE_INIT_PARAM});
+        return _createChangeManager(changeManager);
       }
     }
     return new NullChangeManager();
@@ -317,28 +308,17 @@
   private ChangeManager _createChangeManager(
     String className)
   {
-    ChangeManager manager = null;
-    Throwable e = null;
-
     try
     {
       Class managerClass = ClassLoaderUtils.loadClass(className);
-      manager = (ChangeManager)managerClass.newInstance();
+      return (ChangeManager)managerClass.newInstance();
     }
     catch (Throwable throwable)
     {
-      e = throwable;
+      _LOG.warning("Unable to create ChangeManager:" + className,
+                   throwable);
+      return new NullChangeManager();
     }
-
-    // if loading the specified class failed,
-    if (manager == null)
-    {
-      _LOG.warning("Unable to create ChangeManager:" + className, e); // NOTRANS
-
-      manager = new SessionChangeManager();
-    }
-
-    return manager;
   }
 
 



Mime
View raw message