public interface KPIManager
Modifier and Type | Field and Description |
---|---|
static int |
EVENT_ALL |
static int |
EVENT_KPI_CREATED |
static int |
EVENT_KPI_DELETED |
static int |
EVENT_KPI_SAVED |
Modifier and Type | Method and Description |
---|---|
void |
addKPIListener(KPIListener kpiListener,
int eventId)
Register a listener interested in all process events.
|
KPI |
createKPI()
Factory method for the creation of a KPI brand new instance.
|
Set |
getAllKPIs()
Get all KPIs defined.
|
KPI |
getKPIByCode(String code)
Get a persistent KPI by its universal code.
|
KPI |
getKPIById(Long id)
Get a persistent KPI by its identifier.
|
Map<Integer,List<KPIListener>> |
getKPIListenerMap()
Retrieve registered kpi listeners.
|
List<KPIListener> |
getKPIListeners(int eventId)
Retrieve registered kpi listeners for a specified event.
|
void |
notifyKPIListener(int eventId,
KPI kpi)
Notify the specified event to the registered listeners.
|
void |
removeKPIListener(KPIListener kpiListener)
Removes a registered listener.
|
void |
removeKPIListener(KPIListener kpiListener,
int eventId)
Removes a registered listener.
|
void |
sortKPIsByDescription(List<KPI> propList,
boolean ascending)
Sort a list of properties by name.
|
static final int EVENT_ALL
static final int EVENT_KPI_CREATED
static final int EVENT_KPI_SAVED
static final int EVENT_KPI_DELETED
KPI createKPI()
KPI getKPIById(Long id) throws Exception
Exception
KPI getKPIByCode(String code) throws Exception
Exception
void sortKPIsByDescription(List<KPI> propList, boolean ascending)
Map<Integer,List<KPIListener>> getKPIListenerMap()
List<KPIListener> getKPIListeners(int eventId)
eventId
- The event being listened.void addKPIListener(KPIListener kpiListener, int eventId)
WARNING: In order to solve the -lapsed listener- problem the reference to the listener stored by the manager is weak. This means that if the listener reference is lost then is also automatically removed from the listeners list. To avoid this issue ensure that your listener instance is referenced in your object model and exists as long as the manager is alive.
kpiListener
- Be sure your listener instance added is referred by another object
instance in order to avoid garbage collector to finalize your listener unexpectedly.eventId
- The event interested in.void removeKPIListener(KPIListener kpiListener, int eventId)
eventId
- The event listener was interested in.void removeKPIListener(KPIListener kpiListener)
void notifyKPIListener(int eventId, KPI kpi)
Copyright © 2012-2014 JBoss by Red Hat. All Rights Reserved.