7
|
1 import models.TPGraph;
|
|
2
|
|
3 import com.tinkerpop.blueprints.Graph;
|
|
4 import com.tinkerpop.blueprints.Vertex;
|
|
5
|
|
6 import play.Application;
|
|
7 import play.GlobalSettings;
|
|
8 import play.Logger;
|
|
9
|
|
10
|
|
11 public class Global extends GlobalSettings {
|
|
12
|
|
13 @Override
|
|
14 public void onStart(Application app) {
|
|
15 TPGraph tpgraph = TPGraph.getInstance();
|
|
16 tpgraph.setPath(null);
|
|
17 Graph graph = tpgraph.newGraph();
|
|
18 Vertex claimV = graph.addVertex(null);
|
8
|
19 tpgraph.setClaimRootId(claimV.getId());
|
7
|
20 Vertex userV = graph.addVertex(null);
|
8
|
21 tpgraph.setUserRootId(userV.getId());
|
7
|
22 }
|
|
23
|
|
24 @Override
|
|
25 public void onStop(Application app) {
|
|
26 Logger.info("Application shutdown...");
|
|
27
|
|
28 }
|
|
29
|
|
30
|
|
31
|
|
32
|
|
33 }
|