Author: chris.laprun(a)jboss.com
Date: 2010-10-04 19:20:52 -0400 (Mon, 04 Oct 2010)
New Revision: 4485
Modified:
components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/servlet/ServletAccess.java
Log:
- Improved error message creation, hopefully.
Modified:
components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/servlet/ServletAccess.java
===================================================================
---
components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/servlet/ServletAccess.java 2010-10-04
21:25:11 UTC (rev 4484)
+++
components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/servlet/ServletAccess.java 2010-10-04
23:20:52 UTC (rev 4485)
@@ -1,6 +1,6 @@
/*
* JBoss, a division of Red Hat
- * Copyright 2009, Red Hat Middleware, LLC, and individual
+ * Copyright 2010, Red Hat Middleware, LLC, and individual
* contributors as indicated by the @authors tag. See the
* copyright.txt in the distribution for a full listing of
* individual contributors.
@@ -35,7 +35,7 @@
public class ServletAccess implements InvocationHandler
{
- public static final ThreadLocal local = new ThreadLocal();
+ public static final ThreadLocal<Invocation> local = new
ThreadLocal<Invocation>();
protected Object next;
@@ -62,7 +62,7 @@
{
Object req = args[0];
Object resp = args[1];
- Invocation invocation = new Invocation(req, resp);
+ Invocation invocation = new Invocation((HttpServletRequest)req,
(HttpServletResponse)resp);
local.set(invocation);
return method.invoke(next, args);
}
@@ -85,21 +85,21 @@
public static HttpServletRequest getRequest()
{
- Invocation invocation = (Invocation)local.get();
- return invocation != null ? (HttpServletRequest)invocation.req : null;
+ Invocation invocation = local.get();
+ return invocation != null ? invocation.req : null;
}
public static HttpServletResponse getResponse()
{
- return (HttpServletResponse)((Invocation)local.get()).resp;
+ return local.get().resp;
}
private static class Invocation
{
- private final Object req;
- private final Object resp;
+ private final HttpServletRequest req;
+ private final HttpServletResponse resp;
- public Invocation(Object req, Object resp)
+ public Invocation(HttpServletRequest req, HttpServletResponse resp)
{
this.req = req;
this.resp = resp;
Show replies by date