Interface NotificationHandlerMBean

All Superinterfaces:
InfoMBean, SelfEmailingMBean

public interface NotificationHandlerMBean extends InfoMBean
Listen for a specified notification and log and/or e-mail data whenever the notification in question occurs

Supported API: true

Extendable: true
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addCustomDelegateFactory(String factoryName, String factoryClass)
    Add custom delegate factory instance and associate it with the given name.
    void
    addTargetInfoItem(String mbeanAttributeName, String displayName)
    Add item to end of list of those to be obtained upon receipt of a notification; similar to addMBeanInfo(), but always targets the MBean from which the notification was received

    Supported API: true
    void
    emailXsltStylesheet(String addressesOrEmailList, String subject)
    E-mail XSLT stylesheet

    Supported API: true
    Attributes for which this MBean will be notified upon an AttributeChangeNotification; if not specified, notification is performed for any attribute

    Supported API: true
    Name of e-mail list to send e-mail to upon receipt of notification; no e-mail is sent if this is unspecified or invalid

    Supported API: true
    int
    Maximum number of e-mails sent without a reset; unlimited if less than or equal to zero

    Supported API: true
    int
    Number of e-mails sent since last reset

    Supported API: true
    Subject of e-mail sent upon receipt of notification; if this is unspecified, then a default subject will be generated from the notification

    Supported API: true
    Low-level (java.util.Formatter) log format string; if specified, overrides UseShortFormat and SeparatorString

    Supported API: true
    Notification types for which this MBean will not be notified; useful to listen to all but a few notification types

    Supported API: true
    String preview representation of data currently selected by info items; for any items referencing the implicit target MBean a sample MBean matching TargetObjectName (if such an MBean is currently registered) is used for purposes of generating this preview

    Supported API: true
    Level to assign to generated log messages; valid values are ALL, TRACE, DEBUG, INFO, WARN, ERROR, FATAL, OFF (or blank/unspecified); see LoggerLevel also

    Supported API: true
    Logger to output data to upon receipt of notification; if not specified, no such logging is performed

    Supported API: true
    Cutoff level for logger; must be at least as high as LogAsLevel for log to be produced; valid values are ALL, TRACE, DEBUG, INFO, WARN, ERROR, FATAL, OFF (or blank/unspecified)

    Supported API: true
    List of data attributes to be output to log upon receipt of notification

    Supported API: true
    List of attributes always supported for use in LoggerOutputAttributes; all bean properties of the notification are exposed as well

    Supported API: true
    Name of NotificationHandlerMBean

    Supported API: true
    int
    Number of MBeans currently being listened to

    Supported API: true
    Item separator string used in log format

    Supported API: true
    Notification types for which this MBean will be notified; if not specified, will be notified for all types not specified by IgnoredNotificationTypes

    Supported API: true
    ObjectName (or ObjectName pattern) of MBean to listen to for notifications

    Supported API: true
    Value of threshold attribute on target MBean to set as part of listener registration (optional)

    Supported API: true
    Name of threshold attribute on target MBean to set as part of listener registration (optional)

    Supported API: true
    URL, file, or resource reference of XSLT stylesheet to apply to XML data to produce e-mail content

    Supported API: true
    XsltStylesheet as an absolute URL reference

    Supported API: true
    void
    insertTargetInfoItem(int infoItemIdx, String mbeanAttributeName, String displayName)
    Insert item into list of those to be obtained upon receipt of a notification; similar to insertMBeanInfo(), but always targets the MBean from which the notification was received

    Supported API: true
    boolean
    Whether multi-line format is used

    Supported API: true
    boolean
    Whether short format (which contains only attribute values, not names) is used for logging

    Supported API: true
    void
    Disable this e-mail notifier and remove it from the management console

    Supported API: true
    void
    Resets EmailsSent

    Supported API: true
    void
    setAttributeChangeTargets(String attributeChangeTargets)
    Attributes for which this MBean will be notified upon an AttributeChangeNotification; if not specified, notification is performed for any attribute

    Supported API: true
    void
    setEmailRecipientListName(String emailRecipientListName)
    Name of e-mail list to send e-mail to upon receipt of notification; no e-mail is sent if this is unspecified or invalid

    Supported API: true
    void
    setEmailSendLimit(int emailSendLimit)
    Maximum number of e-mails sent without a reset; unlimited if less than or equal to zero

    Supported API: true
    void
    setEmailSubject(String emailSubject)
    Subject of e-mail sent upon receipt of notification; if this is unspecified, then a default subject will be generated from the notification

    Supported API: true
    void
    setFormatString(String formatString)
    Low-level (java.util.Formatter) log format string; if specified, overrides UseShortFormat and SeparatorString

    Supported API: true
    void
    setIgnoredNotificationTypes(String ignoredNotificationTypes)
    Notification types for which this MBean will be notified; useful to listen to all but a few notification types

    Supported API: true
    void
    setLogAsLevel(String logAsLevel)
    Level to assign to generated log messages; valid values are ALL, TRACE, DEBUG, INFO, WARN, ERROR, FATAL, OFF (or blank/unspecified); see LoggerLevel also

    Supported API: true
    void
    setLogger(String loggerName)
    Logger to output data to upon receipt of notification; if not specified, no such logging is performed

    Supported API: true
    void
    Cutoff level for logger; must be at least as high as LogAsLevel for log to be produced; valid values are ALL, TRACE, DEBUG, INFO, WARN, ERROR, FATAL, OFF (or blank/unspecified)

    Supported API: true
    void
    setLoggerOutputAttributes(String loggerOutputAttributes)
    List of data attributes to be output to log upon receipt of notification

    Supported API: true
    void
    setMultiLineFormat(boolean multiLineFormat)
    Whether multi-line format is used

    Supported API: true
    void
    setSeparatorString(String separatorString)
    Item separator string used in log format

    Supported API: true
    void
    setTargetNotificationTypes(String targetNotificationTypes)
    Notification types for which this MBean will be notified; if not specified, will be notified for all types not specified by IgnoredNotificationTypes

    Supported API: true
    void
    setTargetThreshold(Number targetThreshold)
    Value of threshold attribute on target MBean to set as part of listener registration (optional)

    Supported API: true
    void
    setTargetThresholdAttribute(String targetThresholdAttribute)
    Name of threshold attribute on target MBean to set as part of listener registration (optional)

    Supported API: true
    void
    setUseShortFormat(boolean useShortFormat)
    Whether short format (which contains only attribute values, not names) is used for logging

    Supported API: true
    void
    setXsltStylesheet(String xsltStylesheet)
    URL, file, or resource reference of XSLT stylesheet to apply to XML data to produce e-mail content

    Supported API: true
    View XSLT stylesheet

    Supported API: true

    Methods inherited from interface wt.jmx.core.mbeans.SelfEmailingMBean

    emailThisMBean
  • Method Details

    • getName

      String getName()
      Name of NotificationHandlerMBean

      Supported API: true
    • getTargetObjectName

      ObjectName getTargetObjectName()
      ObjectName (or ObjectName pattern) of MBean to listen to for notifications

      Supported API: true
    • getNumberMBeansListenedTo

      int getNumberMBeansListenedTo()
      Number of MBeans currently being listened to

      Supported API: true
    • getTargetThresholdAttribute

      String getTargetThresholdAttribute()
      Name of threshold attribute on target MBean to set as part of listener registration (optional)

      Supported API: true
    • setTargetThresholdAttribute

      void setTargetThresholdAttribute(String targetThresholdAttribute)
      Name of threshold attribute on target MBean to set as part of listener registration (optional)

      Supported API: true
    • getTargetThreshold

      Number getTargetThreshold()
      Value of threshold attribute on target MBean to set as part of listener registration (optional)

      Supported API: true
    • setTargetThreshold

      void setTargetThreshold(Number targetThreshold)
      Value of threshold attribute on target MBean to set as part of listener registration (optional)

      Supported API: true
    • getAttributeChangeTargets

      String getAttributeChangeTargets()
      Attributes for which this MBean will be notified upon an AttributeChangeNotification; if not specified, notification is performed for any attribute

      Supported API: true
    • setAttributeChangeTargets

      void setAttributeChangeTargets(String attributeChangeTargets)
      Attributes for which this MBean will be notified upon an AttributeChangeNotification; if not specified, notification is performed for any attribute

      Supported API: true
    • getTargetNotificationTypes

      String getTargetNotificationTypes()
      Notification types for which this MBean will be notified; if not specified, will be notified for all types not specified by IgnoredNotificationTypes

      Supported API: true
    • setTargetNotificationTypes

      void setTargetNotificationTypes(String targetNotificationTypes)
      Notification types for which this MBean will be notified; if not specified, will be notified for all types not specified by IgnoredNotificationTypes

      Supported API: true
    • getIgnoredNotificationTypes

      String getIgnoredNotificationTypes()
      Notification types for which this MBean will not be notified; useful to listen to all but a few notification types

      Supported API: true
    • setIgnoredNotificationTypes

      void setIgnoredNotificationTypes(String ignoredNotificationTypes)
      Notification types for which this MBean will be notified; useful to listen to all but a few notification types

      Supported API: true
    • getEmailRecipientListName

      String getEmailRecipientListName()
      Name of e-mail list to send e-mail to upon receipt of notification; no e-mail is sent if this is unspecified or invalid

      Supported API: true
    • setEmailRecipientListName

      void setEmailRecipientListName(String emailRecipientListName)
      Name of e-mail list to send e-mail to upon receipt of notification; no e-mail is sent if this is unspecified or invalid

      Supported API: true
    • getEmailSubject

      String getEmailSubject()
      Subject of e-mail sent upon receipt of notification; if this is unspecified, then a default subject will be generated from the notification

      Supported API: true
    • setEmailSubject

      void setEmailSubject(String emailSubject)
      Subject of e-mail sent upon receipt of notification; if this is unspecified, then a default subject will be generated from the notification

      Supported API: true
    • getXsltStylesheetURLString

      String getXsltStylesheetURLString()
      XsltStylesheet as an absolute URL reference

      Supported API: true
    • getXsltStylesheet

      String getXsltStylesheet()
      URL, file, or resource reference of XSLT stylesheet to apply to XML data to produce e-mail content

      Supported API: true
    • setXsltStylesheet

      void setXsltStylesheet(String xsltStylesheet)
      URL, file, or resource reference of XSLT stylesheet to apply to XML data to produce e-mail content

      Supported API: true
    • getLogger

      String getLogger()
      Logger to output data to upon receipt of notification; if not specified, no such logging is performed

      Supported API: true
    • setLogger

      void setLogger(String loggerName)
      Logger to output data to upon receipt of notification; if not specified, no such logging is performed

      Supported API: true
    • getLogAsLevel

      String getLogAsLevel()
      Level to assign to generated log messages; valid values are ALL, TRACE, DEBUG, INFO, WARN, ERROR, FATAL, OFF (or blank/unspecified); see LoggerLevel also

      Supported API: true
    • setLogAsLevel

      void setLogAsLevel(String logAsLevel)
      Level to assign to generated log messages; valid values are ALL, TRACE, DEBUG, INFO, WARN, ERROR, FATAL, OFF (or blank/unspecified); see LoggerLevel also

      Supported API: true
    • getLoggerLevel

      String getLoggerLevel()
      Cutoff level for logger; must be at least as high as LogAsLevel for log to be produced; valid values are ALL, TRACE, DEBUG, INFO, WARN, ERROR, FATAL, OFF (or blank/unspecified)

      Supported API: true
    • setLoggerLevel

      void setLoggerLevel(String level)
      Cutoff level for logger; must be at least as high as LogAsLevel for log to be produced; valid values are ALL, TRACE, DEBUG, INFO, WARN, ERROR, FATAL, OFF (or blank/unspecified)

      Supported API: true
    • getLoggerOutputAttributes

      String getLoggerOutputAttributes()
      List of data attributes to be output to log upon receipt of notification

      Supported API: true
    • setLoggerOutputAttributes

      void setLoggerOutputAttributes(String loggerOutputAttributes)
      List of data attributes to be output to log upon receipt of notification

      Supported API: true
    • getLoggerOutputAttributesSupported

      String[] getLoggerOutputAttributesSupported()
      List of attributes always supported for use in LoggerOutputAttributes; all bean properties of the notification are exposed as well

      Supported API: true
    • isUseShortFormat

      boolean isUseShortFormat()
      Whether short format (which contains only attribute values, not names) is used for logging

      Supported API: true
    • setUseShortFormat

      void setUseShortFormat(boolean useShortFormat)
      Whether short format (which contains only attribute values, not names) is used for logging

      Supported API: true
    • isMultiLineFormat

      boolean isMultiLineFormat()
      Whether multi-line format is used

      Supported API: true
    • setMultiLineFormat

      void setMultiLineFormat(boolean multiLineFormat)
      Whether multi-line format is used

      Supported API: true
    • getSeparatorString

      String getSeparatorString()
      Item separator string used in log format

      Supported API: true
    • setSeparatorString

      void setSeparatorString(String separatorString)
      Item separator string used in log format

      Supported API: true
    • getFormatString

      String getFormatString()
      Low-level (java.util.Formatter) log format string; if specified, overrides UseShortFormat and SeparatorString

      Supported API: true
    • setFormatString

      void setFormatString(String formatString)
      Low-level (java.util.Formatter) log format string; if specified, overrides UseShortFormat and SeparatorString

      Supported API: true
    • getEmailSendLimit

      int getEmailSendLimit()
      Maximum number of e-mails sent without a reset; unlimited if less than or equal to zero

      Supported API: true
    • setEmailSendLimit

      void setEmailSendLimit(int emailSendLimit)
      Maximum number of e-mails sent without a reset; unlimited if less than or equal to zero

      Supported API: true
    • getEmailsSent

      int getEmailsSent()
      Number of e-mails sent since last reset

      Supported API: true
    • getInfoItemsPreview

      String[] getInfoItemsPreview()
      String preview representation of data currently selected by info items; for any items referencing the implicit target MBean a sample MBean matching TargetObjectName (if such an MBean is currently registered) is used for purposes of generating this preview

      Supported API: true
      Specified by:
      getInfoItemsPreview in interface InfoMBean
    • addTargetInfoItem

      @MBeanOperationImpact(0) void addTargetInfoItem(String mbeanAttributeName, String displayName)
      Add item to end of list of those to be obtained upon receipt of a notification; similar to addMBeanInfo(), but always targets the MBean from which the notification was received

      Supported API: true
      Parameters:
      mbeanAttributeName - Name of attribute in 'mbeanObjectName' to obtain; can use .itemName-style suffixes to select CompositeData fields
      displayName - Display name to use for this item; used when UseShortFormat is false and FormatString is unspecified
    • insertTargetInfoItem

      @MBeanOperationImpact(1) void insertTargetInfoItem(int infoItemIdx, String mbeanAttributeName, String displayName)
      Insert item into list of those to be obtained upon receipt of a notification; similar to insertMBeanInfo(), but always targets the MBean from which the notification was received

      Supported API: true
      Parameters:
      infoItemIdx - Index of item to insert in front of
      mbeanAttributeName - Name of attribute in 'mbeanObjectName' to obtain; can use .itemName-style suffixes to select CompositeData fields
      displayName - Display name to use for this item; used when UseShortFormat is false and FormatString is unspecified
    • resetEmailsSent

      @MBeanOperationImpact(0) void resetEmailsSent()
      Resets EmailsSent

      Supported API: true
    • viewXsltStylesheet

      @MBeanOperationImpact(0) String[] viewXsltStylesheet() throws IOException
      View XSLT stylesheet

      Supported API: true
      Throws:
      IOException
    • emailXsltStylesheet

      @MBeanOperationImpact(0) void emailXsltStylesheet(String addressesOrEmailList, String subject) throws IOException
      E-mail XSLT stylesheet

      Supported API: true
      Parameters:
      addressesOrEmailList - Comma-delimited list of e-mail addresses or name of e-mail list to send e-mail to
      subject - Subject to give e-mail
      Throws:
      IOException
    • addCustomDelegateFactory

      @MBeanOperationImpact(1) void addCustomDelegateFactory(String factoryName, String factoryClass) throws ClassNotFoundException, InstantiationException, IllegalAccessException
      Add custom delegate factory instance and associate it with the given name.

      An attempt is made to find a constructor in the specified class taking a single String argument and call this constructor passing the specified name. If this fails, the no-arg constructor (which must be public) is used instead and an attempt is also made to call setName(String) on the instance. An attempt is also made to call setOwnerMBean(BaseObjectNamed) on the instance, passing it this MBean, so that any interested delegate factory can obtain this information.

      If the factory is a SelfAwareMBean, then the factory is registered as a child MBean of this MBean.

      The factory class must implement NotificationHandlerDelegateFactory. The factory class should also override equals() to return 'true' for logically equivalent instances.

      Supported API: true

      Specified by:
      addCustomDelegateFactory in interface InfoMBean
      Parameters:
      factoryName - Name to associate with custom delegate factory; will use factoryClass if this is null
      factoryClass - Name of custom delegate factory class; class must implement NotificationHandlerDelegateFactory
      Throws:
      ClassNotFoundException
      InstantiationException
      IllegalAccessException
    • remove

      @MBeanOperationImpact(1) void remove()
      Disable this e-mail notifier and remove it from the management console

      Supported API: true