Author: rajith
Date: Tue Oct  9 20:36:19 2007
New Revision: 583351

URL: http://svn.apache.org/viewvc?rev=583351&view=rev
Log:
Removed system.outs and replaced with log statements

Modified:
    incubator/qpid/trunk/qpid/java/client/src/main/java/client.log4j
    
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageProducer_0_10.java
    
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpidity/nclient/interop/BasicInteropTest.java
    
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpidity/nclient/util/ByteBufferMessage.java
    
incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/testutil/QpidTestCase.java
    
incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpidity/security/CallbackHandlerRegistry.java
    
incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpidity/security/DynamicSaslRegistrar.java

Modified: incubator/qpid/trunk/qpid/java/client/src/main/java/client.log4j
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/src/main/java/client.log4j?rev=583351&r1=583350&r2=583351&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/src/main/java/client.log4j (original)
+++ incubator/qpid/trunk/qpid/java/client/src/main/java/client.log4j Tue Oct  9 
20:36:19 2007
@@ -6,9 +6,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
@@ -19,8 +19,15 @@
 log4j.rootLogger=${root.logging.level}
 
 
-log4j.logger.org.apache.qpid=${amqj.logging.level}, console
+#log4j.logger.org.apache.qpid=${amqj.logging.level}, console
+#log4j.additivity.org.apache.qpid=false
+#log4j.logger.org.apache.qpidity.transport=TRACE, console
+
+log4j.logger.org.apache.qpid=MAJOR, console
 log4j.additivity.org.apache.qpid=false
+log4j.logger.org.apache.qpidity.transport=MAJOR, console
+log4j.logger.org.apache.qpid.testutil.QpidTestCase=MAJOR, console
+
 
 log4j.appender.console=org.apache.log4j.ConsoleAppender
 log4j.appender.console.Threshold=all

Modified: 
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageProducer_0_10.java
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageProducer_0_10.java?rev=583351&r1=583350&r2=583351&view=diff
==============================================================================
--- 
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageProducer_0_10.java
 (original)
+++ 
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/BasicMessageProducer_0_10.java
 Tue Oct  9 20:36:19 2007
@@ -96,7 +96,7 @@
         BasicContentHeaderProperties contentHeaderProperties = 
message.getContentHeaderProperties();
         // set the application properties
         
qpidityMessage.getMessageProperties().setContentType(contentHeaderProperties.getContentType().toString());
-        
qpidityMessage.getMessageProperties().setMessageId(message.getJMSMessageID()) ; 
     
+        
qpidityMessage.getMessageProperties().setMessageId(message.getJMSMessageID()) ;
         AMQShortString correlationID = 
contentHeaderProperties.getCorrelationId();
         if( correlationID != null )
         {
@@ -125,7 +125,7 @@
 
             for(String 
key:qpidityMessage.getMessageProperties().getApplicationHeaders().keySet())
             {
-                System.out.println(key + "=" + 
qpidityMessage.getMessageProperties().getApplicationHeaders().get(key));
+                _logger.debug(key + "=" + 
qpidityMessage.getMessageProperties().getApplicationHeaders().get(key));
             }
         }
         // send the message

Modified: 
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpidity/nclient/interop/BasicInteropTest.java
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpidity/nclient/interop/BasicInteropTest.java?rev=583351&r1=583350&r2=583351&view=diff
==============================================================================
--- 
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpidity/nclient/interop/BasicInteropTest.java
 (original)
+++ 
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpidity/nclient/interop/BasicInteropTest.java
 Tue Oct  9 20:36:19 2007
@@ -81,6 +81,8 @@
         props.put("spf", 8.5);
         session.header(new DeliveryProperties().setRoutingKey("testKey"),new 
MessageProperties().setApplicationHeaders(props));
 
+        //session.header(new DeliveryProperties().setRoutingKey("testKey"));
+
         session.data("TestMessage");
         session.endData();
         session.sync();

Modified: 
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpidity/nclient/util/ByteBufferMessage.java
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpidity/nclient/util/ByteBufferMessage.java?rev=583351&r1=583350&r2=583351&view=diff
==============================================================================
--- 
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpidity/nclient/util/ByteBufferMessage.java
 (original)
+++ 
incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpidity/nclient/util/ByteBufferMessage.java
 Tue Oct  9 20:36:19 2007
@@ -14,8 +14,8 @@
  * for small messages. When the readData methods are called
  * we assume the message is complete. i.e there want be any
  * appendData operations after that.</p>
- * 
- * <p>If you need large message support please see 
+ *
+ * <p>If you need large message support please see
  * <code>FileMessage</code> and <code>StreamingMessage</code>
  * </p>
  */
@@ -23,7 +23,7 @@
 {
     private Queue<ByteBuffer> _data = new LinkedList<ByteBuffer>();
     private ByteBuffer _readBuffer;
-    private int _dataSize; 
+    private int _dataSize;
     private DeliveryProperties _currentDeliveryProps;
     private MessageProperties _currentMessageProps;
     private long _transferId;
@@ -37,19 +37,19 @@
     public ByteBufferMessage(long transferId)
     {
         _transferId = transferId;
-    }    
-    
+    }
+
     public long getMessageTransferId()
     {
         return _transferId;
     }
