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(org.neo4j.kernel.GraphDatabaseAPI db)
          Create an instance with default settings.
WrappingNeoServerBootstrapper(org.neo4j.kernel.GraphDatabaseAPI db, Configurator configurator)
          Create an instance with custom documentation.
 
Method Summary
protected  void addShutdownHook()
           
protected  Configurator getConfigurator()
           
protected  GraphDatabaseFactory getGraphDatabaseFactory(org.apache.commons.configuration.Configuration configuration)
           
 Iterable<StartupHealthCheckRule> getHealthCheckRules()
           
 Iterable<Class<? extends ServerModule>> getServerModules()
           
 int stop(int stopArg)
           
 
Methods inherited from class org.neo4j.server.Bootstrapper
controlEvent, getServer, isMoreDerivedThan, loadMostDerivedBootstrapper, main, start, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WrappingNeoServerBootstrapper

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

Parameters:
db -

WrappingNeoServerBootstrapper

public WrappingNeoServerBootstrapper(org.neo4j.kernel.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

getHealthCheckRules

public Iterable<StartupHealthCheckRule> getHealthCheckRules()
Specified by:
getHealthCheckRules in class Bootstrapper

getServerModules

public Iterable<Class<? extends ServerModule>> getServerModules()
Specified by:
getServerModules in class Bootstrapper

stop

public int stop(int stopArg)
Overrides:
stop in class Bootstrapper

addShutdownHook

protected void addShutdownHook()
Overrides:
addShutdownHook in class Bootstrapper

getGraphDatabaseFactory

protected GraphDatabaseFactory getGraphDatabaseFactory(org.apache.commons.configuration.Configuration configuration)
Specified by:
getGraphDatabaseFactory in class Bootstrapper

getConfigurator

protected Configurator getConfigurator()
Overrides:
getConfigurator in class Bootstrapper


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