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 Details

    • ServletContextSystemInfo

      public ServletContextSystemInfo()
  • Method Details

    • getVersion

      @ManagedAttribute(description="System version") public @Nullable String getVersion()
      Description copied from interface: SystemInfoMXBean
      Gives the system version.
      Specified by:
      getVersion in interface SystemInfoMXBean
      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 interface SystemInfoMXBean
      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 interface SystemInfoMXBean
      Returns:
      the revision number of the system
    • setServletContext

      public void setServletContext(jakarta.servlet.ServletContext servletContext)
      Specified by:
      setServletContext in interface org.springframework.web.context.ServletContextAware