<?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:lang="http://www.springframework.org/schema/lang"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
                           http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang-2.0.xsd">
	
	<bean id="placeholderConfig" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
	    <property name="location" value="/WEB-INF/red5-web.properties" />
	</bean>
	
	<bean id="web.context" class="org.red5.server.Context" autowire="byType" />
	
	<bean id="web.scope" class="org.red5.server.WebScope"
		 init-method="register">
		<property name="server" ref="red5.server" />
		<property name="parent" ref="global.scope" />
		<property name="context" ref="web.context" />
		<property name="handler" ref="web.handler" />
		<property name="contextPath" value="${webapp.contextPath}" />
		<property name="virtualHosts" value="${webapp.virtualHosts}" />
	</bean>
	
	<bean id="web.handler" class="com.tenchong.tclive.chat.app.TCLiveChatApp" >
		<property name="domain">
			<value>${webapp.domain}</value>
		</property>
		<property name="saveChatFlag">
			<value>${webapp.saveChatFlag}</value>
		</property>
		<property name="aclList">
            <list>
                <!-- 允许连接的SWFURL位置 -->
                 <!--
                <value>http://localhost:5080/.*</value>
                -->
            </list>
        </property>
    </bean>
    
	<bean id="tCRed5SequenceCommand" class="com.tenchong.red5.lib.flash.TCRed5SequenceCommand" />
	<bean id="tCRed5Listener" class="com.tenchong.red5.lib.flash.TCRed5Listener" >
		<property name="commandMap">
		    <map>
		        <entry key="messageEvent">
					 <ref bean="messageCommand" />
				</entry>
				<entry key="changeNicknameEvent">
					 <ref bean="changeNicknameCommand" />
				</entry>
				<entry key="changeModeEvent">
					 <ref bean="changeModeCommand" />
				</entry>
				<entry key="autoMicEvent">
					 <ref bean="autoMicCommand" />
				</entry>
				<entry key="queueMicEvent">
					 <ref bean="queueMicCommand" />
				</entry>
				<entry key="onMicUpEvent">
					 <ref bean="onMicCommand" />
				</entry>
				<entry key="onMicDownEvent">
					 <ref bean="onMicCommand" />
				</entry>
				<entry key="changeDeviceEvent">
					 <ref bean="changeDeviceCommand" />
				</entry>
				<entry key="publishVideoEvent">
					 <ref bean="publishCommand" />
				</entry>
				<entry key="publishAudioEvent">
					 <ref bean="publishCommand" />
				</entry>
				<entry key="controlScreenCapEvent">
					 <ref bean="controlScreenCapCommand" />
				</entry>
				<entry key="allowMessageEvent">
					 <ref bean="limitMessageCommand" />
				</entry>
				<entry key="forbidMessageEvent">
					 <ref bean="limitMessageCommand" />
				</entry>
				<entry key="limitVideoEvent">
					 <ref bean="limitDeviceCommand" />
				</entry>
				<entry key="limitAudioEvent">
					 <ref bean="limitDeviceCommand" />
				</entry>
				<entry key="limitAllVideoEvent">
					 <ref bean="limitDeviceCommand" />
				</entry>
				<entry key="limitAllAudioEvent">
					 <ref bean="limitDeviceCommand" />
				</entry>
				<entry key="kickEvent">
					 <ref bean="kickCommand" />
				</entry>
				<entry key="lockEvent">
					 <ref bean="lockCommand" />
				</entry>
				<entry key="inviteEvent">
					 <ref bean="inviteCommand" />
				</entry>
				<entry key="dissolveEvent">
					 <ref bean="dissolveCommand" />
				</entry>
				<entry key="addShareFileEvent">
					 <ref bean="shareFileCommand" />
				</entry>
				<entry key="removeShareFileEvent">
					 <ref bean="shareFileCommand" />
				</entry>
				<entry key="synchEvent">
					 <ref bean="synchCommand" />
				</entry>
				<entry key="synchOperateEvent">
					 <ref bean="synchOperateCommand" />
				</entry>
				<entry key="whiteBoardShapeChangeEvent">
					 <ref bean="whiteBoardCommand" />
				</entry>	
		    </map>
	    </property>
	</bean>
	<bean id="messageCommand" class="com.tenchong.tclive.chat.command.MessageCommand"/>
	<bean id="autoMicCommand" class="com.tenchong.tclive.chat.command.AutoMicCommand"/>
	<bean id="changeNicknameCommand" class="com.tenchong.tclive.chat.command.ChangeNicknameCommand"/>
	<bean id="changeModeCommand" class="com.tenchong.tclive.chat.command.ChangeModeCommand"/>
	<bean id="queueMicCommand" class="com.tenchong.tclive.chat.command.QueueMicCommand"/>
	<bean id="onMicCommand" class="com.tenchong.tclive.chat.command.OnMicCommand"/>
	<bean id="changeDeviceCommand" class="com.tenchong.tclive.chat.command.ChangeDeviceCommand"/>
	<bean id="publishCommand" class="com.tenchong.tclive.chat.command.PublishCommand"/>
	<bean id="controlScreenCapCommand" class="com.tenchong.tclive.chat.command.ControlScreenCapCommand"/>
	<bean id="kickCommand" class="com.tenchong.tclive.chat.command.KickCommand"/>
	<bean id="lockCommand" class="com.tenchong.tclive.chat.command.LockCommand"/>
	<bean id="inviteCommand" class="com.tenchong.tclive.chat.command.InviteCommand"/>
	<bean id="dissolveCommand" class="com.tenchong.tclive.chat.command.DissolveCommand"/>
	<bean id="limitDeviceCommand" class="com.tenchong.tclive.chat.command.LimitDeviceCommand"/>
	<bean id="limitMessageCommand" class="com.tenchong.tclive.chat.command.LimitMessageCommand"/>
	<bean id="shareFileCommand" class="com.tenchong.tclive.chat.command.ShareFileCommand"/>
	<bean id="synchCommand" class="com.tenchong.tclive.chat.command.SynchCommand"/>
	<bean id="synchOperateCommand" class="com.tenchong.tclive.chat.command.SynchOperateCommand"/>
	<bean id="whiteBoardCommand" class="com.tenchong.tclive.chat.command.WhiteBoardCommand"/>
</beans>