Prototype per-request global (thread local) object
authorgilbert <gilbert@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Thu, 28 Oct 2004 13:41:57 +0000 (13:41 +0000)
committergilbert <gilbert@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Thu, 28 Oct 2004 13:41:57 +0000 (13:41 +0000)
Will be deleted if not found to be useful.

git-svn-id: https://subversion.switch.ch/svn/shibboleth/java-idp/trunk@1158 ab3bd59b-922f-494d-bb5f-6f0a3c29deca

src/edu/internet2/middleware/shibboleth/serviceprovider/RequestTracker.java [new file with mode: 0644]

diff --git a/src/edu/internet2/middleware/shibboleth/serviceprovider/RequestTracker.java b/src/edu/internet2/middleware/shibboleth/serviceprovider/RequestTracker.java
new file mode 100644 (file)
index 0000000..190b1a8
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * RequestTracker.java
+ * 
+ * An object representing a sanitized version of information
+ * on the current request. Typically, data will be extracted 
+ * from the current HttpRequest and stored here. A reference to 
+ * the object is stored in a ThreadLocal field of the 
+ * ServiceProviderContext when a request arrives, and then the 
+ * reference is nulled before returning to the container.
+ * 
+ * Thread local storage is somewhat expensive, though it gets
+ * more efficient with each release. Therefore, a reference to
+ * this object should be obtained once when needed and saved
+ * in a local variable. Obviously, a reference must never be
+ * saved in a field because the data here is thread-specific.
+ */
+package edu.internet2.middleware.shibboleth.serviceprovider;
+
+/**
+ * Hold information about the current request in a ThreadLocal object.
+ * 
+ * <p>ServiceProviderContext context = ServiceProviderContext.getInstance();<br />
+ * RequestTracker requestTracker = context.getRequestContext();</p>
+ * 
+ * @author Howard Gilbert
+ */
+public class RequestTracker {
+    
+    String ipaddr = null;
+
+    public String getIpaddr() {
+        return ipaddr;
+    }
+    public void setIpaddr(String ipaddr) {
+        this.ipaddr = ipaddr;
+    }
+}