org.opennms.netmgt.events.api.annotations.EventHandler类的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(8.2k)|赞(0)|评价(0)|浏览(86)

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

EventHandler介绍

暂无

代码示例

代码示例来源:origin: OpenNMS/opennms

/**
 * <p>handleServiceDeleted</p>
 *
 * @param event a {@link org.opennms.netmgt.xml.event.Event} object.
 */
@EventHandler(uei=EventConstants.SERVICE_DELETED_EVENT_UEI)
public void handleServiceDeleted(final Event event) {
  m_pollerBackEnd.configurationUpdated();
}

代码示例来源:origin: org.opennms.features.events/org.opennms.features.events.api

private void populateUeiToHandlerMap() {
  Method[] methods = m_annotatedListener.getClass().getMethods();
  
  for(Method method : methods) {
    EventHandler handlerInfo = AnnotationUtils.findAnnotation(method, EventHandler.class);
    if (handlerInfo != null) {
      String singleUei = handlerInfo.uei();
      if (singleUei != null && !"".equals(singleUei)) {
        validateMethodAsEventHandler(method);
        Assert.state(!m_ueiToHandlerMap.containsKey(singleUei), "Cannot define method "+method+" as a handler for event "+singleUei+" since "+m_ueiToHandlerMap.get(singleUei)+" is already defined as a handler");
        m_ueiToHandlerMap.put(singleUei, method);
      }
      String[] ueis = handlerInfo.ueis();
      if (ueis != null && ueis.length > 0) {
        validateMethodAsEventHandler(method);
        for (String uei : ueis) {
          Assert.state(!m_ueiToHandlerMap.containsKey(uei), "Cannot define method "+method+" as a handler for event "+uei+" since "+m_ueiToHandlerMap.get(uei)+" is already defined as a handler");
          m_ueiToHandlerMap.put(uei, method);
        }
      }
    }
  }
  Assert.state(!m_ueiToHandlerMap.isEmpty(), "annotatedListener must have public EventHandler annotated methods");
}

代码示例来源:origin: OpenNMS/opennms

/**
 * <p>handleServiceUnmanaged</p>
 *
 * @param event a {@link org.opennms.netmgt.xml.event.Event} object.
 */
@EventHandler(uei=EventConstants.SERVICE_UNMANAGED_EVENT_UEI)
public void handleServiceUnmanaged(final Event event) {
  m_pollerBackEnd.configurationUpdated();
}

代码示例来源:origin: OpenNMS/opennms

private void populateUeiToHandlerMap() {
  Method[] methods = m_annotatedListener.getClass().getMethods();
  
  for(Method method : methods) {
    EventHandler handlerInfo = AnnotationUtils.findAnnotation(method, EventHandler.class);
    if (handlerInfo != null) {
      String singleUei = handlerInfo.uei();
      if (singleUei != null && !"".equals(singleUei)) {
        validateMethodAsEventHandler(method);
        Assert.state(!m_ueiToHandlerMap.containsKey(singleUei), "Cannot define method "+method+" as a handler for event "+singleUei+" since "+m_ueiToHandlerMap.get(singleUei)+" is already defined as a handler");
        m_ueiToHandlerMap.put(singleUei, method);
      }
      String[] ueis = handlerInfo.ueis();
      if (ueis != null && ueis.length > 0) {
        validateMethodAsEventHandler(method);
        for (String uei : ueis) {
          Assert.state(!m_ueiToHandlerMap.containsKey(uei), "Cannot define method "+method+" as a handler for event "+uei+" since "+m_ueiToHandlerMap.get(uei)+" is already defined as a handler");
          m_ueiToHandlerMap.put(uei, method);
        }
      }
    }
  }
  Assert.state(!m_ueiToHandlerMap.isEmpty(), "annotatedListener must have public EventHandler annotated methods");
}

代码示例来源:origin: OpenNMS/opennms

/**
 * <p>handleNodeDeleted</p>
 *
 * @param event a {@link org.opennms.netmgt.xml.event.Event} object.
 */
@EventHandler(uei=EventConstants.NODE_DELETED_EVENT_UEI)
public void handleNodeDeleted(final Event event) {
  m_pollerBackEnd.configurationUpdated();
}

代码示例来源:origin: OpenNMS/opennms

/**
 * <p>handleDiscoveryPause</p>
 *
 * @param event a {@link org.opennms.netmgt.xml.event.Event} object.
 */
@EventHandler(uei=EventConstants.DISC_PAUSE_EVENT_UEI)
public void handleDiscoveryPause(Event event) {
  pause();
}

代码示例来源:origin: org.opennms.features.poller/org.opennms.features.poller.remote

/**
 * <p>handleNodeDeleted</p>
 *
 * @param event a {@link org.opennms.netmgt.xml.event.Event} object.
 */
@EventHandler(uei=EventConstants.NODE_DELETED_EVENT_UEI)
public void handleNodeDeleted(final Event event) {
  m_pollerBackEnd.configurationUpdated();
}

代码示例来源:origin: org.opennms.features/org.opennms.features.discovery

/**
 * <p>handleDiscoveryResume</p>
 *
 * @param event a {@link org.opennms.netmgt.xml.event.Event} object.
 */
@EventHandler(uei=EventConstants.DISC_RESUME_EVENT_UEI)
public void handleDiscoveryResume(Event event) {
  resume();
}

