Package io.aether.net.fastMeta
Interface FastMetaApi<T,R extends RemoteApi>
-
- Type Parameters:
T- The type of the local API interface.R- The type of the remote API interface (proxy).
public interface FastMetaApi<T,R extends RemoteApi>Interface defining the metadata and factory methods for a specific API pair (Local/Remote).
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanisValidCommand(int commandId)Validates whether the specified command ID exists in this API.voidmakeLocal(MetaContext ctx, io.aether.utils.dataio.DataIn in)Reads binary data fromDataInand deserializes it into method calls on the providedlocalApiimplementation.RmakeRemote(MetaContext ctx)Creates an implementation (proxy) of the remote interfaceR.
-
-
-
Method Detail
-
makeRemote
R makeRemote(MetaContext ctx)
Creates an implementation (proxy) of the remote interfaceR.Method calls performed on this implementation result in data serialization and writing to the provided context
ctx.- Parameters:
ctx- The context used for serialization and network transmission.- Returns:
- The remote API implementation.
-
makeLocal
void makeLocal(MetaContext ctx, io.aether.utils.dataio.DataIn in)
Reads binary data fromDataInand deserializes it into method calls on the providedlocalApiimplementation.- Parameters:
ctx- The context used for deserialization and future management.in- The input stream containing binary command data.
-
isValidCommand
boolean isValidCommand(int commandId)
Validates whether the specified command ID exists in this API.This is used for early filtering of incoming connections or packets to reject invalid commands before resource-intensive deserialization occurs.
- Parameters:
commandId- The command identifier (typically the first byte of the packet).- Returns:
trueif the command is supported,falseotherwise.
-
-