Changeset 49 for trunk/src/main/java/omq/common/util
- Timestamp:
- 06/19/13 15:59:53 (11 years ago)
- Location:
- trunk/src/main/java/omq/common/util
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/main/java/omq/common/util/OmqConnectionFactory.java
r44 r49 5 5 import java.security.NoSuchAlgorithmException; 6 6 import java.util.Properties; 7 8 import org.apache.log4j.Logger; 7 9 8 10 import com.rabbitmq.client.Channel; … … 16 18 */ 17 19 public class OmqConnectionFactory { 20 private static final Logger logger = Logger.getLogger(OmqConnectionFactory.class.getName()); 21 18 22 private static Connection connection; 19 23 private static int connectionTimeout = 2 * 1000; … … 34 38 working = true; 35 39 } catch (Exception e) { 36 e.printStackTrace();40 logger.error(e); 37 41 long milis = Long.parseLong(env.getProperty(ParameterQueue.RETRY_TIME_CONNECTION, "2000")); 38 42 Thread.sleep(milis); … … 64 68 factory.useSslProtocol(); 65 69 } 66 return factory.newConnection(); 70 71 Connection connection = factory.newConnection(); 72 logger.info("New connection created using: username: " + username + ", host: " + host + ", port: " + port + ", connection timeout: " 73 + connectionTimeout + " SSL enabled: " + ssl); 74 return connection; 67 75 } 68 76 69 77 public static Channel getNewChannel() throws IOException { 70 return connection.createChannel(); 78 Channel channel = connection.createChannel(); 79 logger.info("New channel created using the default connection"); 80 return channel; 71 81 } 72 82 } -
trunk/src/main/java/omq/common/util/Serializer.java
r47 r49 3 3 import java.io.IOException; 4 4 import java.util.Properties; 5 6 import org.apache.log4j.Logger; 5 7 6 8 import omq.common.broker.Broker; … … 21 23 */ 22 24 public class Serializer { 25 private static final Logger logger = Logger.getLogger(Serializer.class.getName()); 23 26 public static String kryo = "kryo"; 24 27 public static String java = "java"; … … 158 161 159 162 public static void removeSerializers() { 163 logger.warn("Removing serializers"); 160 164 serializer = null; 161 165 kryoSerializer = null; -
trunk/src/main/java/omq/common/util/Serializers/GsonImp.java
r44 r49 22 22 public byte[] serialize(Object obj) throws SerializerException { 23 23 String json = gson.toJson(obj); 24 System.out.println(json);25 24 return json.getBytes(); 26 25 }
Note: See TracChangeset
for help on using the changeset viewer.