org.neo4j.server
Class WrappingNeoServerBootstrapper
java.lang.Object
org.neo4j.server.Bootstrapper
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.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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 -
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.