Search in sources :

Example 1 with ComponentSerializationPlanConfigurer

use of org.apereo.cas.util.serialization.ComponentSerializationPlanConfigurer in project cas by apereo.

the class CasCoreUtilSerializationConfiguration method componentSerializationPlan.

@ConditionalOnMissingBean(name = "componentSerializationPlan")
@Bean
@RefreshScope(proxyMode = ScopedProxyMode.DEFAULT)
public ComponentSerializationPlan componentSerializationPlan(final ObjectProvider<List<ComponentSerializationPlanConfigurer>> configurers) {
    val plan = new DefaultComponentSerializationPlan();
    plan.registerSerializableClass(TriStateBoolean.class);
    configurers.ifAvailable(cfgs -> cfgs.forEach(c -> {
        LOGGER.trace("Configuring component serialization plan [{}]", c.getName());
        c.configureComponentSerializationPlan(plan);
    }));
    return plan;
}
Also used : lombok.val(lombok.val) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) lombok.val(lombok.val) ScopedProxyMode(org.springframework.context.annotation.ScopedProxyMode) ComponentSerializationPlan(org.apereo.cas.util.serialization.ComponentSerializationPlan) DefaultComponentSerializationPlan(org.apereo.cas.util.serialization.DefaultComponentSerializationPlan) RefreshScope(org.springframework.cloud.context.config.annotation.RefreshScope) Configuration(org.springframework.context.annotation.Configuration) Slf4j(lombok.extern.slf4j.Slf4j) ObjectProvider(org.springframework.beans.factory.ObjectProvider) List(java.util.List) TriStateBoolean(org.apereo.cas.util.model.TriStateBoolean) Bean(org.springframework.context.annotation.Bean) ComponentSerializationPlanConfigurer(org.apereo.cas.util.serialization.ComponentSerializationPlanConfigurer) DefaultComponentSerializationPlan(org.apereo.cas.util.serialization.DefaultComponentSerializationPlan) RefreshScope(org.springframework.cloud.context.config.annotation.RefreshScope) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean)

Aggregations

List (java.util.List)1 Slf4j (lombok.extern.slf4j.Slf4j)1 lombok.val (lombok.val)1 TriStateBoolean (org.apereo.cas.util.model.TriStateBoolean)1 ComponentSerializationPlan (org.apereo.cas.util.serialization.ComponentSerializationPlan)1 ComponentSerializationPlanConfigurer (org.apereo.cas.util.serialization.ComponentSerializationPlanConfigurer)1 DefaultComponentSerializationPlan (org.apereo.cas.util.serialization.DefaultComponentSerializationPlan)1 ObjectProvider (org.springframework.beans.factory.ObjectProvider)1 ConditionalOnMissingBean (org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean)1 RefreshScope (org.springframework.cloud.context.config.annotation.RefreshScope)1 Bean (org.springframework.context.annotation.Bean)1 Configuration (org.springframework.context.annotation.Configuration)1 ScopedProxyMode (org.springframework.context.annotation.ScopedProxyMode)1