diff --git a/jOOQ-console/src/main/java/org/jooq/debug/console/remote/messaging/CommandMessage.java b/jOOQ-console/src/main/java/org/jooq/debug/console/remote/messaging/CommandMessage.java index f2ec87354e..60f420f01a 100644 --- a/jOOQ-console/src/main/java/org/jooq/debug/console/remote/messaging/CommandMessage.java +++ b/jOOQ-console/src/main/java/org/jooq/debug/console/remote/messaging/CommandMessage.java @@ -68,7 +68,7 @@ public abstract class CommandMessage extends Message */ public void asyncExec(CommunicationInterface communicationInterface, Object... arguments) { setArgs(arguments); - asyncSend(communicationInterface); + communicationInterface.asyncSend(this); } /** @@ -78,7 +78,7 @@ public abstract class CommandMessage extends Message */ public S syncExec(CommunicationInterface communicationInterface, Object... arguments) { setArgs(arguments); - return syncSend(communicationInterface); + return communicationInterface.syncSend(this); } private static final Object[] EMPTY_ARGS = new Object[0]; diff --git a/jOOQ-console/src/main/java/org/jooq/debug/console/remote/messaging/CommunicationInterface.java b/jOOQ-console/src/main/java/org/jooq/debug/console/remote/messaging/CommunicationInterface.java index 90d4d86f4c..ea0effb291 100644 --- a/jOOQ-console/src/main/java/org/jooq/debug/console/remote/messaging/CommunicationInterface.java +++ b/jOOQ-console/src/main/java/org/jooq/debug/console/remote/messaging/CommunicationInterface.java @@ -130,7 +130,13 @@ public class CommunicationInterface { return messagingInterface; } - S syncSend(final Message message) { + /** + * Send that message synchronously, potentially returning a result if the + * message type allows that. + * + * @return the result if any. + */ + final S syncSend(final Message message) { checkOpen(); if(message instanceof LocalMessage) { LocalMessage localMessage = (LocalMessage) message; @@ -140,7 +146,10 @@ public class CommunicationInterface { return messagingInterface.syncSend(message); } - void asyncSend(final Message message) { + /** + * Send a message asynchronously. + */ + final void asyncSend(final Message message) { if(IS_SYNCING_MESSAGES) { syncSend(message); } else { diff --git a/jOOQ-console/src/main/java/org/jooq/debug/console/remote/messaging/Message.java b/jOOQ-console/src/main/java/org/jooq/debug/console/remote/messaging/Message.java index 0ea364a744..829652cac0 100644 --- a/jOOQ-console/src/main/java/org/jooq/debug/console/remote/messaging/Message.java +++ b/jOOQ-console/src/main/java/org/jooq/debug/console/remote/messaging/Message.java @@ -97,21 +97,6 @@ public abstract class Message implements Serializable { return isSyncExec; } - /** - * Send that message asynchronously. - */ - public void asyncSend(CommunicationInterface communicationInterface) { - communicationInterface.asyncSend(this); - } - - /** - * Send that message synchronously, potentially returning a result if the message type allows that. - * @return the result if any. - */ - public S syncSend(CommunicationInterface communicationInterface) { - return communicationInterface.syncSend(this); - } - /** * Indicate whether the message is valid. This is called before interpreting it to give a chance for the message to prevent its interpretation. * @return true if the message is valid and should be interpreted, false otherwise.