- Timestamp:
- 10/01/13 12:02:41 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/supervisor/src/main/java/omq/common/broker/Broker.java
r91 r92 20 20 import omq.exception.RemoteException; 21 21 import omq.server.RemoteObject; 22 import omq.supervisor.Supervisor; 22 23 23 24 import org.apache.log4j.Logger; … … 49 50 private boolean connectionClosed = false; 50 51 private Properties environment = null; 51 private RemoteBrokerImpl remoteBrokerImpl;52 52 private Map<String, RemoteObject> remoteObjs; 53 53 private Map<String, Object> proxies = new Hashtable<String, Object>(); 54 54 private Map<String, Object> multiProxies = new Hashtable<String, Object>(); 55 56 // Supervisor 57 private Supervisor supervisor; 55 58 56 59 public Broker(Properties env) throws Exception { … … 358 361 } 359 362 360 public void setSupervisor(String brokerSet, String brokerName) throws Exception {361 remoteBrokerImpl = new RemoteBrokerImpl();362 remoteBrokerImpl.startRemoteBroker(brokerSet, brokerName, this, getEnvironment());363 }364 365 363 public Properties getEnvironment() { 366 364 return environment; … … 379 377 } 380 378 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 } 381 394 }
Note: See TracChangeset
for help on using the changeset viewer.