Changeset 112 for trunk/src/main/java/omq/common/broker/Broker.java
- Timestamp:
- 04/04/14 13:09:57 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/main/java/omq/common/broker/Broker.java
r98 r112 3 3 import java.io.IOException; 4 4 import java.lang.reflect.Proxy; 5 import java.net.URL;6 5 import java.util.HashMap; 7 6 import java.util.Hashtable; … … 22 21 23 22 import org.apache.log4j.Logger; 24 import org.apache.log4j.xml.DOMConfigurator; 25 23 24 import com.rabbitmq.client.AMQP.BasicProperties; 26 25 import com.rabbitmq.client.Channel; 27 26 import com.rabbitmq.client.Connection; 28 27 import com.rabbitmq.client.QueueingConsumer; 29 import com.rabbitmq.client.AMQP.BasicProperties;30 28 import com.rabbitmq.client.QueueingConsumer.Delivery; 31 29 import com.rabbitmq.client.ShutdownListener; … … 56 54 public Broker(Properties env) throws Exception { 57 55 // Load log4j configuration 58 URL log4jResource = Broker.class.getResource("/log4j.xml");59 DOMConfigurator.configure(log4jResource);56 // URL log4jResource = Broker.class.getResource("/log4j.xml"); 57 // DOMConfigurator.configure(log4jResource); 60 58 61 59 remoteObjs = new HashMap<String, RemoteObject>(); … … 65 63 channel = connection.createChannel(); 66 64 addFaultTolerance(); 67 try { 68 tryConnection(env); 69 } catch (Exception e) { 70 channel.close(); 71 connection.close(); 65 if (!connection.isOpen() || !channel.isOpen()) { 66 if (connection.isOpen()) { 67 connection.close(); 68 } 72 69 throw new InitBrokerException("The connection didn't work"); 73 70 } 71 72 // try { 73 // tryConnection(env); 74 // } catch (Exception e) { 75 // channel.close(); 76 // connection.close(); 77 // throw new InitBrokerException("The connection didn't work"); 78 // } 74 79 } 75 80 … … 95 100 96 101 clientStarted = false; 97 connectionClosed = false;102 // connectionClosed = false; 98 103 environment = null; 99 104 remoteObjs = null; … … 117 122 connectionClosed = true; 118 123 connection.close(); 119 connectionClosed = false;124 // connectionClosed = false; 120 125 } 121 126
Note: See TracChangeset
for help on using the changeset viewer.