Package com.graphaware.runtime

Examples of com.graphaware.runtime.GraphAwareRuntime


    private GraphDatabaseService database;

    @Before
    public void setUp() {
        database = new TestGraphDatabaseFactory().newImpermanentDatabase();
        GraphAwareRuntime runtime = GraphAwareRuntimeFactory.createRuntime(database);
        runtime.registerModule(new FriendshipStrengthModule("FSM", database));
        runtime.start();
    }
View Full Code Here


    @Override
    protected WebApplicationContext createServletApplicationContext() {
        GenericApplicationContext parent = new GenericApplicationContext();
        parent.getBeanFactory().registerSingleton("database", database);

        GraphAwareRuntime runtime = RuntimeRegistry.getRuntime(database);
        if (runtime != null) {
            runtime.waitUntilStarted();
            parent.getBeanFactory().registerSingleton("databaseWriter", runtime.getDatabaseWriter());
        }

        parent.refresh();

        AnnotationConfigWebApplicationContext appContext = new AnnotationConfigWebApplicationContext();
View Full Code Here

        new ExecutionEngine(getDatabase()).execute(cypher);
    }

    @Test
    public void clearGraphWithRuntimeShouldDeleteAllNodesAndRelsButNotGraphProps() {
        GraphAwareRuntime runtime = GraphAwareRuntimeFactory.createRuntime(getDatabase());
        runtime.start();

        try (Transaction tx = getDatabase().beginTx()) {
            String cypher = "CREATE " +
                    "(blue:Blue {name:'Blue'})<-[:REL]-(red1:Red {name:'Red'})-[:REL]->(black1:Black {name:'Black'})-[:REL]->(green:Green {name:'Green'})," +
                    "(red2:Red {name:'Red'})-[:REL]->(black2:Black {name:'Black'})";
View Full Code Here

        }
    }

    @Test
    public void equalGraphsWithRuntimeShouldPassSameGraphTestBusinessStrategies() {
        GraphAwareRuntime runtime = GraphAwareRuntimeFactory.createRuntime(getDatabase());
        runtime.start();

        String assertCypher = "CREATE " +
                "(blue:Blue {name:'Blue'})<-[:REL]-(red1:Red {name:'Red'})-[:REL]->(black1:Black {name:'Black'})-[:REL]->(green:Green {name:'Green'})," +
                "(red2:Red {name:'Red'})-[:REL]->(black2:Black {name:'Black'})";
        populateDatabase(assertCypher);
View Full Code Here

            return;
        }

        LOG.info("GraphAware Runtime enabled, bootstrapping...");

        final GraphAwareRuntime runtime = createRuntime(database, new Neo4jConfigBasedRuntimeConfiguration(config));

        registerModules(runtime);

        new Thread(new Runnable() {
            @Override
            public void run() {
                if (database.isAvailable(5 * 60 * 1000)) {
                    runtime.start();
                    LOG.info("GraphAware Runtime automatically started.");
                } else {
                    LOG.error("Could not start GraphAware Runtime because the database didn't get to a usable state within 5 minutes.");
                }
            }
View Full Code Here

TOP

Related Classes of com.graphaware.runtime.GraphAwareRuntime

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.