FileDocCategorySizeDatePackage
ApplicationLoaderEventNotifier.javaAPI DocGlassfish v2 API5581Fri May 04 22:35:44 BST 2007com.sun.enterprise.server.event

ApplicationLoaderEventNotifier

public class ApplicationLoaderEventNotifier extends Object

Fields Summary
private static Logger
_logger
private static ApplicationLoaderEventNotifier
_notifier
private ArrayList
listeners
private ArrayList
appclientListeners
Constructors Summary
private ApplicationLoaderEventNotifier()


      
    
Methods Summary
public voidaddListener(ApplicationLoaderEventListener listener)

	synchronized (listeners) {
	    listeners.add(listener);
	}
    
public voidaddListener(ApplicationClientLoaderEventListener listener)

	synchronized (appclientListeners) {
	    appclientListeners.add(listener);
	}
    
public static com.sun.enterprise.server.event.ApplicationLoaderEventNotifiergetInstance()

	return _notifier;
    
public voidnotifyListeners(ApplicationEvent event)

	ArrayList myListeners = null;

	_logger.log(Level.FINE, "LoaderEventNotifier: " + event);

	synchronized (listeners) {
	    myListeners = (ArrayList) listeners.clone();
	}

	int sz = myListeners.size();
	for (int i=0; i<sz; i++) {
	   ApplicationLoaderEventListener listener =
	       (ApplicationLoaderEventListener) myListeners.get(i);

	   try {
	       listener.handleApplicationEvent(event);
	   } catch (Exception ex) {
	       _logger.log(Level.WARNING, "Exception during "
		       + "handleApplicationEvent", ex);
	   }
	}
    
public voidnotifyListeners(EjbContainerEvent event)

	ArrayList myListeners = null;

	_logger.log(Level.FINE, "LoaderEventNotifier: " + event);

	synchronized (listeners) {
	    myListeners = (ArrayList) listeners.clone();
	}

	int sz = myListeners.size();
	for (int i=0; i<sz; i++) {
	   ApplicationLoaderEventListener listener =
	       (ApplicationLoaderEventListener) myListeners.get(i);

	   try {
	       listener.handleEjbContainerEvent(event);
	   } catch (Exception ex) {
	       _logger.log(Level.WARNING, "Exception during "
		       + "handleEjbContainerEvent", ex);
	   }
	}
    
public voidnotifyListeners(ApplicationClientEvent event)

	ArrayList myListeners = null;

	_logger.log(Level.FINE, "LoaderEventNotifier: " + event);

	synchronized (appclientListeners) {
	    myListeners = (ArrayList) appclientListeners.clone();
	}

	int sz = myListeners.size();
	for (int i=0; i<sz; i++) {
	   ApplicationClientLoaderEventListener listener =
	       (ApplicationClientLoaderEventListener) myListeners.get(i);

	   try {
	       listener.handleApplicationClientEvent(event);
	   } catch (Exception ex) {
	       _logger.log(Level.WARNING, "Exception during "
		       + "handleApplicationClientEvent", ex);
	   }
	}
    
public voidremoveListener(ApplicationLoaderEventListener listener)

	synchronized (listeners) {
	    listeners.remove(listener);
	}
    
public voidremoveListener(ApplicationClientLoaderEventListener listener)

	synchronized (appclientListeners) {
	    appclientListeners.remove(listener);
	}