<?xml version="1.0"  encoding="ISO-8859-1"?>

<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure 1.2//EN" "http://jetty.mortbay.org/configure_1_2.dtd">

<!--

This jetty-web.xml file demonstrates:

  1. distributable HttpSessions
  2. single sign on


1. Distributable HttpSessions
-----------------------------
Distributable HttpSessions live in a container, much like JBoss EJBs,
comprising a stack of interceptors which are used to aggregate the
necessary functionality at deploy time. This is slower, but simpler
and more flexible than doing it at compile time. It also allows the
user to insert custom interceptors - a very powerful feature.


IMPORTANT:

This currently assumes three modes for HttpSession containers :

LOCAL - no distributions occurs.

MIGRATABLE - Just as the spec requires. Migration will only occur on
undeployment of the webapp, at which point references stored in the
session will be resolved and their contents serialised. This is no
good for fail-over, since it requires a controlled undeployment of the
webapp, which will not happen in a fail situation.

EXTENDED - Goes beyond the current spec in order to implement
fail-over. Changes to the session are immediately distributed
off-node. Developers should be aware that objects placed into these
sessions are manipulated by VALUE, not REFERENCE, (compare
Local/Distributable HttpSessions with Local/Remote EJBs). If you put a
reference into a session, then alter the reference contents your
changes will NOT be distributed, because you placed a COPY of your
object into the session. To update it you MUST place a fresh copy over
it. This new value will then be distributed.


2. Single Sign On
-----------------
To enable single sign on for a collection of web applications, use a
jetty-web.xml file per webapp to specify a common name for the sso realm. 
That is, each webapp wishing to participate in single
sign on must have a jetty-web.xml file, and all files must specify the
same sso realm name. See the example below.

-->

<Configure class="org.mortbay.jetty.servlet.WebApplicationContext">

  <!-- ================================================================== -->
  <!-- Enable HttpSessions                                                -->  
  <!-- ================================================================== -->
  <!-- this interceptor stack is for an EXTENDED session using JavaGroups -->
  <Get name="ServletHandler">
  <Set name="SessionManager">
  <New class="org.mortbay.j2ee.session.Manager">
   <Set name="interceptorStack">
    <Array type="org.mortbay.j2ee.session.StateInterceptor">
     <!-- <Item><New class="org.mortbay.j2ee.session.DebugInterceptor"/></Item> -->
     <Item><New class="org.mortbay.j2ee.session.ValidatingInterceptor"/></Item>
     <Item><New class="org.mortbay.j2ee.session.TypeCheckingInterceptor"/></Item>
     <Item><New class="org.mortbay.j2ee.session.BindingInterceptor"/></Item>
     <Item><New class="org.mortbay.j2ee.session.SynchronizingInterceptor"/></Item>
     <Item><New class="org.mortbay.j2ee.session.PublishingInterceptor"/></Item>
     <Item><New class="org.mortbay.j2ee.session.SubscribingInterceptor"/></Item>
    </Array>
   </Set>
   <Set name="store">
    <New class="org.mortbay.j2ee.session.JGStore">
    </New>
   </Set>
  </New>
  </Set>
  </Get>

  <!-- ================================================================== -->
  <!-- Enable SSO                                                         -->
  <!--                                                                    -->
  <!-- Change MY-SSO-REALM-NAME to the name of your sso realm.            --> 
  <!-- ================================================================== -->
  <Get name="UserRealm">
    <Set name="SSORealmName">MY-SSO-REALM-NAME</Set>
  </Get>

</Configure>
