Author: coheigea
Date: Thu Feb 28 05:58:27 2013
New Revision: 1451107

URL: http://svn.apache.org/r1451107
Log:
Return the default Merlin instance without class loading

Modified:
    
webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/components/crypto/CryptoFactory.java

Modified: 
webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/components/crypto/CryptoFactory.java
URL: 
http://svn.apache.org/viewvc/webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/components/crypto/CryptoFactory.java?rev=1451107&r1=1451106&r2=1451107&view=diff
==============================================================================
--- 
webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/components/crypto/CryptoFactory.java
 (original)
+++ 
webservices/wss4j/branches/1_6_x-fixes/src/main/java/org/apache/ws/security/components/crypto/CryptoFactory.java
 Thu Feb 28 05:58:27 2013
@@ -37,8 +37,6 @@ import java.util.Properties;
 public abstract class CryptoFactory {
     private static final org.apache.commons.logging.Log LOG = 
         org.apache.commons.logging.LogFactory.getLog(CryptoFactory.class);
-    private static final Class<? extends Crypto> DEFAULT_CRYPTO_CLASS = 
-        org.apache.ws.security.components.crypto.Merlin.class;
 
     /**
      * getInstance
@@ -102,7 +100,14 @@ public abstract class CryptoFactory {
         Class<? extends Crypto> cryptoClass = null;
         if (cryptoClassName == null 
             || 
cryptoClassName.equals("org.apache.ws.security.components.crypto.Merlin")) {
-            cryptoClass = DEFAULT_CRYPTO_CLASS;
+            try {
+                return new Merlin(properties, classLoader);
+            } catch (java.lang.Exception e) {
+                if (LOG.isDebugEnabled()) {
+                    LOG.debug("Unable to instantiate Merlin", e);
+                }
+                throw new WSSecurityException(cryptoClass + " cannot create 
instance", e);
+            }
         } else {
             try {
                 // instruct the class loader to load the crypto implementation


Reply via email to