Ignore:
Timestamp:
10/01/13 12:02:41 (11 years ago)
Author:
stoda
Message:

TODO: delete in supervisor
check the code

File:
1 edited

Legend:

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

    r91 r92  
    2020import omq.exception.RemoteException;
    2121import omq.server.RemoteObject;
     22import omq.supervisor.Supervisor;
    2223
    2324import org.apache.log4j.Logger;
     
    4950        private boolean connectionClosed = false;
    5051        private Properties environment = null;
    51         private RemoteBrokerImpl remoteBrokerImpl;
    5252        private Map<String, RemoteObject> remoteObjs;
    5353        private Map<String, Object> proxies = new Hashtable<String, Object>();
    5454        private Map<String, Object> multiProxies = new Hashtable<String, Object>();
     55
     56        // Supervisor
     57        private Supervisor supervisor;
    5558
    5659        public Broker(Properties env) throws Exception {
     
    358361        }
    359362
    360         public void setSupervisor(String brokerSet, String brokerName) throws Exception {
    361                 remoteBrokerImpl = new RemoteBrokerImpl();
    362                 remoteBrokerImpl.startRemoteBroker(brokerSet, brokerName, this, getEnvironment());
    363         }
    364 
    365363        public Properties getEnvironment() {
    366364                return environment;
     
    379377        }
    380378
     379        /*
     380         * Supervisor
     381         */
     382        public void setSupervisor(String supervisorName, String brokerName) throws Exception {
     383                // Create a RemoteBrokerImpl
     384                bind(brokerName, new RemoteBrokerImpl());
     385                // Subscribe broker
     386                supervisor = lookup(supervisorName, Supervisor.class);
     387                supervisor.subscribe(brokerName);
     388                logger.info("Supervisor set: " + supervisorName + ", BrokerName: " + brokerName);
     389        }
     390
     391        public Supervisor getSupervisor() {
     392                return supervisor;
     393        }
    381394}
Note: See TracChangeset for help on using the changeset viewer.