<?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:util="http://www.springframework.org/schema/util"
	xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd">

	<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
		<property name="systemPropertiesModeName" value="SYSTEM_PROPERTIES_MODE_OVERRIDE" />
	</bean>

	<bean id="simpleEchoDataHandler" class="gov.va.med.cds.socket.server.MinaSimpleEchoDataHandler" />

	<bean id="minaMllpCodecFactory" class="gov.va.med.cds.socket.server.handler.MinaMllpCodecFactory" />

	<bean id="minaMllpProtocolFilter" class="org.apache.mina.filter.codec.ProtocolCodecFilter">
		<constructor-arg index="0" ref="minaMllpCodecFactory" />
	</bean>

	<util:constant id="defaultLogLevel" static-field="org.apache.mina.filter.logging.LogLevel.INFO" />

	<bean id="loggingFilter" class="org.apache.mina.filter.logging.LoggingFilter" />

	<bean id="filterChainBuilder" class="org.apache.mina.core.filterchain.DefaultIoFilterChainBuilder">
		<property name="filters">
			<map>
				<entry key="minaMllpProtocolFilter" value-ref="minaMllpProtocolFilter" />
				<entry key="loggingFilter" value-ref="loggingFilter" />
			</map>
		</property>
	</bean>

	<bean id="minaServer" class="org.apache.mina.transport.socket.nio.NioSocketAcceptor" destroy-method="unbind">
		<property name="handler" ref="simpleEchoDataHandler" />
		<property name="filterChainBuilder" ref="filterChainBuilder" />
	</bean>

	<bean id="acceptorMBean" class="org.apache.mina.integration.jmx.IoServiceMBean">
		<constructor-arg ref="minaServer" />
	</bean>

	<bean id="socketAddress" class="java.net.InetSocketAddress">
		<constructor-arg>
			<bean class="java.lang.Integer" factory-method="parseInt">
				<constructor-arg type="java.lang.String" value="5002" />
			</bean>
		</constructor-arg>
	</bean>

	<bean id="minaServerManager" class="gov.va.med.cds.socket.server.MinaServerManager" init-method="init">
		<property name="minaServer" ref="minaServer" />
		<property name="socketAddress" ref="socketAddress" />
		<property name="acceptorMBean" ref="acceptorMBean" />
		<property name="defaultLogLevel" ref="defaultLogLevel" />
	</bean>

</beans>