Interface TransactionalPacketRegistry

    • Method Detail

      • registerTransactional

        <P extends RequestPacket<R>,​R extends PacketFixedTransactionalPacketBinding<P,​R> registerTransactional​(Class<P> requestPacketType,
                                                                                                                             Class<R> responsePacketType,
                                                                                                                             int packetOpcode)
        Register a request/response packet class pair to this channel. A receiving handler isn't required when sending the request using TransactionalPacketDispatcher.sendTo(EngineConnection, RequestPacket).

        The response packet type may be reused by multiple request types.

        Type Parameters:
        P - The type of the request packet
        R - The type of the response packet
        Parameters:
        packetOpcode - A unique opcode for this request/response packet type pair
        requestPacketType - The type of the request packet being registered
        responsePacketType - The type of the response packet being registered
        Returns:
        The created transactional packet binding
      • transactionalBinding

        <P extends RequestPacket<R>,​R extends PacketOptional<TransactionalPacketBinding<P,​R>> transactionalBinding​(Class<P> requestPacketType)
        Gets the TransactionalPacketBinding for the given RequestPacket class, if the type is registered to this channel as a transactional binding.
        Type Parameters:
        P - The type of the request packet
        R - The type of the response packet
        Parameters:
        requestPacketType - The request packet type
        Returns:
        The transactional packet binding, if found