Skip to content

Commit

Permalink
Add an in-process, blocking mode for running Arbiter
Browse files Browse the repository at this point in the history
  • Loading branch information
benbc committed Mar 16, 2016
1 parent 0236e9c commit a8951e8
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
Expand Up @@ -21,7 +21,7 @@


public class CommunityEntryPoint public class CommunityEntryPoint
{ {
private static BlockingBootstrapper bootstrapper; private static Bootstrapper bootstrapper;


public static void main( String[] args ) public static void main( String[] args )
{ {
Expand Down
Expand Up @@ -22,10 +22,15 @@
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;


import org.neo4j.server.BlockingBootstrapper;
import org.neo4j.server.Bootstrapper;
import org.neo4j.server.ServerBootstrapper;
import org.neo4j.server.configuration.ServerSettings; import org.neo4j.server.configuration.ServerSettings;


public class ArbiterEntryPoint public class ArbiterEntryPoint
{ {
private static Bootstrapper bootstrapper;

public static void main( String[] args ) throws IOException public static void main( String[] args ) throws IOException
{ {
int status = new ArbiterBootstrapper().start( getConfigFile() ); int status = new ArbiterBootstrapper().start( getConfigFile() );
Expand All @@ -35,6 +40,20 @@ public static void main( String[] args ) throws IOException
} }
} }


public static void start( String[] args )
{
bootstrapper = new BlockingBootstrapper( new ArbiterBootstrapper() );
System.exit( ServerBootstrapper.start( bootstrapper, args ) );
}

public static void stop( @SuppressWarnings("UnusedParameters") String[] args )
{
if ( bootstrapper != null )
{
bootstrapper.stop();
}
}

static File getConfigFile() static File getConfigFile()
{ {
String configPath = System.getProperty( ServerSettings.SERVER_CONFIG_FILE_KEY ); String configPath = System.getProperty( ServerSettings.SERVER_CONFIG_FILE_KEY );
Expand Down
Expand Up @@ -20,11 +20,12 @@
package org.neo4j.server.enterprise; package org.neo4j.server.enterprise;


import org.neo4j.server.BlockingBootstrapper; import org.neo4j.server.BlockingBootstrapper;
import org.neo4j.server.Bootstrapper;
import org.neo4j.server.ServerBootstrapper; import org.neo4j.server.ServerBootstrapper;


public class EnterpriseEntryPoint public class EnterpriseEntryPoint
{ {
private static BlockingBootstrapper bootstrapper; private static Bootstrapper bootstrapper;


public static void main( String[] args ) public static void main( String[] args )
{ {
Expand Down

0 comments on commit a8951e8

Please sign in to comment.