<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure 1.0//EN" "http://jetty.mortbay.org/configure_1_1.dtd">

<Configure class="org.mortbay.jetty.Server">

	<Call name="addRealm">
		<Arg>
			<New class="com.actional.jetty.UserRealm">
				<Arg>Aurea Monitor Management Server Realm</Arg>
			</New>
		</Arg>
        </Call>

        <Call name="addRealm">
		<Arg>
			<New class="com.actional.jetty.UserRealm">
				<Arg>Aurea Monitor Application Server Realm</Arg>
			</New>
		</Arg>
        </Call>

	<!--
		The following context and handler are meant to redirect to the main
		web application of our product when the root URL is accessed (aka
		when the user enters http://localhost:port/)
	-->

	<Call name="addContext">
		<Arg>/</Arg>

		<Call name="addHandler">
			<Arg>
				<New class="com.actional.jetty.RedirectHandler">
					<Call name="addRedirect">
						<Arg>/</Arg>
						<Arg>/lgserver/</Arg>
					</Call>
					<Call name="addRedirect">
						<Arg>/index.jsp</Arg>
						<Arg>/lgserver/</Arg>
					</Call>
					<Call name="addRedirect">
						<Arg>/index.html</Arg>
						<Arg>/lgserver/</Arg>
					</Call>
					<Call name="addRedirect">
						<Arg>/index.htm</Arg>
						<Arg>/lgserver/</Arg>
					</Call>
				</New>
			</Arg>
		</Call>
        </Call>

	<Call name="addWebApplication">
		<Arg>/lgserver</Arg>
		<Arg><SystemProperty name="lg.webapp"/></Arg>
		<Set name="realmName">Aurea Monitor Management Server Realm</Set>
		<Set name="authenticator"><New class="org.mortbay.jetty.servlet.FormAuthenticator"/></Set>
	</Call>

	<!--
		Note: add the app server web app must be added last as it is the
		one that opens up the HTTP listeners. We want to do this last as
		we don't want HTTP clients pinging our various web applications
		before they had time to completely initialize themselves.
		Furthermore, we have the app server web app automatically start
		a browser pointing at our product.
	-->

	<Call name="addWebApplication">
		<Arg>/appsrv</Arg>
		<Arg><SystemProperty name="jetty.webapp"/></Arg>
		<Set name="realmName">Aurea Monitor Application Server Realm</Set>
		<Set name="authenticator"><New class="org.mortbay.jetty.servlet.FormAuthenticator"/></Set>
	</Call>
</Configure>
