summaryrefslogtreecommitdiffstats
path: root/jdisc_core
diff options
context:
space:
mode:
authorBjørn Christian Seime <bjorncs@yahooinc.com>2023-04-27 13:28:47 +0200
committerBjørn Christian Seime <bjorncs@yahooinc.com>2023-04-27 13:57:02 +0200
commitc688e62a1fa657aede46ebbd51bcdb4433aa2cb6 (patch)
tree1706fbac2f0c5d694831622ab5e2d05a6021f19a /jdisc_core
parent139646116e78288ee7c53f92a17802e7e329e6c0 (diff)
Use timestamp from Jetty as creation time for Request/HttpRequest
Diffstat (limited to 'jdisc_core')
-rw-r--r--jdisc_core/abi-spec.json1
-rw-r--r--jdisc_core/src/main/java/com/yahoo/jdisc/Request.java7
2 files changed, 6 insertions, 2 deletions
diff --git a/jdisc_core/abi-spec.json b/jdisc_core/abi-spec.json
index acacccb4241..31594fed155 100644
--- a/jdisc_core/abi-spec.json
+++ b/jdisc_core/abi-spec.json
@@ -175,6 +175,7 @@
"methods" : [
"public void <init>(com.yahoo.jdisc.service.CurrentContainer, java.net.URI)",
"public void <init>(com.yahoo.jdisc.service.CurrentContainer, java.net.URI, boolean)",
+ "public void <init>(com.yahoo.jdisc.service.CurrentContainer, java.net.URI, boolean, long)",
"public void <init>(com.yahoo.jdisc.Request, java.net.URI)",
"public com.yahoo.jdisc.Container container()",
"public java.net.URI getUri()",
diff --git a/jdisc_core/src/main/java/com/yahoo/jdisc/Request.java b/jdisc_core/src/main/java/com/yahoo/jdisc/Request.java
index c219ae06846..7b63eba86b5 100644
--- a/jdisc_core/src/main/java/com/yahoo/jdisc/Request.java
+++ b/jdisc_core/src/main/java/com/yahoo/jdisc/Request.java
@@ -82,15 +82,18 @@ public class Request extends AbstractResource {
this(current, uri, true);
}
- public Request(CurrentContainer current, URI uri, boolean isServerRequest) {
+ public Request(CurrentContainer current, URI uri, boolean isServerRequest) { this(current, uri, isServerRequest, -1); }
+
+ public Request(CurrentContainer current, URI uri, boolean isServerRequest, long creationTime) {
parent = null;
parentReference = null;
serverRequest = isServerRequest;
this.uri = uri.normalize();
container = current.newReference(uri, this);
- creationTime = container.currentTimeMillis();
+ this.creationTime = creationTime >= 0 ? creationTime : container.currentTimeMillis();
}
+
/**
* <p>Creates a new instance of this class. As a {@link RequestHandler} you should use this method to spawn child
* Requests of another. As a {@link ServerProvider} that needs to spawn new Requests, us the {@link