public class EventServiceImpl extends org.apache.hive.service.AbstractService implements LensEventService
Modifier and Type | Field and Description |
---|---|
static org.apache.commons.logging.Log |
LOG
The Constant LOG.
|
NAME
Constructor and Description |
---|
EventServiceImpl(String name)
Instantiates a new event service impl.
|
Modifier and Type | Method and Description |
---|---|
<T extends LensEvent> |
addListenerForType(LensEventListener<? super T> listener,
Class<T> eventType)
Add a listener for the given event type.
|
Map<Class<? extends LensEvent>,List<LensEventListener>> |
getEventListeners() |
<T extends LensEvent> |
getListeners(Class<T> eventType)
Get all listeners of a particular type.
|
void |
init(org.apache.hadoop.hive.conf.HiveConf hiveConf) |
void |
notifyEvent(LensEvent evt)
Process an event, and notify all listeners interested in this event.
|
void |
removeListener(LensEventListener listener)
Remove this listener instance from all subscribed event types.
|
<T extends LensEvent> |
removeListenerForType(LensEventListener<? super T> listener,
Class<T> eventType)
Remove listener for a given event type.
|
void |
start() |
void |
stop() |
public EventServiceImpl(String name)
name
- the namepublic void init(org.apache.hadoop.hive.conf.HiveConf hiveConf)
init
in interface org.apache.hive.service.Service
init
in class org.apache.hive.service.AbstractService
public void removeListener(LensEventListener listener)
LensEventService
removeListener
in interface LensEventService
listener
- the listenerpublic void notifyEvent(LensEvent evt) throws LensException
LensEventService
notifyEvent
in interface LensEventService
evt
- objectLensException
- the lens exceptionpublic <T extends LensEvent> Collection<LensEventListener> getListeners(Class<T> eventType)
LensEventService
getListeners
in interface LensEventService
eventType
- the change typepublic void start()
start
in interface org.apache.hive.service.Service
start
in class org.apache.hive.service.AbstractService
public void stop()
stop
in interface org.apache.hive.service.Service
stop
in class org.apache.hive.service.AbstractService
public Map<Class<? extends LensEvent>,List<LensEventListener>> getEventListeners()
public <T extends LensEvent> void addListenerForType(LensEventListener<? super T> listener, Class<T> eventType)
LensEventService
addListenerForType
in interface LensEventService
listener
- the listenereventType
- the event typepublic <T extends LensEvent> void removeListenerForType(LensEventListener<? super T> listener, Class<T> eventType)
LensEventService
removeListenerForType
in interface LensEventService
listener
- the listenereventType
- the event typeCopyright © 2014–2015 Apache Software Foundation. All rights reserved.