Package 

Object GlobalRum


  • 
    public class GlobalRum
    
                        

    A 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 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.
      • 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)