com.jamonapi.Monitor.getListenerType()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(4.2k)|赞(0)|评价(0)|浏览(92)

本文整理了Java中com.jamonapi.Monitor.getListenerType()方法的一些代码示例,展示了Monitor.getListenerType()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Monitor.getListenerType()方法的具体详情如下:
包路径:com.jamonapi.Monitor
类名称:Monitor
方法名:getListenerType

Monitor.getListenerType介绍

[英]pass in a valid listener type (min, max, value, maxactive) and get the ListenerType
[中]传入有效的侦听器类型(min、max、value、maxactive)并获取ListenerType

代码示例

代码示例来源:origin: net.sf.patterntesting/patterntesting-rt

/**
 * Gets the listener type.
 *
 * @param listenerType the listener type
 *
 * @return listener type
 *
 * @see com.jamonapi.Monitor#getListenerType(java.lang.String)
 */
public ListenerType getListenerType(String listenerType) {
  return monitor.getListenerType(listenerType);
}

代码示例来源:origin: org.patterntesting/patterntesting-rt

/**
 * Gets the listener type.
 *
 * @param listenerType
 *            the listener type
 *
 * @return listener type
 *
 * @see com.jamonapi.Monitor#getListenerType(java.lang.String)
 */
public ListenerType getListenerType(final String listenerType) {
  return monitor.getListenerType(listenerType);
}

代码示例来源:origin: stevensouza/jamonapi

/** Introduced as a way to remove listeners that allows for lazy initialization saving a fair amount of memory.  Note
 * a future enhancement would be to delete the Listeners object when all listeners are removed.
 * 
 * @since 2.71
 * 
 */
public void removeListener(String listenerTypeName, String listenerName) {
  synchronized (monData) {
    if (!monData.hasListeners()) // return if there is nothing to remove
      return;
    ListenerType type=getListenerType(listenerTypeName);
    if (type!=null)
      type.removeListener(listenerName);
  }
}

代码示例来源:origin: stevensouza/jamonapi

/** Returns true if this listenertype ('max', 'min', 'value', 'maxactive') has any listeners at all
 * 
 * @param listenerTypeName
 * @return boolean
 */
public boolean hasListeners(String listenerTypeName) {
  synchronized (monData) {
    if (!monData.hasListeners())
      return false;
    ListenerType type=getListenerType(listenerTypeName);
    if (type==null)
      return false;
    else
      return type.hasListeners();
  }
}

代码示例来源:origin: stevensouza/jamonapi

/** Introduced as a way to check for listeners that allows for lazy initialization saving a fair amount of memory.  Note
 * a future enhancement would be to delete the Listeners object when all listeners are removed.
 * 
 * @since 2.71
 */
public boolean hasListener(String listenerTypeName, String listenerName) {
  synchronized (monData) {
    if (!monData.hasListeners())
      return false;
    ListenerType type=getListenerType(listenerTypeName);
    if (type==null)
      return false;
    else
      return type.hasListener(listenerName);
  }
}

代码示例来源:origin: stevensouza/jamonapi

private JAMonBufferListener getExceptionBufferListener() {
  if (MonitorFactory.exists(MonitorFactory.EXCEPTIONS_LABEL, EXCEPTION)) {
    Monitor mon = MonitorFactory.getMonitor(MonitorFactory.EXCEPTIONS_LABEL, EXCEPTION);
    if (mon.hasListener("value", "FIFOBuffer")) {
      JAMonListener bufferListener = mon.getListenerType("value").getListener("FIFOBuffer");
      if (bufferListener instanceof JAMonBufferListener) {
        return (JAMonBufferListener) bufferListener;
      }
    }
  }
  return null;
}

代码示例来源:origin: stevensouza/jamonapi

@Override
public String getMostRecentException() {
  if (!MonitorFactory.exists(LABEL, UNITS)) {
    return "No exceptions have been thrown";
  }
  if (!MonitorFactory.getMonitor(LABEL, UNITS).hasListener("value", "FIFOBuffer")) {
    return "Exception Stacktrace tracking is not enabled.";
  }
  JAMonListener listener = MonitorFactory.getMonitor(LABEL, UNITS).getListenerType("value").getListener("FIFOBuffer");
  if (!(listener instanceof JAMonBufferListener) || ((JAMonBufferListener) listener).isEmpty()) {
    return "There are no stacktraces";
  }
  return getMostRecentStacktrace((JAMonBufferListener) listener);
}

代码示例来源:origin: com.jamonapi/com.springsource.com.jamonapi

delme.getListenerType("max").addListener(jbl);
MonitorFactory.getMonitor("/jamon/jamonadmin.jsp","ms.").add(100);
jbl=(JAMonBufferListener)MonitorFactory.getMonitor("/jamon/jamonadmin.jsp","ms.").getListenerType("max").getListener();
Object[][] data=jbl.getData();

代码示例来源:origin: stevensouza/jamonapi

delme.addListener("max", jbl);
MonitorFactory.getMonitor("/jamon/jamonadmin.jsp","ms.").add(100);
jbl=(JAMonBufferListener)MonitorFactory.getMonitor("/jamon/jamonadmin.jsp","ms.").getListenerType("max").getListener();
Object[][] data=jbl.getDetailData().getData();

相关文章