io.vertx.up.uca.micro.invoke.MessageInvoker Maven / Gradle / Ivy
package io.vertx.up.uca.micro.invoke;
import io.vertx.core.Vertx;
import io.vertx.core.eventbus.Message;
import io.vertx.up.commune.Envelop;
import io.vertx.up.exception.web._501RpcRejectException;
import io.vertx.up.util.Ut;
import java.lang.reflect.Method;
/**
* void method(Messsage)
*/
public class MessageInvoker extends AbstractInvoker {
@Override
public void ensure(final Class> returnType,
final Class> paramCls) {
// Verify
final boolean valid =
(void.class == returnType || Void.class == returnType)
&& Message.class.isAssignableFrom(paramCls);
InvokerUtil.verify(!valid, returnType, paramCls, getClass());
}
@Override
public void invoke(final Object proxy,
final Method method,
final Message message) {
// Invoker and do not reply
Ut.invoke(proxy, method.getName(), message);
}
@Override
public void next(final Object proxy,
final Method method,
final Message message,
final Vertx vertx) {
// Return void is reject by Rpc continue
throw new _501RpcRejectException(getClass());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy