public class Components extends Object
Configuration instance.
If no explicit configuration is supplied, the class will attempt to auto-configure.
Auto-configuration is accomplished using a properties file. By default, this file
is called "ogm.properties" and it must be available on the class path.
You can supply a different configuration properties file, by specifying a system property
"ogm.properties" that refers to the configuration file you want to use. Your alternative
configuration file must be on the class path.
The properties file should contain the desired configuration values for each of the
various components - Driver, Compiler, etc. Please refer to the relevant configuration
for each of these.| Modifier and Type | Method and Description |
|---|---|
static void |
autoConfigure()
The OGM Components can be auto-configured from a properties file, "ogm.properties", or
a similar configuration file, specified by a system property or environment variable called "ogm.properties".
|
static AutoIndexMode |
autoIndexMode()
Return the
AutoIndexMode from the AutoIndexConfiguration |
static Compiler |
compiler()
Returns a new instance of the compiler
|
static void |
configure(Configuration configuration)
Configure the OGM from a pre-built Configuration class
|
static void |
configure(String configurationFileName)
Configure the OGM from the specified config file
|
static void |
destroy()
Releases any current driver resources and clears the current configuration
|
static Driver |
driver()
Returns the current OGM
Driver
Normally only one instance of the driver exists for the lifetime of the application
You cannot use this method to find out if a driver is initialised because it will attempt to
initialise the driver if it is not. |
static Configuration |
getConfiguration()
There is a single configuration object, which should never be null, associated with the Components class
You can update this configuration in-situ, or you can replace the configuration with another.
|
static double |
neo4jVersion()
Gets the neo4j.version from the current configuration
|
static void |
setDriver(Driver driver)
Sets a new
Driver to be used by the OGM. |
public static void configure(Configuration configuration)
configuration - The configuration to usepublic static void configure(String configurationFileName)
configurationFileName - The config file to usepublic static Driver driver()
Driver
Normally only one instance of the driver exists for the lifetime of the application
You cannot use this method to find out if a driver is initialised because it will attempt to
initialise the driver if it is not.Driver to be used by the OGMpublic static Compiler compiler()
Compiler to be used by the OGMpublic static void autoConfigure()
public static void setDriver(Driver driver)
Driver to be used by the OGM.
If a different driver is in use, it will be closed first. In addition, the Configuration is updated
to reflect the correct classname for the new driver.driver - an instance of Driver to be used by the OGM.public static double neo4jVersion()
public static void destroy()
public static AutoIndexMode autoIndexMode()
AutoIndexMode from the AutoIndexConfigurationpublic static Configuration getConfiguration()
Copyright © 2017 Neo Technology, Inc.. All rights reserved.