[jboss-cvs] Picketlink SVN: r1570 - in product/branches/2.0.2_JBPAPP-9307/picketlink-core/src/main/java/org/picketlink/identity/federation: core/util and 1 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Jul 10 15:38:10 EDT 2012


Author: dehort
Date: 2012-07-10 15:38:10 -0400 (Tue, 10 Jul 2012)
New Revision: 1570

Modified:
   product/branches/2.0.2_JBPAPP-9307/picketlink-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/util/DocumentUtil.java
   product/branches/2.0.2_JBPAPP-9307/picketlink-core/src/main/java/org/picketlink/identity/federation/core/util/TransformerUtil.java
   product/branches/2.0.2_JBPAPP-9307/picketlink-core/src/main/java/org/picketlink/identity/federation/web/constants/GeneralConstants.java
Log:
Backporting PLFED-346 to 2.0.2 [JBPAPP-9307]

Modified: product/branches/2.0.2_JBPAPP-9307/picketlink-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/util/DocumentUtil.java
===================================================================
--- product/branches/2.0.2_JBPAPP-9307/picketlink-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/util/DocumentUtil.java	2012-07-10 19:36:03 UTC (rev 1569)
+++ product/branches/2.0.2_JBPAPP-9307/picketlink-core/src/main/java/org/picketlink/identity/federation/core/saml/v2/util/DocumentUtil.java	2012-07-10 19:38:10 UTC (rev 1570)
@@ -69,6 +69,8 @@
 
    private static boolean trace = log.isTraceEnabled();
 
+   private static DocumentBuilderFactory documentBuilderFactory;
+
    /**
     * Check whether a node belongs to a document
     * @param doc
@@ -517,14 +519,17 @@
    }
 
    /**
-    * Create a namespace aware Document builder factory
+    * <p>Creates a namespace aware {@link DocumentBuilderFactory}. The returned instance is cached and shared between different threads.</p>
     * @return
     */
    private static DocumentBuilderFactory getDocumentBuilderFactory()
    {
-      DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
-      factory.setNamespaceAware(true);
-      factory.setXIncludeAware(true);
-      return factory;
+        if (documentBuilderFactory == null) {
+            documentBuilderFactory = DocumentBuilderFactory.newInstance();
+            documentBuilderFactory.setNamespaceAware(true);
+            documentBuilderFactory.setXIncludeAware(true);
+        }
+        
+        return documentBuilderFactory;
    }
-}
\ No newline at end of file
+}

Modified: product/branches/2.0.2_JBPAPP-9307/picketlink-core/src/main/java/org/picketlink/identity/federation/core/util/TransformerUtil.java
===================================================================
--- product/branches/2.0.2_JBPAPP-9307/picketlink-core/src/main/java/org/picketlink/identity/federation/core/util/TransformerUtil.java	2012-07-10 19:36:03 UTC (rev 1569)
+++ product/branches/2.0.2_JBPAPP-9307/picketlink-core/src/main/java/org/picketlink/identity/federation/core/util/TransformerUtil.java	2012-07-10 19:38:10 UTC (rev 1570)
@@ -73,6 +73,8 @@
 
    private static final boolean trace = log.isTraceEnabled();
 
+   private static TransformerFactory transformerFactory;
+
    /**
     * Get the Default Transformer
     * @return
@@ -83,7 +85,7 @@
       Transformer transformer;
       try
       {
-         transformer = TransformerFactory.newInstance().newTransformer();
+         transformer = getTransformerFactory().newTransformer();
       }
       catch (TransformerConfigurationException e)
       {
@@ -99,6 +101,20 @@
    }
 
    /**
+    * <p>Creates a {@link TransformerFactory}. The returned instance is cached and shared between different threads.</p>
+    * 
+    * @return
+    * @throws TransformerFactoryConfigurationError
+    */
+   private static TransformerFactory getTransformerFactory() throws TransformerFactoryConfigurationError {
+       if (transformerFactory == null) {
+           transformerFactory = TransformerFactory.newInstance();
+       }
+
+       return transformerFactory;
+   }
+
+   /**
     * Get the Custom Stax Source to DOM result transformer that has been written
     * to get over the JDK transformer bugs (JDK6) as well as the issue of Xalan
     * installing its Transformer (which does not support stax).
@@ -433,4 +449,4 @@
          }
       }
    }
-}
\ No newline at end of file
+}

Modified: product/branches/2.0.2_JBPAPP-9307/picketlink-core/src/main/java/org/picketlink/identity/federation/web/constants/GeneralConstants.java
===================================================================
--- product/branches/2.0.2_JBPAPP-9307/picketlink-core/src/main/java/org/picketlink/identity/federation/web/constants/GeneralConstants.java	2012-07-10 19:36:03 UTC (rev 1569)
+++ product/branches/2.0.2_JBPAPP-9307/picketlink-core/src/main/java/org/picketlink/identity/federation/web/constants/GeneralConstants.java	2012-07-10 19:38:10 UTC (rev 1570)
@@ -101,4 +101,6 @@
    String USERNAME_FIELD = "JBID_USERNAME";
 
    String PASS_FIELD = "JBID_PASSWORD";
-}
\ No newline at end of file
+
+   String SUBSYSTEM_RUNTIME = "picketlink.subsystem.runtime";
+}



More information about the jboss-cvs-commits mailing list