Class RPCInternalInstanceFactory.TempRPCInternalInstanceFactory
java.lang.Object
eu.cloudnetservice.driver.impl.network.rpc.generation.RPCInternalInstanceFactory
eu.cloudnetservice.driver.impl.network.rpc.generation.RPCInternalInstanceFactory.TempRPCInternalInstanceFactory
- Enclosing class:
RPCInternalInstanceFactory
static final class RPCInternalInstanceFactory.TempRPCInternalInstanceFactory
extends RPCInternalInstanceFactory
An instance factory implementation that is temporarily not delegated (during class construction) to prevent issues
with circular class references.
- Since:
- 4.0
-
Nested Class Summary
Nested classes/interfaces inherited from class RPCInternalInstanceFactory
RPCInternalInstanceFactory.SpecialArg, RPCInternalInstanceFactory.TempRPCInternalInstanceFactory -
Field Summary
FieldsFields inherited from class RPCInternalInstanceFactory
MT_BASIC_IMPLEMENTATION_CONSTRUCTOR, MTD_BASIC_IMPLEMENTATION_CONSTRUCTOR -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconstructInstance(@Nullable eu.cloudnetservice.driver.network.rpc.ChainableRPC baseRPC, @Nullable eu.cloudnetservice.driver.network.rpc.RPCSender classRPCSender, @NonNull Supplier<eu.cloudnetservice.driver.network.NetworkChannel> channelSupplier, @NonNull Object[] additionalConstructorArgs) Uses the delegate instance of this temp factory to construct the target rpc implementation class.constructInstance(@Nullable eu.cloudnetservice.driver.network.rpc.ChainableRPC baseRPC, @NonNull Supplier<eu.cloudnetservice.driver.network.NetworkChannel> channelSupplier, @NonNull Object[] additionalConstructorArgs) Uses the delegate instance of this temp factory to construct the target rpc implementation class.voidsetDelegate(@NonNull RPCInternalInstanceFactory delegate) Sets the delegate instance factory if that didn't happen yet.Methods inherited from class RPCInternalInstanceFactory
make
-
Field Details
-
delegate
-
-
Constructor Details
-
TempRPCInternalInstanceFactory
TempRPCInternalInstanceFactory()
-
-
Method Details
-
setDelegate
Sets the delegate instance factory if that didn't happen yet.- Parameters:
delegate- the delegate instance factory to set.- Throws:
NullPointerException- if the given delegate is null.
-
constructInstance
@NonNull public @NonNull Object constructInstance(@Nullable @Nullable eu.cloudnetservice.driver.network.rpc.ChainableRPC baseRPC, @NonNull @NonNull Supplier<eu.cloudnetservice.driver.network.NetworkChannel> channelSupplier, @NonNull @NonNull Object[] additionalConstructorArgs) Uses the delegate instance of this temp factory to construct the target rpc implementation class.- Overrides:
constructInstancein classRPCInternalInstanceFactory- Parameters:
baseRPC- the base RPC to use for chained api calls.channelSupplier- the channel supplier to which all network requests should be sent.additionalConstructorArgs- the array of additional constructor args to supply to the generated class.- Returns:
- a constructed instance of the generated rpc class implementation.
- Throws:
NullPointerException- if the given channel supplier or additional args is null.IllegalArgumentException- if the given additional constructor args mismatch the expected count.IllegalStateException- if this factory is not yet delegated or the construction fails.
-
constructInstance
@NonNull public @NonNull Object constructInstance(@Nullable @Nullable eu.cloudnetservice.driver.network.rpc.ChainableRPC baseRPC, @Nullable @Nullable eu.cloudnetservice.driver.network.rpc.RPCSender classRPCSender, @NonNull @NonNull Supplier<eu.cloudnetservice.driver.network.NetworkChannel> channelSupplier, @NonNull @NonNull Object[] additionalConstructorArgs) Uses the delegate instance of this temp factory to construct the target rpc implementation class.- Overrides:
constructInstancein classRPCInternalInstanceFactory- Parameters:
baseRPC- the base RPC to use for chained api calls.classRPCSender- the rpc sender to use instead of the fallback one given to this factory.channelSupplier- the channel supplier to which all network requests should be sent.additionalConstructorArgs- the array of additional constructor args to supply to the generated class.- Returns:
- a constructed instance of the generated rpc class implementation.
- Throws:
NullPointerException- if the given channel supplier or additional args is null.IllegalArgumentException- if the given additional constructor args mismatch the expected count.IllegalStateException- if this factory is not yet delegated or the construction fails.
-