Class MetricsServiceImpl

  • All Implemented Interfaces:
    MetricsService, fish.payara.monitoring.collect.MonitoringDataSource, ConfigListener

    @Service(name="microprofile-metrics-service")
    @RunLevel(10)
    public class MetricsServiceImpl
    extends Object
    implements MetricsService, ConfigListener, fish.payara.monitoring.collect.MonitoringDataSource
    • Constructor Detail

      • MetricsServiceImpl

        public MetricsServiceImpl()
    • Method Detail

      • init

        @PostConstruct
        public void init()
      • getContext

        public MetricsService.MetricsContext getContext​(boolean createIfNotExists)
        Description copied from interface: MetricsService
        Access current application metric context. If this is called from a context that is not linked to an application context the server context is returned.
        Specified by:
        getContext in interface MetricsService
        Parameters:
        createIfNotExists - true to create the requested context in case it did not exist, false to instead return null in that case
        Returns:
        the existing or created context or null if it did not exist and parameter was false or if the servicenot MetricsService.isEnabled()
      • collect

        public void collect​(fish.payara.monitoring.collect.MonitoringDataCollector rootCollector)
        Specified by:
        collect in interface fish.payara.monitoring.collect.MonitoringDataSource
      • refresh

        public void refresh()
        Registers unresolved MBeans if they have been started after the metrics service.
        Specified by:
        refresh in interface MetricsService
      • resetMetricsEnabledProperty

        public void resetMetricsEnabledProperty()
      • isMetricsSecure

        public Boolean isMetricsSecure()
      • resetMetricsSecureProperty

        public void resetMetricsSecureProperty()
      • isSecurityEnabled

        public boolean isSecurityEnabled()
      • registerApplication

        public void registerApplication​(String applicationName)
        Adds an application to the enabled map
        Parameters:
        applicationName - The name of the application to create
      • deregisterApplication

        public void deregisterApplication​(String applicationName)
        Removes an application from the enabled map
        Parameters:
        applicationName - The name of the application to remove
      • getApplicationName

        public String getApplicationName()
        Gets the application name from the invocation manager.
        Returns:
        The application name
      • changed

        public UnprocessedChangeEvents changed​(PropertyChangeEvent[] events)
        Description copied from interface: ConfigListener
        Notification that @Configured objects that were injected have changed
        Specified by:
        changed in interface ConfigListener
        Parameters:
        events - list of changes
        Returns:
        the list of unprocessed events (requiring a restart) or null if all reconfiguration was processed successfully