Search in sources :

Example 1 with MemcachedHealthIndicator

use of org.apereo.cas.monitor.MemcachedHealthIndicator in project cas by apereo.

the class MemcachedMonitorConfiguration method memcachedHealthIndicator.

@Bean
public HealthIndicator memcachedHealthIndicator() {
    final MonitorProperties.Memcached memcached = casProperties.getMonitor().getMemcached();
    final MemcachedPooledClientConnectionFactory factory = new MemcachedPooledClientConnectionFactory(memcached, memcachedMonitorTranscoder());
    final ObjectPool<MemcachedClientIF> pool = new GenericObjectPool<>(factory);
    return new MemcachedHealthIndicator(pool, casProperties);
}
Also used : MemcachedPooledClientConnectionFactory(org.apereo.cas.memcached.MemcachedPooledClientConnectionFactory) MemcachedClientIF(net.spy.memcached.MemcachedClientIF) GenericObjectPool(org.apache.commons.pool2.impl.GenericObjectPool) MemcachedHealthIndicator(org.apereo.cas.monitor.MemcachedHealthIndicator) MonitorProperties(org.apereo.cas.configuration.model.core.monitor.MonitorProperties) Bean(org.springframework.context.annotation.Bean)

Aggregations

MemcachedClientIF (net.spy.memcached.MemcachedClientIF)1 GenericObjectPool (org.apache.commons.pool2.impl.GenericObjectPool)1 MonitorProperties (org.apereo.cas.configuration.model.core.monitor.MonitorProperties)1 MemcachedPooledClientConnectionFactory (org.apereo.cas.memcached.MemcachedPooledClientConnectionFactory)1 MemcachedHealthIndicator (org.apereo.cas.monitor.MemcachedHealthIndicator)1 Bean (org.springframework.context.annotation.Bean)1