net.sf.javagimmicks.collections.event.cdi.CDIBridgeBase Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gimmicks Show documentation
Show all versions of gimmicks Show documentation
Utility classes, APIs and tools for Java
package net.sf.javagimmicks.collections.event.cdi;
import java.lang.annotation.Annotation;
import javax.enterprise.event.Event;
import javax.enterprise.inject.Any;
import net.sf.javagimmicks.cdi.AnnotationLiteralHelper;
import net.sf.javagimmicks.cdi.CDIContext;
import net.sf.javagimmicks.cdi.InjectionSpec;
abstract class CDIBrigeBase
{
@SuppressWarnings("rawtypes")
private static final InjectionSpec EVENT_INJECTION = InjectionSpec
. build()
.setClass(Event.class)
.addTypeParameters(Object.class)
.addAnnotations(AnnotationLiteralHelper.annotation(Any.class))
.getInjection();
@SuppressWarnings("unchecked")
static Event buildEvent(final Class eventType, final Annotation... annotations)
{
return EVENT_INJECTION.getInstance(CDIContext.getBeanManager()).select(eventType, annotations);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy