Changeset 112 for trunk/src/main


Ignore:
Timestamp:
04/04/14 13:09:57 (11 years ago)
Author:
stoda
Message:

Tryconnection function mades no sense and does not work as expected

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/main/java/omq/common/broker/Broker.java

    r98 r112  
    33import java.io.IOException;
    44import java.lang.reflect.Proxy;
    5 import java.net.URL;
    65import java.util.HashMap;
    76import java.util.Hashtable;
     
    2221
    2322import org.apache.log4j.Logger;
    24 import org.apache.log4j.xml.DOMConfigurator;
    25 
     23
     24import com.rabbitmq.client.AMQP.BasicProperties;
    2625import com.rabbitmq.client.Channel;
    2726import com.rabbitmq.client.Connection;
    2827import com.rabbitmq.client.QueueingConsumer;
    29 import com.rabbitmq.client.AMQP.BasicProperties;
    3028import com.rabbitmq.client.QueueingConsumer.Delivery;
    3129import com.rabbitmq.client.ShutdownListener;
     
    5654        public Broker(Properties env) throws Exception {
    5755                // 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);
    6058
    6159                remoteObjs = new HashMap<String, RemoteObject>();
     
    6563                channel = connection.createChannel();
    6664                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                        }
    7269                        throw new InitBrokerException("The connection didn't work");
    7370                }
     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                // }
    7479        }
    7580
     
    95100
    96101                clientStarted = false;
    97                 connectionClosed = false;
     102                // connectionClosed = false;
    98103                environment = null;
    99104                remoteObjs = null;
     
    117122                connectionClosed = true;
    118123                connection.close();
    119                 connectionClosed = false;
     124                // connectionClosed = false;
    120125        }
    121126
Note: See TracChangeset for help on using the changeset viewer.