org.neo4j.server
Class WrappingNeoServerBootstrapper

java.lang.Object
  extended by org.neo4j.server.Bootstrapper
      extended by org.neo4j.server.WrappingNeoServerBootstrapper

public class WrappingNeoServerBootstrapper
extends Bootstrapper

A bootstrapper for the Neo4j Server that takes an already instantiated GraphDatabaseAPI, and optional configuration, and launches a server using that database.

Use this to start up a full Neo4j server from within an application that already uses the EmbeddedGraphDatabase or the HighlyAvailableGraphDatabase. This gives your application the full benefits of the server's REST API, the Web administration interface and statistics tracking.

Example:

 {
     @code WrappingNeoServerBootstrapper srv = new WrappingNeoServerBootstrapper( myDatabase );
     srv.start(); // Launches the server at default URL, http://localhost:7474
 
     // Run your application as long as you please
 
     srv.stop();
 }
 
If you want to change configuration, pass in the optional Configurator arg to the constructor. You can write your own implementation or use ServerConfigurator.


Field Summary
 
Fields inherited from class org.neo4j.server.Bootstrapper
GRAPH_DATABASE_STARTUP_ERROR_CODE, OK, server, WEB_SERVER_STARTUP_ERROR_CODE
 
Constructor Summary
WrappingNeoServerBootstrapper(GraphDatabaseAPI db)
          Create an instance with default settings.
WrappingNeoServerBootstrapper(GraphDatabaseAPI db, Configurator configurator)
          Create an instance with custom documentation.
 
Method Summary
protected  Configurator createConfigurator()
           
protected  NeoServer createNeoServer()
           
 
Methods inherited from class org.neo4j.server.Bootstrapper
addShutdownHook, controlEvent, getServer, isMoreDerivedThan, loadMostDerivedBootstrapper, main, start, start, stop, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WrappingNeoServerBootstrapper

public WrappingNeoServerBootstrapper(GraphDatabaseAPI db)
Create an instance with default settings.

Parameters:
db -

WrappingNeoServerBootstrapper

public WrappingNeoServerBootstrapper(GraphDatabaseAPI db,
                                     Configurator configurator)
Create an instance with custom documentation. ServerConfigurator is written to fit well here, see its' documentation.

Parameters:
db -
configurator -
Method Detail

createConfigurator

protected Configurator createConfigurator()
Overrides:
createConfigurator in class Bootstrapper

createNeoServer

protected NeoServer createNeoServer()
Specified by:
createNeoServer in class Bootstrapper


Copyright © 2002-2013 The Neo4j Graph Database Project. All Rights Reserved.