package org.xdi.service.cdi.event;

import javax.enterprise.util.AnnotationLiteral;
import javax.inject.Qualifier;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
 * @author Yuriy Movchan Date: 04/13/2017
 */
@Qualifier
@Retention(RUNTIME)
@Target({ METHOD, FIELD, PARAMETER, TYPE })
@Documented
public @interface ApplicationInitialized {

    public static final class Literal extends AnnotationLiteral<ApplicationInitialized> implements ApplicationInitialized {

        private static final long serialVersionUID = 4891987789146132930L;

        public static final Literal INSTANCE = new Literal();
    }

}

@@ -25,24 +25,128 @@
 cdi.event;%0A%0A
+import javax.enterprise.context.ApplicationScoped;%0Aimport javax.enterprise.context.Initialized.Literal;%0A
 import javax
@@ -439,16 +439,57 @@
 NTIME;%0A%0A
+import java.lang.annotation.Annotation;%0A%0A
 /**%0A * @
@@ -657,24 +657,135 @@
 tialized %7B%0A%0A
+    /**%0A     * The scope for which to observe initialization%0A     */%0A    Class%3C? extends Annotation%3E value();%0A%0A
     public s
@@ -910,136 +910,571 @@
    p
-rivate static final long serialVersionUID = 4891987789146132930L;%0A%0A        public static final Literal INSTANCE = new Literal();
+ublic static final Literal APPLICATION = of(ApplicationScoped.class);%0A%0A        private static final long serialVersionUID = 1L;%0A%0A        private final Class%3C? extends Annotation%3E value;%0A%0A        public static Literal of(Class%3C? extends Annotation%3E value) %7B%0A            return new Literal(value);%0A        %7D%0A%0A        private Literal(Class%3C? extends Annotation%3E value) %7B%0A            this.value = value;%0A        %7D%0A%0A        @Override%0A        public Class%3C? extends Annotation%3E value() %7B%0A            // TODO Auto-generated method stub%0A            return null;%0A        %7D
 %0A   

Add event to notify plugins about finish application initialization