Search in sources :

Example 1 with EventMetadataImpl

use of org.jboss.weld.event.EventMetadataImpl in project core by weld.

the class HttpContextLifecycle method fireEventForApplicationScope.

private void fireEventForApplicationScope(ServletContext ctx, Annotation qualifier) {
    if (module != null) {
        // Deliver events sequentially
        synchronized (container) {
            if (module.isWebModule()) {
                module.fireEvent(ServletContext.class, ctx, qualifier);
            } else {
                // fallback for backward compatibility
                ServletLogger.LOG.noEeModuleDescriptor(beanManager);
                final EventMetadata metadata = new EventMetadataImpl(ServletContext.class, null, Collections.singleton(qualifier));
                beanManager.getAccessibleLenientObserverNotifier().fireEvent(ServletContext.class, ctx, metadata, qualifier);
            }
        }
    }
}
Also used : EventMetadataImpl(org.jboss.weld.event.EventMetadataImpl) EventMetadata(javax.enterprise.inject.spi.EventMetadata)

Example 2 with EventMetadataImpl

use of org.jboss.weld.event.EventMetadataImpl in project core by weld.

the class BeanDeploymentModule method fireEvent.

/**
 * Fire an event and notify observers that belong to this module.
 * @param eventType
 * @param event
 * @param qualifiers
 */
public void fireEvent(Type eventType, Object event, Annotation... qualifiers) {
    final EventMetadata metadata = new EventMetadataImpl(eventType, null, qualifiers);
    notifier.fireEvent(eventType, event, metadata, qualifiers);
}
Also used : EventMetadataImpl(org.jboss.weld.event.EventMetadataImpl) EventMetadata(javax.enterprise.inject.spi.EventMetadata)

Example 3 with EventMetadataImpl

use of org.jboss.weld.event.EventMetadataImpl in project core by weld.

the class BeanManagerImpl method fireEvent.

/**
 * Fires an event object with given event object for given bindings
 *
 * @param event The event object to pass along
 * @param qualifiers The binding types to match
 * @see javax.enterprise.inject.spi.BeanManager#fireEvent(java.lang.Object, java.lang.annotation.Annotation[])
 */
@Override
public void fireEvent(Object event, Annotation... qualifiers) {
    Preconditions.checkArgumentNotNull(event, "event");
    Type eventType = Types.getCanonicalType(event.getClass());
    EventMetadata metadata = new EventMetadataImpl(eventType, null, qualifiers);
    globalStrictObserverNotifier.fireEvent(event, metadata, qualifiers);
}
Also used : SlimAnnotatedType(org.jboss.weld.annotated.slim.SlimAnnotatedType) AnnotatedType(javax.enterprise.inject.spi.AnnotatedType) Type(java.lang.reflect.Type) EnhancedAnnotatedType(org.jboss.weld.annotated.enhanced.EnhancedAnnotatedType) AnnotatedTypeValidator.validateAnnotatedType(org.jboss.weld.annotated.AnnotatedTypeValidator.validateAnnotatedType) InterceptionType(javax.enterprise.inject.spi.InterceptionType) EventMetadataImpl(org.jboss.weld.event.EventMetadataImpl) EventMetadata(javax.enterprise.inject.spi.EventMetadata)

Aggregations

EventMetadata (javax.enterprise.inject.spi.EventMetadata)3 EventMetadataImpl (org.jboss.weld.event.EventMetadataImpl)3 Type (java.lang.reflect.Type)1 AnnotatedType (javax.enterprise.inject.spi.AnnotatedType)1 InterceptionType (javax.enterprise.inject.spi.InterceptionType)1 AnnotatedTypeValidator.validateAnnotatedType (org.jboss.weld.annotated.AnnotatedTypeValidator.validateAnnotatedType)1 EnhancedAnnotatedType (org.jboss.weld.annotated.enhanced.EnhancedAnnotatedType)1 SlimAnnotatedType (org.jboss.weld.annotated.slim.SlimAnnotatedType)1