Class EmbeddedNeo4jServer

java.lang.Object
io.micronaut.neo4j.bolt.embedded.EmbeddedNeo4jServer
All Implemented Interfaces:
io.micronaut.context.event.BeanCreatedEventListener<Neo4jBoltConfiguration>, Closeable, AutoCloseable, EventListener

@Singleton @Requires(classes=org.neo4j.harness.Neo4j.class) public class EmbeddedNeo4jServer extends Object implements io.micronaut.context.event.BeanCreatedEventListener<Neo4jBoltConfiguration>, Closeable
Starts an embedded Neo4j server if no server is running for the configured settings.
Since:
1.0
Author:
graemerocher
  • Constructor Details

    • EmbeddedNeo4jServer

      public EmbeddedNeo4jServer()
  • Method Details

    • onCreated

      public Neo4jBoltConfiguration onCreated(io.micronaut.context.event.BeanCreatedEvent<Neo4jBoltConfiguration> event)
      Specified by:
      onCreated in interface io.micronaut.context.event.BeanCreatedEventListener<Neo4jBoltConfiguration>
    • start

      public static org.neo4j.harness.Neo4j start(File dataLocation) throws IOException
      Start a server on a random free port.
      Parameters:
      dataLocation - The data location
      Returns:
      The server controls
      Throws:
      IOException - i/o exception
    • start

      public static org.neo4j.harness.Neo4j start(File dataLocation, Map<String,Object> options) throws IOException
      Start a server on a random free port.
      Parameters:
      dataLocation - The data location
      options - options for neo4j
      Returns:
      The server controls
      Throws:
      IOException - i/o exception
    • start

      public static org.neo4j.harness.Neo4j start(InetSocketAddress inetAddr)
      Start a server on the given address.
      Parameters:
      inetAddr - The inet address
      Returns:
      The Neo4j
    • start

      public static org.neo4j.harness.Neo4j start(InetSocketAddress inetAddr, File dataLocation)
      Start a server on the given address.
      Parameters:
      inetAddr - The inet address
      dataLocation - dataLocation file
      Returns:
      The Neo4j
    • start

      public static org.neo4j.harness.Neo4j start(InetSocketAddress inetAddr, File dataLocation, Map<String,Object> options)
      Start a server on the given address.
      Parameters:
      inetAddr - The inet address
      dataLocation - dataLocation file
      options - options for neo4j
      Returns:
      The Neo4j
    • start

      public static org.neo4j.harness.Neo4j start(String address)
      Start a server on the given address.
      Parameters:
      address - The address
      Returns:
      The Neo4j
    • start

      public static org.neo4j.harness.Neo4j start(String address, File dataLocation)
      Start a server on the given address.
      Parameters:
      address - The address
      dataLocation - dataLocation file
      Returns:
      The Neo4j
    • start

      public static org.neo4j.harness.Neo4j start(String address, File dataLocation, Map<String,Object> options)
      Start a server on the given address.
      Parameters:
      address - The address
      options - options for neo4j
      dataLocation - dataLocation file
      Returns:
      The Neo4j
    • start

      public static org.neo4j.harness.Neo4j start(String host, int port)
      Start a server on the given address.
      Parameters:
      host - The host
      port - The port
      Returns:
      The Neo4j
    • start

      public static org.neo4j.harness.Neo4j start(String host, int port, File dataLocation)
      Start a server on the given address.
      Parameters:
      host - The host
      port - The port
      dataLocation - dataLocation file
      Returns:
      The Neo4j
    • start

      public static org.neo4j.harness.Neo4j start(String host, int port, File dataLocation, Map<String,Object> options)
      Start a server on the given address.
      Parameters:
      host - The host
      port - The port
      dataLocation - dataLocation file
      options - options for neo4j
      Returns:
      The Neo4j
    • close

      @PreDestroy public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException