Package org.apache.shiro.event
Annotation Type Subscribe
-
@Retention(RUNTIME) @Target(METHOD) public @interface Subscribe
Indicates a method is an event consumer. The method must have a single argument and the argument's type determines what type of events should be delivered to the method for consumption. For example:@Subscribe public void onSomeEvent(SomeEvent event) { ... }Because the method argument is declared as aSomeEventtype, the method will be called by the event dispatcher whenever aSomeEventinstance (or one of its subclass instances that is not already registered) is published.- Since:
- 1.3