Skip to content

Commit

Permalink
proxy-cache and db-pool regressions
Browse files Browse the repository at this point in the history
git-svn-id: svn://svn.caucho.com/resin/trunk/modules/hessian@7588 9c94448d-38f1-0310-a231-d98308ff1ebf
  • Loading branch information
ferg committed Oct 7, 2010
1 parent b452313 commit bdd1a4d
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/com/caucho/burlap/server/BurlapServlet.java
Expand Up @@ -182,7 +182,7 @@ public void service(ServletRequest request, ServletResponse response)
if (objectId == null)
objectId = req.getParameter("ejbid");

ServiceContext.begin(req, serviceId, objectId);
ServiceContext.begin(req, res, serviceId, objectId);

try {
InputStream is = request.getInputStream();
Expand Down
2 changes: 1 addition & 1 deletion src/com/caucho/hessian/server/HessianServlet.java
Expand Up @@ -365,7 +365,7 @@ public void service(ServletRequest request, ServletResponse response)
if (objectId == null)
objectId = req.getParameter("ejbid");

ServiceContext.begin(req, serviceId, objectId);
ServiceContext.begin(req, res, serviceId, objectId);

try {
InputStream is = request.getInputStream();
Expand Down
18 changes: 18 additions & 0 deletions src/com/caucho/services/server/ServiceContext.java
Expand Up @@ -50,6 +50,8 @@

import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;

import java.util.HashMap;

/**
Expand All @@ -59,6 +61,7 @@ public class ServiceContext {
private static final ThreadLocal _localContext = new ThreadLocal();

private ServletRequest _request;
private ServletResponse _response;
private String _serviceName;
private String _objectId;
private int _count;
Expand All @@ -76,6 +79,7 @@ private ServiceContext()
* @param objectId the object identifier
*/
public static void begin(ServletRequest request,
ServletResponse response,
String serviceName,
String objectId)
throws ServletException
Expand All @@ -88,6 +92,7 @@ public static void begin(ServletRequest request,
}

context._request = request;
context._response = response;
context._serviceName = serviceName;
context._objectId = objectId;
context._count++;
Expand Down Expand Up @@ -143,6 +148,19 @@ public static ServletRequest getContextRequest()
return null;
}

/**
* Returns the service request.
*/
public static ServletResponse getContextResponse()
{
ServiceContext context = (ServiceContext) _localContext.get();

if (context != null)
return context._response;
else
return null;
}

/**
* Returns the service id, corresponding to the pathInfo of the URL.
*/
Expand Down

0 comments on commit bdd1a4d

Please sign in to comment.