int port = Integer.parseInt(dbPort);
try {
// New MongoDB Client, see http://docs.mongodb.org/manual/release-notes/drivers-write-concern/
mongo = new MongoClient(host, port);
} catch (UnknownHostException e) {
throw new PersistenceStartException("Unable to resolve the MongoDb hostname", e);
}
try {
// Check to see if we are alive
mongo.getDB(dbName).command("ping");
} catch (MongoException e) {
throw new PersistenceStartException("Can't ping MongoDb", e);
}
isRunning = true;
LOG.info("Started MongoDb persistence");
}