<?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.
-->
<!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app>

    <display-name>ActiveMQ Web Demos</display-name>
    <description>
    Apache ActiveMQ Web Demos
    </description>

    <!-- context config -->
    <context-param>
        <param-name>org.apache.activemq.brokerURL</param-name>
        <param-value>vm://localhost</param-value>
        <description>The URL of the Message Broker to connect to</description>
    </context-param>

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

    <!-- 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>
    </servlet>

    <servlet>
        <servlet-name>MessageServlet</servlet-name>
        <servlet-class>org.apache.activemq.web.MessageServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
        <!--
        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>
    </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>
    </servlet>
    
    <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>

    <filter>
      <filter-name>session</filter-name>
      <filter-class>org.apache.activemq.web.SessionFilter</filter-class>
    </filter>
    
    <filter-mapping>
      <filter-name>session</filter-name>
      <url-pattern>/*</url-pattern>
    </filter-mapping>

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