Created
April 25, 2012 13:52
-
-
Save firexel/2489873 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public @interface EventListener { | |
String value() default ""; | |
} | |
public class AnnotationClient { | |
@EventListener(AnnotationDispatcher.EVENT_ADD) | |
public void onAdd(AnnotationDispatcher.Event event) { | |
System.out.println("onAdd"); | |
} | |
@EventListener(AnnotationDispatcher.EVENT_REMOVE) | |
public void onRemove(AnnotationDispatcher.Event event) { | |
System.out.println("onRemove"); | |
} | |
} | |
public class AnnotationDispatcher { | |
public static final String EVENT_ADD = "event_add"; | |
public static final String EVENT_REMOVE = "event_remove"; | |
public class Event { | |
int data; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment