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);
}
}
}
}
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);
}
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);
}
Aggregations