代码示例来源:origin: OpenNMS/opennms

/**
 * <p>handleNodeGainedInterface</p>
 *
 * @param event a {@link org.opennms.netmgt.xml.event.Event} object.
 */
@EventHandler(uei=EventConstants.NODE_GAINED_INTERFACE_EVENT_UEI)
public void handleNodeGainedInterface(final Event event) {
  m_pollerBackEnd.configurationUpdated();
}

代码示例来源:origin: OpenNMS/opennms

/**
 * <p>handleNodeGainedService</p>
 *
 * @param event a {@link org.opennms.netmgt.xml.event.Event} object.
 */
@EventHandler(uei=EventConstants.NODE_GAINED_SERVICE_EVENT_UEI)
public void handleNodeGainedService(final Event event) {
  m_pollerBackEnd.configurationUpdated();
}

代码示例来源:origin: OpenNMS/opennms

/**
 * <p>handleNodeConfigChanged</p>
 *
 * @param event a {@link org.opennms.netmgt.xml.event.Event} object.
 */
@EventHandler(uei=EventConstants.NODE_CONFIG_CHANGE_UEI)
public void handleNodeConfigChanged(final Event event) {
  m_pollerBackEnd.configurationUpdated();
}

代码示例来源:origin: OpenNMS/opennms

/**
 * <p>handleNodeInfoChanged</p>
 *
 * @param event a {@link org.opennms.netmgt.xml.event.Event} object.
 */
@EventHandler(uei=EventConstants.NODE_INFO_CHANGED_EVENT_UEI)
public void handleNodeInfoChanged(final Event event) {
  m_pollerBackEnd.configurationUpdated();
}

代码示例来源:origin: OpenNMS/opennms

/**
 * <p>handleInterfaceDeleted</p>
 *
 * @param event a {@link org.opennms.netmgt.xml.event.Event} object.
 */
@EventHandler(uei=EventConstants.INTERFACE_DELETED_EVENT_UEI)
public void handleInterfaceDeleted(final Event event) {
  m_pollerBackEnd.configurationUpdated();
}

代码示例来源:origin: OpenNMS/opennms

/**
 * <p>handleDiscoveryConfigurationChanged</p>
 *
 * @param event a {@link org.opennms.netmgt.xml.event.Event} object.
 */
@EventHandler(uei=EventConstants.DISCOVERYCONFIG_CHANGED_EVENT_UEI)
public void handleDiscoveryConfigurationChanged(Event event) {
  LOG.info("handleDiscoveryConfigurationChanged: handling message that a change to configuration happened...");
  reloadAndReStart();
}

代码示例来源:origin: org.opennms.features.poller/org.opennms.features.poller.remote

/**
 * <p>handleNodeGainedInterface</p>
 *
 * @param event a {@link org.opennms.netmgt.xml.event.Event} object.
 */
@EventHandler(uei=EventConstants.NODE_GAINED_INTERFACE_EVENT_UEI)
public void handleNodeGainedInterface(final Event event) {
  m_pollerBackEnd.configurationUpdated();
}

代码示例来源:origin: org.opennms.features.poller/org.opennms.features.poller.remote

/**
 * <p>handleNodeInfoChanged</p>
 *
 * @param event a {@link org.opennms.netmgt.xml.event.Event} object.
 */
@EventHandler(uei=EventConstants.NODE_INFO_CHANGED_EVENT_UEI)
public void handleNodeInfoChanged(final Event event) {
  m_pollerBackEnd.configurationUpdated();
}

代码示例来源:origin: org.opennms.features/org.opennms.features.discovery

/**
 * <p>handleDiscoveryConfigurationChanged</p>
 *
 * @param event a {@link org.opennms.netmgt.xml.event.Event} object.
 */
@EventHandler(uei=EventConstants.DISCOVERYCONFIG_CHANGED_EVENT_UEI)
public void handleDiscoveryConfigurationChanged(Event event) {
  LOG.info("handleDiscoveryConfigurationChanged: handling message that a change to configuration happened...");
  reloadAndReStart();
}

代码示例来源:origin: org.opennms.features/org.opennms.features.discovery

/**
 * <p>handleDiscoveryPause</p>
 *
 * @param event a {@link org.opennms.netmgt.xml.event.Event} object.
 */
@EventHandler(uei=EventConstants.DISC_PAUSE_EVENT_UEI)
public void handleDiscoveryPause(Event event) {
  pause();
}

代码示例来源:origin: org.opennms/org.opennms.features.discovery

/**
 * <p>handleDiscoveryResume</p>
 *
 * @param event a {@link org.opennms.netmgt.xml.event.Event} object.
 */
@EventHandler(uei=EventConstants.DISC_RESUME_EVENT_UEI)
public void handleDiscoveryResume(Event event) {
  try {
    resume();
  } catch (IllegalStateException ex) {
  }
}

代码示例来源:origin: OpenNMS/opennms

/**
 * <p>handleSnmpPollerConfigChanged</p>
 *
 * @param event a {@link org.opennms.netmgt.xml.event.Event} object.
 */
@EventHandler(uei=EventConstants.SNMPPOLLERCONFIG_CHANGED_EVENT_UEI)
public void handleSnmpPollerConfigChanged(final Event event) {
  m_pollerBackEnd.configurationUpdated();
}

相关文章

EventHandler类方法