<?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.
-->
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
      version="3.0"> 

    <display-name>Apache ActiveMQ Web Demo</display-name>

    <!-- context config -->
    <context-param>
    	<description>Whether we should include an embedded broker or not</description>
        <param-name>org.apache.activemq.embeddedBroker</param-name>
        <param-value>true</param-value>       
    </context-param>

	<!-- filters -->
	<filter>
		<filter-name>session</filter-name>
		<filter-class>org.apache.activemq.web.SessionFilter</filter-class>
		<async-supported>true</async-supported>
	</filter>
	<filter-mapping>
		<filter-name>session</filter-name>
		<url-pattern>/*</url-pattern>
	</filter-mapping>

	<!-- listener -->
	<listener>
		<listener-class>org.apache.activemq.web.SessionListener</listener-class>
	</listener>

	<!-- servlet mappings -->
    
    <!-- the subscription REST servlet -->
    <servlet>
        <servlet-name>AjaxServlet</servlet-name>
        <servlet-class>org.apache.activemq.web.AjaxServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
        <async-supported>true</async-supported>
    </servlet>

    <servlet>
        <servlet-name>MessageServlet</servlet-name>
        <servlet-class>org.apache.activemq.web.MessageServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
        <async-supported>true</async-supported>
        <!--
        Uncomment this parameter if you plan to use multiple consumers over REST
        <init-param>
                <param-name>destinationOptions</param-name>
                <param-value>consumer.prefetchSize=1</param-value>
        </init-param> 
        -->
    </servlet>

    <!-- the queue browse servlet -->
    <servlet>
        <servlet-name>QueueBrowseServlet</servlet-name>
        <servlet-class>org.apache.activemq.web.QueueBrowseServlet</servlet-class>
        <async-supported>true</async-supported>
    </servlet>

    <!-- servlets for the portfolio demo -->
    <servlet>
        <servlet-name>PortfolioPublishServlet</servlet-name>
        <servlet-class>org.apache.activemq.web.PortfolioPublishServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
        <async-supported>true</async-supported>
    </servlet>

	<!-- servlet mappings -->
    <servlet-mapping>
        <servlet-name>AjaxServlet</servlet-name>
        <url-pattern>/amq/*</url-pattern>
    </servlet-mapping>
    
    <servlet-mapping>
        <servlet-name>MessageServlet</servlet-name>
        <url-pattern>/message/*</url-pattern>
    </servlet-mapping>
    
    <servlet-mapping>
        <servlet-name>QueueBrowseServlet</servlet-name>
        <url-pattern>/queueBrowse/*</url-pattern>
    </servlet-mapping>
    
    <servlet-mapping>
        <servlet-name>PortfolioPublishServlet</servlet-name>
        <url-pattern>/portfolioPublish</url-pattern>
    </servlet-mapping>

    <welcome-file-list>
      <welcome-file>index.html</welcome-file>
      <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>

</web-app>
