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 theMonitoringConsoleRuntime
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 implementingApplicationLifecycleInterceptor
it forces the creation of an instance of thisService
even though it is not otherwise referenced within the HK2 context. As this happens fairly early in the bootstrapping it then registers itself as anEventListener
so that it can run its actualinit()
bootstrapping as soon as theEventTypes.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 implementMonitoringDataSource
orMonitoringWatchSource
.- 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 void
add(String name, String watchJson)
void
after(ExtendedDeploymentContext.Phase phase, ExtendedDeploymentContext context)
Provide call back after a certain phase of the application lifecyclevoid
before(ExtendedDeploymentContext.Phase phase, ExtendedDeploymentContext context)
Provide call back before a certain phase of the application lifecycleUnprocessedChangeEvents
changed(PropertyChangeEvent[] events)
Notification that @Configured objects that were injected have changedvoid
disable(String name)
void
enable(String name)
void
event(EventListener.Event<?> event)
Process a Glassfish/Payara eventfish.payara.monitoring.adapt.GroupDataRepository
getGroupData()
String
getPage(String name)
fish.payara.monitoring.adapt.MonitoringConsolePageConfig
getPageConfig()
fish.payara.monitoring.adapt.MonitoringConsoleWatchConfig
getWatchConfig()
void
init()
boolean
isDisabled(String name)
Iterable<String>
list()
Iterable<String>
listPages()
void
postConstruct()
void
putPage(String name, String pageJson)
boolean
receive(Consumer<byte[]> receiver)
void
remove(String name)
ScheduledFuture<?>
scheduleAtFixedRate(Runnable task, long initialDelay, long period, TimeUnit unit)
Collection<fish.payara.monitoring.adapt.GroupData>
selectAll(String source, String group)
boolean
send(byte[] snapshot)
-
-
-
Method Detail
-
postConstruct
@PostConstruct public void postConstruct()
-
event
public void event(EventListener.Event<?> event)
Description copied from interface:EventListener
Process a Glassfish/Payara event- Specified by:
event
in interfaceEventListener
-
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 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:
scheduleAtFixedRate
in interfacefish.payara.monitoring.adapt.MonitoringConsoleRuntime
-
send
public boolean send(byte[] snapshot)
- Specified by:
send
in interfacefish.payara.monitoring.adapt.MonitoringConsoleRuntime
-
receive
public boolean receive(Consumer<byte[]> receiver)
- Specified by:
receive
in interfacefish.payara.monitoring.adapt.MonitoringConsoleRuntime
-
getWatchConfig
public fish.payara.monitoring.adapt.MonitoringConsoleWatchConfig getWatchConfig()
- Specified by:
getWatchConfig
in interfacefish.payara.monitoring.adapt.MonitoringConsoleRuntime
-
isDisabled
public boolean isDisabled(String name)
- Specified by:
isDisabled
in interfacefish.payara.monitoring.adapt.MonitoringConsoleWatchConfig
-
disable
public void disable(String name)
- Specified by:
disable
in interfacefish.payara.monitoring.adapt.MonitoringConsoleWatchConfig
-
enable
public void enable(String name)
- Specified by:
enable
in interfacefish.payara.monitoring.adapt.MonitoringConsoleWatchConfig
-
add
public void add(String name, String watchJson)
- Specified by:
add
in interfacefish.payara.monitoring.adapt.MonitoringConsoleWatchConfig
-
remove
public void remove(String name)
- Specified by:
remove
in interfacefish.payara.monitoring.adapt.MonitoringConsoleWatchConfig
-
list
public Iterable<String> list()
- Specified by:
list
in interfacefish.payara.monitoring.adapt.MonitoringConsoleWatchConfig
-
getPageConfig
public fish.payara.monitoring.adapt.MonitoringConsolePageConfig getPageConfig()
- Specified by:
getPageConfig
in interfacefish.payara.monitoring.adapt.MonitoringConsoleRuntime
-
getPage
public String getPage(String name)
- Specified by:
getPage
in interfacefish.payara.monitoring.adapt.MonitoringConsolePageConfig
-
putPage
public void putPage(String name, String pageJson)
- Specified by:
putPage
in interfacefish.payara.monitoring.adapt.MonitoringConsolePageConfig
-
listPages
public Iterable<String> listPages()
- Specified by:
listPages
in interfacefish.payara.monitoring.adapt.MonitoringConsolePageConfig
-
getGroupData
public fish.payara.monitoring.adapt.GroupDataRepository getGroupData()
- Specified by:
getGroupData
in interfacefish.payara.monitoring.adapt.MonitoringConsoleRuntime
-
selectAll
public Collection<fish.payara.monitoring.adapt.GroupData> selectAll(String source, String group)
- Specified by:
selectAll
in interfacefish.payara.monitoring.adapt.GroupDataRepository
-
before
public void before(ExtendedDeploymentContext.Phase phase, ExtendedDeploymentContext context)
Description copied from interface:ApplicationLifecycleInterceptor
Provide call back before a certain phase of the application lifecycle- Specified by:
before
in 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:ApplicationLifecycleInterceptor
Provide call back after a certain phase of the application lifecycle- Specified by:
after
in interfaceApplicationLifecycleInterceptor
- Parameters:
phase
- the application lifecycle phase which the call back will happen aftercontext
- the deployment context
-
-