Package io.undertow.servlet.api

Examples of io.undertow.servlet.api.ListenerInfo


        }
    }

    @Override
    public <T extends EventListener> void addListener(final T t) {
        ListenerInfo listener = new ListenerInfo(t.getClass(), new ImmediateInstanceFactory<EventListener>(t));
        deploymentInfo.addListener(listener);
        deployment.getApplicationListeners().addListener(new ManagedListener(listener));
    }
View Full Code Here


        try {
            factory = deploymentInfo.getClassIntrospecter().createInstanceFactory(listenerClass);
        } catch (NoSuchMethodException e) {
            throw new IllegalArgumentException(e);
        }
        final ListenerInfo listener = new ListenerInfo(listenerClass, factory);
        deploymentInfo.addListener(listener);
        deployment.getApplicationListeners().addListener(new ManagedListener(listener));
    }
View Full Code Here

        return servletInfo;
    }

    private ListenerInfo getResteasyListener() {
        final ListenerInfo listenerInfo = new ListenerInfo(ResteasyBootstrap.class);

        return listenerInfo;
    }
View Full Code Here

        return listenerInfo;
    }

    private ListenerInfo getRestATListener() {
        final ListenerInfo listenerInfo = new ListenerInfo(ContextListener.class);

        return listenerInfo;
    }
View Full Code Here

                    jspServlet.addMapping(mapping);
                }
                seenMappings.addAll(jspPropertyGroupMappings);
                //setup JSP expression factory wrapper
                if (!expressionFactoryWrappers.isEmpty()) {
                    d.addListener(new ListenerInfo(JspInitializationListener.class));
                    d.addServletContextAttribute(JspInitializationListener.CONTEXT_KEY, expressionFactoryWrappers);
                }
            }

            d.setClassIntrospecter(new ComponentClassIntrospector(componentRegistry));
View Full Code Here

        return tagLibraryInfo;
    }

    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);
    }
View Full Code Here

    @Test
    public void getSessionListeners() {
        ServletContext context = mock(ServletContext.class);
        HttpSessionListener listener1 = mock(HttpSessionListener.class);
        HttpSessionListener listener2 = mock(HttpSessionListener.class);
        List<ManagedListener> list = Arrays.asList(new ManagedListener(new ListenerInfo(HttpSessionListener.class, new ImmediateInstanceFactory<>(listener1)), false), new ManagedListener(new ListenerInfo(HttpSessionListener.class, new ImmediateInstanceFactory<>(listener2)), false));
        ApplicationListeners listeners = new ApplicationListeners(list, context);

        when(this.deployment.getApplicationListeners()).thenReturn(listeners);

        Iterable<HttpSessionListener> result = this.context.getSessionListeners();
View Full Code Here

    @Test
    public void getSessionAttributeListeners() {
        ServletContext context = mock(ServletContext.class);
        HttpSessionAttributeListener listener1 = mock(HttpSessionAttributeListener.class);
        HttpSessionAttributeListener listener2 = mock(HttpSessionAttributeListener.class);
        List<ManagedListener> list = Arrays.asList(new ManagedListener(new ListenerInfo(HttpSessionAttributeListener.class, new ImmediateInstanceFactory<>(listener1)), false), new ManagedListener(new ListenerInfo(HttpSessionAttributeListener.class, new ImmediateInstanceFactory<>(listener2)), false));
        ApplicationListeners listeners = new ApplicationListeners(list, context);

        when(this.deployment.getApplicationListeners()).thenReturn(listeners);

        Iterable<HttpSessionAttributeListener> result = this.context.getSessionAttributeListeners();
View Full Code Here

        return this.deployment.getApplicationListeners().isStarted();
    }

    @Override
    public void addRequestListener(ServletRequestListener listener) {
        this.deployment.getApplicationListeners().addListener(new ManagedListener(new ListenerInfo(ServletRequestListener.class, new ImmediateInstanceFactory<>(listener)), true));
    }
View Full Code Here

        // Do nothing
    }

    @Override
    public void addSessionListener(HttpSessionListener listener) {
        this.deployment.getApplicationListeners().addListener(new ManagedListener(new ListenerInfo(HttpSessionListener.class, new ImmediateInstanceFactory<>(listener)), true));
    }
View Full Code Here

TOP

Related Classes of io.undertow.servlet.api.ListenerInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.