public class BinaryBytesMethodWriterInvocationHandler extends net.openhft.chronicle.core.util.AbstractInvocationHandler implements BytesMethodWriterInvocationHandler
BytesOut
.
This class is typically used in conjunction with a proxy to provide a binary "wire" protocol representation
of calls to an interface's methods.Constructor and Description |
---|
BinaryBytesMethodWriterInvocationHandler(Class tClass,
Function<Method,MethodEncoder> methodToId,
BytesOut<?> out)
Create a new invocation handler.
|
Modifier and Type | Method and Description |
---|---|
protected Object |
doInvoke(Object proxy,
Method method,
Object[] args)
Handle a method invocation on a proxy instance.
|
invoke, onClose
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
onClose
invoke
public BinaryBytesMethodWriterInvocationHandler(Class tClass, Function<Method,MethodEncoder> methodToId, BytesOut<?> out)
tClass
- The type of the interface to be handled.methodToId
- A function mapping Methods to corresponding MethodEncoder
instances.out
- The output stream to which encoded invocations should be written.protected Object doInvoke(Object proxy, Method method, Object[] args) throws IllegalStateException, BufferOverflowException, BufferUnderflowException, IllegalArgumentException, ArithmeticException, net.openhft.chronicle.core.io.InvalidMarshallableException
BytesOut
.doInvoke
in class net.openhft.chronicle.core.util.AbstractInvocationHandler
proxy
- The proxy instance on which the method was invoked.method
- The method that was invoked.args
- The arguments provided to the method.IllegalStateException
- if the underlying bytes store is closed.BufferOverflowException
- if there isn't enough space in the BytesOut
to write the value.BufferUnderflowException
- if the underlying bytes store cannot provide enough data.IllegalArgumentException
- if the arguments don't match the method's requirements.ArithmeticException
- if numeric values overflow or underflow.net.openhft.chronicle.core.io.InvalidMarshallableException
- if a marshalling error occurs.Copyright © 2023. All rights reserved.