StorageEventMultiCaster<EVENT_TYPE,EVENT_LISTENER_TYPE> Class
- java.
lang. Object - com.
microsoft. azure. storage. StorageEventMultiCaster<EVENT_TYPE,EVENT_LISTENER_TYPE>
- com.
Type Parameters
- EVENT_TYPE
An object that represents the type of the event.
- EVENT_LISTENER_TYPE
An object that represents the type of the event listener.
public class StorageEventMultiCaster<EVENT_TYPE extends BaseEvent,EVENT_LISTENER_TYPE extends StorageEvent<EVENT_TYPE>>
Represents a generic event multi-caster that allows event listeners to be dynamically added and removed.
Method Summary
Modifier and Type | Method and Description |
---|---|
void |
addListener(final EVENT_LISTENER_TYPE listener)
Adds a listener to the event chain. |
void |
fireEvent(final EVENT_TYPE event)
Fires the event to all subscribed event listeners. |
boolean |
hasListeners()
Returns a value that indicates whether any event listeners are registered for events. |
void |
removeListener(final EVENT_LISTENER_TYPE listener)
Removes an event listener from the event chain. |
Method Details
addListener
public void addListener(final EVENT_LISTENER_TYPE listener)
Adds a listener to the event chain.
Parameters:
EventListenerType
object that represents the listener to add.
fireEvent
public void fireEvent(final EVENT_TYPE event)
Fires the event to all subscribed event listeners.
Parameters:
EVENTTYPE
object that represents the event being multi-casted.
hasListeners
public boolean hasListeners()
Returns a value that indicates whether any event listeners are registered for events.
Returns:
true
if any event listeners are registered; otherwise, false
.
removeListener
public void removeListener(final EVENT_LISTENER_TYPE listener)
Removes an event listener from the event chain.
Parameters:
EventListenerType
object that represents the listener to remove.
Applies to
Azure SDK for Java