Class GuiceInteractionControllerInstantiator
java.lang.Object
com.github.kaktushose.jda.commands.guice.internal.GuiceInteractionControllerInstantiator
- All Implemented Interfaces:
InteractionControllerInstantiator
,Implementation.ExtensionProvidable
@Internal
public class GuiceInteractionControllerInstantiator
extends Object
implements InteractionControllerInstantiator
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.github.kaktushose.jda.commands.dispatching.instance.InteractionControllerInstantiator
InteractionControllerInstantiator.Context
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionforRuntime
(String id, JDA jda) Creates a new child injector with its ownInteractionControllerInstantiatorModule
for each runtime.<T> T
instance
(Class<T> clazz, InteractionControllerInstantiator.Context context) This method will be called each time an instance of a class annotated withInteraction
is needed.
-
Constructor Details
-
GuiceInteractionControllerInstantiator
-
-
Method Details
-
instance
Description copied from interface:InteractionControllerInstantiator
This method will be called each time an instance of a class annotated withInteraction
is needed.- Specified by:
instance
in interfaceInteractionControllerInstantiator
- Parameters:
clazz
- theClass
of needed instancecontext
- a context that gives additional useful information or provide some needed functionality
-
forRuntime
Creates a new child injector with its ownInteractionControllerInstantiatorModule
for each runtime. This has the effect, that each class annotated withInteraction
will be treated as a runtime scoped singleton.- Specified by:
forRuntime
in interfaceInteractionControllerInstantiator
- Parameters:
id
- the runtime idjda
- theJDA
instance associated with the event responsible for creating the new Runtime instance- Returns:
- a specific instance of
InteractionControllerInstantiator
belonging to provided runtime.
-