diff options
| author | Rajith Muditha Attapattu <rajith@apache.org> | 2007-10-10 03:36:19 +0000 |
|---|---|---|
| committer | Rajith Muditha Attapattu <rajith@apache.org> | 2007-10-10 03:36:19 +0000 |
| commit | 935b2daeb76d7ce3e83bd161a29b4fdabdfa7bbb (patch) | |
| tree | 20ffc45e3f3c25011b2a0bdd744c7893f779c132 /qpid/java/common/src | |
| parent | 307a4cf73eda3392bd8195c78e66a07672667537 (diff) | |
| download | qpid-python-935b2daeb76d7ce3e83bd161a29b4fdabdfa7bbb.tar.gz | |
Removed system.outs and replaced with log statements
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@583351 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/common/src')
| -rw-r--r-- | qpid/java/common/src/main/java/org/apache/qpidity/security/CallbackHandlerRegistry.java | 18 | ||||
| -rw-r--r-- | qpid/java/common/src/main/java/org/apache/qpidity/security/DynamicSaslRegistrar.java | 16 |
2 files changed, 20 insertions, 14 deletions
diff --git a/qpid/java/common/src/main/java/org/apache/qpidity/security/CallbackHandlerRegistry.java b/qpid/java/common/src/main/java/org/apache/qpidity/security/CallbackHandlerRegistry.java index 624b015c69..b23fea7e4a 100644 --- a/qpid/java/common/src/main/java/org/apache/qpidity/security/CallbackHandlerRegistry.java +++ b/qpid/java/common/src/main/java/org/apache/qpidity/security/CallbackHandlerRegistry.java @@ -7,9 +7,9 @@ * 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 @@ -24,10 +24,12 @@ import java.util.HashMap; import java.util.Map; import org.apache.qpidity.QpidConfig; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class CallbackHandlerRegistry { - + private static final Logger _logger = LoggerFactory.getLogger(CallbackHandlerRegistry.class); private static CallbackHandlerRegistry _instance = new CallbackHandlerRegistry(); private Map<String,Class> _mechanismToHandlerClassMap = new HashMap<String,Class>(); @@ -36,7 +38,7 @@ public class CallbackHandlerRegistry public static CallbackHandlerRegistry getInstance() { - return _instance; + return _instance; } public Class getCallbackHandlerClass(String mechanism) @@ -57,7 +59,7 @@ public class CallbackHandlerRegistry } private void registerMechanisms() - { + { for (QpidConfig.SecurityMechanism securityMechanism: QpidConfig.get().getSecurityMechanisms() ) { Class clazz = null; @@ -66,14 +68,14 @@ public class CallbackHandlerRegistry clazz = Class.forName(securityMechanism.getHandler()); if (!AMQPCallbackHandler.class.isAssignableFrom(clazz)) { - System.out.println("SASL provider " + clazz + " does not implement " + AMQPCallbackHandler.class + + _logger.debug("SASL provider " + clazz + " does not implement " + AMQPCallbackHandler.class + ". Skipping"); continue; } _mechanismToHandlerClassMap.put(securityMechanism.getType(), clazz); if (_mechanisms == null) { - + _mechanisms = new StringBuilder(); _mechanisms.append(securityMechanism.getType()); } @@ -84,7 +86,7 @@ public class CallbackHandlerRegistry } catch (ClassNotFoundException ex) { - System.out.println("Unable to load class " + securityMechanism.getHandler() + ". Skipping that SASL provider"); + _logger.debug("Unable to load class " + securityMechanism.getHandler() + ". Skipping that SASL provider"); continue; } } diff --git a/qpid/java/common/src/main/java/org/apache/qpidity/security/DynamicSaslRegistrar.java b/qpid/java/common/src/main/java/org/apache/qpidity/security/DynamicSaslRegistrar.java index 52dacc6985..f95c47e0be 100644 --- a/qpid/java/common/src/main/java/org/apache/qpidity/security/DynamicSaslRegistrar.java +++ b/qpid/java/common/src/main/java/org/apache/qpidity/security/DynamicSaslRegistrar.java @@ -7,9 +7,9 @@ * 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 @@ -27,12 +27,16 @@ import java.util.TreeMap; import javax.security.sasl.SaslClientFactory; import org.apache.qpidity.QpidConfig; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class DynamicSaslRegistrar { + private static final Logger _logger = LoggerFactory.getLogger(DynamicSaslRegistrar.class); + public static void registerSaslProviders() { - Map<String, Class> factories = registerSaslClientFactories(); + Map<String, Class> factories = registerSaslClientFactories(); if (factories.size() > 0) { Security.addProvider(new JCAProvider(factories)); @@ -44,7 +48,7 @@ public class DynamicSaslRegistrar { TreeMap<String, Class> factoriesToRegister = new TreeMap<String, Class>(); - + for (QpidConfig.SaslClientFactory factory: QpidConfig.get().getSaslClientFactories()) { String className = factory.getFactoryClass(); @@ -53,14 +57,14 @@ public class DynamicSaslRegistrar Class clazz = Class.forName(className); if (!(SaslClientFactory.class.isAssignableFrom(clazz))) { - System.out.println("Class " + clazz + " does not implement " + SaslClientFactory.class + " - skipping"); + _logger.debug("Class " + clazz + " does not implement " + SaslClientFactory.class + " - skipping"); continue; } factoriesToRegister.put(factory.getType(), clazz); } catch (Exception ex) { - System.out.println("Error instantiating SaslClientFactory calss " + className + " - skipping"); + _logger.debug("Error instantiating SaslClientFactory calss " + className + " - skipping"); } } return factoriesToRegister; |
