use of org.apereo.cas.ticket.registry.CachingTicketRegistry in project cas by apereo.
the class CasCoreTicketsConfiguration method ticketRegistry.
@ConditionalOnMissingBean(name = "ticketRegistry")
@Bean
public TicketRegistry ticketRegistry() {
LOGGER.warn("Runtime memory is used as the persistence storage for retrieving and managing tickets. " + "Tickets that are issued during runtime will be LOST when the web server is restarted. This MAY impact SSO functionality.");
final TicketRegistryProperties.InMemory mem = casProperties.getTicket().getRegistry().getInMemory();
final CipherExecutor cipher = CoreTicketUtils.newTicketRegistryCipherExecutor(mem.getCrypto(), "inMemory");
if (mem.isCache()) {
final LogoutManager logoutManager = applicationContext.getBean("logoutManager", LogoutManager.class);
return new CachingTicketRegistry(cipher, logoutManager);
}
return new DefaultTicketRegistry(mem.getInitialCapacity(), mem.getLoadFactor(), mem.getConcurrency(), cipher);
}
Aggregations