Search in sources :

Example 1 with TicketRegistryProperties

use of org.apereo.cas.configuration.model.core.ticket.registry.TicketRegistryProperties in project cas by apereo.

the class JpaTicketRegistryConfiguration method lockingStrategy.

@Bean
public LockingStrategy lockingStrategy() {
    final TicketRegistryProperties registry = casProperties.getTicket().getRegistry();
    final String uniqueId = StringUtils.defaultIfEmpty(casProperties.getHost().getName(), InetAddressUtils.getCasServerHostName());
    return new JpaLockingStrategy("cas-ticket-registry-cleaner", uniqueId, Beans.newDuration(registry.getJpa().getJpaLockingTimeout()).getSeconds());
}
Also used : JpaLockingStrategy(org.apereo.cas.ticket.registry.support.JpaLockingStrategy) TicketRegistryProperties(org.apereo.cas.configuration.model.core.ticket.registry.TicketRegistryProperties) JpaTicketRegistryProperties(org.apereo.cas.configuration.model.support.jpa.ticketregistry.JpaTicketRegistryProperties) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean) LocalContainerEntityManagerFactoryBean(org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean)

Aggregations

TicketRegistryProperties (org.apereo.cas.configuration.model.core.ticket.registry.TicketRegistryProperties)1 JpaTicketRegistryProperties (org.apereo.cas.configuration.model.support.jpa.ticketregistry.JpaTicketRegistryProperties)1 JpaLockingStrategy (org.apereo.cas.ticket.registry.support.JpaLockingStrategy)1 ConditionalOnMissingBean (org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean)1 Bean (org.springframework.context.annotation.Bean)1 LocalContainerEntityManagerFactoryBean (org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean)1