Class MessageSupplier

java.lang.Object
org.glowroot.agent.plugin.api.MessageSupplier

public abstract class MessageSupplier extends Object
A (lazy) supplier of Message instances. Needs to be thread safe since transaction thread creates it, but trace storage (and live viewing) is done in a separate thread.
  • Constructor Details

    • MessageSupplier

      protected MessageSupplier()
  • Method Details

    • get

      public abstract Message get()
      Returns the Message for a TraceEntry. The Message does not need to be thread safe if it is instantiated by the implementation of this method.
    • create

      public static MessageSupplier create(String message)
      Creates a MessageSupplier for the specified message.
    • create

      public static MessageSupplier create(String template, String... args)
      Creates a MessageSupplier for the specified template and args. The template can contain one or more placeholders {} that will be substituted if/when the message text is needed by the specified args.