Class LifeCycleDecoratorHandler<A extends Annotation>
java.lang.Object
com.thewinterframework.service.decorator.lifecycle.LifeCycleDecoratorHandler<A>
- All Implemented Interfaces:
ServiceDecoratorHandler<A>
- Direct Known Subclasses:
OnDisableDecoratorHandler,OnEnableDecoratorHandler,OnReloadDecoratorHandler
public abstract class LifeCycleDecoratorHandler<A extends Annotation>
extends Object
implements ServiceDecoratorHandler<A>
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final DfsGraph<LifeCycleMethod> protected final com.google.common.collect.Multimap<Class<?>, LifeCycleMethod> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionexecute(WinterPlugin plugin) Executes the lifecycle methods in the correct order.protected voidexecuteInternally(WinterPlugin plugin) protected abstract Class<?>[]extractAfterAnnotations(A annotation) protected abstract Class<?>[]extractBeforeAnnotations(A annotation) final voidonDiscover(Class<?> service, AnnotatedMethodHandle<A> method) Called when a method with the decorator annotation is discovered.final voidonPluginLoad(WinterPlugin plugin) Called when a plugin is loaded.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.thewinterframework.service.decorator.ServiceDecoratorHandler
getAnnotationType, onConfigure, onDiscoverOnType, onPluginDisable, onPluginEnable
-
Field Details
-
lifeCycleMethodsByService
protected final com.google.common.collect.Multimap<Class<?>,LifeCycleMethod> lifeCycleMethodsByService -
graph
-
-
Constructor Details
-
LifeCycleDecoratorHandler
public LifeCycleDecoratorHandler()
-
-
Method Details
-
onDiscover
Description copied from interface:ServiceDecoratorHandlerCalled when a method with the decorator annotation is discovered.- Specified by:
onDiscoverin interfaceServiceDecoratorHandler<A extends Annotation>- Parameters:
service- The class containing the annotated method.method- The annotated method handle.
-
onPluginLoad
Description copied from interface:ServiceDecoratorHandlerCalled when a plugin is loaded.- Specified by:
onPluginLoadin interfaceServiceDecoratorHandler<A extends Annotation>- Parameters:
plugin- The plugin being loaded.
-
executeInternally
-
execute
Executes the lifecycle methods in the correct order.- Parameters:
plugin- The plugin- Returns:
- The result of the execution
-
extractAfterAnnotations
-
extractBeforeAnnotations
-