Package org.waveprotocol.box.server.persistence

Examples of org.waveprotocol.box.server.persistence.PersistenceStartException


    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");
  }
View Full Code Here


    String host = properties.getProperty(HOST_PROPERTY);
    int port = Integer.parseInt(properties.getProperty(PORT_PROPERTY));
    try {
      mongo = new Mongo(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(getDatabaseName()).command("ping");
    } catch (MongoException e) {
      throw new PersistenceStartException("Can't ping MongoDb", e);
    }

    isRunning = true;
    LOG.info("Started MongoDb persistence");
  }
View Full Code Here

    }
    Properties properties = new Properties();
    try {
      properties.load(ClassLoader.getSystemResourceAsStream(PROPERTIES_LOC));
    } catch (IOException e) {
      throw new PersistenceStartException("Unable to load Properties for MongoDb", e);
    }
    this.properties = properties;
  }
View Full Code Here

TOP

Related Classes of org.waveprotocol.box.server.persistence.PersistenceStartException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.