Created
June 8, 2012 20:01
-
-
Save juliandunn/2897842 to your computer and use it in GitHub Desktop.
Jetty Mongo Session example
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
<?xml version="1.0"?> | |
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd"> | |
<Configure id="Server" class="org.eclipse.jetty.server.Server"> | |
<New id="mongodb" class="com.mongodb.Mongo"> | |
<Arg> | |
<New class="java.util.ArrayList"> | |
<Call name="add"> | |
<Arg> | |
<New class="com.mongodb.ServerAddress"> | |
<Arg type="java.lang.String">localhost</Arg> | |
<Arg type="int">27017</Arg> | |
</New> | |
</Arg> | |
</Call> | |
<!-- More Call statements here for bootstrap secondaries --> | |
</New> | |
</Arg> | |
<Call name="getDB"> | |
<Arg>sessions</Arg> | |
<Call id="sessionDocument" name="getCollection"> | |
<Arg>sessions_theapp</Arg> | |
</Call> | |
</Call> | |
<!-- Also want to be able to read from secondaries for sessions --> | |
<!-- XXX does not work - syntax error? | |
<Set name="ReadPreference" type="com.mongodb.ReadPreference">com.mongodb.ReadPreference.SECONDARY</Set> | |
--> | |
</New> | |
<!-- set on the current object, i.e. the Jetty runtime itself --> | |
<Set name="sessionIdManager"> | |
<New id="mongoIdMgr" class="org.eclipse.jetty.nosql.mongodb.MongoSessionIdManager"> | |
<Arg><Ref id="Server"/></Arg> | |
<Arg><Ref id="sessionDocument"/></Arg> | |
<Set name="workerName">plat1</Set> | |
</New> | |
</Set> | |
</Configure> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment