Search in sources :

Example 1 with MethodInvocationMessage

use of org.jowidgets.invocation.common.impl.MethodInvocationMessage in project jo-client-platform by jo-source.

the class InvocationClientImpl method getMethod.

@Override
public IMethod getMethod(final String methodName) {
    return new IMethod() {

        @Override
        public void invoke(final Object invocationId, final Object parameter) {
            final MethodInvocationMessage message = new MethodInvocationMessage(invocationId, methodName, parameter);
            messageChannel.send(message, new ExceptionCallback(invocationClientServiceRegistry, invocationId));
        }
    };
}
Also used : MethodInvocationMessage(org.jowidgets.invocation.common.impl.MethodInvocationMessage) IMethod(org.jowidgets.invocation.common.api.IMethod)

Example 2 with MethodInvocationMessage

use of org.jowidgets.invocation.common.impl.MethodInvocationMessage in project jo-client-platform by jo-source.

the class InvocationServerMessageReceiver method onMessage.

@Override
public void onMessage(final Object message, final IMessageChannel replyChannel) {
    if (message instanceof MethodInvocationMessage) {
        final MethodInvocationMessage invocationMessage = (MethodInvocationMessage) message;
        final Object invocationId = invocationMessage.getInvocationId();
        invocationServer.registerInvocation(invocationId, replyChannel);
        invocationServerServiceRegistry.onMethodInvocation((MethodInvocationMessage) message);
    } else if (message instanceof CancelMessage) {
        final CancelMessage cancelMessage = (CancelMessage) message;
        invocationServerServiceRegistry.onCancel(cancelMessage);
        invocationServer.unregisterInvocation(cancelMessage.getInvocationId());
    } else if (message instanceof ResponseMessage) {
        invocationServerServiceRegistry.onResponse((ResponseMessage) message);
    }
}
Also used : CancelMessage(org.jowidgets.invocation.common.impl.CancelMessage) MethodInvocationMessage(org.jowidgets.invocation.common.impl.MethodInvocationMessage) ResponseMessage(org.jowidgets.invocation.common.impl.ResponseMessage)

Aggregations

MethodInvocationMessage (org.jowidgets.invocation.common.impl.MethodInvocationMessage)2 IMethod (org.jowidgets.invocation.common.api.IMethod)1 CancelMessage (org.jowidgets.invocation.common.impl.CancelMessage)1 ResponseMessage (org.jowidgets.invocation.common.impl.ResponseMessage)1