public class MonitorHelper extends Object implements AutoCloseable
IMonitorContext
.try(MonitorHelper monitorHelper = new MonitorHelper()) { monitorHelper.addWebResourceValues(myWebResource); // for example // do things with web resource values in monitor context } // at this point, web resource values are not in context any more
try(MonitorHelper monitorHelper = new MonitorHelper()) { monitorHelper.addWebResourceValues(myWebResource); // for example // do things with web resource values in monitor context IMonitorValuesProvider myServiceInstanceValueProvider = monitorHelper.addServiceInstanceValues(String serviceInstanceId); // for example // do things with service instance in monitor context monitorHelper.removeAddedValues(myServiceInstanceValueProvider); // no needed to be performed in try-finally because the monitor helper will auto remove all values in #close() // at this point service instance values are not in monitor context any more } // at this point, web resource values are not in context any more
Constructor and Description |
---|
MonitorHelper() |
Modifier and Type | Method and Description |
---|---|
IMonitorValuesProvider |
addMonitorUserValuesByTrackId(String trackId)
Adds a value provider related to
MonitorUser with the given track identifier. |
IMonitorValuesProvider |
addMonitorUserValuesByUserId(String userId)
Adds a value provider related to
MonitorUser with the given user identifier. |
IMonitorValuesProvider |
addServerValues()
Add a value provider related to the server.
|
IMonitorValuesProvider |
addServiceInstanceValues(ServiceInstanceConfig serviceInstanceConfig)
Add a value provider related to the given service instance.
|
IMonitorValuesProvider |
addServiceInstanceValues(String serviceInstanceId)
Add a value provider related to the given service instance.
|
IMonitorValuesProvider |
addServiceInterfaceInstanceValues(ServiceInterfaceInstanceConfig serviceInterfaceInstanceConfig)
Add a value provider related to the given interface instance.
|
IMonitorValuesProvider |
addServiceValues(String serviceId)
Add a value provider related to the given service.
|
IMonitorValuesProvider |
addSessionValues(SessionConfig sessionConfig,
HttpSession httpSession)
Adds a value provider related to
SessionConfig and HttpSession . |
void |
addValues(IMonitorValuesProvider valuesProvider)
Adds the given provider in the context.
|
IMonitorValuesProvider |
addWebResourceValues(WebResource webResource)
Add a value provider related to the given web resource.
|
void |
close() |
void |
removeAddedValues(IMonitorValuesProvider provider)
Removes the given provider from context.
|
public void close()
close
in interface AutoCloseable
public void removeAddedValues(IMonitorValuesProvider provider)
provider
- the provider.public void addValues(IMonitorValuesProvider valuesProvider)
valuesProvider
- the provider.public IMonitorValuesProvider addWebResourceValues(WebResource webResource)
webResource
- the web resource.public IMonitorValuesProvider addServiceInstanceValues(ServiceInstanceConfig serviceInstanceConfig)
serviceInstanceConfig
- the service instance.public IMonitorValuesProvider addServiceInstanceValues(String serviceInstanceId)
serviceInstanceId
- the service instance identifier.public IMonitorValuesProvider addServerValues()
public IMonitorValuesProvider addServiceValues(String serviceId)
serviceId
- the service identifier.public IMonitorValuesProvider addServiceInterfaceInstanceValues(ServiceInterfaceInstanceConfig serviceInterfaceInstanceConfig)
serviceInterfaceInstanceConfig
- the interface instance.public IMonitorValuesProvider addSessionValues(SessionConfig sessionConfig, HttpSession httpSession) throws PortalException
SessionConfig
and HttpSession
.sessionConfig
- the LumisXP user session.httpSession
- the application server http session.PortalException
public IMonitorValuesProvider addMonitorUserValuesByUserId(String userId)
MonitorUser
with the given user identifier.userId
- the monitor user identifier.public IMonitorValuesProvider addMonitorUserValuesByTrackId(String trackId)
MonitorUser
with the given track identifier.trackId
- the monitor user track identifier.LumisXP 12.1.0.191010 - Copyright © 2006–2019 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.