Package wt.method

Interface MethodContextMonitorMBean

All Superinterfaces:
DeluxeStatsMonitorMBean, RawStatisticsProviderMBean, SelfEmailingMBean

public interface MethodContextMonitorMBean extends DeluxeStatsMonitorMBean, RawStatisticsProviderMBean
Monitors Windchill method server method contexts.

Supported API: true

Extendable: true
  • Field Details

    • MAX_ACTIVE_CONTEXTS_NOTIF_TYPE

      static final String MAX_ACTIVE_CONTEXTS_NOTIF_TYPE
      Type of notification produced when MaxAverageActiveContextsThreshold is exceeded

      Supported API: true
  • Method Details

    • getActiveContexts

      int getActiveContexts()
      Number of contexts currently being processed

      Supported API: true
    • getDatabaseConnections

      int getDatabaseConnections()
      Number of database connections open

      Supported API: true
    • getMaxAverageActiveContextsThreshold

      int getMaxAverageActiveContextsThreshold()
      Maximum average context concurrency before log messages become warnings and notifications are sent when this statistic is maintained for a summary interval; threshold disabled when zero or megative

      Supported API: true
    • setMaxAverageActiveContextsThreshold

      void setMaxAverageActiveContextsThreshold(int maxAverageActiveContextThreshold)
      Maximum average context concurrency before log messages become warnings and notifications are sent when this statistic is maintained for a summary interval; threshold disabled when zero or megative

      Supported API: true
    • getContextTimeWarnThreshold

      double getContextTimeWarnThreshold()
      Maximum context duration (in seconds) before related log messages become warnings

      Supported API: true
    • setContextTimeWarnThreshold

      void setContextTimeWarnThreshold(double contextTimeWarnThreshold)
      Maximum context duration (in seconds) before related log messages become warnings

      Supported API: true
    • getVeryLongContextTimeThreshold

      double getVeryLongContextTimeThreshold()
      Minimum duration (in seconds) of contexts reported as warnings by very long context checker

      Supported API: true
    • setVeryLongContextTimeThreshold

      void setVeryLongContextTimeThreshold(double veryLongContextTimeThreshold)
      Minimum duration (in seconds) of contexts reported as warnings by very long context checker

      Supported API: true
    • getVeryLongContextTimeCheckIntervalSeconds

      int getVeryLongContextTimeCheckIntervalSeconds()
      Interval (in seconds) between checks for very long contexts; non-positive values disable these checks

      Supported API: true
    • setVeryLongContextTimeCheckIntervalSeconds

      void setVeryLongContextTimeCheckIntervalSeconds(int veryLongContextTimeCheckIntervalSeconds)
      Interval (in seconds) between checks for very long contexts; non-positive values disable these checks

      Supported API: true
    • getContextLoggerName

      String getContextLoggerName()
      Name of context logger

      Supported API: true
    • getContextLoggerLevel

      String getContextLoggerLevel()
      Context logging level (not persisted with MBean); valid values are ALL, TRACE, DEBUG, INFO, WARN, ERROR, FATAL, OFF (or blank/unspecified)

      Supported API: true
    • setContextLoggerLevel

      void setContextLoggerLevel(String level)
      Context logging level (not persisted with MBean); valid values are ALL, TRACE, DEBUG, INFO, WARN, ERROR, FATAL, OFF (or blank/unspecified)

      Supported API: true
    • getContextLoggerOutputAttributes

      String getContextLoggerOutputAttributes()
      List of ContextMBean attributes to be output to context log

      Supported API: true
    • setContextLoggerOutputAttributes

      void setContextLoggerOutputAttributes(String contextLoggerOutputAttributes)
      List of ContextMBean attributes to be output to context log

      Supported API: true
    • getContextLoggerOutputAttributesSupported

      String[] getContextLoggerOutputAttributesSupported()
      List of attributes supported for use in ContextLoggerOutputAttributes

      Supported API: true
    • isContextLoggerUseShortFormat

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

      Supported API: true
    • setContextLoggerUseShortFormat

      void setContextLoggerUseShortFormat(boolean contextLoggerUseShortFormat)
      Whether short format (which contains only attribute values, not names) is used for context logging

      Supported API: true
    • isContextLoggerMultiLineFormat

      boolean isContextLoggerMultiLineFormat()
      Whether multi-line format is used for context logging

      Supported API: true
    • setContextLoggerMultiLineFormat

      void setContextLoggerMultiLineFormat(boolean contextLoggerMultiLineFormat)
      Whether multi-line format is used for context logging

      Supported API: true
    • getContextLoggerSeparatorString

      String getContextLoggerSeparatorString()
      Item separator string used in context log format

      Supported API: true
    • setContextLoggerSeparatorString

      void setContextLoggerSeparatorString(String contextLoggerSeparatorString)
      Item separator string used in context log format

      Supported API: true
    • getContextLoggerFormatString

      String getContextLoggerFormatString()
      Low-level (java.util.Formatter) context log format string; if specified, overrides ContextLoggerUseShortFormat and ContextLoggerSeparatorString

      Supported API: true
    • setContextLoggerFormatString

      void setContextLoggerFormatString(String contextLoggerFormatString)
      Low-level (java.util.Formatter) context log format string; if specified, overrides ContextLoggerUseShortFormat and ContextLoggerSeparatorString

      Supported API: true
    • isContextRegistrationEnabled

      boolean isContextRegistrationEnabled()
      Whether contexts are automatically registered and deregistered as JMX MBeans as they are received and completed; enabling this can adversely affect performance

      Supported API: true
    • setContextRegistrationEnabled

      void setContextRegistrationEnabled(boolean contextRegistrationEnabled)
      Whether contexts are automatically registered and deregistered as JMX MBeans as they are received and completed; enabling this can adversely affect performance

      Supported API: true
    • getObjectCounterEnabled

      boolean getObjectCounterEnabled()
      Whether WTObject allocation counting is enabled

      Supported API: true
    • setObjectCounterEnabled

      void setObjectCounterEnabled(boolean objectCounterEnabled)
      Whether WTObject allocation counting is enabled

      Supported API: true
    • getObjectCounterData

      CompositeData getObjectCounterData() throws OpenDataException
      Data about WTObject allocation (no data will be collected unless ObjectCounterEnabled is true)

      Supported API: true
      Throws:
      OpenDataException
    • isProcessCpuTimeMonitoringEnabled

      boolean isProcessCpuTimeMonitoringEnabled()
      Whether monitoring of overall process CPU time is enabled for this MBean; if not, then MethodContextMBean's ProcessPercentageOfTotalCpuTime and PercentageOfProcessCpuTime attributes will not have meaningful values.

      Supported API: true
    • setProcessCpuTimeMonitoringEnabled

      void setProcessCpuTimeMonitoringEnabled(boolean processCpuTimeMonitoringEnabled)
      Whether monitoring of overall process CPU time is enabled for this MBean; if not, then MethodContextMBean's ProcessPercentageOfTotalCpuTime and PercentageOfProcessCpuTime attributes will not have meaningful values.

      Supported API: true
    • getContextXsltStylesheet

      String getContextXsltStylesheet()
      XSLT stylesheet used by emailActiveContexts() for styling context data; if not specified, the Dumper MBean's DefaultXsltStylesheet will be used

      Supported API: true
    • setContextXsltStylesheet

      void setContextXsltStylesheet(String contextXsltStylesheet)
      XSLT stylesheet used by emailActiveContexts() for styling context data; if not specified, the Dumper MBean's DefaultXsltStylesheet will be used

      Supported API: true
    • getMinAvailableHeapThreshold

      long getMinAvailableHeapThreshold()
      Minimum available heap threshold (in bytes) below which drastic actions should be performed, including attempting to interrupt the method context that is heuristically most likely to be using the most memory. Non-positive values disable this functionality.

      Supported API: true
    • setMinAvailableHeapThreshold

      void setMinAvailableHeapThreshold(long minAvailableHeapThreshold)
      Minimum available heap threshold (in bytes) below which drastic actions should be performed, including attempting to interrupt the method context that is heuristically most likely to be using the most memory. Non-positive values disable this functionality.

      Supported API: true
    • getMinAvailableHeapPercThreshold

      double getMinAvailableHeapPercThreshold()
      Minimum available heap threshold (as a percentage of overall heap) below which drastic actions should be performed, including attempting to interrupt the method context that is heuristically most likely to be using the most memory. Non-positive values disable this functionality.

      Supported API: true
    • setMinAvailableHeapPercThreshold

      void setMinAvailableHeapPercThreshold(double minAvailableHeapPercThreshold)
      Minimum available heap threshold (as a percentage of overall heap) below which drastic actions should be performed, including attempting to interrupt the method context that is heuristically most likely to be using the most memory. Non-positive values disable this functionality.

      Supported API: true
    • getLargeResultSetThreshold

      long getLargeResultSetThreshold()
      Minimum size result set which is considered "large"; method contexts whose current result set is above this size (where size is the number of rows times the number of columns) are considered to be good candidates for interruption when MinAvailableHeapThreshold is non-zero and less than MinAvailableHeapThreshold bytes of heap memory are available; if this value is non-positive, then no result set is considered large

      Supported API: true
    • setLargeResultSetThreshold

      void setLargeResultSetThreshold(long largeResultSetThreshold)
      Minimum size result set which is considered "large"; method contexts whose current result set is above this size (where size is the number of rows times the number of columns) are considered to be good candidates for interruption when MinAvailableHeapThreshold is non-zero and less than MinAvailableHeapThreshold bytes of heap memory are available; if this value is non-positive, then no result set is considered large

      Supported API: true
    • isUseThreadAllocationData

      boolean isUseThreadAllocationData()
      Whether approximate count of bytes allocated within a method context should be considered (when this data is available) when selecting good candidates for interruption when MinAvailableHeapThreshold is non-zero and less than MinAvailableHeapThreshold bytes of heap memory are available; note that the number of bytes allocated by a thread is not the same as the number of bytes allocated by a thread which are still being referenced -- the former is used here as the latter cannot be efficiently obtained.

      Supported API: true
    • setUseThreadAllocationData

      void setUseThreadAllocationData(boolean useThreadAllocationData)
      Whether approximate count of bytes allocated within a method context should be considered (when this data is available) when selecting good candidates for interruption when MinAvailableHeapThreshold is non-zero and less than MinAvailableHeapThreshold bytes of heap memory are available; note that the number of bytes allocated by a thread is not the same as the number of bytes allocated by a thread which are still being referenced -- the former is used here as the latter cannot be efficiently obtained.

      Supported API: true
    • getSamplingIntervalSeconds

      int getSamplingIntervalSeconds()
      Interval (in seconds) at which both method context and servlet request data is sampled and logged via logActiveContexts(), logRawStatistics(), and the corresponding operations on ServletRequestMonitor MBeans. Non-positive values disable this sampling.

      Supported API: true
    • setSamplingIntervalSeconds

      void setSamplingIntervalSeconds(int samplingIntervalSeconds)
      Interval (in seconds) at which both method context and servlet request data is sampled and logged via logActiveContexts(), logRawStatistics(), and the corresponding operations on ServletRequestMonitor MBeans. Non-positive values disable this sampling.

      Supported API: true
    • getContextMBeanInfo

      MBeanInfo getContextMBeanInfo()
      MBeanInfo of wt.method.MethodContextMBeans. These MBeans are used to generate the context logger attributes and thus this MBeanInfo can be used to obtain type information for these attributes.

      Supported API: true
    • getContextListenerNames

      String[] getContextListenerNames()
      Names of method context listeners

      Supported API: true
    • getContextListenerData

      TabularData getContextListenerData() throws OpenDataException
      Names and class of context listeners

      Supported API: true
      Throws:
      OpenDataException
    • isDetailedRemoteCacheCallTracking

      boolean isDetailedRemoteCacheCallTracking()
      Whether detailed remote cache call tracking is enabled for method contexts; when this is false RemoteCacheCallData and RemoteCacheCallReport method context attribute data is unavailable

      Supported API: true
    • setDetailedRemoteCacheCallTracking

      void setDetailedRemoteCacheCallTracking(boolean detailedRemoteCacheCallTracking)
      Whether detailed remote cache call tracking is enabled for method contexts; when this is false RemoteCacheCallData and RemoteCacheCallReport method context attribute data is unavailable

      Supported API: true
    • addContextListener

      @MBeanOperationImpact(1) void addContextListener(String listenerName, String listenerClassname) throws ClassNotFoundException, InstantiationException, IllegalAccessException
      Add a ContextListener instance of the specified class and give it the specified 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 listener 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 listeners can obtain this information.

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

      The listener class should specifically implement ContextListener<MethodContext> as the ContextListener methods will be passed MethodContext instances.

      Supported API: true

      Parameters:
      listenerName - Name to give new listener
      listenerClassname - Classname of new listener; must implement wt.jmx.core.mbeans.ContextListener
      Throws:
      ClassNotFoundException
      InstantiationException
      IllegalAccessException
    • removeContextListener

      @MBeanOperationImpact(1) void removeContextListener(String listenerName)
      Removes method context listener with the specified name, if such a listener exists.

      Supported API: true
      Parameters:
      listenerName - Name of listener to remove
    • interrupt

      @MBeanOperationImpact(1) void interrupt(String contextId)
      If specified context exists and is not completed, interrupts its thread. WARNING: This is a somewhat drastic operation which may have side-effects.

      Supported API: true
      Parameters:
      contextId - Id of context to interrupt
    • captureActiveContext

      @MBeanOperationImpact(0) long captureActiveContext(String contextId)
      Creates a set of MBeans containing only the context with the specified id, if it is active, and returns the set's id; if no such context is active, -1 is returned

      Supported API: true
      Parameters:
      contextId - Id of context to capture
    • captureActiveContexts

      @MBeanOperationImpact(0) long captureActiveContexts()
      Creates a set of MBeans representing all contexts currently being processed and returns its id

      Supported API: true
    • releaseCapturedContexts

      @MBeanOperationImpact(1) void releaseCapturedContexts()
      Releases all ContextSets and the context MBeans they contain

      Supported API: true
    • releaseCapturedContextSet

      @MBeanOperationImpact(1) void releaseCapturedContextSet(long captureSetId)
      Releases a set of MBeans previously captured with captureActiveContexts()

      Supported API: true
      Parameters:
      captureSetId - Id of set of contexts to release (as returned by captureActiveContexts())
    • getContextSetObjectName

      @MBeanOperationImpact(0) ObjectName getContextSetObjectName(long captureSetId)
      Given the id of a context set as returned by captureActiveContexts(), returns its ObjectName or null if the indicated context set no longer exists

      Supported API: true
      Parameters:
      captureSetId - Id of set of contexts to release (as returned by captureActiveContexts())
    • emailActiveContexts

      @MBeanOperationImpact(0) void emailActiveContexts(String addressesOrEmailList, String subject, boolean compress) throws Exception
      E-mail styled data for all contexts currently being processed

      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
      compress - Whether e-mail contents should be compressed
      Throws:
      Exception
    • getActiveContextAttributes

      @MBeanOperationImpact(0) AttributeList[] getActiveContextAttributes(String[] attributeNames)
      Returns array of AttributeLists containing requested attributes, one for each active context.

      Supported API: true
      Parameters:
      attributeNames - Names of JMX attributes (of wt.method.MethodContextMBean) to retrieve; null implies all attributes
    • getActiveContextAttributes

      @MBeanOperationImpact(0) AttributeList[] getActiveContextAttributes(String[] attributeNames, double elapsedSecondsThreshold)
      Returns array of AttributeLists containing requested attributes, one for each active context that has been active longer than the specified number of seconds.

      Supported API: true
      Parameters:
      attributeNames - Names of JMX attributes (of wt.method.MethodContextMBean) to retrieve; null implies all attributes
      elapsedSecondsThreshold - Minimum length of context in seconds to include in the results of this operation
    • getActiveContextAttributes

      @MBeanOperationImpact(0) AttributeList[] getActiveContextAttributes(String[] attributeNames, MethodContextMBeanFilter filter)
      Returns array of AttributeLists containing requested attributes, one for each active context that passes the specified filter.

      Supported API: true
      Parameters:
      attributeNames - Names of JMX attributes (of wt.method.MethodContextMBean) to retrieve; null implies all attributes
      filter - Filter that determines which method contexts to include data for; if null, data is included for all active method contexts
    • getActiveContextAttributes

      @MBeanOperationImpact(0) AttributeList getActiveContextAttributes(String methodContextId, String[] attributeNames)
      Returns AttributeList containing requested attributes for specified active method context.

      Supported API: true
      Parameters:
      methodContextId - Id of method context to get attributes of
      attributeNames - Names of JMX attributes (of wt.method.MethodContextMBean) to retrieve; null implies all attributes
    • logActiveContexts

      @MBeanOperationImpact(0) void logActiveContexts()
      Logs all active contexts as MethodContextMBean objects. This is done via the wt.method.MethodContextMonitor.activeContext logger at INFO level verbosity except for contexts whose elapsed time exceeds ContextTimeWarnThreshold seconds, which are logged at WARN level verbosity. This operation will therefore produce no output if the level of this logger is not sufficiently verbose. Also note that the default string rendering of these objects provides little information. Instead, these objects are also DynamicMBeans and are intended to provide rich access for specialized log4j appenders, renderers, and layouts.

      Supported API: true
    • logActiveContexts

      @MBeanOperationImpact(0) void logActiveContexts(double elapsedSecondsThreshold)
      Logs active contexts as MethodContextMBean objects. This is done via the wt.method.MethodContextMonitor.activeContext logger at INFO level verbosity except for contexts whose elapsed time exceeds ContextTimeWarnThreshold seconds, which are logged at WARN level verbosity. This operation will therefore produce no output if the level of this logger is not sufficiently verbose. Also note that the default string rendering of these objects provides little information. Instead, these objects are also DynamicMBeans and are intended to provide rich access for specialized log4j appenders, renderers, and layouts.

      Supported API: true
      Parameters:
      elapsedSecondsThreshold - Minimum length of contexts in seconds to log
    • logActiveContexts

      @MBeanOperationImpact(0) void logActiveContexts(MethodContextMBeanFilter filter)
      Logs active contexts as MethodContextMBean objects. This is done via the wt.method.MethodContextMonitor.activeContext logger at INFO level verbosity except for contexts whose elapsed time exceeds ContextTimeWarnThreshold seconds, which are logged at WARN level verbosity. This operation will therefore produce no output if the level of this logger is not sufficiently verbose. Also note that the default string rendering of these objects provides little information. Instead, these objects are also DynamicMBeans and are intended to provide rich access for specialized log4j appenders, renderers, and layouts.

      Supported API: true
      Parameters:
      filter - Filter that determines which contexts to log; if null, all active contexts are logged
    • logRawStatistics

      @MBeanOperationImpact(0) void logRawStatistics()
      Log raw statistics plus the active context count (as an additional "ActiveContexts" item). This is done to the wt.servlet.MethodContextMonitor.rawStatistics logger at INFO level verbosity and will thus be ignored if this level of this logger is not sufficient verbose.

      Supported API: true