<?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:context="http://www.springframework.org/schema/context"
	xmlns:p="http://www.springframework.org/schema/p"
	xmlns:util="http://www.springframework.org/schema/util"
	xmlns:mvc="http://www.springframework.org/schema/mvc"
	xmlns:task="http://www.springframework.org/schema/task"
	xmlns:aop="http://www.springframework.org/schema/aop"
	xsi:schemaLocation="http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-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
		http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-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/context http://www.springframework.org/schema/context/spring-context-3.2.xsd">

	<bean id="propertyPlaceholderConfigurer"
		class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"
		p:ignoreUnresolvablePlaceholders="false" p:ignoreResourceNotFound="true">
		<property name="locations">
			<list>
				<value>arsnova.properties.example</value>
				<value>file:///etc/arsnova/arsnova.properties</value>
			</list>
		</property>
		<property name="fileEncoding" value="UTF-8" />
	</bean>

	<import resource="spring-security.xml" />

	<context:component-scan base-package="de.thm.arsnova.dao,de.thm.arsnova.events,de.thm.arsnova.security,de.thm.arsnova.services" />
	<context:annotation-config />

	<task:annotation-driven />

	<aop:aspectj-autoproxy>
		<aop:include name="authorizationAdviser" />
		<aop:include name="userSessionAspect" />
	</aop:aspectj-autoproxy>

	<bean id="socketServer" class="de.thm.arsnova.socket.ARSnovaSocketIOServer"
		init-method="startServer" destroy-method="stopServer" scope="singleton"
		p:portNumber="${socketio.port}" p:hostIp="${socketio.ip}" p:useSSL="${security.ssl}" p:keystore="${security.keystore}"
		p:storepass="${security.storepass}" />

	<bean id="authorizationAdviser" class="de.thm.arsnova.aop.AuthorizationAdviser">
		<property name="userService" ref="userService" />
	</bean>

	<bean id="userSessionAspect" class="de.thm.arsnova.aop.UserSessionAspect" />

	<bean id="mailSender" class="org.springframework.mail.javamail.JavaMailSenderImpl">
		<property name="host" value="${mail.host}"/>
	</bean>

	<!-- Example of connector client configuration -->
	<!-- Uncomment bean definition to activate connector -->
	<!-- bean id="connectorClient" scope="singleton" class="de.thm.arsnova.connector.client.ConnectorClientImpl">
		<property name="serviceLocation" value="${connector.uri}"></property>
		<property name="username" value="${connector.username}"></property>
		<property name="password" value="${connector.password}"></property>
	</bean -->
</beans>