Package ch.hortis.sonar.db

Examples of ch.hortis.sonar.db.DatabaseEmbedder


  public static void main(String[] args) throws Exception {
    String dbProp = System.getProperty( "sonar.embedded.db" );
    List<String> arguments = Arrays.asList(args);
    if ( dbProp == null || dbProp.equalsIgnoreCase( "true" ) ) {
      DatabaseEmbedder db = dbStartup();
      createDatabaseEmbedderShutdownHook( db );
    }

    int port = DEFAULT_WEB_PORT;
    if (arguments.indexOf("-port")>=0) {
View Full Code Here


    if ( config == null ) {
      throw new Exception( "Unable to find /derby.properties in classpath" );
    }
    derbyProps.load( config );
   
    final DatabaseEmbedder db;
    File dbHome = new File( "../data" );
    if ( !dbHome.exists() ) {
      throw new FileNotFoundException( "../data" );
    }
    if (!derbyProps.isEmpty()) {
      db = new DatabaseEmbedder( dbHome, derbyProps );
    } else {
      db = new DatabaseEmbedder( dbHome );
    }
    db.start();
    System.out.println( "Embedded database started" );
    return db;
  }
View Full Code Here

  public static void main(String[] args) throws Exception {
    String dbProp = System.getProperty( "sonar.embedded.db" );
    List<String> arguments = Arrays.asList(args);
    if ( dbProp == null || dbProp.equalsIgnoreCase( "true" ) ) {
      DatabaseEmbedder db = dbStartup();
      createDatabaseEmbedderShutdownHook( db );
    }

    int port = DEFAULT_WEB_PORT;
    if (arguments.indexOf("-port")>=0) {
View Full Code Here

    if ( config == null ) {
      throw new Exception( "Unable to find /derby.properties in classpath" );
    }
    derbyProps.load( config );
   
    final DatabaseEmbedder db;
    File dbHome = new File( "../data" );
    if ( !dbHome.exists() ) {
      throw new FileNotFoundException( "../data" );
    }
    if (!derbyProps.isEmpty()) {
      db = new DatabaseEmbedder( dbHome, derbyProps );
    } else {
      db = new DatabaseEmbedder( dbHome );
    }
    db.start();
    System.out.println( "Embedded database started" );
    return db;
  }
View Full Code Here

   * @parameter expression="${sonar.db.home}" default-value="./derby" alias="sonar.db.home"
   */
  private File dbHome;

  public void execute() throws MojoExecutionException {
    final DatabaseEmbedder embedder = new DatabaseEmbedder( dbHome );
    try {
      embedder.start();
      getLog().info("Embedded database started, press ctrl C to stop the process");
      Runtime.getRuntime().addShutdownHook( new Thread() {
        public void run() {
          try {
            embedder.stop();
            getLog().info("Embedded database stopped");
          } catch ( Exception e ) {
            System.err.println("Error during embedded database shutdown");
            e.printStackTrace( System.err );
          }
View Full Code Here

TOP

Related Classes of ch.hortis.sonar.db.DatabaseEmbedder

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.