Class JMXStatusEntry

    • Constructor Summary

      Constructors 
      Constructor Description
      JMXStatusEntry​(javax.management.ObjectName mBeanName)
      Constructor for the JMXStatusEntry.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compareTo​(StatusEntry o)
      Compares two entries according to first their location, then their machine name, then their ports, and then their application name, and then their index.
      java.lang.String getApplicationInstanceID()
      Get the instance id of the application that this status entry is from.
      java.lang.String getApplicationName()
      Get the name of the application that this status entry is from.
      java.lang.String getArchiveReplicaName()
      Get the replica id of the application that this status entry is represents.
      java.lang.String getHarvestPriority()
      Get the priority of the harvest queue that this status entry is from.
      java.lang.String getHTTPPort()
      Get the HTTP port used by the application this status entry is from.
      java.lang.String getIndex()
      Get the index in the list of most recent log messages that this status entry is from.
      java.lang.String getLogMessage​(java.util.Locale l)
      Gets the log message from this status entry.
      java.lang.String getMachineName()
      Get the name of the host (machine) this status entry is from.
      java.lang.String getPhysicalLocation()
      Get the (physical) location this status entry is from, e.g.
      static java.util.List<StatusEntry> queryJMX​(java.lang.String query)
      Query the JMX system for system status mbeans.
      static void unregisterJMXInstance​(java.lang.String query)
      Unregister an JMX MBean instance.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • JMXStatusEntry

        public JMXStatusEntry​(javax.management.ObjectName mBeanName)
        Constructor for the JMXStatusEntry.
        Parameters:
        mBeanName - The ObjectName to be assigned to the MBean representing this JMXStatusEntry.
    • Method Detail

      • getLogMessage

        public java.lang.String getLogMessage​(java.util.Locale l)
        Gets the log message from this status entry. This implementation actually talks to an MBeanServer to get the log message. Will return an explanation if remote host does not respond, throws exception or returns null.
        Specified by:
        getLogMessage in interface StatusEntry
        Parameters:
        l - the current Locale
        Returns:
        A log message.
        Throws:
        ArgumentNotValid - if the current Locale is null
      • compareTo

        public int compareTo​(StatusEntry o)
        Compares two entries according to first their location, then their machine name, then their ports, and then their application name, and then their index.
        Specified by:
        compareTo in interface java.lang.Comparable<StatusEntry>
        Parameters:
        o - The object to compare with
        Returns:
        A negative number if this entry comes first, a positive if it comes second and 0 if they are equal.
      • queryJMX

        public static java.util.List<StatusEntryqueryJMX​(java.lang.String query)
                                                    throws javax.management.MalformedObjectNameException
        Query the JMX system for system status mbeans.
        Parameters:
        query - A JMX request, e.g. dk.netarkivet.logging:location=EAST,httpport=8080,*
        Returns:
        A list of status entries for the mbeans that match the query.
        Throws:
        javax.management.MalformedObjectNameException - If the query has wrong format.
      • unregisterJMXInstance

        public static void unregisterJMXInstance​(java.lang.String query)
                                          throws javax.management.MalformedObjectNameException,
                                                 javax.management.InstanceNotFoundException,
                                                 javax.management.MBeanRegistrationException
        Unregister an JMX MBean instance.
        Parameters:
        query - A JMX request, for picking the beans to unregister.
        Throws:
        javax.management.MalformedObjectNameException - if query is malformed.
        javax.management.InstanceNotFoundException - if the instanced unregistered doesn't exists.
        javax.management.MBeanRegistrationException - if unregeterBean is thrown.