public class VanillaMethodReader extends Object implements net.openhft.chronicle.bytes.MethodReader
| Modifier and Type | Field and Description |
|---|---|
static boolean |
DEBUG_ENABLED |
| Constructor and Description |
|---|
VanillaMethodReader(MarshallableIn in,
boolean ignoreDefault,
WireParselet defaultParselet,
FieldNumberParselet fieldNumberParselet,
net.openhft.chronicle.bytes.MethodReaderInterceptorReturns methodReaderInterceptorReturns,
Object... objects) |
VanillaMethodReader(MarshallableIn in,
boolean ignoreDefault,
WireParselet defaultParselet,
FieldNumberParselet fieldNumberParselet,
net.openhft.chronicle.bytes.MethodReaderInterceptorReturns methodReaderInterceptorReturns,
Object[] metaDataHandler,
Object... objects)
This constructor is an overloaded version of the primary VanillaMethodReader constructor.
|
VanillaMethodReader(MarshallableIn in,
boolean ignoreDefault,
WireParselet defaultParselet,
FieldNumberParselet fieldNumberParselet,
net.openhft.chronicle.bytes.MethodReaderInterceptorReturns methodReaderInterceptorReturns,
Object[] metaDataHandler,
Predicate<net.openhft.chronicle.bytes.MethodReader> predicate,
Object... objects)
This is the primary constructor for the VanillaMethodReader class.
|
VanillaMethodReader(MarshallableIn in,
boolean ignoreDefault,
WireParselet defaultParselet,
net.openhft.chronicle.bytes.MethodReaderInterceptorReturns methodReaderInterceptorReturns,
Object[] metaDataHandler,
Object... objects)
Constructor for creating an instance of VanillaMethodReader with specified parameters.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addParseletForMethod(WireParser wireParser,
Object o2,
Object[] context,
Supplier contextSupplier,
@NotNull Method m)
Registers a method with no arguments with the provided WireParser.
|
void |
addParseletForMethod(WireParser wireParser,
Object o2,
Object[] context,
Supplier contextSupplier,
@NotNull Method m,
@NotNull Class[] parameterTypes)
Registers a method with multiple arguments with the provided WireParser.
|
void |
addParseletForMethod(WireParser wireParser,
Object o2,
Object[] context,
Supplier contextSupplier,
@NotNull Method m,
@NotNull Class[] parameterTypes,
MethodFilterOnFirstArg methodFilterOnFirstArg)
Registers a method with multiple arguments with the provided WireParser, applying a filter on the first argument.
|
void |
addParseletForMethod(WireParser wireParser,
Object o2,
Object[] context,
Supplier contextSupplier,
@NotNull Method m,
Class<?> parameterType)
Registers a method with the provided WireParser, enabling parsing of wire messages to trigger method invocations.
|
void |
close() |
@NotNull VanillaMethodReader |
closeIn(boolean closeIn)
Sets the closeIn state of the VanillaMethodReader.
|
protected @NotNull MethodWireKey |
createWireKey(@NotNull Method m,
String name)
Creates a MethodWireKey for a given method.
|
protected Object |
invoke(Object o,
@NotNull Method m,
Object[] args)
Invokes a method on an object with the provided arguments.
|
boolean |
isClosed() |
static void |
logMessage(@NotNull CharSequence s,
@NotNull ValueIn v)
Logs a message if the debug mode is enabled.
|
net.openhft.chronicle.bytes.MethodReaderInterceptorReturns |
methodReaderInterceptorReturns()
Retrieves the current method reader interceptor.
|
boolean |
readOne()
Reads a single message.
|
void |
throwExceptionIfClosed()
Checks if the VanillaMethodReader is closed.
|
@UsedViaReflection public VanillaMethodReader(MarshallableIn in, boolean ignoreDefault, WireParselet defaultParselet, net.openhft.chronicle.bytes.MethodReaderInterceptorReturns methodReaderInterceptorReturns, Object[] metaDataHandler, @NotNull Object... objects)
in - The MarshallableIn source from which methods are read.ignoreDefault - Flag to determine if defaults should be ignored.defaultParselet - The default parselet to use.methodReaderInterceptorReturns - The interceptor for method reading.metaDataHandler - Metadata handler array.objects - Varargs for additional parameters.@UsedViaReflection public VanillaMethodReader(MarshallableIn in, boolean ignoreDefault, WireParselet defaultParselet, FieldNumberParselet fieldNumberParselet, net.openhft.chronicle.bytes.MethodReaderInterceptorReturns methodReaderInterceptorReturns, @NotNull Object... objects)
public VanillaMethodReader(MarshallableIn in, boolean ignoreDefault, WireParselet defaultParselet, FieldNumberParselet fieldNumberParselet, net.openhft.chronicle.bytes.MethodReaderInterceptorReturns methodReaderInterceptorReturns, Object[] metaDataHandler, @NotNull Object... objects)
in - The MarshallableIn source from which methods are read.ignoreDefault - Flag to determine if defaults should be ignored.defaultParselet - The default parselet to be used for parsing.fieldNumberParselet - Custom parselet for handling field numbers.methodReaderInterceptorReturns - Interceptor for reading methods.metaDataHandler - Metadata handler array.objects - Varargs for additional parameters, including custom parselets.public VanillaMethodReader(MarshallableIn in, boolean ignoreDefault, WireParselet defaultParselet, FieldNumberParselet fieldNumberParselet, net.openhft.chronicle.bytes.MethodReaderInterceptorReturns methodReaderInterceptorReturns, Object[] metaDataHandler, Predicate<net.openhft.chronicle.bytes.MethodReader> predicate, @NotNull Object... objects)
in - The MarshallableIn source from which methods are read.ignoreDefault - Flag to determine if defaults should be ignored.defaultParselet - The default parselet to be used for parsing.fieldNumberParselet - Custom parselet for handling field numbers.methodReaderInterceptorReturns - Interceptor for reading methods.metaDataHandler - Metadata handler array.predicate - Predicate for filtering.objects - Varargs for additional parameters, including custom parselets.public static void logMessage(@NotNull
@NotNull CharSequence s,
@NotNull
@NotNull ValueIn v)
s - A CharSequence representing part of the message.v - The ValueIn associated with the message.@NotNull public @NotNull VanillaMethodReader closeIn(boolean closeIn)
closeIn in interface net.openhft.chronicle.bytes.MethodReadercloseIn - The new closeIn state to be setIllegalStateException - if the VanillaMethodReader is already closedpublic void throwExceptionIfClosed()
IllegalStateException - if the VanillaMethodReader is closedpublic void addParseletForMethod(WireParser wireParser, Object o2, Object[] context, Supplier contextSupplier, @NotNull @NotNull Method m, Class<?> parameterType)
wireParser - The WireParser to which the method will be registeredo2 - The object on which the method should be invokedcontext - The current context for method invocationcontextSupplier - Supplies the context for method invocationm - The method to be registeredparameterType - The parameter type of the method being registeredIllegalStateException - if the VanillaMethodReader is closedpublic void addParseletForMethod(WireParser wireParser, Object o2, Object[] context, Supplier contextSupplier, @NotNull @NotNull Method m)
wireParser - The WireParser to which the method will be registeredo2 - The object on which the method should be invokedcontext - The current context for method invocationcontextSupplier - Supplies the context for method invocationm - The method to be registeredIllegalStateException - if the VanillaMethodReader is closed@NotNull protected @NotNull MethodWireKey createWireKey(@NotNull @NotNull Method m, String name)
m - The method for which the key is being generatedname - The name of the methodpublic void addParseletForMethod(WireParser wireParser, Object o2, Object[] context, Supplier contextSupplier, @NotNull @NotNull Method m, @NotNull @NotNull Class[] parameterTypes)
wireParser - The WireParser to which the method will be registeredo2 - The object on which the method should be invokedcontext - The current context for method invocationcontextSupplier - Supplies the context for method invocationm - The method to be registeredparameterTypes - The array of parameter types for the methodIllegalStateException - if the VanillaMethodReader is closedpublic void addParseletForMethod(WireParser wireParser, Object o2, Object[] context, Supplier contextSupplier, @NotNull @NotNull Method m, @NotNull @NotNull Class[] parameterTypes, MethodFilterOnFirstArg methodFilterOnFirstArg)
wireParser - The WireParser to which the method will be registeredo2 - The object on which the method should be invokedcontext - The current context for method invocationcontextSupplier - Supplies the context for method invocationm - The method to be registeredparameterTypes - The array of parameter types for the methodmethodFilterOnFirstArg - The filter that decides if the method should be ignored based on its first argumentIllegalStateException - If the VanillaMethodReader is closedprotected Object invoke(Object o, @NotNull @NotNull Method m, Object[] args) throws net.openhft.chronicle.core.util.InvocationTargetRuntimeException
o - The object on which to invoke the methodm - The method to invokeargs - The arguments to pass to the methodnet.openhft.chronicle.core.util.InvocationTargetRuntimeException - if the invoked method itself throws an exceptionpublic boolean readOne()
throws net.openhft.chronicle.core.util.InvocationTargetRuntimeException
readOne in interface net.openhft.chronicle.bytes.MethodReadernet.openhft.chronicle.core.util.InvocationTargetRuntimeException - if an exception occurs during message readingpublic void close()
close in interface Closeableclose in interface AutoCloseablepublic boolean isClosed()
isClosed in interface net.openhft.chronicle.core.io.QueryCloseablepublic net.openhft.chronicle.bytes.MethodReaderInterceptorReturns methodReaderInterceptorReturns()
methodReaderInterceptorReturns in interface net.openhft.chronicle.bytes.MethodReaderMethodReaderInterceptorReturns instance.IllegalStateException - if the method reader is closed.Copyright © 2024. All rights reserved.