Package fish.payara.monitoring.runtime
Class MonitoringConsoleRuntimeImpl
- java.lang.Object
-
- fish.payara.monitoring.runtime.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 theMonitoringConsoleRuntimeconnects 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 implementingApplicationLifecycleInterceptorit forces the creation of an instance of thisServiceeven though it is not otherwise referenced within the HK2 context. As this happens fairly early in the bootstrapping it then registers itself as anEventListenerso that it can run its actualinit()bootstrapping as soon as theEventTypes.SERVER_READYis 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 implementMonitoringDataSourceorMonitoringWatchSource.- Since:
- 5.201
- Author:
- Jan Bernitt
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.glassfish.api.event.EventListener
EventListener.Event<T>
-
-
Constructor Summary
Constructors Constructor Description MonitoringConsoleRuntimeImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(String name, String watchJson)voidafter(ExtendedDeploymentContext.Phase phase, ExtendedDeploymentContext context)Provide call back after a certain phase of the application lifecyclevoidbefore(ExtendedDeploymentContext.Phase phase, ExtendedDeploymentContext context)Provide call back before a certain phase of the application lifecycleUnprocessedChangeEventschanged(PropertyChangeEvent[] events)Notification that @Configured objects that were injected have changedvoiddisable(String name)voidenable(String name)voidevent(EventListener.Event<?> event)Process a Glassfish/Payara eventfish.payara.monitoring.adapt.GroupDataRepositorygetGroupData()StringgetPage(String name)fish.payara.monitoring.adapt.MonitoringConsolePageConfiggetPageConfig()fish.payara.monitoring.adapt.MonitoringConsoleWatchConfiggetWatchConfig()voidinit()booleanisDisabled(String name)Iterable<String>list()Iterable<String>listPages()voidpostConstruct()voidputPage(String name, String pageJson)booleanreceive(Consumer<byte[]> receiver)voidremove(String name)ScheduledFuture<?>scheduleAtFixedRate(Runnable task, long initialDelay, long period, TimeUnit unit)Collection<fish.payara.monitoring.adapt.GroupData>selectAll(String source, String group)booleansend(byte[] snapshot)
-
-
-
Method Detail
-
postConstruct
@PostConstruct public void postConstruct()
-
event
public void event(EventListener.Event<?> event)
Description copied from interface:EventListenerProcess a Glassfish/Payara event- Specified by:
eventin interfaceEventListener
-
init
public void init()
-
changed
public final UnprocessedChangeEvents changed(PropertyChangeEvent[] events)
Description copied from interface:ConfigListenerNotification that @Configured objects that were injected have changed- Specified by:
changedin interfaceConfigListener- 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:
scheduleAtFixedRatein interfacefish.payara.monitoring.adapt.MonitoringConsoleRuntime
-
send
public boolean send(byte[] snapshot)
- Specified by:
sendin interfacefish.payara.monitoring.adapt.MonitoringConsoleRuntime
-
receive
public boolean receive(Consumer<byte[]> receiver)
- Specified by:
receivein interfacefish.payara.monitoring.adapt.MonitoringConsoleRuntime
-
getWatchConfig
public fish.payara.monitoring.adapt.MonitoringConsoleWatchConfig getWatchConfig()
- Specified by:
getWatchConfigin interfacefish.payara.monitoring.adapt.MonitoringConsoleRuntime
-
isDisabled
public boolean isDisabled(String name)
- Specified by:
isDisabledin interfacefish.payara.monitoring.adapt.MonitoringConsoleWatchConfig
-
disable
public void disable(String name)
- Specified by:
disablein interfacefish.payara.monitoring.adapt.MonitoringConsoleWatchConfig
-
enable
public void enable(String name)
- Specified by:
enablein interfacefish.payara.monitoring.adapt.MonitoringConsoleWatchConfig
-
add
public void add(String name, String watchJson)
- Specified by:
addin interfacefish.payara.monitoring.adapt.MonitoringConsoleWatchConfig
-
remove
public void remove(String name)
- Specified by:
removein interfacefish.payara.monitoring.adapt.MonitoringConsoleWatchConfig
-
list
public Iterable<String> list()
- Specified by:
listin interfacefish.payara.monitoring.adapt.MonitoringConsoleWatchConfig
-
getPageConfig
public fish.payara.monitoring.adapt.MonitoringConsolePageConfig getPageConfig()
- Specified by:
getPageConfigin interfacefish.payara.monitoring.adapt.MonitoringConsoleRuntime
-
getPage
public String getPage(String name)
- Specified by:
getPagein interfacefish.payara.monitoring.adapt.MonitoringConsolePageConfig
-
putPage
public void putPage(String name, String pageJson)
- Specified by:
putPagein interfacefish.payara.monitoring.adapt.MonitoringConsolePageConfig
-
listPages
public Iterable<String> listPages()
- Specified by:
listPagesin interfacefish.payara.monitoring.adapt.MonitoringConsolePageConfig
-
getGroupData
public fish.payara.monitoring.adapt.GroupDataRepository getGroupData()
- Specified by:
getGroupDatain interfacefish.payara.monitoring.adapt.MonitoringConsoleRuntime
-
selectAll
public Collection<fish.payara.monitoring.adapt.GroupData> selectAll(String source, String group)
- Specified by:
selectAllin interfacefish.payara.monitoring.adapt.GroupDataRepository
-
before
public void before(ExtendedDeploymentContext.Phase phase, ExtendedDeploymentContext context)
Description copied from interface:ApplicationLifecycleInterceptorProvide call back before a certain phase of the application lifecycle- Specified by:
beforein interfaceApplicationLifecycleInterceptor- Parameters:
phase- the application lifecycle phase which the call back will happen beforecontext- the deployment context
-
after
public void after(ExtendedDeploymentContext.Phase phase, ExtendedDeploymentContext context)
Description copied from interface:ApplicationLifecycleInterceptorProvide call back after a certain phase of the application lifecycle- Specified by:
afterin interfaceApplicationLifecycleInterceptor- Parameters:
phase- the application lifecycle phase which the call back will happen aftercontext- the deployment context
-
-