Search in sources :

Example 16 with EventListener

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());
    }
}
Also used : MultipartConfigElement(javax.servlet.MultipartConfigElement) EventListener(java.util.EventListener)

Example 17 with EventListener

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);
}
Also used : ListenerInfo(io.undertow.servlet.api.ListenerInfo) ManagedReferenceFactory(org.jboss.as.naming.ManagedReferenceFactory) EventListener(java.util.EventListener)

Example 18 with EventListener

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);
}
Also used : EventListener(java.util.EventListener)

Example 19 with EventListener

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);
}
Also used : EventListener(java.util.EventListener)

Aggregations

EventListener (java.util.EventListener)19 FilterHolder (org.eclipse.jetty.servlet.FilterHolder)3 ServletHolder (org.eclipse.jetty.servlet.ServletHolder)3 ListenerInfo (io.undertow.servlet.api.ListenerInfo)2 ServletException (javax.servlet.ServletException)2 ListenerHolder (org.eclipse.jetty.servlet.ListenerHolder)2 ServletContextHandler (org.eclipse.jetty.servlet.ServletContextHandler)2 Source (org.eclipse.jetty.servlet.Source)2 MetaData (org.eclipse.jetty.webapp.MetaData)2 Injector (com.google.inject.Injector)1 GuiceServletContextListener (com.google.inject.servlet.GuiceServletContextListener)1 EntryListenerConfig (com.hazelcast.config.EntryListenerConfig)1 ManagedListener (io.undertow.servlet.core.ManagedListener)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 URLClassLoader (java.net.URLClassLoader)1 EventListenerProxy (java.util.EventListenerProxy)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 MBeanServer (javax.management.MBeanServer)1 NamingException (javax.naming.NamingException)1