org.apache.oozie.service
Class EventHandlerService

java.lang.Object
  extended by org.apache.oozie.service.EventHandlerService
All Implemented Interfaces:
Service

public class EventHandlerService
extends Object
implements Service

Service class that handles the events system - creating events queue, managing configured properties and managing and invoking various event listeners via worker threads


Nested Class Summary
 class EventHandlerService.EventWorker
           
 
Field Summary
static String CONF_BATCH_SIZE
           
static String CONF_EVENT_QUEUE
           
static String CONF_FILTER_APP_TYPES
           
static String CONF_LISTENERS
           
static String CONF_PREFIX
           
static String CONF_QUEUE_SIZE
           
static String CONF_WORKER_INTERVAL
           
static String CONF_WORKER_THREADS
           
 
Fields inherited from interface org.apache.oozie.service.Service
DEFAULT_LOCK_TIMEOUT, lockTimeout, USE_XCOMMAND
 
Constructor Summary
EventHandlerService()
           
 
Method Summary
 void addEventListener(Object listener, org.apache.hadoop.conf.Configuration conf, String name)
           
 void destroy()
          Destroy the service.
 Set<String> getAppTypes()
           
 EventQueue getEventQueue()
           
 Class<? extends Service> getInterface()
          Return the public interface of the service.
 void init(Services services)
          Initialize the service.
static boolean isEnabled()
           
 boolean isSupportedApptype(String appType)
           
 String listEventListeners()
           
 void queueEvent(org.apache.oozie.client.event.Event event)
           
 void setAppTypes(Set<String> types)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONF_PREFIX

public static final String CONF_PREFIX
See Also:
Constant Field Values

CONF_QUEUE_SIZE

public static final String CONF_QUEUE_SIZE
See Also:
Constant Field Values

CONF_EVENT_QUEUE

public static final String CONF_EVENT_QUEUE
See Also:
Constant Field Values

CONF_LISTENERS

public static final String CONF_LISTENERS
See Also:
Constant Field Values

CONF_FILTER_APP_TYPES

public static final String CONF_FILTER_APP_TYPES
See Also:
Constant Field Values

CONF_BATCH_SIZE

public static final String CONF_BATCH_SIZE
See Also:
Constant Field Values

CONF_WORKER_THREADS

public static final String CONF_WORKER_THREADS
See Also:
Constant Field Values

CONF_WORKER_INTERVAL

public static final String CONF_WORKER_INTERVAL
See Also:
Constant Field Values
Constructor Detail

EventHandlerService

public EventHandlerService()
Method Detail

init

public void init(Services services)
          throws ServiceException
Description copied from interface: Service
Initialize the service.

Invoked by the Service singleton at start up time.

Specified by:
init in interface Service
Parameters:
services - services singleton initializing the service.
Throws:
ServiceException - thrown if the service could not initialize.

addEventListener

public void addEventListener(Object listener,
                             org.apache.hadoop.conf.Configuration conf,
                             String name)
                      throws Exception
Throws:
Exception

isEnabled

public static boolean isEnabled()

destroy

public void destroy()
Description copied from interface: Service
Destroy the service.

Invoked by the Service singleton at shutdown time.

Specified by:
destroy in interface Service

getInterface

public Class<? extends Service> getInterface()
Description copied from interface: Service
Return the public interface of the service.

Services are retrieved by its public interface. Specializations of services must return the public interface.

Specified by:
getInterface in interface Service
Returns:
the interface of the service.

isSupportedApptype

public boolean isSupportedApptype(String appType)

setAppTypes

public void setAppTypes(Set<String> types)

getAppTypes

public Set<String> getAppTypes()

listEventListeners

public String listEventListeners()

queueEvent

public void queueEvent(org.apache.oozie.client.event.Event event)

getEventQueue

public EventQueue getEventQueue()


Copyright © 2013 Apache Software Foundation. All Rights Reserved.