<?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:p="http://www.springframework.org/schema/p"
  xmlns:aop="http://www.springframework.org/schema/aop"
  xmlns:context="http://www.springframework.org/schema/context"
  xmlns:jee="http://www.springframework.org/schema/jee"
  xmlns:tx="http://www.springframework.org/schema/tx"
  xmlns:util="http://www.springframework.org/schema/util"
  xmlns:mvc="http://www.springframework.org/schema/mvc"
  xmlns:task="http://www.springframework.org/schema/task"
  xsi:schemaLocation="
			http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.2.xsd
			http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
			http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd
			http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.2.xsd
			http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.2.xsd
			http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.2.xsd
			http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd
			http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.2.xsd
			">
	
	<context:property-placeholder location="/WEB-INF/properties/*.${eai.systemmode}.properties" />

	<!-- Enable @Scheduled annotation support for API Statistics Scheduler -->
	<task:annotation-driven />

	<import resource="mq/applicationContext-websphere.xml"/>
	<import resource="mq/applicationContext-activemq.xml"/>
	<import resource="applicationContext-jpa.xml"/>

	<!-- Framework DataSource  -->
	<bean id="dataSource" class="com.eactive.eai.common.util.JndiObjectFactoryBeanForElink">    		
		<property name="jndiName" value="${eai.jdbc.Name}"/>
	</bean>

	<bean id="applicationContextProvider"
		  class="com.eactive.eai.common.util.ApplicationContextProvider"/>
		  
	<bean id="customizingAppInitializer"
		  class="com.eactive.eai.custom.CustomizingAppInitializer"/>

	<!-- Framework Initializer  -->
	<beans profile="default">
		<bean id="appInitializer"
			class="com.eactive.eai.common.web.AppInitializer">
			<property name="dataSource" ref="dataSource" />
			<property name="instName" value="${inst.Name}" />
			<property name="instPort" value="${inst.Port:8080}" />
			<property name="scalable" value="${scalable:false}" />
			<property name="tableOwner" value="${eai.tableowner}" />
			<property name="systemMode" value="${eai.systemmode}" />
			<property name="routerUrl" value="${router.url:#{null}}" />
			<property name="rmiPort" value="${eai.rmiport}" />
			<property name="rmiServicePort" value="${eai.rmiserviceport}" />
			<property name="shutdownWaitSecs" value="${shutdown.wait.secs:60}" />
			<property name="shutdownWaitIntervalMs" value="${shutdown.wait.intervalms:500}" />
			<property name="eaiServerExtractor" value="${eai.server.extractor:[0,3],[0,3],[6]}" />
			<property name="jndiName" value="${eai.jdbc.Name}"/>
			<property name="systemType" value="${eai.systemtype}"/>
		</bean>
	</beans>

	<beans profile="GW">
		<bean id="appInitializer"
			class="com.eactive.eai.common.web.GWAppInitializer">
			<property name="dataSource" ref="dataSource" />
			<property name="instName" value="${inst.Name}" />
			<property name="instPort" value="${inst.Port:8080}" />
			<property name="scalable" value="${scalable:false}" />
			<property name="tableOwner" value="${eai.tableowner}" />
			<property name="systemMode" value="${eai.systemmode}" />
			<property name="routerUrl" value="${router.url:#{null}}" />
			<property name="rmiPort" value="${eai.rmiport}" />
			<property name="rmiServicePort" value="${eai.rmiserviceport}" />
			<property name="jndiName" value="${eai.jdbc.Name}"/>
		</bean>
	</beans>
	
	<beans profile="rolling">
		<import resource="applicationContext-jpa-rolling.xml"/>
	</beans>

	<!--  SMS  Logging -->
    <!-- 
    <bean name="manageSMSJob" class="org.springframework.scheduling.quartz.JobDetailFactoryBean">
        <property name="jobClass" value="com.eactive.eai.common.util.SMSLogUtil"/>
    </bean>
    <bean id="cronTrigger" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">
        <property name="jobDetail" ref="manageSMSJob"/>
        <property name="cronExpression" value="0 0 0 * * ?"/>
    </bean>
    <bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
        <property name="triggers">
            <list>
                <ref bean="cronTrigger"/>
            </list>
        </property>
        <property name="quartzProperties">
      	<props>
        	<prop key="org.quartz.scheduler.skipUpdateCheck">true</prop>
        </props>
        </property>
    </bean>
     -->
    <!--  SMS  Logging -->
</beans>
