<?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 class="org.springframework.scripting.support.ScriptFactoryPostProcessor"/>

	<bean id="web.handler" class="org.red5.server.script.rhino.RhinoScriptFactory">
		<constructor-arg index="0" value="classpath:applications/main.js"/>
		<constructor-arg index="1">
			<list>
     			<value>org.red5.server.api.IScopeHandler</value>
     			<value>org.red5.server.adapter.IApplication</value>
  			</list>
		</constructor-arg>
		<constructor-arg index="2">
   			<value>org.red5.server.adapter.ApplicationAdapter</value>
		</constructor-arg>
	</bean>
<!-- 
	<bean id="web.handler" class="org.red5.server.script.jruby.JRubyScriptFactory">
		<constructor-arg index="0" value="classpath:applications/main.rb"/>
		<constructor-arg index="1">
			<list>
				<value>org.red5.server.api.IScopeHandler</value>
				<value>org.red5.server.adapter.IApplication</value>
			</list>
		</constructor-arg>
	</bean>		
-->
<!--
	<bean id="web.handler" class="org.red5.server.script.jython.JythonScriptFactory">
		<constructor-arg index="0" value="classpath:applications/main.py"/>
		<constructor-arg index="1">
			<list>
     			<value>org.red5.server.api.IScopeHandler</value>
     			<value>org.red5.server.adapter.IApplication</value>
  			</list>
		</constructor-arg>
	</bean>
-->

	<bean id="demoService.service" class="org.red5.server.script.rhino.RhinoScriptFactory">
		<constructor-arg index="0" value="classpath:applications/demoservice.js"/>
		<constructor-arg index="1">
			<list>
     			<value>org.red5.server.webapp.oflaDemo.IDemoService</value>
  			</list>
		</constructor-arg>
		<constructor-arg index="2">
   			<value>org.red5.server.webapp.oflaDemo.DemoServiceImpl</value>
		</constructor-arg>		
	</bean>

<!--
	<bean id="demoService.service" class="org.red5.server.script.jruby.JRubyScriptFactory">
		<constructor-arg index="0" value="classpath:applications/demoservice.rb"/>
		<constructor-arg index="1">
			<list>
     			<value>org.red5.server.webapp.oflaDemo.IDemoService</value>
  			</list>
		</constructor-arg>
	</bean>	
-->
<!--
	<bean id="demoService.service" class="org.red5.server.script.jython.JythonScriptFactory">
		<constructor-arg index="0" value="classpath:applications/demoservice.py"/>
		<constructor-arg index="1">
			<list>
				<value>org.red5.server.webapp.oflaDemo.IDemoService</value>
			</list>
		</constructor-arg>
		<constructor-arg index="2">
			<value>org.red5.server.webapp.oflaDemo.DemoServiceImpl</value>
		</constructor-arg>		
	</bean>
-->

</beans>
