@StableMinor(version="12.1", sinceVersion="9.0") public abstract class AbstractMonitorValuesProvider extends Object implements IMonitorValuesProvider
IMonitorValuesProvider
abstract implementation that provides both tread-safety and
caching.map
. This map is filled by
initValues(SessionConfig, ITransaction)
method. This method is the one implementors
should override.initValues(SessionConfig, ITransaction)
will be called
only once. Once it has been called, the values will be cached and no further call will be
performed.Constructor and Description |
---|
AbstractMonitorValuesProvider() |
Modifier and Type | Method and Description |
---|---|
List<? extends Serializable> |
getValues(SessionConfig sessionConfig,
IMonitorField field,
ITransaction transaction)
Returns the values for the given field.
If this value does not provide values for the given field, it must throw a FieldNotProvidedException .Note that returning a null value is not the same
as throwing a FieldNotProvidedException . |
protected abstract Map<String,List<? extends Serializable>> |
initValues(SessionConfig sessionConfig,
ITransaction transaction)
Initializes the monitoring values map.
|
public List<? extends Serializable> getValues(SessionConfig sessionConfig, IMonitorField field, ITransaction transaction) throws FieldNotProvidedException, Exception
IMonitorValuesProvider
FieldNotProvidedException
.null
value is not the same
as throwing a FieldNotProvidedException
. When returning a null
value, it is implied that the field has an explicit null
value.
It is important to notice also that the given session config is not
the session of the user that generated the monitoring event. Instead,
it is a system user
session.
As well as session config, the given transaction is not related
to the transaction that generated the event (if any).
getValues
in interface IMonitorValuesProvider
sessionConfig
- the current session.field
- the desired field.transaction
- the current transaction.FieldNotProvidedException
- if this provider does not provide values for the given field.Exception
- if any other error occur.protected abstract Map<String,List<? extends Serializable>> initValues(SessionConfig sessionConfig, ITransaction transaction) throws Exception
null
. If no value is present, an empty map should be returned
instead.sessionConfig
- the session config.transaction
- the transaction.Exception
LumisXP 12.1.0.191010 - Copyright © 2006–2019 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.