@Override
public void rebind() {
Lifecycle expectedState = ServiceStateLogic.getExpectedState(this);
if (expectedState == null || expectedState != Lifecycle.RUNNING) {
LOG.warn("On rebind of {}, not calling software process rebind hooks because expected state is {}", this, expectedState);
return;
}
Lifecycle actualState = ServiceStateLogic.getActualState(this);
if (actualState == null || actualState != Lifecycle.RUNNING) {
LOG.warn("Rebinding entity {}, even though actual state is {}. Expected state is {}", new Object[] { this, actualState, expectedState });
}
LOG.info("Rebind {} connecting to pre-running service", this);
MachineLocation machine = getMachineOrNull();
if (machine != null) {
initDriver(machine);
driver.rebind();
LOG.debug("On rebind of {}, re-created driver {}", this, driver);
} else {
LOG.info("On rebind of {}, no MachineLocation found (with locations {}) so not generating driver", this, getLocations());
}
callRebindHooks();
}