<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:security="http://www.springframework.org/schema/security" xmlns:aop="http://www.springframework.org/schema/aop"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
       http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security.xsd
       http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd">

    <bean id="loginConfig" class="com.armedia.acm.web.model.LoginConfig" scope="refresh">
        <aop:scoped-proxy/>
    </bean>

    <bean id="loginWarningMessageService" class="com.armedia.acm.web.api.service.LoginWarningMessageServiceImpl">
        <property name="applicationMetaInfoService" ref="applicationMetaInfoService"/>
        <property name="loginConfig" ref="loginConfig"/>
    </bean>

    <bean id="applicationMetaInfoService" class="com.armedia.acm.web.api.service.ApplicationMetaInfoService"/>

    <bean id="corsFilter" class="com.armedia.acm.web.api.CorsFilter"/>
    <!--
    <bean id="asyncAplicationListenerExecutor"
          class="org.springframework.scheduling.concurrent.ConcurrentTaskExecutor">
        <property name="concurrentExecutor">
            <bean class="com.armedia.acm.web.api.MDCThreadPoolTaskExecutor">
                <property name="corePoolSize" value="5"/>
                <property name="maxPoolSize" value="10"/>
                 <property name="queueCapacity" value="100" />
                <property name="allowCoreThreadTimeOut" value="true"/>
                <property name="waitForTasksToCompleteOnShutdown" value="true"/>
            </bean>
        </property>
    </bean>
    
    <bean class="com.armedia.acm.web.api.DistributiveEventMulticaster" id="applicationEventMulticaster">
        <property name="syncEventMulticaster">
            <bean class="org.springframework.context.event.SimpleApplicationEventMulticaster" />
        </property>
        <property name="asyncEventMulticaster">
            <bean class="org.springframework.context.event.SimpleApplicationEventMulticaster">
                <property name="taskExecutor" ref="asyncAplicationListenerExecutor" />
            </bean>
        </property>
    </bean>
    -->

    <!-- data access control -->
    <security:global-method-security pre-post-annotations="enabled">
        <security:expression-handler ref="serviceExpressionHandler"/>
    </security:global-method-security>

    <bean id="serviceExpressionHandler"
        class="org.springframework.security.access.expression.method.DefaultMethodSecurityExpressionHandler">
        <property name="permissionEvaluator" ref="arkPermissionEvaluator"/>
    </bean>

</beans>