-
public class GlobalRumA global RumMonitor holder, ensuring that all RUM events are registered on the same instance.
The registerIfAbsent method should only be called once during the application initialization phase. Any following calls will be no-op. If the registerIfAbsent method is never called, a default no-op implementation is used.
You can then retrieve the active RumMonitor using the get method.
-
-
Method Summary
Modifier and Type Method Description final static BooleanisRegistered()Identify whether a RumMonitor has previously been registered. final static BooleanregisterIfAbsent(RumMonitor monitor)Register a RumMonitor to back the behaviour of the get. final static BooleanregisterIfAbsent(Callable<RumMonitor> provider)Register a RumMonitor to back the behaviour of the get. final static RumMonitorget()Returns the constant RumMonitor instance. final static UnitaddAttribute(String key, Object value)Adds a global attribute to all future RUM events. final static UnitremoveAttribute(String key)Removes a global attribute from all future RUM events. -
-
Method Detail
-
isRegistered
final static Boolean isRegistered()
Identify whether a RumMonitor has previously been registered.
This check is useful in scenarios where more than one component may be responsible for registering a monitor.
-
registerIfAbsent
final static Boolean registerIfAbsent(RumMonitor monitor)
Register a RumMonitor to back the behaviour of the get.
Registration is a one-time operation. Once a monitor has been registered, all attempts at re-registering will return
false.Every application intending to use the global monitor is responsible for registering it once during its initialization.
- Parameters:
monitor- the monitor to use as global monitor.
-
registerIfAbsent
final static Boolean registerIfAbsent(Callable<RumMonitor> provider)
Register a RumMonitor to back the behaviour of the get.
The monitor is provided through a Callable that will only be called if the global monitor is absent. Registration is a one-time operation. Once a monitor has been registered, all attempts at re-registering will return
false.Every application intending to use the global monitor is responsible for registering it once during its initialization.
- Parameters:
provider- Provider for the monitor to use as global monitor.
-
get
final static RumMonitor get()
Returns the constant RumMonitor instance.
Until a monitor is explicitly configured with registerIfAbsent, a no-op implementation is returned.
-
addAttribute
final static Unit addAttribute(String key, Object value)
Adds a global attribute to all future RUM events.
- Parameters:
key- the attribute key (non null)value- the attribute value (or null)
-
removeAttribute
final static Unit removeAttribute(String key)
Removes a global attribute from all future RUM events.
- Parameters:
key- the attribute key (non null)
-
-
-
-