Package javax.servlet

Examples of javax.servlet.ServletContextAttributeEvent


        // Notify interested application event listeners
        Object listeners[] = context.getApplicationEventListeners();
        if ((listeners == null) || (listeners.length == 0))
            return;
        ServletContextAttributeEvent event = null;
        if (replaced)
            event =
                new ServletContextAttributeEvent(context.getServletContext(),
                                                 name, oldValue);
        else
            event =
                new ServletContextAttributeEvent(context.getServletContext(),
                                                 name, value);

        for (int i = 0; i < listeners.length; i++) {
            if (!(listeners[i] instanceof ServletContextAttributeListener))
                continue;
View Full Code Here


    Object value = attributes.remove(name);
    if (listeners != null)
      for (EventListener listener : listeners)
        if (listener instanceof ServletContextAttributeListener)
          ((ServletContextAttributeListener) listener)
              .attributeRemoved(new ServletContextAttributeEvent(
                  this, name, value));
  }
View Full Code Here

    if (listeners != null)
      for (EventListener listener : listeners) {
        if (listener instanceof ServletContextAttributeListener)
          if (oldObj == null)
            ((ServletContextAttributeListener) listener)
                .attributeAdded(new ServletContextAttributeEvent(
                    this, name, object));
          else
            ((ServletContextAttributeListener) listener)
                .attributeReplaced(new ServletContextAttributeEvent(
                    this, name, object));
      }
  }
View Full Code Here

        // Notify interested application event listeners
        Object listeners[] = context.getApplicationListeners();
        if ((listeners == null) || (listeners.length == 0))
            return;
        ServletContextAttributeEvent event =
          new ServletContextAttributeEvent(context.getServletContext(),
                                            name, value);
        for (int i = 0; i < listeners.length; i++) {
            if (!(listeners[i] instanceof ServletContextAttributeListener))
                continue;
            ServletContextAttributeListener listener =
View Full Code Here

        // Notify interested application event listeners
        Object listeners[] = context.getApplicationListeners();
        if ((listeners == null) || (listeners.length == 0))
            return;
        ServletContextAttributeEvent event = null;
        if (replaced)
            event =
                new ServletContextAttributeEvent(context.getServletContext(),
                                                 name, oldValue);
        else
            event =
                new ServletContextAttributeEvent(context.getServletContext(),
                                                 name, value);

        for (int i = 0; i < listeners.length; i++) {
            if (!(listeners[i] instanceof ServletContextAttributeListener))
                continue;
View Full Code Here

        // Notify interested application event listeners
        Object listeners[] = context.getApplicationEventListeners();
        if ((listeners == null) || (listeners.length == 0))
            return;
        ServletContextAttributeEvent event =
          new ServletContextAttributeEvent(context.getServletContext(),
                                            name, value);
        for (int i = 0; i < listeners.length; i++) {
            if (!(listeners[i] instanceof ServletContextAttributeListener))
                continue;
            ServletContextAttributeListener listener =
View Full Code Here

        // Notify interested application event listeners
        Object listeners[] = context.getApplicationEventListeners();
        if ((listeners == null) || (listeners.length == 0))
            return;
        ServletContextAttributeEvent event = null;
        if (replaced)
            event =
                new ServletContextAttributeEvent(context.getServletContext(),
                                                 name, oldValue);
        else
            event =
                new ServletContextAttributeEvent(context.getServletContext(),
                                                 name, value);

        for (int i = 0; i < listeners.length; i++) {
            if (!(listeners[i] instanceof ServletContextAttributeListener))
                continue;
View Full Code Here

    return attributes.keys();
  }

  public void setAttribute(String name, Object object) {
    Object previousValue = attributes.put(name, object);
    ServletContextAttributeEvent event;
    if (previousValue != null) {
      event = createEvent(name, previousValue);
      webapp.getGlobalServletContextAttributeListener()
          .attributeReplaced(event);
    } else {
View Full Code Here

  }

  public void removeAttribute(String name) {
    Object oldValue = attributes.remove(name);
    if (oldValue != null) {
      ServletContextAttributeEvent event = createEvent(name, oldValue);
      webapp.getGlobalServletContextAttributeListener().attributeRemoved(event);
    }
  }
View Full Code Here

      webapp.getGlobalServletContextAttributeListener().attributeRemoved(event);
    }
  }

  private ServletContextAttributeEvent createEvent(String name, Object value) {
    return new ServletContextAttributeEvent(webapp.getContext(), name, value);
  }
View Full Code Here

TOP

Related Classes of javax.servlet.ServletContextAttributeEvent

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.