Class RPCGenerationCache

java.lang.Object
eu.cloudnetservice.driver.impl.network.rpc.generation.RPCGenerationCache

public final class RPCGenerationCache extends Object
The cache for rpc implementation generations to prevent multiple generations for the same class.
Since:
4.0
  • Field Details

  • Constructor Details

    • RPCGenerationCache

      public RPCGenerationCache(@NonNull @NonNull DefaultRPCFactory rpcFactory)
      Constructs a new rpc generation cache.
      Parameters:
      rpcFactory - the rpc factory that is associated with this generation cache.
      Throws:
      NullPointerException - if the given rpc factory is null.
  • Method Details

    • getOrGenerateImplementation

      @NonNull @NonNull RPCInternalInstanceFactory getOrGenerateImplementation(int generationFlags, @NonNull @NonNull Class<?> senderTargetType, @NonNull @NonNull RPCClassMetadata baseClassMeta)
      Gets an existing instance factory for the target class wrapped in the given target class metadata. The generation process is triggered again if different generation flags are supplied for the same type.
      Parameters:
      generationFlags - the options to apply during class generation.
      baseClassMeta - the class meta for the class that is being generated.
      Returns:
      an instance factory for the generated rpc api implementation.
      Throws:
      NullPointerException - if the given base class meta is null.
    • getOrGenerateImplementation

      @NonNull public @NonNull RPCInternalInstanceFactory getOrGenerateImplementation(int generationFlags, @NonNull @NonNull eu.cloudnetservice.driver.network.rpc.RPCSender rpcSender, @NonNull @NonNull RPCClassMetadata baseClassMeta)
      Gets an existing instance factory for the target class wrapped in the given target class metadata. The generation process is triggered again if different generation flags are supplied for the same type.
      Parameters:
      generationFlags - the options to apply during class generation.
      rpcSender - the base rpc sender for the target class.
      baseClassMeta - the class meta for the class that is being generated.
      Returns:
      an instance factory for the generated rpc api implementation.
      Throws:
      NullPointerException - if the given rpc sender or base class meta is null.