Update jdbc module for new session architecture

This commit is contained in:
Jan Bartel 2016-02-16 15:12:23 +01:00
parent 9b5aa6f90d
commit c965dc905c
3 changed files with 9 additions and 11 deletions

View File

@ -13,12 +13,15 @@
<Ref refid="Server"/> <Ref refid="Server"/>
</Arg> </Arg>
<Set name="workerName"><Property name="jetty.jdbcSession.workerName" default="node1"/></Set> <Set name="workerName"><Property name="jetty.jdbcSession.workerName" default="node1"/></Set>
<Set name="scavengeInterval"><Property name="jetty.jdbcSession.scavenge" default="1800"/></Set> <Set name="sessionScavenger">
<New class="org.eclipse.jetty.server.session.SessionScavenger">
<Set name="scavengeIntervalSec"><Property name="jetty.jdbcSession.scavenge" default="1800"/></Set>
</New>
</Set>
<!-- ===================================================================== --> <!-- ===================================================================== -->
<!-- Uncomment either the datasource or driver setup and configure --> <!-- Uncomment either the datasource or driver setup and configure -->
<!-- ===================================================================== --> <!-- ===================================================================== -->
<Get name="databaseAdaptor">
<!-- <!--
<Set name="DatasourceName"><Property name="jetty.jdbcSession.datasource" default="javax.sql.DataSource/default"/></Set> <Set name="DatasourceName"><Property name="jetty.jdbcSession.datasource" default="javax.sql.DataSource/default"/></Set>
--> -->
@ -28,6 +31,7 @@
<Arg><Property name="jetty.jdbcSession.connectionURL"/></Arg> <Arg><Property name="jetty.jdbcSession.connectionURL"/></Arg>
</Call> </Call>
--> -->
</Get>
</New> </New>
</Set> </Set>

View File

@ -118,13 +118,9 @@ public class JdbcTestServer extends AbstractTestServer
JDBCSessionIdManager idManager = new JDBCSessionIdManager(_server); JDBCSessionIdManager idManager = new JDBCSessionIdManager(_server);
idManager.setWorkerName("w"+(__workers++)); idManager.setWorkerName("w"+(__workers++));
idManager.getDatabaseAdaptor().setDriverInfo(DRIVER_CLASS, (config==null?DEFAULT_CONNECTION_URL:(String)config)); idManager.getDatabaseAdaptor().setDriverInfo(DRIVER_CLASS, (config==null?DEFAULT_CONNECTION_URL:(String)config));
JDBCSessionIdManager.SessionIdTableSchema idTableSchema = new JDBCSessionIdManager.SessionIdTableSchema(); JDBCSessionIdManager.SessionIdTableSchema idTableSchema = idManager.getSessionIdTableSchema();
idTableSchema.setTableName("mysessionids"); idTableSchema.setTableName("mysessionids");
idTableSchema.setIdColumn("myid"); idTableSchema.setIdColumn("myid");
return idManager; return idManager;
} }
} }

View File

@ -118,9 +118,7 @@
<contextPath>/test</contextPath> <contextPath>/test</contextPath>
<tempDirectory>${project.build.directory}/work</tempDirectory> <tempDirectory>${project.build.directory}/work</tempDirectory>
<sessionHandler implementation="org.eclipse.jetty.server.session.SessionHandler"> <sessionHandler implementation="org.eclipse.jetty.server.session.SessionHandler">
<sessionManager implementation="org.eclipse.jetty.server.session.HashSessionManager"> <sessionManager implementation="org.eclipse.jetty.server.session.HashSessionManager"/>
<storeDirectory>${basedir}/target/sessions</storeDirectory>
</sessionManager>
</sessionHandler> </sessionHandler>
</webApp> </webApp>
<loginServices> <loginServices>