Package java.util

Examples of java.util.EventListener


     */
    public void dispose() {
        // remove all listeners from all list elements
        for (int i = 0, n = this.observedElements.size(); i < n; i++) {
            final E element = this.observedElements.get(i);
            final EventListener listener = this.getListener(i);
            this.disconnectElement(element, listener);
        }

        // clear out the reference to this list from the associated connector
        this.elementConnector.setObservableElementList(null);
View Full Code Here


                            if (Log.isDebugEnabled()) Log.debug("listener="+className);
                           
                            try
                            {
                                Class listenerClass=getWebAppContext().loadClass(className);
                                EventListener l=(EventListener)listenerClass.newInstance();
                                _context.addEventListener(l);
                            }
                            catch(Exception e)
                            {
                                Log.warn("Could not instantiate listener "+className+": "+e);
View Full Code Here

              this.myUriOpenElements,
              this.globalOpenElements);

          if (isAllowed) {

            EventListener el =
                (EventListener) (registeredListeners.get(constraintsIter.previousIndex()));

            if (isElementTag) {
              //it's an element
View Full Code Here

    public void setListenerClassNames(Collection eventListeners) throws ClassNotFoundException, IllegalAccessException, InstantiationException {
        if (eventListeners != null) {
            for (Iterator iterator = eventListeners.iterator(); iterator.hasNext();) {
                String listenerClassName = (String) iterator.next();
                Class clazz = loadClass(listenerClassName);
                EventListener listener = (EventListener) clazz.newInstance();
                addEventListener(listener);
                handler.addEventListener(listener);
            }
        }
    }
View Full Code Here

    }


    @Override
    public void addListener(Class<? extends EventListener> listenerClass) {
        EventListener listener;
        try {
            listener = createListener(listenerClass);
        } catch (ServletException e) {
            throw new IllegalArgumentException(sm.getString(
                    "applicationContext.addListener.iae.init",
View Full Code Here

                throw new IllegalArgumentException(sm.getString(
                        "applicationContext.addListener.iae.wrongType",
                        className));
            }

            EventListener listener = (EventListener) obj;
            addListener(listener);
        } catch (IllegalAccessException e) {
            throw new IllegalArgumentException(sm.getString(
                    "applicationContext.addListener.iae.cnfe", className),
                    e);
View Full Code Here

    public void setListenerClassNames(Collection<String> eventListeners) throws ClassNotFoundException, IllegalAccessException, InstantiationException {
        if (eventListeners != null) {
            Collection<EventListener> listeners = new ArrayList<EventListener>();
            for (String listenerClassName : eventListeners) {
                EventListener listener = (EventListener) newInstance(listenerClassName);
                listeners.add(listener);
            }
            webAppContext.setEventListeners(listeners.toArray(new EventListener[listeners.size()]));
        }
    }
View Full Code Here

        }
        if (!context.isStarting()) {
            throw new IllegalStateException(sm.getString("applicationContext.alreadyInitialized",
                            getContextPath()));
        }
        EventListener listenerInstance = null;
        try {
            Class<?> clazz = context.getLoader().getClassLoader().loadClass(className);
            listenerInstance = (EventListener) context.getInstanceManager().newInstance(clazz);
        } catch (Throwable t) {
            throw new IllegalArgumentException(sm.getString("applicationContext.badListenerClass",
View Full Code Here

        }
        if (!context.isStarting()) {
            throw new IllegalStateException(sm.getString("applicationContext.alreadyInitialized",
                            getContextPath()));
        }
        EventListener listenerInstance = null;
        try {
            listenerInstance = (EventListener) context.getInstanceManager().newInstance(listenerClass);
        } catch (Exception e) {
            throw new IllegalArgumentException(sm.getString("applicationContext.badListenerClass",
                    listenerClass.getName(), getContextPath()), e);
View Full Code Here

        if (log.isDebugEnabled())
            log.debug("Configuring application event listeners");

        // Instantiate the required listeners
        String listeners[] = findApplicationListeners();
        EventListener listenerInstances[] = applicationListenerInstances;
        EventListener results[] = new EventListener[listeners.length + listenerInstances.length];
        boolean ok = true;
        for (int i = 0; i < listeners.length; i++) {
            if (getLogger().isDebugEnabled())
                getLogger().debug(" Configuring event listener class '" +
                    listeners[i] + "'");
View Full Code Here

TOP

Related Classes of java.util.EventListener

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.