<?xml version="1.0" encoding="UTF-8"?>
<!--
/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *  http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */
-->
<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"
       xsi:schemaLocation="
			http://www.springframework.org/schema/beans
			http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
			http://www.springframework.org/schema/context
			http://www.springframework.org/schema/context/spring-context-3.0.xsd">

    <context:component-scan base-package="org.apache.struts2.showcase"/>
    <context:annotation-config/>

    <!-- Showcase's CustomFreemarkerManager example -->
    <bean id="customFreemarkerManager" class="org.apache.struts2.showcase.freemarker.CustomFreemarkerManager">
        <constructor-arg index="0">
            <ref bean="customFreemarkerManagerUtil"/>
        </constructor-arg>
    </bean>
    <bean id="customFreemarkerManagerUtil" class="org.apache.struts2.showcase.freemarker.CustomFreemarkerManagerUtil"/>


    <!-- Chat Example -->
    <bean id="chatService" class="org.apache.struts2.showcase.chat.ChatServiceImpl">
    </bean>

    <bean id="chatLoginAction" class="org.apache.struts2.showcase.chat.ChatLoginAction" scope="prototype">
        <constructor-arg index="0" ref="chatService"/>
    </bean>

    <bean id="chatLogoutAction" class="org.apache.struts2.showcase.chat.ChatLogoutAction" scope="prototype">
        <constructor-arg index="0" ref="chatService"/>
    </bean>

    <bean id="usersAvailableAction" class="org.apache.struts2.showcase.chat.UsersAvailableAction" scope="prototype">
        <constructor-arg index="0" ref="chatService"/>
    </bean>

    <bean id="roomsAvailableAction" class="org.apache.struts2.showcase.chat.RoomsAvailableAction" scope="prototype">
        <constructor-arg index="0" ref="chatService"/>
    </bean>

    <bean id="crudRoomAction" class="org.apache.struts2.showcase.chat.CrudRoomAction" scope="prototype">
        <constructor-arg index="0" ref="chatService"/>
    </bean>

    <bean id="enterRoomAction" class="org.apache.struts2.showcase.chat.EnterRoomAction" scope="prototype">
        <constructor-arg index="0" ref="chatService"/>
    </bean>

    <bean id="messagesAvailableInRoomAction" class="org.apache.struts2.showcase.chat.MessagesAvailableInRoomAction"
          scope="prototype">
        <constructor-arg index="0" ref="chatService"/>
    </bean>

    <bean id="sendMessageToRoomAction" class="org.apache.struts2.showcase.chat.SendMessageToRoomAction"
          scope="prototype">
        <constructor-arg index="0" ref="chatService"/>
    </bean>

    <bean id="usersAvailableInRoomAction" class="org.apache.struts2.showcase.chat.UsersAvailableInRoomAction"
          scope="prototype">
        <constructor-arg index="0" ref="chatService"/>
    </bean>

    <bean id="exitRoomAction" class="org.apache.struts2.showcase.chat.ExitRoomAction" scope="prototype">
        <constructor-arg index="0" ref="chatService"/>
    </bean>


    <!-- Hangman Showcase Example  -->
    <bean id="hangmanService" class="org.apache.struts2.showcase.hangman.HangmanService">
        <constructor-arg index="0">
            <bean class="org.apache.struts2.showcase.hangman.PropertiesVocabSource">
                <constructor-arg index="0">
                    <props>
                        <!--
                                                                <prop key="DOG">An animal, men best friend</prop>
                                                                <prop key="CAT">An animal whose child is called kitten</prop>
                                                                <prop key="CAR">A common vehical with 4 wheels</prop>
                                                                <prop key="STRUTS2">The premier action-based framework for Java</prop>
                                                                -->
                        <prop key="JAVA">A popular programming language that is used to create the Struts framework
                        </prop>
                    </props>
                </constructor-arg>
            </bean>
        </constructor-arg>
    </bean>

    <bean id="startHangmanAction" class="org.apache.struts2.showcase.hangman.StartHangmanAction" scope="prototype">
        <constructor-arg index="0" ref="hangmanService"/>
    </bean>

    <bean id="guessCharacterAction" class="org.apache.struts2.showcase.hangman.GuessCharacterAction" scope="prototype"/>
    <bean id="getUpdatedHangmanAction" class="org.apache.struts2.showcase.hangman.GetUpdatedHangmanAction"
          scope="prototype"/>
</beans>

