org.glassfish.virtualization.spi
Interface EventSource<T extends Enum>

Type Parameters:
T - the enumeration of events types that this event source can send.

public interface EventSource<T extends Enum>

Definition of events source which supports registration of listeners.

Author:
Jerome Dochez

Method Summary
 void addListener(Listener<T> listener, ExecutorService executorService)
          add a listener to this event source.
 void fireEvent(T event)
          fires an event to all the registered listeners.
 

Method Detail

addListener

void addListener(Listener<T> listener,
                 ExecutorService executorService)
add a listener to this event source.

Parameters:
listener - the listener to notify of events
executorService - the executor service to use for the notification of the above listener. If null, the notification thread calling the fireEvent(Enum) will be used.

fireEvent

void fireEvent(T event)
fires an event to all the registered listeners.

Parameters:
event - the event to fire


Copyright © 2012. All Rights Reserved.