Created
December 17, 2012 17:22
-
-
Save spmallette/4320048 to your computer and use it in GitHub Desktop.
Standalone Rexster
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.tinkerpop.rexster; | |
import com.tinkerpop.blueprints.impls.tg.TinkerGraph; | |
import com.tinkerpop.rexster.server.DefaultRexsterApplication; | |
import com.tinkerpop.rexster.server.RexProRexsterServer; | |
import com.tinkerpop.rexster.server.RexsterApplication; | |
import com.tinkerpop.rexster.server.ShutdownManager; | |
import org.apache.commons.configuration.XMLConfiguration; | |
/** | |
* @author Stephen Mallette (http://stephen.genoprime.com) | |
*/ | |
public class Starter { | |
public static void main(final String[] args) throws Exception { | |
final XMLConfiguration conf = new XMLConfiguration(); | |
final RexProRexsterServer server = new RexProRexsterServer(conf); | |
final RexsterApplication ra = new DefaultRexsterApplication("graph", new TinkerGraph()); | |
server.start(ra); | |
final ShutdownManager shutdownManager = new ShutdownManager("0.0.0.0", 8183); | |
shutdownManager.registerShutdownListener(new ShutdownManager.ShutdownListener() { | |
public void shutdown() { | |
// shutdown grizzly/graphs | |
try { server.stop(); } catch (Exception ex) { ex.printStackTrace(); } | |
} | |
}); | |
shutdownManager.start(); | |
shutdownManager.waitForShutdown(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment