Merge remote-tracking branch 'origin/jetty-9.4.x'

This commit is contained in:
Jan Bartel 2016-09-21 15:25:47 +10:00
commit 0ab80e4d98
2 changed files with 20 additions and 12 deletions

View File

@ -25,28 +25,25 @@ import org.eclipse.jetty.server.handler.ContextHandler.Context;
/**
* SessionContext
*
* The worker name which identifies this server instance, and the particular
* Context.
* Information about the context to which sessions belong: the Context,
* the SessionHandler of the context, and the unique name of the node.
*
* A SessionManager is 1:1 with a SessionContext.
* A SessionHandler is 1:1 with a SessionContext.
*/
public class SessionContext
{
public final static String NULL_VHOST = "0.0.0.0";
private ContextHandler.Context _context;
private SessionHandler _sessionHandler;
private String _workerName;
private String _canonicalContextPath;
private String _vhost;
public String getWorkerName()
{
return _workerName;
}
public SessionContext (String workerName, ContextHandler.Context context)
{
_sessionHandler = context.getContextHandler().getChildHandlerByClass(SessionHandler.class);
_workerName = workerName;
_context = context;
_canonicalContextPath = canonicalizeContextPath(_context);
@ -54,6 +51,17 @@ public class SessionContext
}
public String getWorkerName()
{
return _workerName;
}
public SessionHandler getSessionHandler()
{
return _sessionHandler;
}
public Context getContext ()
{
return _context;

View File

@ -81,7 +81,7 @@ public class GCloudSessionTestSupport
public Set<String> getSessionIds () throws Exception
{
HashSet<String> ids = new HashSet<String>();
GqlQuery.Builder builder = Query.gqlQueryBuilder(ResultType.ENTITY, "select * from "+GCloudSessionDataStore.KIND);
GqlQuery.Builder builder = Query.gqlQueryBuilder(ResultType.ENTITY, "select * from "+GCloudSessionDataStore.EntityDataModel.KIND);
Query<Entity> query = builder.build();
@ -99,7 +99,7 @@ public class GCloudSessionTestSupport
public void listSessions () throws Exception
{
GqlQuery.Builder builder = Query.gqlQueryBuilder(ResultType.ENTITY, "select * from "+GCloudSessionDataStore.KIND);
GqlQuery.Builder builder = Query.gqlQueryBuilder(ResultType.ENTITY, "select * from "+GCloudSessionDataStore.EntityDataModel.KIND);
Query<Entity> query = builder.build();
@ -117,7 +117,7 @@ public class GCloudSessionTestSupport
public void assertSessions(int count) throws Exception
{
Query<Key> query = Query.keyQueryBuilder().kind(GCloudSessionDataStore.KIND).build();
Query<Key> query = Query.keyQueryBuilder().kind(GCloudSessionDataStore.EntityDataModel.KIND).build();
QueryResults<Key> results = _ds.run(query);
assertNotNull(results);
int actual = 0;
@ -131,7 +131,7 @@ public class GCloudSessionTestSupport
public void deleteSessions () throws Exception
{
Query<Key> query = Query.keyQueryBuilder().kind(GCloudSessionDataStore.KIND).build();
Query<Key> query = Query.keyQueryBuilder().kind(GCloudSessionDataStore.EntityDataModel.KIND).build();
QueryResults<Key> results = _ds.run(query);
if (results != null)