use of java.util.EventListener in project spring-boot by spring-projects.
the class ServletContextInitializerBeans method addAdaptableBeans.
@SuppressWarnings("unchecked")
private void addAdaptableBeans(ListableBeanFactory beanFactory) {
MultipartConfigElement multipartConfig = getMultipartConfig(beanFactory);
addAsRegistrationBean(beanFactory, Servlet.class, new ServletRegistrationBeanAdapter(multipartConfig));
addAsRegistrationBean(beanFactory, Filter.class, new FilterRegistrationBeanAdapter());
for (Class<?> listenerType : ServletListenerRegistrationBean.getSupportedTypes()) {
addAsRegistrationBean(beanFactory, EventListener.class, (Class<EventListener>) listenerType, new ServletListenerRegistrationBeanAdapter());
}
}
use of java.util.EventListener in project wildfly by wildfly.
the class UndertowDeploymentInfoService method addListener.
private static void addListener(final ClassLoader classLoader, final ComponentRegistry components, final DeploymentInfo d, final ListenerMetaData listener) throws ClassNotFoundException {
ListenerInfo l;
final Class<? extends EventListener> listenerClass = (Class<? extends EventListener>) classLoader.loadClass(listener.getListenerClass());
ManagedReferenceFactory creator = components.createInstanceFactory(listenerClass);
if (creator != null) {
InstanceFactory<EventListener> factory = createInstanceFactory(creator);
l = new ListenerInfo(listenerClass, factory);
} else {
l = new ListenerInfo(listenerClass);
}
d.addListener(l);
}
use of java.util.EventListener in project jdk8u_jdk by JetBrains.
the class AWTEventMulticaster method remove.
/**
* Removes a listener from this multicaster.
* <p>
* The returned multicaster contains all the listeners in this
* multicaster with the exception of all occurrences of {@code oldl}.
* If the resulting multicaster contains only one regular listener
* the regular listener may be returned. If the resulting multicaster
* is empty, then {@code null} may be returned instead.
* <p>
* No exception is thrown if {@code oldl} is {@code null}.
*
* @param oldl the listener to be removed
* @return resulting listener
*/
protected EventListener remove(EventListener oldl) {
if (oldl == a)
return b;
if (oldl == b)
return a;
EventListener a2 = removeInternal(a, oldl);
EventListener b2 = removeInternal(b, oldl);
if (a2 == a && b2 == b) {
// it's not here
return this;
}
return addInternal(a2, b2);
}
use of java.util.EventListener in project jdk8u_jdk by JetBrains.
the class DnDEventMulticaster method remove.
/**
* Removes a listener from this multicaster and returns the
* resulting multicast listener.
* @param oldl the listener to be removed
*/
protected EventListener remove(EventListener oldl) {
if (oldl == a)
return b;
if (oldl == b)
return a;
EventListener a2 = removeInternal(a, oldl);
EventListener b2 = removeInternal(b, oldl);
if (a2 == a && b2 == b) {
// it's not here
return this;
}
return addInternal(a2, b2);
}
Aggregations