- private static final class Proxy implements Externalizable {
- private static final long serialVersionUID = 1L;
- private LocalHistoryIdentifier historyId;
- private long transactionId;
-
- // checkstyle flags the public modifier as redundant however it is explicitly needed for Java serialization to
- // be able to create instances via reflection.
- @SuppressWarnings("checkstyle:RedundantModifier")
- public Proxy() {
- // For Externalizable
- }
-
- Proxy(final LocalHistoryIdentifier historyId, final long transactionId) {
- this.historyId = requireNonNull(historyId);
- this.transactionId = transactionId;
- }
-
- @Override
- public void writeExternal(final ObjectOutput out) throws IOException {
- historyId.writeTo(out);
- WritableObjects.writeLong(out, transactionId);
- }
-
- @Override
- public void readExternal(final ObjectInput in) throws IOException {
- historyId = LocalHistoryIdentifier.readFrom(in);
- transactionId = WritableObjects.readLong(in);
- }
-
- private Object readResolve() {
- return new TransactionIdentifier(historyId, transactionId);
- }
- }
-