git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@813980 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Davies 2009-09-11 18:49:23 +00:00
parent 7eac1f7132
commit 7da608c411
2 changed files with 19 additions and 1 deletions

View File

@ -465,7 +465,7 @@ public class BrokerService implements Service {
service.start(); service.start();
} }
} }
if (!isSlave()) { if (!isSlave() && (this.masterConnector == null || isShutdownOnMasterFailure() == false)) {
startAllConnectors(); startAllConnectors();
} }
if (!stopped.get()) { if (!stopped.get()) {

View File

@ -74,6 +74,7 @@ public class MasterConnector implements Service, BrokerServiceAware {
private final AtomicBoolean masterActive = new AtomicBoolean(); private final AtomicBoolean masterActive = new AtomicBoolean();
private BrokerInfo brokerInfo; private BrokerInfo brokerInfo;
private boolean firstConnection=true; private boolean firstConnection=true;
private boolean failedToStart;
public MasterConnector() { public MasterConnector() {
} }
@ -185,6 +186,7 @@ public class MasterConnector implements Service, BrokerServiceAware {
}else{ }else{
LOG.info("Slave stopped before connected to the master."); LOG.info("Slave stopped before connected to the master.");
} }
setFailedToStart(true);
} }
} }
@ -348,4 +350,20 @@ public class MasterConnector implements Service, BrokerServiceAware {
return stoppedBeforeStart.get(); return stoppedBeforeStart.get();
} }
/**
* Get the failedToStart
* @return the failedToStart
*/
public boolean isFailedToStart() {
return this.failedToStart;
}
/**
* Set the failedToStart
* @param failedToStart the failedToStart to set
*/
public void setFailedToStart(boolean failedToStart) {
this.failedToStart = failedToStart;
}
} }