[#1472] Add a Settings.executeDebugging property, and move server-side
Console logic to core - Inline Message.{sync|async}Send(). This
indirection is not needed
This commit is contained in:
parent
8fbe50b8e5
commit
baffa39059
@ -68,7 +68,7 @@ public abstract class CommandMessage<S extends Serializable> extends Message<S>
|
||||
*/
|
||||
public void asyncExec(CommunicationInterface communicationInterface, Object... arguments) {
|
||||
setArgs(arguments);
|
||||
asyncSend(communicationInterface);
|
||||
communicationInterface.asyncSend(this);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -78,7 +78,7 @@ public abstract class CommandMessage<S extends Serializable> extends Message<S>
|
||||
*/
|
||||
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];
|
||||
|
||||
@ -130,7 +130,13 @@ public class CommunicationInterface {
|
||||
return messagingInterface;
|
||||
}
|
||||
|
||||
<S extends Serializable> S syncSend(final Message<S> message) {
|
||||
/**
|
||||
* Send that message synchronously, potentially returning a result if the
|
||||
* message type allows that.
|
||||
*
|
||||
* @return the result if any.
|
||||
*/
|
||||
final <S extends Serializable> S syncSend(final Message<S> message) {
|
||||
checkOpen();
|
||||
if(message instanceof LocalMessage) {
|
||||
LocalMessage<S> localMessage = (LocalMessage<S>) message;
|
||||
@ -140,7 +146,10 @@ public class CommunicationInterface {
|
||||
return messagingInterface.syncSend(message);
|
||||
}
|
||||
|
||||
<S extends Serializable> void asyncSend(final Message<S> message) {
|
||||
/**
|
||||
* Send a message asynchronously.
|
||||
*/
|
||||
final <S extends Serializable> void asyncSend(final Message<S> message) {
|
||||
if(IS_SYNCING_MESSAGES) {
|
||||
syncSend(message);
|
||||
} else {
|
||||
|
||||
@ -97,21 +97,6 @@ public abstract class Message<S extends Serializable> 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.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user