Class AbstractInstrumentationProvider

  • All Implemented Interfaces:
    Configurable, InstrumentationProvider
    Direct Known Subclasses:
    JMXProvider

    public abstract class AbstractInstrumentationProvider
    extends java.lang.Object
    implements InstrumentationProvider, Configurable
    Specialized instrumentation providers can extend this class to get basic provider state and capabilities. It implements Configurable so it can be used within the configuration framework to participate in automatic configuration.
    • Constructor Detail

      • AbstractInstrumentationProvider

        public AbstractInstrumentationProvider()
    • Method Detail

      • startConfiguration

        public void startConfiguration()
        Description copied from interface: Configurable
        Invoked before bean property configuration is begun on this object.
        Specified by:
        startConfiguration in interface Configurable
      • endConfiguration

        public void endConfiguration()
        Description copied from interface: Configurable
        Invoked upon completion of bean property configuration for this object.
        Specified by:
        endConfiguration in interface Configurable
      • setInstrument

        public void setInstrument​(java.lang.String instrument)
        Description copied from interface: InstrumentationProvider
        Used to associate one or more instruments to a provider. Instruments are specified by class name or alias. Multiple instruments must be specified as a comma separated list. example: DataCache,QueryCache,com.my.MyInstrument where DataCache and QueryCache have aliases and com.my.MyInstrument is a class implementing an Instrument.
        Specified by:
        setInstrument in interface InstrumentationProvider
        Parameters:
        instrument - one or more instrument class names or aliases
      • addInstrument

        public void addInstrument​(Instrument instrument)
        Description copied from interface: InstrumentationProvider
        Adds an instrument to this providers list of managed instruments. The instrument will participate in context-based lifecycle routines, depending on the instrumentation level.
        Specified by:
        addInstrument in interface InstrumentationProvider
      • initializeInstrument

        public void initializeInstrument​(Instrument instrument,
                                         java.lang.Object context)
        Description copied from interface: InstrumentationProvider
        Initializes an instrument within the provided context.
        Specified by:
        initializeInstrument in interface InstrumentationProvider
        Parameters:
        instrument - an instrument
        context - instrumentation context (factory, broker, config)
      • initializeInstrument

        public void initializeInstrument​(Instrument instrument,
                                         java.lang.String options,
                                         java.lang.Object context)
        Description copied from interface: InstrumentationProvider
        Initializes an instrument within the provided options and context.
        Specified by:
        initializeInstrument in interface InstrumentationProvider
        Parameters:
        instrument - an instrument
        options - configuration options to provide the instrument during initialization
        context - instrumentation context (factory, broker, config)
      • getInstrumentByName

        public Instrument getInstrumentByName​(java.lang.String name)
        Description copied from interface: InstrumentationProvider
        Returns an instrument instrumented by this provider by name
        Specified by:
        getInstrumentByName in interface InstrumentationProvider
        Parameters:
        name - the name of the instrument to return
        Returns:
        the instrument or null if not instrumented by this provider
      • stopInstruments

        public void stopInstruments​(InstrumentationLevel level,
                                    java.lang.Object context)
        Description copied from interface: InstrumentationProvider
        Stops all instruments of the specified instrumentation level and context.
        Specified by:
        stopInstruments in interface InstrumentationProvider
        Parameters:
        level - instrumentation level
        context - instrumentation context (factory, broker, config)
      • startInstruments

        public void startInstruments​(InstrumentationLevel level,
                                     java.lang.Object context)
        Description copied from interface: InstrumentationProvider
        Starts all instruments of the specified instrumentation level and context.
        Specified by:
        startInstruments in interface InstrumentationProvider
        Parameters:
        level - instrumentation level
        context - instrumentation context (factory, broker, config)
      • removeInstrumentByName

        public void removeInstrumentByName​(java.lang.String name)
        Description copied from interface: InstrumentationProvider
        Removes an instrument instrumented by this provider by name
        Specified by:
        removeInstrumentByName in interface InstrumentationProvider
        Parameters:
        name - the name of the instrument to remove
      • setStarted

        protected void setStarted​(boolean started)
      • getInstrumentAliases

        public java.lang.String[] getInstrumentAliases()
        Description copied from interface: InstrumentationProvider
        Returns an string array of identifier to class name aliases for instruments known to the instrumentation provider. Example: {"DataCache", "org.apache.openjpa.instrumentation.DataCacheInstrument", "QueryCache", "org.apache.openjpa.instrumentation.QueryCacheInstrument"}
        Specified by:
        getInstrumentAliases in interface InstrumentationProvider
        Returns:
        a string array of identifier, class name pairs.