MCPcopy Create free account
hub / github.com/apache/tomcat / getDiff

Method getDiff

java/org/apache/catalina/ha/session/DeltaSession.java:143–170  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

141 }
142
143 @Override
144 public byte[] getDiff() throws IOException {
145 SynchronizedStack<DeltaRequest> deltaRequestPool = null;
146 DeltaRequest newDeltaRequest;
147
148 if (manager instanceof ClusterManagerBase) {
149 deltaRequestPool = ((ClusterManagerBase) manager).getDeltaRequestPool();
150 newDeltaRequest = deltaRequestPool.pop();
151 if (newDeltaRequest == null) {
152 newDeltaRequest = createRequest(null, ((ClusterManagerBase) manager).isRecordAllActions());
153 }
154 } else {
155 newDeltaRequest = createRequest();
156 }
157
158 DeltaRequest oldDeltaRequest = replaceDeltaRequest(newDeltaRequest);
159
160 byte[] result = oldDeltaRequest.serialize();
161
162 if (deltaRequestPool != null) {
163 // Only need to reset the old request if it is going to be pooled.
164 // Otherwise let GC do its thing.
165 oldDeltaRequest.reset();
166 deltaRequestPool.push(oldDeltaRequest);
167 }
168
169 return result;
170 }
171
172 /**
173 * Get the class loaders used for deserialization.

Callers 1

requestCompletedMethod · 0.95

Calls 8

createRequestMethod · 0.95
replaceDeltaRequestMethod · 0.95
serializeMethod · 0.95
resetMethod · 0.95
getDeltaRequestPoolMethod · 0.80
isRecordAllActionsMethod · 0.80
pushMethod · 0.65
popMethod · 0.45

Tested by

no test coverage detected