package com.atlassian.bitbucket.mesh.event;

import org.springframework.core.annotation.AliasFor;

import java.lang.annotation.*;

/**
 * Annotation that marks a method as a listener for application events.
 *
 * @see org.springframework.context.event.EventListener
 */
@Documented
@org.springframework.context.event.EventListener
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.METHOD, ElementType.ANNOTATION_TYPE})
public @interface EventListener {

    /**
     * Alias for {@link org.springframework.context.event.EventListener#value}.
     *
     * @return the classes
     */
    @AliasFor(annotation = org.springframework.context.event.EventListener.class, attribute = "value")
    Class<?>[] value() default {};

    /**
     * The event classes that this listener handles.
     * <p>If this attribute is specified with a single value, the
     * annotated method may optionally accept a single parameter.
     * However, if this attribute is specified with multiple values,
     * the annotated method must <em>not</em> declare any parameters.
     *
     * @return the classes
     */
    @AliasFor(annotation = org.springframework.context.event.EventListener.class, attribute = "classes")
    Class<?>[] classes() default {};
}
