This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch 7.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/7.0.x by this push:
new db89a2a Added extension point for custom delta requests
db89a2a is described below
commit db89a2a54df18bfdc7a1a03bc130511320a0eda8
Author: Thomas Stock <[email protected]>
AuthorDate: Thu Feb 13 12:55:32 2020 +0100
Added extension point for custom delta requests
---
.../apache/catalina/ha/session/DeltaSession.java | 21 +++++++++++++++++----
webapps/docs/changelog.xml | 9 +++++++++
2 files changed, 26 insertions(+), 4 deletions(-)
diff --git a/java/org/apache/catalina/ha/session/DeltaSession.java
b/java/org/apache/catalina/ha/session/DeltaSession.java
index 4662914..5b68513 100644
--- a/java/org/apache/catalina/ha/session/DeltaSession.java
+++ b/java/org/apache/catalina/ha/session/DeltaSession.java
@@ -109,7 +109,20 @@ public class DeltaSession extends StandardSession
implements Externalizable,Clus
super(manager);
boolean recordAllActions = manager instanceof ClusterManagerBase &&
((ClusterManagerBase)manager).isRecordAllActions();
- deltaRequest = new DeltaRequest(getIdInternal(), recordAllActions);
+ deltaRequest = createRequest(getIdInternal(), recordAllActions);
+ }
+
+ private DeltaRequest createRequest() {
+ return createRequest(null, false);
+ }
+
+ /*
+ * DeltaRequest instances are created via this protected method to enable
+ * sub-classes to over-ride the method to use custom DeltaRequest
+ * implementations.
+ */
+ protected DeltaRequest createRequest(String sessionId, boolean
recordAllActions) {
+ return new DeltaRequest(sessionId, recordAllActions);
}
// ----------------------------------------------------- ReplicatedMapEntry
@@ -148,10 +161,10 @@ public class DeltaSession extends StandardSession
implements Externalizable,Clus
deltaRequestPool = ((ClusterManagerBase)
manager).getDeltaRequestPool();
newDeltaRequest = deltaRequestPool.pop();
if (newDeltaRequest == null) {
- newDeltaRequest = new DeltaRequest(null, ((ClusterManagerBase)
manager).isRecordAllActions());
+ newDeltaRequest = createRequest(null, ((ClusterManagerBase)
manager).isRecordAllActions());
}
} else {
- newDeltaRequest = new DeltaRequest();
+ newDeltaRequest = createRequest();
}
DeltaRequest oldDeltaRequest = replaceDeltaRequest(newDeltaRequest);
@@ -693,7 +706,7 @@ public class DeltaSession extends StandardSession
implements Externalizable,Clus
DeltaRequest newDeltaRequest = deltaRequestPool.pop();
if (newDeltaRequest == null) {
- newDeltaRequest = new DeltaRequest(null, ((ClusterManagerBase)
manager).isRecordAllActions());
+ newDeltaRequest = createRequest(null, ((ClusterManagerBase)
manager).isRecordAllActions());
}
ReplicationStream ois = ((ClusterManagerBase)
manager).getReplicationStream(delta);
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 3cc3eae..d9fa048 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -110,6 +110,15 @@
</add>
</changelog>
</subsection>
+ <subsection name="Cluster">
+ <changelog>
+ <scode>
+ Refactor the creation of <code>DeltaRequest</code> objects to make it
+ simpler to use custom implementations. Based on a pull request provided
+ by Thomas Stock. (markt)
+ </scode>
+ </changelog>
+ </subsection>
<subsection name="Web applications">
<changelog>
<fix>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]