org.apache.lens.server.api.events
Interface LensEventService

All Known Implementing Classes:
EventServiceImpl

public interface LensEventService

Singleton which is responsible for managing the event-listener mapping as well as processing events.


Field Summary
static String NAME
          The Constant NAME.
 
Method Summary
<T extends LensEvent>
void
addListenerForType(LensEventListener<? super T> listener, Class<T> eventType)
          Add a listener for the given event type.
<T extends LensEvent>
Collection<LensEventListener>
getListeners(Class<T> changeType)
          Get all listeners of a particular type.
 void notifyEvent(LensEvent event)
          Process an event, and notify all listeners interested in this event.
<T extends LensEvent>
void
removeListener(LensEventListener<? super T> listener)
          Remove this listener instance from all subscribed event types.
<T extends LensEvent>
void
removeListenerForType(LensEventListener<? super T> listener, Class<T> eventType)
          Remove listener for a given event type.
 

Field Detail

NAME

static final String NAME
The Constant NAME.

See Also:
Constant Field Values
Method Detail

addListenerForType

<T extends LensEvent> void addListenerForType(LensEventListener<? super T> listener,
                                              Class<T> eventType)
Add a listener for the given event type. Use this method to register if the same class is expected to receive events of different types

Parameters:
listener - the listener
eventType - the event type

removeListenerForType

<T extends LensEvent> void removeListenerForType(LensEventListener<? super T> listener,
                                                 Class<T> eventType)
Remove listener for a given event type.

Parameters:
listener - the listener
eventType - the event type

removeListener

<T extends LensEvent> void removeListener(LensEventListener<? super T> listener)
Remove this listener instance from all subscribed event types.

Parameters:
listener - the listener

notifyEvent

void notifyEvent(LensEvent event)
                 throws LensException
Process an event, and notify all listeners interested in this event.

Parameters:
event - object
Throws:
LensException - the lens exception

getListeners

<T extends LensEvent> Collection<LensEventListener> getListeners(Class<T> changeType)
Get all listeners of a particular type.

Parameters:
changeType - the change type
Returns:
all the listeners


Copyright © 2014–2015 Apache Software Foundation. All rights reserved.