Search in sources :

Example 1 with JMXManager

use of org.olat.core.commons.services.jmx.JMXManager in project OpenOLAT by OpenOLAT.

the class DatabaseStatsManager method getConnectionInfos.

public DatabaseConnectionVO getConnectionInfos() {
    DatabaseConnectionVO vo = new DatabaseConnectionVO();
    vo.setActiveConnectionCount(0);
    vo.setCurrentConnectionCount(0);
    try {
        JMXManager jmxManager = CoreSpringFactory.getImpl(JMXManager.class);
        MBeanServer mBeanServer = jmxManager.getMBeanServer();
        boolean found = searchHikariDataSources(mBeanServer, vo) || searchTomcatDataSources(mBeanServer, vo) || searchC3P0DataSources(mBeanServer, vo);
        if (log.isDebug()) {
            log.debug("MBean for datasource found: " + found);
        }
    } catch (Exception e) {
        log.error("", e);
    }
    return vo;
}
Also used : JMXManager(org.olat.core.commons.services.jmx.JMXManager) DatabaseConnectionVO(org.olat.admin.sysinfo.model.DatabaseConnectionVO) MBeanServer(javax.management.MBeanServer)

Example 2 with JMXManager

use of org.olat.core.commons.services.jmx.JMXManager in project openolat by klemens.

the class DatabaseStatsManager method getConnectionInfos.

public DatabaseConnectionVO getConnectionInfos() {
    DatabaseConnectionVO vo = new DatabaseConnectionVO();
    vo.setActiveConnectionCount(0);
    vo.setCurrentConnectionCount(0);
    try {
        JMXManager jmxManager = CoreSpringFactory.getImpl(JMXManager.class);
        MBeanServer mBeanServer = jmxManager.getMBeanServer();
        boolean found = searchHikariDataSources(mBeanServer, vo) || searchTomcatDataSources(mBeanServer, vo) || searchC3P0DataSources(mBeanServer, vo);
        if (log.isDebug()) {
            log.debug("MBean for datasource found: " + found);
        }
    } catch (Exception e) {
        log.error("", e);
    }
    return vo;
}
Also used : JMXManager(org.olat.core.commons.services.jmx.JMXManager) DatabaseConnectionVO(org.olat.admin.sysinfo.model.DatabaseConnectionVO) MBeanServer(javax.management.MBeanServer)

Aggregations

MBeanServer (javax.management.MBeanServer)2 DatabaseConnectionVO (org.olat.admin.sysinfo.model.DatabaseConnectionVO)2 JMXManager (org.olat.core.commons.services.jmx.JMXManager)2