Neo4j kernel extension that automatically creates a
GraphAwareRuntime and registers
RuntimeModules with it.
The mechanism of this extension works as follows. Of course, the GraphAware Framework .jar file must be present on
classpath (embedded mode), or in the "plugins" directory (server mode).
The Runtime is only created when a setting called "com.graphaware.runtime.enabled" with value equal to "true" or "1"
is passed as a configuration to the database. This can be achieved by any of the standard mechanisms of passing
configuration to the database, for example programmaticaly using
org.neo4j.graphdb.factory.GraphDatabaseFactory
(embedded mode), or declaratively using neo4j.conf (typically server mode).
Modules are registered similarly. For each module that should be registered, there must be an entry in the configuration
passed to the database. The key of the entry should be "com.graphaware.module.X.Y", where X becomes the ID
of the module (
RuntimeModule.getId()) and Y becomes the order in which the
module gets registered with respect to other modules. The value of the configuration entry must be a fully qualified
class name of a
RuntimeModuleBootstrapper present on the classpath or as a .jar
file in the "plugins" directory. Of course, third party modules can be registered as well.
Custom configuration to the modules can be also passed via database configuration in the form of
"com.graphaware.module.X.A = B", where X is the module ID, A is the configuration key, and B is the configuration value.
For instance, if you develop a
RuntimeModule that is bootstrapped by
com.mycompany.mymodule.MyBootstrapper and want to register it as the first module of the runtime with MyModuleID as
the module ID, with an extra configuration called "threshold" equal to 20, then there should be the two following
configuration entries passed to the database:
com.graphaware.runtime.enabled=true
com.graphaware.module.MyModuleID.1=com.mycompany.mymodule.MyBootstrapper
com.graphaware.module.MyModuleID.threshold=20
The runtime has a capability of delegating to
TimerDrivenModules on a scheduled
basis. For configuration of the timing, please see
Neo4jConfigBasedRuntimeConfiguration.