Class ServletContextSystemInfo
java.lang.Object
com.reallifedeveloper.common.infrastructure.jmx.ServletContextSystemInfo
- All Implemented Interfaces:
SystemInfoMXBean
,org.springframework.beans.factory.Aware
,org.springframework.web.context.ServletContextAware
@ManagedResource(description="General System Information")
public class ServletContextSystemInfo
extends Object
implements SystemInfoMXBean, org.springframework.web.context.ServletContextAware
An implementation of the JMX
SystemInfoMXBean
interface that reads the system information from a manifest file in a WAR file.
This class expects to be configured as a Spring bean in a web application so that the setServletContext(ServletContext)
method
is called automatically. If you want to use this class outside of Spring, you are responsible for calling this method.
- Author:
- RealLifeDeveloper
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@Nullable String
Gives the date and time the system was built.@Nullable String
Gives the revision number of the system in version control.@Nullable String
Gives the system version.void
setServletContext
(jakarta.servlet.ServletContext servletContext)
-
Constructor Details
-
ServletContextSystemInfo
public ServletContextSystemInfo()
-
-
Method Details
-
getVersion
Description copied from interface:SystemInfoMXBean
Gives the system version.- Specified by:
getVersion
in interfaceSystemInfoMXBean
- Returns:
- the system version
-
getBuildTime
@ManagedAttribute(description="Date and time that the system was built") public @Nullable String getBuildTime()Description copied from interface:SystemInfoMXBean
Gives the date and time the system was built.- Specified by:
getBuildTime
in interfaceSystemInfoMXBean
- Returns:
- the date and time the system was built
-
getScmRevision
@ManagedAttribute(description="System revision number in version control") public @Nullable String getScmRevision()Description copied from interface:SystemInfoMXBean
Gives the revision number of the system in version control.- Specified by:
getScmRevision
in interfaceSystemInfoMXBean
- Returns:
- the revision number of the system
-
setServletContext
public void setServletContext(jakarta.servlet.ServletContext servletContext) - Specified by:
setServletContext
in interfaceorg.springframework.web.context.ServletContextAware
-