[#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:
Lukas Eder 2012-09-08 11:28:33 +02:00
parent 8fbe50b8e5
commit baffa39059
3 changed files with 13 additions and 19 deletions

View File

@ -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];

View File

@ -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 {

View File

@ -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.