ng reference to request ServletRequest request = ...; LifecycleManager manager = LifecycleManagerStore.get(ServletRequest.class, request); manager.fireEvent(new CustomLifecycleEvent());
with following implementation of CustomLifecycleEvent
public class CustomLifecycleEvent extends WarpLifecycleEvent { public Annotation getAnnotation() { return new CustomAnnotation() { public Class extends Annotation> annotationType() { return CustomAnnotation.class; } }; } }
and following implementation of CustomAnnotation
{@literal @}Retention(RUNTIME) {@literal @}Target(ElementType.METHOD) public {@literal @}interface CustomAnnotation { }
This will cause executing following method in associated user-defined {@link Inspection}:
{@literal @}CustomAnnotation public void verifyCustomBehavior() { ... }
For more details how to implement CustomLifecycleEvent, see {@link WarpLifecycleEvent}.
For more info on how to retrieve {@link LifecycleManagerStore}, see {@link LifecycleManagerStore#get(Class,Object)}.
@author Lukas Fryc