Factories and Modules
Clone this wiki locally
To obtain a framed graph use a
FramedGraphFactory factory = new FramedGraphFactory(); FramedGraph framedGraph = factory.create(baseGraph);
TransactionalFramedGraph can be created from a TransactionalGraph
FramedGraphFactory factory = new FramedGraphFactory(); TransactionalFramedGraph transactionalFramedGraph = factory.create(baseTransactionalGraph);
A factory should be reused to create many graphs. Under the hood it may share resources between graphs where appropriate. This can make a big difference to performance and memory footprint.
Modules are used to extend the capability of FramedGraph. They are registered in the constructor of the
In this example the framed graph will now support the
@GremlinGroovy annotation on frames.
FramedGraphFactory factory = new FramedGraphFactory(new GremlinGroovyModule()); FramedGraph framedGraph = factory.create(baseGraph);
Any number of modules can be added to the factory, but a
FramedGraphwill always support the Core Annotations.