-    
+
     public void clearData()
     {
         _data = new LinkedList<ByteBuffer>();
         _readBuffer = null;
     }
-        
+
     public void appendData(byte[] src) throws IOException
     {
         appendData(ByteBuffer.wrap(src));
@@ -61,9 +61,9 @@
     public void appendData(ByteBuffer src) throws IOException
     {
         _data.offer(src);
-        _dataSize += src.remaining();        
+        _dataSize += src.remaining();
     }
-    
+
     public DeliveryProperties getDeliveryProperties()
     {
         return _currentDeliveryProps;
@@ -71,10 +71,9 @@
 
     public MessageProperties getMessageProperties()
     {
-        System.out.println("MessageProperties is null ? " + 
_currentMessageProps == null? "true":"false");
         return _currentMessageProps;
     }
-    
+
     public void setDeliveryProperties(DeliveryProperties props)
     {
         _currentDeliveryProps = props;
@@ -84,17 +83,17 @@
     {
         _currentMessageProps = props;
     }
-    
+
     public void readData(byte[] target) throws IOException
     {
         getReadBuffer().get(target);
     }
-    
+
     public ByteBuffer readData() throws IOException
-    {   
+    {
         return getReadBuffer();
     }
-    
+
     private void buildReadBuffer()
     {
         //optimize for the simple cases
@@ -112,13 +111,13 @@
             _readBuffer.flip();
         }
     }
-    
+
     private ByteBuffer getReadBuffer() throws IOException
     {
         if (_readBuffer != null )
         {
            return _readBuffer.slice();
-        }    
+        }
         else
         {
             if (_data.size() >0)
@@ -132,7 +131,7 @@
             }
         }
     }
-    
+
     //hack for testing
     @Override public String toString()
     {

Modified: 
incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/testutil/QpidTestCase.java
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/testutil/QpidTestCase.java?rev=583351&r1=583350&r2=583351&view=diff
==============================================================================
--- 
incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/testutil/QpidTestCase.java
 (original)
+++ 
incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/testutil/QpidTestCase.java
 Tue Oct  9 20:36:19 2007
@@ -5,9 +5,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
@@ -38,7 +38,7 @@
  */
 public class QpidTestCase extends TestCase
 {
-   
+
     /* this clas logger */
     private static final Logger _logger = 
LoggerFactory.getLogger(QpidTestCase.class);
 
@@ -91,7 +91,7 @@
             // create an in_VM broker
             TransportConnection.createVMBroker(1);
         }
-       _logger.info("=========================================");
+        _logger.info("=========================================");
         _logger.info("= " + _shel + " " + _brokerPath + " " + _brokerParams);
     }
 
@@ -116,7 +116,7 @@
          super.tearDown();
     }
 
-    //--------- Util method 
+    //--------- Util method
 
     /**
      * This method starts a remote server by spawning an external process.
@@ -134,7 +134,7 @@
             //bad, we had an error starting the broker
             throw new Exception("Problem when starting the broker: " + 
reader.readLine());
         }
-        // We need to wait for th ebroker to start ideally we would need to 
ping it 
+        // We need to wait for th ebroker to start ideally we would need to 
ping it
         synchronized(this)
         {
             this.wait(1000);

Modified: 
incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpidity/security/CallbackHandlerRegistry.java
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpidity/security/CallbackHandlerRegistry.java?rev=583351&r1=583350&r2=583351&view=diff
==============================================================================
--- 
incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpidity/security/CallbackHandlerRegistry.java
 (original)
+++ 
incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpidity/security/CallbackHandlerRegistry.java
 Tue Oct  9 20:36:19 2007
@@ -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.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 static CallbackHandlerRegistry getInstance()
     {
-        return _instance;        
+        return _instance;
     }
 
     public Class getCallbackHandlerClass(String mechanism)
@@ -57,7 +59,7 @@
     }
 
     private void registerMechanisms()
-    {          
+    {
         for (QpidConfig.SecurityMechanism  securityMechanism: 
QpidConfig.get().getSecurityMechanisms() )
         {
             Class clazz = null;
@@ -66,14 +68,14 @@
                 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 @@
             }
             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;
             }
         }

Modified: 
incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpidity/security/DynamicSaslRegistrar.java
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpidity/security/DynamicSaslRegistrar.java?rev=583351&r1=583350&r2=583351&view=diff
==============================================================================
--- 
incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpidity/security/DynamicSaslRegistrar.java
 (original)
+++ 
incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpidity/security/DynamicSaslRegistrar.java
 Tue Oct  9 20:36:19 2007
@@ -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 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 @@
     {
         TreeMap<String, Class> factoriesToRegister =
                 new TreeMap<String, Class>();
-        
+
         for (QpidConfig.SaslClientFactory factory: 
QpidConfig.get().getSaslClientFactories())
         {
             String className = factory.getFactoryClass();
@@ -53,14 +57,14 @@
                 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;


Reply via email to