if (host != null || port != null) {
uri = DeployUtils.getConnectionURI(host, port, secure);
}
if (offline) {
startOfflineDeployer(kernel);
manager = new LocalDeploymentManager(kernel);
} else {
tryToConnect(uri, driver, user, password, secure);
}
if (manager == null) {
throw new DeploymentException("Unexpected error; connection failed.");