mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
#1427 - QueryCache should be cleared, if one of a dependent bean is updated
Update RemoteTransactionEvent, add (back) common binary message handling (Common to TCP, K8s and upcoming binary pubsub)
This commit is contained in:
@@ -3,7 +3,7 @@ package io.ebeaninternal.server.transaction;
|
||||
import io.ebeaninternal.api.SpiEbeanServer;
|
||||
import io.ebeaninternal.api.TransactionEventTable.TableIUD;
|
||||
import io.ebeaninternal.server.cache.RemoteCacheEvent;
|
||||
import io.ebeaninternal.server.cluster.BinaryMessageList;
|
||||
import io.ebeaninternal.server.cluster.binarymessage.BinaryMessageList;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
@@ -19,6 +19,8 @@ public class RemoteTransactionEvent implements Runnable {
|
||||
|
||||
private RemoteCacheEvent remoteCacheEvent;
|
||||
|
||||
private RemoteTableMod remoteTableMod;
|
||||
|
||||
private String serverName;
|
||||
|
||||
private transient SpiEbeanServer server;
|
||||
@@ -53,6 +55,10 @@ public class RemoteTransactionEvent implements Runnable {
|
||||
|
||||
public void writeBinaryMessage(BinaryMessageList msgList) throws IOException {
|
||||
|
||||
if (remoteTableMod != null) {
|
||||
remoteTableMod.writeBinary(msgList);
|
||||
}
|
||||
|
||||
if (tableList != null) {
|
||||
for (TableIUD aTableList : tableList) {
|
||||
aTableList.writeBinaryMessage(msgList);
|
||||
@@ -113,6 +119,10 @@ public class RemoteTransactionEvent implements Runnable {
|
||||
tableList.add(tableIud);
|
||||
}
|
||||
|
||||
public void addRemoteTableMod(RemoteTableMod remoteTableMod) {
|
||||
this.remoteTableMod = remoteTableMod;
|
||||
}
|
||||
|
||||
public String getServerName() {
|
||||
return serverName;
|
||||
}
|
||||
@@ -141,4 +151,8 @@ public class RemoteTransactionEvent implements Runnable {
|
||||
return remoteCacheEvent;
|
||||
}
|
||||
|
||||
public RemoteTableMod getRemoteTableMod() {
|
||||
return remoteTableMod;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user