Class MonitoringConsoleRuntimeImpl

  • All Implemented Interfaces:
    fish.payara.monitoring.adapt.GroupDataRepository, fish.payara.monitoring.adapt.MonitoringConsolePageConfig, fish.payara.monitoring.adapt.MonitoringConsoleRuntime, fish.payara.monitoring.adapt.MonitoringConsoleWatchConfig, EventListener, ApplicationLifecycleInterceptor, ConfigListener

    @Service
    public class MonitoringConsoleRuntimeImpl
    extends Object
    implements ConfigListener, ApplicationLifecycleInterceptor, EventListener, fish.payara.monitoring.adapt.MonitoringConsoleRuntime, fish.payara.monitoring.adapt.MonitoringConsoleWatchConfig, fish.payara.monitoring.adapt.MonitoringConsolePageConfig, fish.payara.monitoring.adapt.GroupDataRepository
    This implementation of the MonitoringConsoleRuntime connects the Payara independent parts of the monitoring console with the Payara server. The most complicated aspect about the implementation is the way it is bootstrapped. By implementing ApplicationLifecycleInterceptor it forces the creation of an instance of this Service even though it is not otherwise referenced within the HK2 context. As this happens fairly early in the bootstrapping it then registers itself as an EventListener so that it can run its actual init() bootstrapping as soon as the EventTypes.SERVER_READY is received. This makes sure the bootstrapping of the console runtime does not alter the order of services created by starting to collect data from services that implement MonitoringDataSource or MonitoringWatchSource.
    Since:
    5.201
    Author:
    Jan Bernitt
    • Constructor Detail

      • MonitoringConsoleRuntimeImpl

        public MonitoringConsoleRuntimeImpl()
    • Method Detail

      • postConstruct

        @PostConstruct
        public void postConstruct()
      • init

        public void init()
      • changed

        public final 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
      • scheduleAtFixedRate

        public ScheduledFuture<?> scheduleAtFixedRate​(Runnable task,
                                                      long initialDelay,
                                                      long period,
                                                      TimeUnit unit)
        Specified by:
        scheduleAtFixedRate in interface fish.payara.monitoring.adapt.MonitoringConsoleRuntime
      • send

        public boolean send​(byte[] snapshot)
        Specified by:
        send in interface fish.payara.monitoring.adapt.MonitoringConsoleRuntime
      • receive

        public boolean receive​(Consumer<byte[]> receiver)
        Specified by:
        receive in interface fish.payara.monitoring.adapt.MonitoringConsoleRuntime
      • getWatchConfig

        public fish.payara.monitoring.adapt.MonitoringConsoleWatchConfig getWatchConfig()
        Specified by:
        getWatchConfig in interface fish.payara.monitoring.adapt.MonitoringConsoleRuntime
      • isDisabled

        public boolean isDisabled​(String name)
        Specified by:
        isDisabled in interface fish.payara.monitoring.adapt.MonitoringConsoleWatchConfig
      • disable

        public void disable​(String name)
        Specified by:
        disable in interface fish.payara.monitoring.adapt.MonitoringConsoleWatchConfig
      • enable

        public void enable​(String name)
        Specified by:
        enable in interface fish.payara.monitoring.adapt.MonitoringConsoleWatchConfig
      • add

        public void add​(String name,
                        String watchJson)
        Specified by:
        add in interface fish.payara.monitoring.adapt.MonitoringConsoleWatchConfig
      • remove

        public void remove​(String name)
        Specified by:
        remove in interface fish.payara.monitoring.adapt.MonitoringConsoleWatchConfig
      • list

        public Iterable<String> list()
        Specified by:
        list in interface fish.payara.monitoring.adapt.MonitoringConsoleWatchConfig
      • getPageConfig

        public fish.payara.monitoring.adapt.MonitoringConsolePageConfig getPageConfig()
        Specified by:
        getPageConfig in interface fish.payara.monitoring.adapt.MonitoringConsoleRuntime
      • getPage

        public String getPage​(String name)
        Specified by:
        getPage in interface fish.payara.monitoring.adapt.MonitoringConsolePageConfig
      • putPage

        public void putPage​(String name,
                            String pageJson)
        Specified by:
        putPage in interface fish.payara.monitoring.adapt.MonitoringConsolePageConfig
      • listPages

        public Iterable<String> listPages()
        Specified by:
        listPages in interface fish.payara.monitoring.adapt.MonitoringConsolePageConfig
      • getGroupData

        public fish.payara.monitoring.adapt.GroupDataRepository getGroupData()
        Specified by:
        getGroupData in interface fish.payara.monitoring.adapt.MonitoringConsoleRuntime
      • selectAll

        public Collection<fish.payara.monitoring.adapt.GroupData> selectAll​(String source,
                                                                            String group)
        Specified by:
        selectAll in interface fish.payara.monitoring.adapt.GroupDataRepository