Search in sources :

Example 16 with MonitorElementInstance

use of com.creditease.monitor.captureframework.spi.MonitorElementInstance in project uavstack by uavorg.

the class StandardMonitor method doPreStore.

@Override
public void doPreStore() {
    MonitorRepository cmr = getRepository();
    MonitorElement[] elems = cmr.getElements();
    for (MonitorElement elem : elems) {
        MonitorElemCapHandler caphandler = selectHandler(elem.getCapClass());
        if (caphandler == null)
            continue;
        MonitorElementInstance[] instances = elem.getInstances();
        for (MonitorElementInstance instance : instances) {
            try {
                caphandler.preStore(instance);
            } catch (Exception e) {
                log.error("captureHandler[" + caphandler.getClass().getName() + "] execution [preStore] fails ", e);
            // ignore
            }
        }
    }
}
Also used : MonitorElementInstance(com.creditease.monitor.captureframework.spi.MonitorElementInstance) MonitorRepository(com.creditease.monitor.captureframework.spi.MonitorRepository) StandardMonitorRepository(com.creditease.monitor.captureframework.repository.StandardMonitorRepository) MonitorElemCapHandler(com.creditease.monitor.captureframework.spi.MonitorElemCapHandler) MonitorElement(com.creditease.monitor.captureframework.spi.MonitorElement)

Aggregations

MonitorElementInstance (com.creditease.monitor.captureframework.spi.MonitorElementInstance)16 DataSource (javax.sql.DataSource)4 DruidDataSource (com.alibaba.druid.pool.DruidDataSource)1 StandardMonitorRepository (com.creditease.monitor.captureframework.repository.StandardMonitorRepository)1 MonitorElemCapHandler (com.creditease.monitor.captureframework.spi.MonitorElemCapHandler)1 MonitorElement (com.creditease.monitor.captureframework.spi.MonitorElement)1 MonitorRepository (com.creditease.monitor.captureframework.spi.MonitorRepository)1 ComboPooledDataSource (com.mchange.v2.c3p0.ComboPooledDataSource)1 Set (java.util.Set)1 HttpServletRequest (javax.servlet.http.HttpServletRequest)1