You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by je...@apache.org on 2015/12/29 22:10:55 UTC

[01/24] incubator-geode git commit: GEODE-14: Move GemFire Sessions module and relocate all packages to 'internal'

Repository: incubator-geode
Updated Branches:
  refs/heads/feature/GEODE-14 ed3be77de -> 18be1c059


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/util/ThreadLocalSession.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/util/ThreadLocalSession.java b/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/util/ThreadLocalSession.java
deleted file mode 100644
index 3d04bbb..0000000
--- a/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/util/ThreadLocalSession.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-package com.gemstone.gemfire.modules.session.filter.util;
-
-import javax.servlet.http.HttpSession;
-
-/**
- */
-public class ThreadLocalSession {
-  private static ThreadLocal<HttpSession> threadLocal =
-      new ThreadLocal<HttpSession>();
-
-  public static HttpSession get() {
-    return threadLocal.get();
-  }
-
-  public static void set(HttpSession session) {
-    threadLocal.set(session);
-  }
-
-  public static void remove() {
-    threadLocal.remove();
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/util/TypeAwareMap.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/util/TypeAwareMap.java b/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/util/TypeAwareMap.java
deleted file mode 100644
index a3a1f3d..0000000
--- a/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/util/TypeAwareMap.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-
-package com.gemstone.gemfire.modules.session.filter.util;
-
-import com.gemstone.gemfire.modules.session.common.CacheProperty;
-
-import java.util.HashMap;
-
-/**
- *
- */
-public class TypeAwareMap<K extends CacheProperty, Object> extends HashMap {
-
-  private Class<K> keyType;
-
-  public TypeAwareMap(Class<K> keyType) {
-    super();
-    this.keyType = keyType;
-  }
-
-  public Object put(K key, Object value) {
-    if (!key.getClazz().isAssignableFrom(value.getClass())) {
-      if (key.getClazz() == Boolean.class) {
-        return (Object) super.put(key, Boolean.valueOf((String) value));
-      } else if (key.getClazz() == Integer.class) {
-        return (Object) super.put(key, Integer.valueOf((String) value));
-      } else {
-        throw new IllegalArgumentException("Value is not of type " +
-            key.getClazz().getName());
-      }
-    }
-
-    return (Object) super.put(key, value);
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/jmx/SessionStatistics.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/jmx/SessionStatistics.java b/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/jmx/SessionStatistics.java
deleted file mode 100644
index 3a05d48..0000000
--- a/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/jmx/SessionStatistics.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-
-package com.gemstone.gemfire.modules.session.jmx;
-
-import java.util.concurrent.atomic.AtomicInteger;
-import java.util.concurrent.atomic.AtomicLong;
-
-/**
- * Class to manage session statistics
- */
-public class SessionStatistics implements SessionStatisticsMXBean {
-
-  private AtomicInteger activeSessions = new AtomicInteger(0);
-
-  private AtomicInteger totalSessions = new AtomicInteger(0);
-
-  private AtomicLong regionUpdates = new AtomicLong(0);
-
-  @Override
-  public int getActiveSessions() {
-    return activeSessions.get();
-  }
-
-  @Override
-  public int getTotalSessions() {
-    return totalSessions.get();
-  }
-
-  @Override
-  public long getRegionUpdates() {
-    return regionUpdates.get();
-  }
-
-  public void setActiveSessions(int sessions) {
-    activeSessions.set(sessions);
-  }
-
-  public void setTotalSessions(int sessions) {
-    totalSessions.set(sessions);
-  }
-
-  public void incActiveSessions() {
-    activeSessions.incrementAndGet();
-    totalSessions.incrementAndGet();
-  }
-
-  public void decActiveSessions() {
-    activeSessions.decrementAndGet();
-  }
-
-  public void incTotalSessions() {
-    totalSessions.incrementAndGet();
-  }
-
-  public void decTotalSessions() {
-    totalSessions.decrementAndGet();
-  }
-
-  public void incRegionUpdates() {
-    regionUpdates.incrementAndGet();
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/jmx/SessionStatisticsMXBean.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/jmx/SessionStatisticsMXBean.java b/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/jmx/SessionStatisticsMXBean.java
deleted file mode 100644
index 1fe3abb..0000000
--- a/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/jmx/SessionStatisticsMXBean.java
+++ /dev/null
@@ -1,14 +0,0 @@
-
-package com.gemstone.gemfire.modules.session.jmx;
-
-/**
- * MXBean interface to retrieve Session statistics
- */
-public interface SessionStatisticsMXBean {
-
-  public int getActiveSessions();
-
-  public int getTotalSessions();
-
-  public long getRegionUpdates();
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session/src/test/resources/log4j.properties
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session/src/test/resources/log4j.properties b/modules/gemfire-modules-session/src/test/resources/log4j.properties
deleted file mode 100644
index b346714..0000000
--- a/modules/gemfire-modules-session/src/test/resources/log4j.properties
+++ /dev/null
@@ -1,12 +0,0 @@
-# To change this template, choose Tools | Templates
-# and open the template in the editor.
-
-# Set root logger level to DEBUG and its only appender to A1.
-log4j.rootLogger=DEBUG, A1
-
-# A1 is set to be a ConsoleAppender.
-log4j.appender.A1=org.apache.log4j.ConsoleAppender
-
-# A1 uses PatternLayout.
-log4j.appender.A1.layout=org.apache.log4j.PatternLayout
-log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/settings.gradle
----------------------------------------------------------------------
diff --git a/settings.gradle b/settings.gradle
index a5df712..a4b7395 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -29,6 +29,7 @@ include 'gemfire-lucene'
 include 'extensions/gemfire-modules'
 include 'extensions/gemfire-modules-tomcat7'
 include 'extensions/gemfire-modules-hibernate'
+include 'extensions/gemfire-modules-session'
 
 def minimumGradleVersion = '2.3'
 if (GradleVersion.current() < GradleVersion.version(minimumGradleVersion)) {


[06/24] incubator-geode git commit: GEODE-14: Move GemFire Sessions module and relocate all packages to 'internal'

Posted by je...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session-external/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/SessionCachingFilter.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-external/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/SessionCachingFilter.java b/modules/gemfire-modules-session-external/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/SessionCachingFilter.java
new file mode 100644
index 0000000..b3dada5
--- /dev/null
+++ b/modules/gemfire-modules-session-external/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/SessionCachingFilter.java
@@ -0,0 +1,639 @@
+/*=========================================================================
+ * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+package com.gemstone.gemfire.modules.session.internal.filter;
+
+import com.gemstone.gemfire.modules.session.internal.filter.util.ThreadLocalSession;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.servlet.Filter;
+import javax.servlet.FilterChain;
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.Cookie;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletRequestWrapper;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpServletResponseWrapper;
+import javax.servlet.http.HttpSession;
+import java.io.IOException;
+import java.io.PrintStream;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.security.Principal;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.atomic.AtomicInteger;
+
+/**
+ * Primary class which orchestrates everything. This is the class which gets
+ * configured in the web.xml.
+ */
+public class SessionCachingFilter implements Filter {
+
+  /**
+   * Logger instance
+   */
+  private static final Logger LOG =
+      LoggerFactory.getLogger(SessionCachingFilter.class.getName());
+
+  /**
+   * The filter configuration object we are associated with.  If this value is
+   * null, this filter instance is not currently configured.
+   */
+  private FilterConfig filterConfig = null;
+
+  /**
+   * Some containers will want to instantiate multiple instances of this filter,
+   * but we only need one SessionManager
+   */
+  private static SessionManager manager = null;
+
+  /**
+   * Can be overridden during testing.
+   */
+  private static AtomicInteger started =
+      new AtomicInteger(
+          Integer.getInteger("gemfire.override.session.manager.count", 1));
+
+  private static int percentInactiveTimeTriggerRebuild =
+      Integer.getInteger("gemfire.session.inactive.trigger.rebuild", 80);
+
+  /**
+   * This latch ensures that at least one thread/instance has fired up the
+   * session manager before any other threads complete the init method.
+   */
+  private static CountDownLatch startingLatch = new CountDownLatch(1);
+
+  /**
+   * This request wrapper class extends the support class
+   * HttpServletRequestWrapper, which implements all the methods in the
+   * HttpServletRequest interface, as delegations to the wrapped request. You
+   * only need to override the methods that you need to change. You can get
+   * access to the wrapped request using the method getRequest()
+   */
+  public static class RequestWrapper extends HttpServletRequestWrapper {
+
+    private static final String URL_SESSION_IDENTIFIER = ";jsessionid=";
+
+    private ResponseWrapper response;
+
+    private boolean sessionFromCookie = false;
+
+    private boolean sessionFromURL = false;
+
+    private String requestedSessionId = null;
+
+    private GemfireHttpSession session = null;
+
+    private SessionManager manager;
+
+    private HttpServletRequest outerRequest = null;
+
+    /**
+     * Need to save this in case we need the original {@code RequestDispatcher}
+     */
+    private HttpServletRequest originalRequest;
+
+    public RequestWrapper(SessionManager manager,
+        HttpServletRequest request,
+        ResponseWrapper response) {
+
+      super(request);
+      this.response = response;
+      this.manager = manager;
+      this.originalRequest = request;
+
+      final Cookie[] cookies = request.getCookies();
+      if (cookies != null) {
+        for (final Cookie cookie : cookies) {
+          if (cookie.getName().equalsIgnoreCase(
+              manager.getSessionCookieName()) &&
+              cookie.getValue().endsWith("-GF")) {
+            requestedSessionId = cookie.getValue();
+            sessionFromCookie = true;
+
+            LOG.debug("Cookie contains sessionId: {}",
+                requestedSessionId);
+          }
+        }
+      }
+
+      if (requestedSessionId == null) {
+        requestedSessionId = extractSessionId();
+        LOG.debug("Extracted sessionId from URL {}", requestedSessionId);
+        if (requestedSessionId != null) {
+          sessionFromURL = true;
+        }
+      }
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public HttpSession getSession() {
+      return getSession(true);
+    }
+
+    /**
+     * Create our own sessions. TODO: Handle invalidated sessions
+     *
+     * @return a HttpSession
+     */
+    @Override
+    public HttpSession getSession(boolean create) {
+      if (session != null && session.isValid()) {
+        session.setIsNew(false);
+        session.updateAccessTime();
+                /*
+                 * This is a massively gross hack. Currently, there is no way
+                 * to actually update the last accessed time for a session, so
+                 * what we do here is once we're into X% of the session's TTL
+                 * we grab a new session from the container.
+                 *
+                 * (inactive * 1000) * (pct / 100) ==> (inactive * 10 * pct)
+                 */
+        if (session.getLastAccessedTime() - session.getCreationTime() >
+            (session.getMaxInactiveInterval() * 10 * percentInactiveTimeTriggerRebuild)) {
+          HttpSession nativeSession = super.getSession();
+          session.failoverSession(nativeSession);
+        }
+        return session;
+      }
+
+      if (requestedSessionId != null) {
+        session = (GemfireHttpSession) manager.getSession(
+            requestedSessionId);
+        if (session != null) {
+          session.setIsNew(false);
+          // This means we've failed over to another node
+          if (session.getNativeSession() == null) {
+            try {
+              ThreadLocalSession.set(session);
+              HttpSession nativeSession = super.getSession();
+              session.failoverSession(nativeSession);
+              session.putInRegion();
+            } finally {
+              ThreadLocalSession.remove();
+            }
+          }
+        }
+      }
+
+      if (session == null || !session.isValid()) {
+        if (create) {
+          try {
+            session = (GemfireHttpSession) manager.wrapSession(null);
+            ThreadLocalSession.set(session);
+            HttpSession nativeSession = super.getSession();
+            if (session.getNativeSession() == null) {
+              session.setNativeSession(nativeSession);
+            } else {
+              assert (session.getNativeSession() == nativeSession);
+            }
+            session.setIsNew(true);
+            manager.putSession(session);
+          } finally {
+            ThreadLocalSession.remove();
+          }
+        } else {
+          // create is false, and session is either null or not valid.
+          // The spec says return a null:
+          return null;
+        }
+      }
+
+      if (session != null) {
+        addSessionCookie(response);
+        session.updateAccessTime();
+      }
+
+      return session;
+    }
+
+    private void addSessionCookie(HttpServletResponse response) {
+      // Don't bother if the response is already committed
+      if (response.isCommitted()) {
+        return;
+      }
+
+      // Get the existing cookies
+      Cookie[] cookies = getCookies();
+
+      Cookie cookie = new Cookie(manager.getSessionCookieName(),
+          session.getId());
+      cookie.setPath("".equals(getContextPath()) ? "/" : getContextPath());
+      // Clear out all old cookies and just set ours
+      response.addCookie(cookie);
+
+      // Replace all other cookies which aren't JSESSIONIDs
+      if (cookies != null) {
+        for (Cookie c : cookies) {
+          if (manager.getSessionCookieName().equals(c.getName())) {
+            continue;
+          }
+          response.addCookie(c);
+        }
+      }
+
+    }
+
+    private String getCookieString(Cookie c) {
+      StringBuilder cookie = new StringBuilder();
+      cookie.append(c.getName()).append("=").append(c.getValue());
+
+      if (c.getPath() != null) {
+        cookie.append("; ").append("Path=").append(c.getPath());
+      }
+      if (c.getDomain() != null) {
+        cookie.append("; ").append("Domain=").append(c.getDomain());
+      }
+      if (c.getSecure()) {
+        cookie.append("; ").append("Secure");
+      }
+
+      cookie.append("; HttpOnly");
+
+      return cookie.toString();
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean isRequestedSessionIdFromCookie() {
+      return sessionFromCookie;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean isRequestedSessionIdFromURL() {
+      return sessionFromURL;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public String getRequestedSessionId() {
+      if (requestedSessionId != null) {
+        return requestedSessionId;
+      } else {
+        return super.getRequestedSessionId();
+      }
+    }
+
+        /*
+         * Hmmm... not sure if this is right or even good to do. So, in some
+         * cases - for ex. using a Spring security filter, we have 3 possible
+         * wrappers to deal with - the original, this one and one created by
+         * Spring. When a servlet or JSP is forwarded to the original request
+         * is passed in, but then this (the wrapped) request is used by the JSP.
+         * In some cases, the outer wrapper also contains information relevant
+         * to the request - in this case security info. So here we allow access
+         * to that. There's probably a better way....
+         */
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public Principal getUserPrincipal() {
+      if (outerRequest != null) {
+        return outerRequest.getUserPrincipal();
+      } else {
+        return super.getUserPrincipal();
+      }
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public String getRemoteUser() {
+      if (outerRequest != null) {
+        return outerRequest.getRemoteUser();
+      } else {
+        return super.getRemoteUser();
+      }
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean isUserInRole(String role) {
+      if (outerRequest != null) {
+        return outerRequest.isUserInRole(role);
+      } else {
+        return super.isUserInRole(role);
+      }
+    }
+
+    //////////////////////////////////////////////////////////////
+    // Non-API methods
+
+    void setOuterWrapper(HttpServletRequest outer) {
+      this.outerRequest = outer;
+    }
+
+    //////////////////////////////////////////////////////////////
+    // Private methods
+    private String extractSessionId() {
+      final int prefix = getRequestURL().indexOf(URL_SESSION_IDENTIFIER);
+      if (prefix != -1) {
+        final int start = prefix + URL_SESSION_IDENTIFIER.length();
+        int suffix = getRequestURL().indexOf("?", start);
+        if (suffix < 0) {
+          suffix = getRequestURL().indexOf("#", start);
+        }
+        if (suffix <= prefix) {
+          return getRequestURL().substring(start);
+        }
+        return getRequestURL().substring(start, suffix);
+      }
+      return null;
+    }
+  }
+
+  /**
+   * This response wrapper class extends the support class
+   * HttpServletResponseWrapper, which implements all the methods in the
+   * HttpServletResponse interface, as delegations to the wrapped response. You
+   * only need to override the methods that you need to change. You can get
+   * access to the wrapped response using the method getResponse()
+   */
+  class ResponseWrapper extends HttpServletResponseWrapper {
+
+    HttpServletResponse originalResponse;
+
+    public ResponseWrapper(HttpServletResponse response) throws IOException {
+      super(response);
+      originalResponse = response;
+    }
+
+    public HttpServletResponse getOriginalResponse() {
+      return originalResponse;
+    }
+
+    @Override
+    public void setHeader(String name, String value) {
+      super.setHeader(name, value);
+    }
+
+    @Override
+    public void setIntHeader(String name, int value) {
+      super.setIntHeader(name, value);
+    }
+  }
+
+
+  public SessionCachingFilter() {
+  }
+
+  /**
+   * @param request  The servlet request we are processing
+   * @param response The servlet response we are creating
+   * @param chain    The filter chain we are processing
+   * @throws IOException      if an input/output error occurs
+   * @throws ServletException if a servlet error occurs
+   */
+  @Override
+  public void doFilter(ServletRequest request, ServletResponse response,
+      FilterChain chain)
+      throws IOException, ServletException {
+
+    HttpServletRequest httpReq = (HttpServletRequest) request;
+    HttpServletResponse httpResp = (HttpServletResponse) response;
+
+    /**
+     * Early out if this isn't the right kind of request. We might see a
+     * RequestWrapper instance during a forward or include request.
+     */
+    if (request instanceof RequestWrapper ||
+        !(request instanceof HttpServletRequest)) {
+      LOG.debug("Handling already-wrapped request");
+      chain.doFilter(request, response);
+      return;
+    }
+
+    // Create wrappers for the request and response objects.
+    // Using these, you can extend the capabilities of the
+    // request and response, for example, allow setting parameters
+    // on the request before sending the request to the rest of the filter chain,
+    // or keep track of the cookies that are set on the response.
+    //
+    // Caveat: some servers do not handle wrappers very well for forward or
+    // include requests.
+
+    ResponseWrapper wrappedResponse = new ResponseWrapper(httpResp);
+    final RequestWrapper wrappedRequest =
+        new RequestWrapper(manager, httpReq, wrappedResponse);
+
+    Throwable problem = null;
+
+    try {
+      chain.doFilter(wrappedRequest, wrappedResponse);
+    } catch (Throwable t) {
+      // If an exception is thrown somewhere down the filter chain,
+      // we still want to execute our after processing, and then
+      // rethrow the problem after that.
+      problem = t;
+      LOG.error("Exception processing filter chain", t);
+    }
+
+    GemfireHttpSession session =
+        (GemfireHttpSession) wrappedRequest.getSession(false);
+
+    // If there was a problem, we want to rethrow it if it is
+    // a known type, otherwise log it.
+    if (problem != null) {
+      if (problem instanceof ServletException) {
+        throw (ServletException) problem;
+      }
+      if (problem instanceof IOException) {
+        throw (IOException) problem;
+      }
+      sendProcessingError(problem, response);
+    }
+
+    /**
+     * Commit any updates. What actually happens at that point is
+     * dependent on the type of attributes defined for use by the sessions.
+     */
+    if (session != null) {
+      session.commit();
+    }
+  }
+
+  /**
+   * Return the filter configuration object for this filter.
+   */
+  public FilterConfig getFilterConfig() {
+    return (this.filterConfig);
+  }
+
+  /**
+   * Set the filter configuration object for this filter.
+   *
+   * @param filterConfig The filter configuration object
+   */
+  public void setFilterConfig(FilterConfig filterConfig) {
+    this.filterConfig = filterConfig;
+  }
+
+  /**
+   * Destroy method for this filter
+   */
+  @Override
+  public void destroy() {
+    if (manager != null) {
+      manager.stop();
+    }
+  }
+
+  /**
+   * This is where all the initialization happens.
+   *
+   * @param config
+   * @throws ServletException
+   */
+  @Override
+  public void init(final FilterConfig config) {
+    LOG.info("Starting Session Filter initialization");
+    this.filterConfig = config;
+
+    if (started.getAndDecrement() > 0) {
+      /**
+       * Allow override for testing purposes
+       */
+      String managerClassStr =
+          config.getInitParameter("session-manager-class");
+
+      // Otherwise default
+      if (managerClassStr == null) {
+        managerClassStr = GemfireSessionManager.class.getName();
+      }
+
+      try {
+        manager = (SessionManager) Class.forName(
+            managerClassStr).newInstance();
+        manager.start(config, this.getClass().getClassLoader());
+      } catch (Exception ex) {
+        LOG.error("Exception creating Session Manager", ex);
+      }
+
+      startingLatch.countDown();
+    } else {
+      try {
+        startingLatch.await();
+      } catch (InterruptedException iex) {
+      }
+
+      LOG.debug("SessionManager and listener initialization skipped - "
+          + "already done.");
+    }
+
+    LOG.info("Session Filter initialization complete");
+    LOG.debug("Filter class loader {}", this.getClass().getClassLoader());
+  }
+
+  /**
+   * Return a String representation of this object.
+   */
+  @Override
+  public String toString() {
+    if (filterConfig == null) {
+      return ("SessionCachingFilter()");
+    }
+    StringBuilder sb = new StringBuilder("SessionCachingFilter(");
+    sb.append(filterConfig);
+    sb.append(")");
+    return (sb.toString());
+
+  }
+
+
+  private void sendProcessingError(Throwable t, ServletResponse response) {
+    String stackTrace = getStackTrace(t);
+
+    if (stackTrace != null && !stackTrace.equals("")) {
+      try {
+        response.setContentType("text/html");
+        PrintStream ps = new PrintStream(response.getOutputStream());
+        PrintWriter pw = new PrintWriter(ps);
+        pw.print(
+            "<html>\n<head>\n<title>Error</title>\n</head>\n<body>\n"); //NOI18N
+
+        // PENDING! Localize this for next official release
+        pw.print("<h1>The resource did not process correctly</h1>\n<pre>\n");
+        pw.print(stackTrace);
+        pw.print("</pre></body>\n</html>"); //NOI18N
+        pw.close();
+        ps.close();
+        response.getOutputStream().close();
+      } catch (Exception ex) {
+      }
+    } else {
+      try {
+        PrintStream ps = new PrintStream(response.getOutputStream());
+        t.printStackTrace(ps);
+        ps.close();
+        response.getOutputStream().close();
+      } catch (Exception ex) {
+      }
+    }
+  }
+
+  public static String getStackTrace(Throwable t) {
+    String stackTrace = null;
+    try {
+      StringWriter sw = new StringWriter();
+      PrintWriter pw = new PrintWriter(sw);
+      t.printStackTrace(pw);
+      pw.close();
+      sw.close();
+      stackTrace = sw.getBuffer().toString();
+    } catch (Exception ex) {
+    }
+    return stackTrace;
+  }
+
+  /**
+   * Retrieve the SessionManager. This is only here so that tests can get access
+   * to the cache.
+   */
+  static SessionManager getSessionManager() {
+    return manager;
+  }
+
+  /**
+   * Return the GemFire session which wraps a native session
+   *
+   * @param nativeSession the native session for which the corresponding GemFire
+   *                      session should be returned.
+   * @return the GemFire session or null if no session maps to the native
+   * session
+   */
+  public static HttpSession getWrappingSession(HttpSession nativeSession) {
+        /*
+         * This is a special case where the GemFire session has been set as a
+         * ThreadLocal during session creation.
+         */
+    GemfireHttpSession gemfireSession = (GemfireHttpSession) ThreadLocalSession.get();
+    if (gemfireSession != null) {
+      gemfireSession.setNativeSession(nativeSession);
+      return gemfireSession;
+    }
+    return getSessionManager().getWrappingSession(nativeSession.getId());
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session-external/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/SessionListener.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-external/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/SessionListener.java b/modules/gemfire-modules-session-external/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/SessionListener.java
new file mode 100644
index 0000000..254fafe
--- /dev/null
+++ b/modules/gemfire-modules-session-external/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/SessionListener.java
@@ -0,0 +1,41 @@
+/*=========================================================================
+ * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+package com.gemstone.gemfire.modules.session.internal.filter;
+
+import com.gemstone.gemfire.distributed.DistributedSystemDisconnectedException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.servlet.http.HttpSessionEvent;
+import javax.servlet.http.HttpSessionListener;
+
+public class SessionListener implements HttpSessionListener {
+
+  private static final Logger LOG =
+      LoggerFactory.getLogger(SessionListener.class.getName());
+
+  public void sessionCreated(HttpSessionEvent httpSessionEvent) {
+  }
+
+  /**
+   * This will receive events from the container using the native sessions.
+   */
+  public void sessionDestroyed(HttpSessionEvent event) {
+    String nativeId = event.getSession().getId();
+    try {
+      String sessionId = SessionCachingFilter.getSessionManager().destroyNativeSession(
+          nativeId);
+      LOG.debug(
+          "Received sessionDestroyed event for native session {} (wrapped by {})",
+          nativeId, sessionId);
+    } catch (DistributedSystemDisconnectedException dex) {
+      LOG.debug("Cache disconnected - unable to destroy native session {0}",
+          nativeId);
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/filter/AbstractListener.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/filter/AbstractListener.java b/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/filter/AbstractListener.java
deleted file mode 100644
index 75e5c8b..0000000
--- a/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/filter/AbstractListener.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-
-package com.gemstone.gemfire.modules.session.filter;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-
-/**
- * @author jdeppe
- */
-public abstract class AbstractListener {
-
-  protected final List<ListenerEventType> events =
-      new ArrayList<ListenerEventType>();
-
-  protected CountDownLatch latch;
-
-  public AbstractListener() {
-    this(1);
-  }
-
-  public AbstractListener(int numCalls) {
-    latch = new CountDownLatch(numCalls);
-    RendezvousManager.registerListener(this);
-  }
-
-  public synchronized void setLatch(int numCalls) {
-    latch = new CountDownLatch(numCalls);
-    events.clear();
-  }
-
-  public boolean await(long timeout,
-      TimeUnit unit) throws InterruptedException {
-    return latch.await(timeout, unit);
-  }
-
-  public List<ListenerEventType> getEvents() {
-    return events;
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/filter/Callback.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/filter/Callback.java b/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/filter/Callback.java
deleted file mode 100644
index ccca6c4..0000000
--- a/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/filter/Callback.java
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-
-package com.gemstone.gemfire.modules.session.filter;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-/**
- * @author jdeppe
- */
-public interface Callback {
-  public void call(HttpServletRequest request,
-      HttpServletResponse response);
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/filter/CallbackServlet.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/filter/CallbackServlet.java b/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/filter/CallbackServlet.java
deleted file mode 100644
index 69c2e09..0000000
--- a/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/filter/CallbackServlet.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-package com.gemstone.gemfire.modules.session.filter;
-
-import java.io.IOException;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-/**
- * @author jdeppe
- */
-public class CallbackServlet extends HttpServlet {
-
-  private Callback callback;
-
-  /**
-   * Processes requests for both HTTP <code>GET</code> and <code>POST</code>
-   * methods.
-   *
-   * @param request  servlet request
-   * @param response servlet response
-   * @throws ServletException if a servlet-specific error occurs
-   * @throws IOException      if an I/O error occurs
-   */
-  protected void processRequest(HttpServletRequest request,
-      HttpServletResponse response)
-      throws ServletException, IOException {
-
-    if (callback != null) {
-      callback.call(request, response);
-    }
-  }
-
-  public void setCallback(Callback callback) {
-    this.callback = callback;
-  }
-
-  /**
-   * Handles the HTTP <code>GET</code> method.
-   *
-   * @param request  servlet request
-   * @param response servlet response
-   * @throws ServletException if a servlet-specific error occurs
-   * @throws IOException      if an I/O error occurs
-   */
-  @Override
-  protected void doGet(HttpServletRequest request, HttpServletResponse response)
-      throws ServletException, IOException {
-    processRequest(request, response);
-  }
-
-  /**
-   * Handles the HTTP <code>POST</code> method.
-   *
-   * @param request  servlet request
-   * @param response servlet response
-   * @throws ServletException if a servlet-specific error occurs
-   * @throws IOException      if an I/O error occurs
-   */
-  @Override
-  protected void doPost(HttpServletRequest request,
-      HttpServletResponse response)
-      throws ServletException, IOException {
-    processRequest(request, response);
-  }
-
-  /**
-   * Returns a short description of the servlet.
-   *
-   * @return a String containing servlet description
-   */
-  @Override
-  public String getServletInfo() {
-    return "Short description";
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/filter/CommonTests.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/filter/CommonTests.java b/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/filter/CommonTests.java
deleted file mode 100644
index 8a8a829..0000000
--- a/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/filter/CommonTests.java
+++ /dev/null
@@ -1,583 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-package com.gemstone.gemfire.modules.session.filter;
-
-import com.mockrunner.mock.web.MockFilterConfig;
-import com.mockrunner.mock.web.MockHttpServletRequest;
-import com.mockrunner.mock.web.MockHttpServletResponse;
-import com.mockrunner.mock.web.MockHttpSession;
-import com.mockrunner.servlet.BasicServletTestCaseAdapter;
-import org.junit.After;
-import org.junit.Ignore;
-import org.junit.Test;
-
-import java.util.concurrent.TimeUnit;
-import javax.servlet.http.Cookie;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpSession;
-import javax.servlet.http.HttpSessionAttributeListener;
-
-import static junit.framework.Assert.assertEquals;
-import static org.junit.Assert.*;
-
-/**
- * This servlet tests the effects of the downstream SessionCachingFilter filter.
- * When these tests are performed, the filter would already have taken effect.
- */
-public abstract class CommonTests extends BasicServletTestCaseAdapter {
-
-  protected static final String CONTEXT_PATH = "/test";
-
-  @After
-  public void tearDown() throws Exception {
-    super.tearDown();
-  }
-
-  @Test
-  public void testGetSession1() throws Exception {
-    doFilter();
-    HttpSession session1 =
-        ((HttpServletRequest) getFilteredRequest()).getSession();
-    HttpSession session2 =
-        ((HttpServletRequest) getFilteredRequest()).getSession();
-
-    assertSame("Session should be the same", session1, session2);
-  }
-
-  @Test
-  public void testGetSession2() throws Exception {
-    doFilter();
-
-    HttpSession session1 = ((HttpServletRequest) getFilteredRequest()).getSession();
-
-    MockHttpServletResponse response = getWebMockObjectFactory().getMockResponse();
-    Cookie cookie = (Cookie) response.getCookies().get(0);
-    getWebMockObjectFactory().getMockRequest().addCookie(cookie);
-
-    doFilter();
-
-    HttpSession session2 = ((HttpServletRequest) getFilteredRequest()).getSession();
-
-    assertEquals("Session objects across requests should be the same", session1, session2);
-  }
-
-  @Test
-  public void testGetAttributeRequest1() throws Exception {
-    doFilter();
-
-    getFilteredRequest().setAttribute("foo", "bar");
-
-    assertEquals("bar", getFilteredRequest().getAttribute("foo"));
-    assertNull("Unknown attribute should be null",
-        getFilteredRequest().getAttribute("baz"));
-  }
-
-  @Test
-  public void testGetAttributeRequest2() throws Exception {
-    // Setup
-    CallbackServlet s = (CallbackServlet) getServlet();
-    s.setCallback(new Callback() {
-      @Override
-      public void call(HttpServletRequest request, HttpServletResponse response) {
-        request.setAttribute("foo", "bar");
-      }
-    });
-    doFilter();
-
-    assertEquals("bar", getFilteredRequest().getAttribute("foo"));
-    assertNull("Unknown attribute should be null",
-        getFilteredRequest().getAttribute("baz"));
-  }
-
-  @Test
-  public void testGetAttributeSession1() throws Exception {
-    doFilter();
-
-    ((HttpServletRequest) getFilteredRequest()).getSession().setAttribute("foo", "bar");
-
-    HttpServletRequest request = (HttpServletRequest) getFilteredRequest();
-    assertEquals("bar", request.getSession().getAttribute("foo"));
-  }
-
-  /**
-   * Are attributes preserved across client requests?
-   */
-  @Test
-  public void testGetAttributeSession2() throws Exception {
-    doFilter();
-
-    ((HttpServletRequest) getFilteredRequest()).getSession().setAttribute("foo", "bar");
-
-    MockHttpServletResponse response = getWebMockObjectFactory().getMockResponse();
-    Cookie cookie = (Cookie) response.getCookies().get(0);
-    getWebMockObjectFactory().getMockRequest().addCookie(cookie);
-
-    doFilter();
-    HttpServletRequest request = (HttpServletRequest) getFilteredRequest();
-
-    assertEquals("bar", request.getSession().getAttribute("foo"));
-  }
-
-  /**
-   * Setting a session attribute to null should remove it
-   */
-  @Test
-  public void testSetAttributeNullSession1() throws Exception {
-    // Setup
-    CallbackServlet s = (CallbackServlet) getServlet();
-    s.setCallback(new Callback() {
-      private boolean called = false;
-
-      @Override
-      public void call(HttpServletRequest request, HttpServletResponse response) {
-        if (called) {
-          request.getSession().setAttribute("foo", null);
-        } else {
-          request.getSession().setAttribute("foo", "bar");
-          called = true;
-        }
-      }
-    });
-
-    doFilter();
-    doFilter();
-
-    HttpSession session = ((HttpServletRequest) getFilteredRequest()).getSession();
-
-    String attr = (String) session.getAttribute("foo");
-    assertNull("Attribute should be null but is " + attr, attr);
-  }
-
-
-  /**
-   * Test that various methods throw the appropriate exception when the session is
-   * invalid.
-   */
-  @Test
-  public void testInvalidate1() throws Exception {
-    doFilter();
-
-    HttpSession session = ((HttpServletRequest) getFilteredRequest()).getSession();
-    session.invalidate();
-
-    try {
-      session.getAttribute("foo");
-      fail("Session should be invalid and an exception should be thrown");
-    } catch (IllegalStateException iex) {
-      // Pass
-    }
-  }
-
-  @Test
-  public void testInvalidate2() throws Exception {
-    doFilter();
-
-    HttpSession session = ((HttpServletRequest) getFilteredRequest()).getSession();
-    session.invalidate();
-
-    try {
-      session.getAttributeNames();
-      fail("Session should be invalid and an exception should be thrown");
-    } catch (IllegalStateException iex) {
-      // Pass
-    }
-  }
-
-  @Ignore(value = "until mockrunner 1.0.9 - see pull request #23")
-  public void testInvalidate3() throws Exception {
-    doFilter();
-
-    HttpSession session = ((HttpServletRequest) getFilteredRequest()).getSession();
-    session.invalidate();
-
-    try {
-      session.getCreationTime();
-      fail("Session should be invalid and an exception should be thrown");
-    } catch (IllegalStateException iex) {
-      // Pass
-    }
-  }
-
-  @Test
-  public void testInvalidate4() throws Exception {
-    doFilter();
-
-    HttpSession session = ((HttpServletRequest) getFilteredRequest()).getSession();
-    session.invalidate();
-
-    try {
-      session.getId();
-    } catch (Exception iex) {
-      fail("Exception should not be thrown");
-    }
-  }
-
-  @Test
-  public void testInvalidate5() throws Exception {
-    doFilter();
-
-    HttpSession session = ((HttpServletRequest) getFilteredRequest()).getSession();
-    session.invalidate();
-
-    try {
-      session.getLastAccessedTime();
-      fail("Session should be invalid and an exception should be thrown");
-    } catch (IllegalStateException iex) {
-      // Pass
-    }
-  }
-
-  @Test
-  public void testInvalidate6() throws Exception {
-    doFilter();
-
-    HttpSession session = ((HttpServletRequest) getFilteredRequest()).getSession();
-    session.invalidate();
-
-    try {
-      session.getMaxInactiveInterval();
-    } catch (Exception ex) {
-      fail("Exception should not be thrown");
-    }
-  }
-
-  @Test
-  public void testInvalidate7() throws Exception {
-    doFilter();
-
-    HttpSession session = ((HttpServletRequest) getFilteredRequest()).getSession();
-    session.invalidate();
-
-    try {
-      session.getServletContext();
-    } catch (Exception ex) {
-      fail("Exception should not be thrown");
-    }
-  }
-
-  @Test
-  public void testInvalidate8() throws Exception {
-    doFilter();
-
-    HttpSession session = ((HttpServletRequest) getFilteredRequest()).getSession();
-    session.invalidate();
-
-    try {
-      session.isNew();
-      fail("Session should be invalid and an exception should be thrown");
-    } catch (IllegalStateException iex) {
-      // Pass
-    }
-  }
-
-  @Test
-  public void testInvalidate9() throws Exception {
-    doFilter();
-
-    HttpSession session = ((HttpServletRequest) getFilteredRequest()).getSession();
-    session.invalidate();
-
-    try {
-      session.removeAttribute("foo");
-      fail("Session should be invalid and an exception should be thrown");
-    } catch (IllegalStateException iex) {
-      // Pass
-    }
-  }
-
-  @Test
-  public void testInvalidate10() throws Exception {
-    doFilter();
-
-    HttpSession session = ((HttpServletRequest) getFilteredRequest()).getSession();
-    session.invalidate();
-
-    try {
-      session.setAttribute("foo", "bar");
-      fail("Session should be invalid and an exception should be thrown");
-    } catch (IllegalStateException iex) {
-      // Pass
-    }
-  }
-
-  @Test
-  public void testInvalidate11() throws Exception {
-    doFilter();
-
-    HttpSession session = ((HttpServletRequest) getFilteredRequest()).getSession();
-    session.invalidate();
-
-    try {
-      session.setMaxInactiveInterval(1);
-    } catch (Exception ex) {
-      fail("Exception should not be thrown");
-    }
-  }
-
-  /**
-   * Test that Session Attribute events get triggered
-   */
-  @Test
-  public void testSessionAttributeListener1() throws Exception {
-    AbstractListener listener = new HttpSessionAttributeListenerImpl();
-    RendezvousManager.registerListener(listener);
-    listener.setLatch(3);
-
-    doFilter();
-
-    // Ugh
-    MockHttpSession session = (MockHttpSession) ((GemfireHttpSession) ((HttpServletRequest) getFilteredRequest()).getSession()).getNativeSession();
-    session.addAttributeListener((HttpSessionAttributeListener) listener);
-    session.setAttribute("foo", "bar");
-    session.setAttribute("foo", "baz");
-    session.setAttribute("foo", null);
-
-    assertTrue("Event timeout", listener.await(1, TimeUnit.SECONDS));
-    assertEquals(ListenerEventType.SESSION_ATTRIBUTE_ADDED, listener.getEvents().get(0));
-    assertEquals(ListenerEventType.SESSION_ATTRIBUTE_REPLACED,
-        listener.getEvents().get(1));
-    assertEquals(ListenerEventType.SESSION_ATTRIBUTE_REMOVED,
-        listener.getEvents().get(2));
-  }
-
-  /**
-   * Test that both replace and remove events get triggered
-   */
-  @Test
-  public void testHttpSessionBindingListener1() throws Exception {
-    doFilter();
-
-    HttpSession session =
-        ((HttpServletRequest) getFilteredRequest()).getSession();
-
-    HttpSessionBindingListenerImpl listener1 =
-        new HttpSessionBindingListenerImpl(2);
-    HttpSessionBindingListenerImpl listener2 =
-        new HttpSessionBindingListenerImpl(2);
-
-    session.setAttribute("foo", listener1);
-    session.setAttribute("foo", listener2);
-    session.setAttribute("foo", null);
-
-    assertTrue("Event timeout", listener1.await(1, TimeUnit.SECONDS));
-    assertTrue("Event timeout", listener2.await(1, TimeUnit.SECONDS));
-
-    assertEquals("Event list size incorrect", 2, listener1.getEvents().size());
-    assertEquals("Event list size incorrect", 2, listener2.getEvents().size());
-    assertEquals(ListenerEventType.SESSION_VALUE_BOUND, listener1.getEvents().get(0));
-    assertEquals(ListenerEventType.SESSION_VALUE_UNBOUND,
-        listener1.getEvents().get(1));
-    assertEquals(ListenerEventType.SESSION_VALUE_BOUND, listener2.getEvents().get(0));
-    assertEquals(ListenerEventType.SESSION_VALUE_UNBOUND,
-        listener2.getEvents().get(1));
-  }
-
-  @Test
-  public void testGetId1() throws Exception {
-    doFilter();
-
-    assertNotNull("Session Id should not be null",
-        ((HttpServletRequest) getFilteredRequest()).getSession().getId());
-  }
-
-  /**
-   * Test that multiple calls from the same client return the same session id
-   */
-  @Test
-  public void testGetId2() throws Exception {
-    doFilter();
-
-    String sessionId = ((HttpServletRequest) getFilteredRequest()).getSession().getId();
-
-    MockHttpServletResponse response = getWebMockObjectFactory().getMockResponse();
-    Cookie cookie = (Cookie) response.getCookies().get(0);
-    getWebMockObjectFactory().getMockRequest().addCookie(cookie);
-
-    doFilter();
-
-    assertEquals("Session Ids should be the same", sessionId,
-        ((HttpServletRequest) getFilteredRequest()).getSession().getId());
-  }
-
-  @Test
-  public void testGetCreationTime1() throws Exception {
-    doFilter();
-
-    HttpServletRequest request = (HttpServletRequest) getFilteredRequest();
-    assertTrue("Session should have a non-zero creation time",
-        request.getSession().getCreationTime() > 0);
-  }
-
-
-  /**
-   * Test that multiple calls from the same client don't change the creation time.
-   */
-  @Test
-  public void testGetCreationTime2() throws Exception {
-    doFilter();
-
-    long creationTime = ((HttpServletRequest) getFilteredRequest()).getSession().getCreationTime();
-
-    MockHttpServletResponse response = getWebMockObjectFactory().getMockResponse();
-    Cookie cookie = (Cookie) response.getCookies().get(0);
-    getWebMockObjectFactory().getMockRequest().addCookie(cookie);
-
-    doFilter();
-
-    assertEquals("Session creation time should be the same", creationTime,
-        ((HttpServletRequest) getFilteredRequest()).getSession().getCreationTime());
-  }
-
-  @Test
-  public void testResponseContainsRequestedSessionId1() throws Exception {
-    Cookie cookie = new Cookie("JSESSIONID", "999-GF");
-    getWebMockObjectFactory().getMockRequest().addCookie(cookie);
-
-    doFilter();
-
-    HttpServletRequest request = (HttpServletRequest) getFilteredRequest();
-
-    assertEquals("Request does not contain requested session ID", "999-GF",
-        request.getRequestedSessionId());
-  }
-
-  @Test
-  public void testGetLastAccessedTime1() throws Exception {
-    doFilter();
-
-    HttpServletRequest request = (HttpServletRequest) getFilteredRequest();
-    assertTrue("Session should have a non-zero last access time",
-        request.getSession().getLastAccessedTime() > 0);
-  }
-
-
-  /**
-   * Test that repeated accesses update the last accessed time
-   */
-  @Test
-  public void testGetLastAccessedTime2() throws Exception {
-    // Setup
-    CallbackServlet s = (CallbackServlet) getServlet();
-    s.setCallback(new Callback() {
-
-      @Override
-      public void call(HttpServletRequest request, HttpServletResponse response) {
-        request.getSession();
-      }
-    });
-
-    doFilter();
-
-    HttpServletRequest request = (HttpServletRequest) getFilteredRequest();
-    long lastAccess = request.getSession().getLastAccessedTime();
-    assertTrue("Session should have a non-zero last access time", lastAccess > 0);
-
-    MockHttpServletResponse response = getWebMockObjectFactory().getMockResponse();
-    Cookie cookie = (Cookie) response.getCookies().get(0);
-
-    MockHttpServletRequest mRequest = getWebMockObjectFactory().createMockRequest();
-    mRequest.setRequestURL("/test/foo/bar");
-    mRequest.setContextPath(CONTEXT_PATH);
-    mRequest.addCookie(cookie);
-    getWebMockObjectFactory().addRequestWrapper(mRequest);
-
-    Thread.sleep(50);
-    doFilter();
-
-    assertTrue("Last access time should be changing",
-        request.getSession().getLastAccessedTime() > lastAccess);
-  }
-
-  @Test
-  public void testGetSetMaxInactiveInterval() throws Exception {
-    doFilter();
-
-    HttpServletRequest request = (HttpServletRequest) getFilteredRequest();
-    request.getSession().setMaxInactiveInterval(50);
-
-    assertEquals(50, request.getSession().getMaxInactiveInterval());
-  }
-
-  @Test
-  public void testIsNew1() throws Exception {
-    doFilter();
-
-    HttpServletRequest request = (HttpServletRequest) getFilteredRequest();
-    assertTrue("Session should be new", request.getSession().isNew());
-  }
-
-  /**
-   * Subsequent calls should not return true
-   */
-  @Test
-  public void testIsNew2() throws Exception {
-    // Setup
-    CallbackServlet s = (CallbackServlet) getServlet();
-    s.setCallback(new Callback() {
-
-      @Override
-      public void call(HttpServletRequest request, HttpServletResponse response) {
-        request.getSession();
-      }
-    });
-
-    doFilter();
-
-    HttpServletRequest request = (HttpServletRequest) getFilteredRequest();
-    request.getSession();
-
-    MockHttpServletResponse response = getWebMockObjectFactory().getMockResponse();
-    Cookie cookie = (Cookie) response.getCookies().get(0);
-
-    MockHttpServletRequest mRequest = getWebMockObjectFactory().createMockRequest();
-    mRequest.setRequestURL("/test/foo/bar");
-    mRequest.setContextPath(CONTEXT_PATH);
-    mRequest.addCookie(cookie);
-    getWebMockObjectFactory().addRequestWrapper(mRequest);
-
-    doFilter();
-
-    request = (HttpServletRequest) getFilteredRequest();
-    HttpSession s1 = request.getSession();
-
-    assertFalse("Subsequent isNew() calls should be false", request.getSession().isNew());
-  }
-
-  @Test
-  public void testIsRequestedSessionIdFromCookie() {
-    MockHttpServletRequest mRequest = getWebMockObjectFactory().getMockRequest();
-    Cookie c = new Cookie("JSESSIONID", "1-GF");
-    mRequest.addCookie(c);
-
-    doFilter();
-    HttpServletRequest request = (HttpServletRequest) getFilteredRequest();
-    request.getSession();
-
-    assertTrue(request.isRequestedSessionIdFromCookie());
-  }
-
-  @Test
-  public void testIsRequestedSessionIdFromURL() {
-    MockHttpServletRequest mRequest = getWebMockObjectFactory().getMockRequest();
-    mRequest.setRequestURL("/foo/bar;jsessionid=1");
-
-    doFilter();
-    HttpServletRequest request = (HttpServletRequest) getFilteredRequest();
-    request.getSession();
-
-    assertFalse("Session ID should not be from cookie",
-        request.isRequestedSessionIdFromCookie());
-    assertTrue("Session ID should be from URL", request.isRequestedSessionIdFromURL());
-  }
-
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/filter/GemfireCacheTest.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/filter/GemfireCacheTest.java b/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/filter/GemfireCacheTest.java
deleted file mode 100644
index 01ce9fb..0000000
--- a/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/filter/GemfireCacheTest.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-package com.gemstone.gemfire.modules.session.filter;
-
-import com.mockrunner.mock.web.MockFilterConfig;
-import com.mockrunner.mock.web.MockServletConfig;
-import org.junit.Before;
-
-/**
- * This servlet tests the effects of the downstream SessionCachingFilter filter.
- * When these tests are performed, the filter would already have taken effect.
- */
-public class GemfireCacheTest extends CommonTests {
-
-  @Before
-  public void setUp() throws Exception {
-    super.setUp();
-    getWebMockObjectFactory().getMockRequest().setRequestURL("/test/foo/bar");
-    getWebMockObjectFactory().getMockRequest().setContextPath(CONTEXT_PATH);
-    MockFilterConfig config = getWebMockObjectFactory().getMockFilterConfig();
-
-    config.setInitParameter("gemfire.property.mcast-port", "19991");
-    config.setInitParameter("cache-type", "peer-to-peer");
-    System.setProperty("gemfire.logdir", "/tmp");
-
-    getWebMockObjectFactory().getMockServletContext().setContextPath(
-        CONTEXT_PATH);
-
-    setDoChain(true);
-
-    createFilter(SessionCachingFilter.class);
-    createServlet(CallbackServlet.class);
-
-    MockServletConfig servletConfig = getWebMockObjectFactory().getMockServletConfig();
-    ContextManager.getInstance().putContext(servletConfig.getServletContext());
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/filter/GemfireLocalCacheTest.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/filter/GemfireLocalCacheTest.java b/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/filter/GemfireLocalCacheTest.java
deleted file mode 100644
index df01899..0000000
--- a/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/filter/GemfireLocalCacheTest.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-package com.gemstone.gemfire.modules.session.filter;
-
-import com.mockrunner.mock.web.MockFilterConfig;
-import com.mockrunner.mock.web.MockHttpServletRequest;
-import com.mockrunner.mock.web.MockHttpServletResponse;
-import com.mockrunner.mock.web.MockServletConfig;
-import com.mockrunner.servlet.BasicServletTestCaseAdapter;
-import org.junit.After;
-import org.junit.Before;
-
-import javax.servlet.Filter;
-import javax.servlet.http.Cookie;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpSession;
-
-/**
- * This servlet tests the effects of the downstream SessionCachingFilter filter.
- * When these tests are performed, the filter would already have taken effect.
- */
-public class GemfireLocalCacheTest extends BasicServletTestCaseAdapter {
-
-  Filter filter;
-
-  protected static final String CONTEXT_PATH = "/test";
-
-  @Before
-  public void setUp() throws Exception {
-    super.setUp();
-    getWebMockObjectFactory().getMockRequest().setRequestURL("/test/foo/bar");
-    getWebMockObjectFactory().getMockRequest().setContextPath(CONTEXT_PATH);
-    MockFilterConfig config = getWebMockObjectFactory().getMockFilterConfig();
-
-    config.setInitParameter("gemfire.property.mcast-port", "19991");
-    config.setInitParameter("cache-type", "peer-to-peer");
-    config.setInitParameter("gemfire.cache.enable_local_cache", "true");
-    System.setProperty("gemfire.logdir", "/tmp");
-
-    getWebMockObjectFactory().getMockServletContext().setContextPath(
-        CONTEXT_PATH);
-
-    setDoChain(true);
-
-    filter = createFilter(SessionCachingFilter.class);
-    createServlet(CallbackServlet.class);
-
-    MockServletConfig servletConfig = getWebMockObjectFactory().getMockServletConfig();
-    ContextManager.getInstance().putContext(servletConfig.getServletContext());
-  }
-
-  @After
-  public void tearDown() throws Exception {
-    super.tearDown();
-    filter.destroy();
-  }
-
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/filter/HttpSessionAttributeListenerImpl.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/filter/HttpSessionAttributeListenerImpl.java b/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/filter/HttpSessionAttributeListenerImpl.java
deleted file mode 100644
index 484d8f7..0000000
--- a/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/filter/HttpSessionAttributeListenerImpl.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-
-package com.gemstone.gemfire.modules.session.filter;
-
-import javax.servlet.http.HttpSessionAttributeListener;
-import javax.servlet.http.HttpSessionBindingEvent;
-
-/**
- *
- */
-public class HttpSessionAttributeListenerImpl extends AbstractListener
-    implements HttpSessionAttributeListener {
-
-  @Override
-  public synchronized void attributeAdded(HttpSessionBindingEvent se) {
-    events.add(ListenerEventType.SESSION_ATTRIBUTE_ADDED);
-    latch.countDown();
-  }
-
-  @Override
-  public synchronized void attributeRemoved(HttpSessionBindingEvent se) {
-    events.add(ListenerEventType.SESSION_ATTRIBUTE_REMOVED);
-    latch.countDown();
-  }
-
-  @Override
-  public synchronized void attributeReplaced(HttpSessionBindingEvent se) {
-    events.add(ListenerEventType.SESSION_ATTRIBUTE_REPLACED);
-    latch.countDown();
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/filter/HttpSessionBindingListenerImpl.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/filter/HttpSessionBindingListenerImpl.java b/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/filter/HttpSessionBindingListenerImpl.java
deleted file mode 100644
index 2aa7b4b..0000000
--- a/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/filter/HttpSessionBindingListenerImpl.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-
-package com.gemstone.gemfire.modules.session.filter;
-
-import java.io.Serializable;
-import javax.servlet.http.HttpSessionBindingEvent;
-import javax.servlet.http.HttpSessionBindingListener;
-
-/**
- * @author jdeppe
- */
-public class HttpSessionBindingListenerImpl extends AbstractListener implements
-    HttpSessionBindingListener, Serializable {
-
-  public HttpSessionBindingListenerImpl(int i) {
-    super(i);
-  }
-
-  @Override
-  public synchronized void valueBound(HttpSessionBindingEvent event) {
-    events.add(ListenerEventType.SESSION_VALUE_BOUND);
-    latch.countDown();
-  }
-
-  @Override
-  public synchronized void valueUnbound(HttpSessionBindingEvent event) {
-    events.add(ListenerEventType.SESSION_VALUE_UNBOUND);
-    latch.countDown();
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/filter/HttpSessionListenerImpl.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/filter/HttpSessionListenerImpl.java b/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/filter/HttpSessionListenerImpl.java
deleted file mode 100644
index 818ca6d..0000000
--- a/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/filter/HttpSessionListenerImpl.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-
-package com.gemstone.gemfire.modules.session.filter;
-
-import com.gemstone.gemfire.modules.session.filter.ListenerEventType;
-
-import javax.servlet.http.HttpSessionEvent;
-import javax.servlet.http.HttpSessionListener;
-
-/**
- * @author jdeppe
- */
-public class HttpSessionListenerImpl extends AbstractListener
-    implements HttpSessionListener {
-
-  public synchronized void sessionCreated(HttpSessionEvent se) {
-    events.add(ListenerEventType.SESSION_CREATED);
-    latch.countDown();
-  }
-
-  public synchronized void sessionDestroyed(HttpSessionEvent se) {
-    events.add(ListenerEventType.SESSION_DESTROYED);
-    latch.countDown();
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/filter/RendezvousManager.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/filter/RendezvousManager.java b/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/filter/RendezvousManager.java
deleted file mode 100644
index 1abf1ee..0000000
--- a/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/filter/RendezvousManager.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-
-package com.gemstone.gemfire.modules.session.filter;
-
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-
-/**
- *
- */
-public class RendezvousManager {
-
-  private static AbstractListener listener = null;
-
-  private static CountDownLatch latch = new CountDownLatch(1);
-
-  public static void registerListener(AbstractListener listener) {
-    RendezvousManager.listener = listener;
-    latch.countDown();
-  }
-
-  public static AbstractListener getListener() {
-    try {
-      latch.await(2, TimeUnit.SECONDS);
-    } catch (InterruptedException ex) {
-    }
-
-    return listener;
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/filter/ServletRequestAttributeListenerImpl.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/filter/ServletRequestAttributeListenerImpl.java b/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/filter/ServletRequestAttributeListenerImpl.java
deleted file mode 100644
index e5d7e7b..0000000
--- a/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/filter/ServletRequestAttributeListenerImpl.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-
-package com.gemstone.gemfire.modules.session.filter;
-
-import com.gemstone.gemfire.modules.session.filter.ListenerEventType;
-
-import javax.servlet.ServletRequestAttributeEvent;
-import javax.servlet.ServletRequestAttributeListener;
-
-/**
- * @author jdeppe
- */
-public class ServletRequestAttributeListenerImpl extends AbstractListener
-    implements ServletRequestAttributeListener {
-
-  public synchronized void attributeAdded(ServletRequestAttributeEvent srae) {
-    events.add(ListenerEventType.SERVLET_REQUEST_ATTRIBUTE_ADDED);
-    latch.countDown();
-  }
-
-  public synchronized void attributeRemoved(ServletRequestAttributeEvent srae) {
-    events.add(ListenerEventType.SERVLET_REQUEST_ATTRIBUTE_REMOVED);
-    latch.countDown();
-  }
-
-  public synchronized void attributeReplaced(
-      ServletRequestAttributeEvent srae) {
-    events.add(ListenerEventType.SERVLET_REQUEST_ATTRIBUTE_REPLACED);
-    latch.countDown();
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/filter/ServletRequestListenerImpl.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/filter/ServletRequestListenerImpl.java b/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/filter/ServletRequestListenerImpl.java
deleted file mode 100644
index 0574ebc..0000000
--- a/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/filter/ServletRequestListenerImpl.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-
-package com.gemstone.gemfire.modules.session.filter;
-
-import com.gemstone.gemfire.modules.session.filter.ListenerEventType;
-
-import javax.servlet.ServletRequestEvent;
-import javax.servlet.ServletRequestListener;
-
-/**
- * @author jdeppe
- */
-public class ServletRequestListenerImpl extends AbstractListener
-    implements ServletRequestListener {
-
-  public synchronized void requestDestroyed(ServletRequestEvent sre) {
-    events.add(ListenerEventType.SERVLET_REQUEST_DESTROYED);
-    latch.countDown();
-  }
-
-  public synchronized void requestInitialized(ServletRequestEvent sre) {
-    events.add(ListenerEventType.SERVLET_REQUEST_INITIALIZED);
-    latch.countDown();
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/filter/SessionTestSuite1.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/filter/SessionTestSuite1.java b/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/filter/SessionTestSuite1.java
deleted file mode 100644
index efe95c1..0000000
--- a/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/filter/SessionTestSuite1.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-package com.gemstone.gemfire.modules.session.filter;
-
-import com.gemstone.gemfire.modules.session.junit.SeparateClassloaderTestRunner;
-import com.mockrunner.mock.web.MockFilterConfig;
-import com.mockrunner.mock.web.WebMockObjectFactory;
-import com.mockrunner.servlet.ServletTestModule;
-
-import java.io.File;
-import javax.servlet.Filter;
-
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.runner.RunWith;
-
-/**
- *
- */
-@RunWith(SeparateClassloaderTestRunner.class)
-public class SessionTestSuite1 extends GemfireCacheTest {
-
-  private static Filter filter;
-
-  private static final File tmpdir;
-
-  private static final String gemfire_log;
-
-  static {
-    // Create a per-user scratch directory
-    tmpdir = new File(System.getProperty("java.io.tmpdir"),
-        "gemfire_modules-" + System.getProperty("user.name"));
-    tmpdir.mkdirs();
-    tmpdir.deleteOnExit();
-
-    gemfire_log = tmpdir.getPath() +
-        System.getProperty("file.separator") + "gemfire_modules.log";
-  }
-
-
-  @BeforeClass
-  public static void setupClass() throws Exception {
-    System.out.println("Executing " + SessionTestSuite1.class.getName());
-    WebMockObjectFactory factory = new WebMockObjectFactory();
-    MockFilterConfig config = factory.getMockFilterConfig();
-
-    config.setInitParameter("gemfire.property.mcast-port", "19991");
-    config.setInitParameter("gemfire.property.log-file", gemfire_log);
-    config.setInitParameter("gemfire.property.writable-working-dir",
-        tmpdir.getPath());
-    config.setInitParameter("cache-type", "peer-to-peer");
-    config.setInitParameter("close-cache-on-stop", "true");
-
-    factory.getMockServletContext().setContextPath("");
-
-    ServletTestModule module = new ServletTestModule(factory);
-    filter = module.createFilter(SessionCachingFilter.class);
-  }
-
-  @AfterClass
-  public static void teardownClass() throws Exception {
-    filter.destroy();
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/filter/SessionTestSuite2.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/filter/SessionTestSuite2.java b/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/filter/SessionTestSuite2.java
deleted file mode 100644
index 1efeb6d..0000000
--- a/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/filter/SessionTestSuite2.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-package com.gemstone.gemfire.modules.session.filter;
-
-import com.gemstone.gemfire.modules.session.junit.SeparateClassloaderTestRunner;
-import com.mockrunner.mock.web.MockFilterConfig;
-import com.mockrunner.mock.web.WebMockObjectFactory;
-import com.mockrunner.servlet.ServletTestModule;
-
-import java.io.File;
-import javax.servlet.Filter;
-
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.runner.RunWith;
-
-/**
- *
- */
-@RunWith(SeparateClassloaderTestRunner.class)
-public class SessionTestSuite2 extends GemfireCacheTest {
-
-  private static Filter filter;
-
-  private static final File tmpdir;
-
-  private static final String gemfire_log;
-
-  static {
-    // Create a per-user scratch directory
-    tmpdir = new File(System.getProperty("java.io.tmpdir"),
-        "gemfire_modules-" + System.getProperty("user.name"));
-    tmpdir.mkdirs();
-    tmpdir.deleteOnExit();
-
-    gemfire_log = tmpdir.getPath() +
-        System.getProperty("file.separator") + "gemfire_modules.log";
-  }
-
-  @BeforeClass
-  public static void setupClass() throws Exception {
-    System.out.println("Executing " + SessionTestSuite2.class.getName());
-    WebMockObjectFactory factory = new WebMockObjectFactory();
-    MockFilterConfig config = factory.getMockFilterConfig();
-
-    config.setInitParameter("mcast-port", "19991");
-    config.setInitParameter("gemfire.property.log-file", gemfire_log);
-    config.setInitParameter("gemfire.property.writable-working-dir",
-        tmpdir.getPath());
-    config.setInitParameter("cache-type", "peer-to-peer");
-    config.setInitParameter("gemfire.cache.enable_local_cache", "true");
-
-    factory.getMockServletContext().setContextPath("");
-
-    ServletTestModule module = new ServletTestModule(factory);
-    filter = module.createFilter(SessionCachingFilter.class);
-  }
-
-  @AfterClass
-  public static void teardownClass() throws Exception {
-    filter.destroy();
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/filter/SessionUberSuite.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/filter/SessionUberSuite.java b/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/filter/SessionUberSuite.java
deleted file mode 100644
index fa6a562..0000000
--- a/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/filter/SessionUberSuite.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-package com.gemstone.gemfire.modules.session.filter;
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.util.ArrayList;
-import java.util.List;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * The goal of having a suite of suites is for each suite to be able to start up
- * and shut down a unique cache with a different config. Currently a restart
- * doesn't work... This is dependent on gemfire 6.5.1.4 which provides a unified
- * classloading framework. Once that can be introduced here we can simply switch
- * the URLClassLoader for a ChildFirstClassLoader and have the ability to run
- * multiple caches in a single JVM. This should also allow us the ability to
- * cleanly shut down a cache at the end of a test.
- * <p/>
- * To be continued...
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
-  SessionTestSuite1.class,
-  SessionTestSuite2.class
-})
-public class SessionUberSuite {
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/AbstractListener.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/AbstractListener.java b/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/AbstractListener.java
new file mode 100644
index 0000000..94dc07f
--- /dev/null
+++ b/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/AbstractListener.java
@@ -0,0 +1,52 @@
+/*=========================================================================
+ * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package com.gemstone.gemfire.modules.session.internal.filter;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * @author jdeppe
+ */
+public abstract class AbstractListener {
+
+  protected final List<ListenerEventType> events =
+      new ArrayList<ListenerEventType>();
+
+  protected CountDownLatch latch;
+
+  public AbstractListener() {
+    this(1);
+  }
+
+  public AbstractListener(int numCalls) {
+    latch = new CountDownLatch(numCalls);
+    RendezvousManager.registerListener(this);
+  }
+
+  public synchronized void setLatch(int numCalls) {
+    latch = new CountDownLatch(numCalls);
+    events.clear();
+  }
+
+  public boolean await(long timeout,
+      TimeUnit unit) throws InterruptedException {
+    return latch.await(timeout, unit);
+  }
+
+  public List<ListenerEventType> getEvents() {
+    return events;
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/Callback.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/Callback.java b/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/Callback.java
new file mode 100644
index 0000000..ab74084
--- /dev/null
+++ b/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/Callback.java
@@ -0,0 +1,17 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package com.gemstone.gemfire.modules.session.internal.filter;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * @author jdeppe
+ */
+public interface Callback {
+  public void call(HttpServletRequest request,
+      HttpServletResponse response);
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/CallbackServlet.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/CallbackServlet.java b/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/CallbackServlet.java
new file mode 100644
index 0000000..f9d2971
--- /dev/null
+++ b/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/CallbackServlet.java
@@ -0,0 +1,88 @@
+/*=========================================================================
+ * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package com.gemstone.gemfire.modules.session.internal.filter;
+
+import java.io.IOException;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * @author jdeppe
+ */
+public class CallbackServlet extends HttpServlet {
+
+  private Callback callback;
+
+  /**
+   * Processes requests for both HTTP <code>GET</code> and <code>POST</code>
+   * methods.
+   *
+   * @param request  servlet request
+   * @param response servlet response
+   * @throws ServletException if a servlet-specific error occurs
+   * @throws IOException      if an I/O error occurs
+   */
+  protected void processRequest(HttpServletRequest request,
+      HttpServletResponse response)
+      throws ServletException, IOException {
+
+    if (callback != null) {
+      callback.call(request, response);
+    }
+  }
+
+  public void setCallback(Callback callback) {
+    this.callback = callback;
+  }
+
+  /**
+   * Handles the HTTP <code>GET</code> method.
+   *
+   * @param request  servlet request
+   * @param response servlet response
+   * @throws ServletException if a servlet-specific error occurs
+   * @throws IOException      if an I/O error occurs
+   */
+  @Override
+  protected void doGet(HttpServletRequest request, HttpServletResponse response)
+      throws ServletException, IOException {
+    processRequest(request, response);
+  }
+
+  /**
+   * Handles the HTTP <code>POST</code> method.
+   *
+   * @param request  servlet request
+   * @param response servlet response
+   * @throws ServletException if a servlet-specific error occurs
+   * @throws IOException      if an I/O error occurs
+   */
+  @Override
+  protected void doPost(HttpServletRequest request,
+      HttpServletResponse response)
+      throws ServletException, IOException {
+    processRequest(request, response);
+  }
+
+  /**
+   * Returns a short description of the servlet.
+   *
+   * @return a String containing servlet description
+   */
+  @Override
+  public String getServletInfo() {
+    return "Short description";
+  }
+
+}


[11/24] incubator-geode git commit: GEODE-14: Adding integration tests from '-external'

Posted by je...@apache.org.
GEODE-14: Adding integration tests from '-external'


Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/db02660d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/db02660d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/db02660d

Branch: refs/heads/feature/GEODE-14
Commit: db02660d2919e4c6fb0c69d8bb8338dbe0a5f5ee
Parents: 92ee6a7
Author: Jens Deppe <jd...@pivotal.io>
Authored: Mon Dec 28 11:05:07 2015 -0800
Committer: Jens Deppe <jd...@pivotal.io>
Committed: Mon Dec 28 11:07:12 2015 -0800

----------------------------------------------------------------------
 extensions/gemfire-modules-session/build.gradle |   7 +
 .../session/filter/SessionCachingFilter.java    | 642 +++++++++++++++++++
 .../modules/session/filter/SessionListener.java |  41 ++
 .../modules/session/installer/Installer.java    | 287 +++++++++
 .../session/installer/JarClassLoader.java       | 114 ++++
 .../session/installer/args/Argument.java        | 265 ++++++++
 .../session/installer/args/ArgumentHandler.java |  28 +
 .../installer/args/ArgumentProcessor.java       | 387 +++++++++++
 .../session/installer/args/ArgumentValues.java  | 212 ++++++
 .../installer/args/URLArgumentHandler.java      |  67 ++
 .../installer/args/UnknownArgumentHandler.java  |  19 +
 .../session/installer/args/UsageException.java  |  79 +++
 .../internal/common/PeerToPeerSessionCache.java |   4 +-
 .../session/internal/filter/ContextManager.java |  95 ---
 .../internal/filter/AbstractListener.java       |  52 ++
 .../session/internal/filter/Callback.java       |  17 +
 .../internal/filter/CallbackServlet.java        |  88 +++
 .../session/internal/filter/CommonTests.java    | 576 +++++++++++++++++
 .../HttpSessionAttributeListenerImpl.java       |  37 ++
 .../filter/HttpSessionBindingListenerImpl.java  |  40 ++
 .../filter/HttpSessionListenerImpl.java         |  33 +
 .../internal/filter/RendezvousManager.java      |  37 ++
 .../ServletRequestAttributeListenerImpl.java    |  40 ++
 .../filter/ServletRequestListenerImpl.java      |  34 +
 .../filter/SessionReplicationJUnitTest.java     |  43 ++
 .../SessionReplicationLocalCacheJUnitTest.java  |  44 ++
 .../junit/SeparateClassloaderTestRunner.java    |  39 ++
 .../modules/session/installer/Installer.java    | 287 ---------
 .../session/installer/JarClassLoader.java       | 114 ----
 .../session/installer/args/Argument.java        | 265 --------
 .../session/installer/args/ArgumentHandler.java |  28 -
 .../installer/args/ArgumentProcessor.java       | 387 -----------
 .../session/installer/args/ArgumentValues.java  | 212 ------
 .../installer/args/URLArgumentHandler.java      |  67 --
 .../installer/args/UnknownArgumentHandler.java  |  19 -
 .../session/installer/args/UsageException.java  |  79 ---
 .../internal/filter/SessionCachingFilter.java   | 639 ------------------
 .../internal/filter/SessionListener.java        |  41 --
 .../internal/filter/AbstractListener.java       |  52 --
 .../session/internal/filter/Callback.java       |  17 -
 .../internal/filter/CallbackServlet.java        |  88 ---
 .../session/internal/filter/CommonTests.java    | 582 -----------------
 .../internal/filter/GemfireCacheTest.java       |  46 --
 .../internal/filter/GemfireLocalCacheTest.java  |  62 --
 .../HttpSessionAttributeListenerImpl.java       |  37 --
 .../filter/HttpSessionBindingListenerImpl.java  |  40 --
 .../filter/HttpSessionListenerImpl.java         |  33 -
 .../internal/filter/RendezvousManager.java      |  37 --
 .../ServletRequestAttributeListenerImpl.java    |  40 --
 .../filter/ServletRequestListenerImpl.java      |  34 -
 .../internal/filter/SessionTestSuite1.java      |  69 --
 .../internal/filter/SessionTestSuite2.java      |  68 --
 .../internal/filter/SessionUberSuite.java       |  30 -
 .../junit/SeparateClassloaderTestRunner.java    |  39 --
 .../filter/HttpSessionListenerImpl.java         |   2 +
 .../filter/HttpSessionListenerImpl2.java        |   2 +
 .../internal/filter/IntegrationTest.java        |   1 +
 57 files changed, 3235 insertions(+), 3509 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/db02660d/extensions/gemfire-modules-session/build.gradle
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/build.gradle b/extensions/gemfire-modules-session/build.gradle
index 156f204..29ecd30 100644
--- a/extensions/gemfire-modules-session/build.gradle
+++ b/extensions/gemfire-modules-session/build.gradle
@@ -1,4 +1,11 @@
 dependencies {
   compile project(':extensions/gemfire-modules')
   compile project(':gemfire-core')
+
+  testCompile 'javax.servlet:servlet-api:2.5'
+  testCompile 'org.slf4j:slf4j-jdk14:1.7.7'
+  testCompile('com.mockrunner:mockrunner-servlet:1.0.8') {
+    exclude group: 'jboss'
+  }
+  provided project(path: ':gemfire-junit', configuration: 'testOutput')
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/db02660d/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/SessionCachingFilter.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/SessionCachingFilter.java b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/SessionCachingFilter.java
new file mode 100644
index 0000000..a241f20
--- /dev/null
+++ b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/SessionCachingFilter.java
@@ -0,0 +1,642 @@
+/*=========================================================================
+ * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+package com.gemstone.gemfire.modules.session.filter;
+
+import com.gemstone.gemfire.modules.session.internal.filter.GemfireHttpSession;
+import com.gemstone.gemfire.modules.session.internal.filter.GemfireSessionManager;
+import com.gemstone.gemfire.modules.session.internal.filter.SessionManager;
+import com.gemstone.gemfire.modules.session.internal.filter.util.ThreadLocalSession;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.servlet.Filter;
+import javax.servlet.FilterChain;
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.Cookie;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletRequestWrapper;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpServletResponseWrapper;
+import javax.servlet.http.HttpSession;
+import java.io.IOException;
+import java.io.PrintStream;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.security.Principal;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.atomic.AtomicInteger;
+
+/**
+ * Primary class which orchestrates everything. This is the class which gets
+ * configured in the web.xml.
+ */
+public class SessionCachingFilter implements Filter {
+
+  /**
+   * Logger instance
+   */
+  private static final Logger LOG =
+      LoggerFactory.getLogger(SessionCachingFilter.class.getName());
+
+  /**
+   * The filter configuration object we are associated with.  If this value is
+   * null, this filter instance is not currently configured.
+   */
+  private FilterConfig filterConfig = null;
+
+  /**
+   * Some containers will want to instantiate multiple instances of this filter,
+   * but we only need one SessionManager
+   */
+  private static SessionManager manager = null;
+
+  /**
+   * Can be overridden during testing.
+   */
+  private static AtomicInteger started =
+      new AtomicInteger(
+          Integer.getInteger("gemfire.override.session.manager.count", 1));
+
+  private static int percentInactiveTimeTriggerRebuild =
+      Integer.getInteger("gemfire.session.inactive.trigger.rebuild", 80);
+
+  /**
+   * This latch ensures that at least one thread/instance has fired up the
+   * session manager before any other threads complete the init method.
+   */
+  private static CountDownLatch startingLatch = new CountDownLatch(1);
+
+  /**
+   * This request wrapper class extends the support class
+   * HttpServletRequestWrapper, which implements all the methods in the
+   * HttpServletRequest interface, as delegations to the wrapped request. You
+   * only need to override the methods that you need to change. You can get
+   * access to the wrapped request using the method getRequest()
+   */
+  public static class RequestWrapper extends HttpServletRequestWrapper {
+
+    private static final String URL_SESSION_IDENTIFIER = ";jsessionid=";
+
+    private ResponseWrapper response;
+
+    private boolean sessionFromCookie = false;
+
+    private boolean sessionFromURL = false;
+
+    private String requestedSessionId = null;
+
+    private GemfireHttpSession session = null;
+
+    private SessionManager manager;
+
+    private HttpServletRequest outerRequest = null;
+
+    /**
+     * Need to save this in case we need the original {@code RequestDispatcher}
+     */
+    private HttpServletRequest originalRequest;
+
+    public RequestWrapper(SessionManager manager,
+        HttpServletRequest request,
+        ResponseWrapper response) {
+
+      super(request);
+      this.response = response;
+      this.manager = manager;
+      this.originalRequest = request;
+
+      final Cookie[] cookies = request.getCookies();
+      if (cookies != null) {
+        for (final Cookie cookie : cookies) {
+          if (cookie.getName().equalsIgnoreCase(
+              manager.getSessionCookieName()) &&
+              cookie.getValue().endsWith("-GF")) {
+            requestedSessionId = cookie.getValue();
+            sessionFromCookie = true;
+
+            LOG.debug("Cookie contains sessionId: {}",
+                requestedSessionId);
+          }
+        }
+      }
+
+      if (requestedSessionId == null) {
+        requestedSessionId = extractSessionId();
+        LOG.debug("Extracted sessionId from URL {}", requestedSessionId);
+        if (requestedSessionId != null) {
+          sessionFromURL = true;
+        }
+      }
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public HttpSession getSession() {
+      return getSession(true);
+    }
+
+    /**
+     * Create our own sessions. TODO: Handle invalidated sessions
+     *
+     * @return a HttpSession
+     */
+    @Override
+    public HttpSession getSession(boolean create) {
+      if (session != null && session.isValid()) {
+        session.setIsNew(false);
+        session.updateAccessTime();
+                /*
+                 * This is a massively gross hack. Currently, there is no way
+                 * to actually update the last accessed time for a session, so
+                 * what we do here is once we're into X% of the session's TTL
+                 * we grab a new session from the container.
+                 *
+                 * (inactive * 1000) * (pct / 100) ==> (inactive * 10 * pct)
+                 */
+        if (session.getLastAccessedTime() - session.getCreationTime() >
+            (session.getMaxInactiveInterval() * 10 * percentInactiveTimeTriggerRebuild)) {
+          HttpSession nativeSession = super.getSession();
+          session.failoverSession(nativeSession);
+        }
+        return session;
+      }
+
+      if (requestedSessionId != null) {
+        session = (GemfireHttpSession) manager.getSession(
+            requestedSessionId);
+        if (session != null) {
+          session.setIsNew(false);
+          // This means we've failed over to another node
+          if (session.getNativeSession() == null) {
+            try {
+              ThreadLocalSession.set(session);
+              HttpSession nativeSession = super.getSession();
+              session.failoverSession(nativeSession);
+              session.putInRegion();
+            } finally {
+              ThreadLocalSession.remove();
+            }
+          }
+        }
+      }
+
+      if (session == null || !session.isValid()) {
+        if (create) {
+          try {
+            session = (GemfireHttpSession) manager.wrapSession(null);
+            ThreadLocalSession.set(session);
+            HttpSession nativeSession = super.getSession();
+            if (session.getNativeSession() == null) {
+              session.setNativeSession(nativeSession);
+            } else {
+              assert (session.getNativeSession() == nativeSession);
+            }
+            session.setIsNew(true);
+            manager.putSession(session);
+          } finally {
+            ThreadLocalSession.remove();
+          }
+        } else {
+          // create is false, and session is either null or not valid.
+          // The spec says return a null:
+          return null;
+        }
+      }
+
+      if (session != null) {
+        addSessionCookie(response);
+        session.updateAccessTime();
+      }
+
+      return session;
+    }
+
+    private void addSessionCookie(HttpServletResponse response) {
+      // Don't bother if the response is already committed
+      if (response.isCommitted()) {
+        return;
+      }
+
+      // Get the existing cookies
+      Cookie[] cookies = getCookies();
+
+      Cookie cookie = new Cookie(manager.getSessionCookieName(),
+          session.getId());
+      cookie.setPath("".equals(getContextPath()) ? "/" : getContextPath());
+      // Clear out all old cookies and just set ours
+      response.addCookie(cookie);
+
+      // Replace all other cookies which aren't JSESSIONIDs
+      if (cookies != null) {
+        for (Cookie c : cookies) {
+          if (manager.getSessionCookieName().equals(c.getName())) {
+            continue;
+          }
+          response.addCookie(c);
+        }
+      }
+
+    }
+
+    private String getCookieString(Cookie c) {
+      StringBuilder cookie = new StringBuilder();
+      cookie.append(c.getName()).append("=").append(c.getValue());
+
+      if (c.getPath() != null) {
+        cookie.append("; ").append("Path=").append(c.getPath());
+      }
+      if (c.getDomain() != null) {
+        cookie.append("; ").append("Domain=").append(c.getDomain());
+      }
+      if (c.getSecure()) {
+        cookie.append("; ").append("Secure");
+      }
+
+      cookie.append("; HttpOnly");
+
+      return cookie.toString();
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean isRequestedSessionIdFromCookie() {
+      return sessionFromCookie;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean isRequestedSessionIdFromURL() {
+      return sessionFromURL;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public String getRequestedSessionId() {
+      if (requestedSessionId != null) {
+        return requestedSessionId;
+      } else {
+        return super.getRequestedSessionId();
+      }
+    }
+
+        /*
+         * Hmmm... not sure if this is right or even good to do. So, in some
+         * cases - for ex. using a Spring security filter, we have 3 possible
+         * wrappers to deal with - the original, this one and one created by
+         * Spring. When a servlet or JSP is forwarded to the original request
+         * is passed in, but then this (the wrapped) request is used by the JSP.
+         * In some cases, the outer wrapper also contains information relevant
+         * to the request - in this case security info. So here we allow access
+         * to that. There's probably a better way....
+         */
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public Principal getUserPrincipal() {
+      if (outerRequest != null) {
+        return outerRequest.getUserPrincipal();
+      } else {
+        return super.getUserPrincipal();
+      }
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public String getRemoteUser() {
+      if (outerRequest != null) {
+        return outerRequest.getRemoteUser();
+      } else {
+        return super.getRemoteUser();
+      }
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public boolean isUserInRole(String role) {
+      if (outerRequest != null) {
+        return outerRequest.isUserInRole(role);
+      } else {
+        return super.isUserInRole(role);
+      }
+    }
+
+    //////////////////////////////////////////////////////////////
+    // Non-API methods
+
+    void setOuterWrapper(HttpServletRequest outer) {
+      this.outerRequest = outer;
+    }
+
+    //////////////////////////////////////////////////////////////
+    // Private methods
+    private String extractSessionId() {
+      final int prefix = getRequestURL().indexOf(URL_SESSION_IDENTIFIER);
+      if (prefix != -1) {
+        final int start = prefix + URL_SESSION_IDENTIFIER.length();
+        int suffix = getRequestURL().indexOf("?", start);
+        if (suffix < 0) {
+          suffix = getRequestURL().indexOf("#", start);
+        }
+        if (suffix <= prefix) {
+          return getRequestURL().substring(start);
+        }
+        return getRequestURL().substring(start, suffix);
+      }
+      return null;
+    }
+  }
+
+  /**
+   * This response wrapper class extends the support class
+   * HttpServletResponseWrapper, which implements all the methods in the
+   * HttpServletResponse interface, as delegations to the wrapped response. You
+   * only need to override the methods that you need to change. You can get
+   * access to the wrapped response using the method getResponse()
+   */
+  class ResponseWrapper extends HttpServletResponseWrapper {
+
+    HttpServletResponse originalResponse;
+
+    public ResponseWrapper(HttpServletResponse response) throws IOException {
+      super(response);
+      originalResponse = response;
+    }
+
+    public HttpServletResponse getOriginalResponse() {
+      return originalResponse;
+    }
+
+    @Override
+    public void setHeader(String name, String value) {
+      super.setHeader(name, value);
+    }
+
+    @Override
+    public void setIntHeader(String name, int value) {
+      super.setIntHeader(name, value);
+    }
+  }
+
+
+  public SessionCachingFilter() {
+  }
+
+  /**
+   * @param request  The servlet request we are processing
+   * @param response The servlet response we are creating
+   * @param chain    The filter chain we are processing
+   * @throws IOException      if an input/output error occurs
+   * @throws ServletException if a servlet error occurs
+   */
+  @Override
+  public void doFilter(ServletRequest request, ServletResponse response,
+      FilterChain chain)
+      throws IOException, ServletException {
+
+    HttpServletRequest httpReq = (HttpServletRequest) request;
+    HttpServletResponse httpResp = (HttpServletResponse) response;
+
+    /**
+     * Early out if this isn't the right kind of request. We might see a
+     * RequestWrapper instance during a forward or include request.
+     */
+    if (request instanceof RequestWrapper ||
+        !(request instanceof HttpServletRequest)) {
+      LOG.debug("Handling already-wrapped request");
+      chain.doFilter(request, response);
+      return;
+    }
+
+    // Create wrappers for the request and response objects.
+    // Using these, you can extend the capabilities of the
+    // request and response, for example, allow setting parameters
+    // on the request before sending the request to the rest of the filter chain,
+    // or keep track of the cookies that are set on the response.
+    //
+    // Caveat: some servers do not handle wrappers very well for forward or
+    // include requests.
+
+    ResponseWrapper wrappedResponse = new ResponseWrapper(httpResp);
+    final RequestWrapper wrappedRequest =
+        new RequestWrapper(manager, httpReq, wrappedResponse);
+
+    Throwable problem = null;
+
+    try {
+      chain.doFilter(wrappedRequest, wrappedResponse);
+    } catch (Throwable t) {
+      // If an exception is thrown somewhere down the filter chain,
+      // we still want to execute our after processing, and then
+      // rethrow the problem after that.
+      problem = t;
+      LOG.error("Exception processing filter chain", t);
+    }
+
+    GemfireHttpSession session =
+        (GemfireHttpSession) wrappedRequest.getSession(false);
+
+    // If there was a problem, we want to rethrow it if it is
+    // a known type, otherwise log it.
+    if (problem != null) {
+      if (problem instanceof ServletException) {
+        throw (ServletException) problem;
+      }
+      if (problem instanceof IOException) {
+        throw (IOException) problem;
+      }
+      sendProcessingError(problem, response);
+    }
+
+    /**
+     * Commit any updates. What actually happens at that point is
+     * dependent on the type of attributes defined for use by the sessions.
+     */
+    if (session != null) {
+      session.commit();
+    }
+  }
+
+  /**
+   * Return the filter configuration object for this filter.
+   */
+  public FilterConfig getFilterConfig() {
+    return (this.filterConfig);
+  }
+
+  /**
+   * Set the filter configuration object for this filter.
+   *
+   * @param filterConfig The filter configuration object
+   */
+  public void setFilterConfig(FilterConfig filterConfig) {
+    this.filterConfig = filterConfig;
+  }
+
+  /**
+   * Destroy method for this filter
+   */
+  @Override
+  public void destroy() {
+    if (manager != null) {
+      manager.stop();
+    }
+  }
+
+  /**
+   * This is where all the initialization happens.
+   *
+   * @param config
+   * @throws ServletException
+   */
+  @Override
+  public void init(final FilterConfig config) {
+    LOG.info("Starting Session Filter initialization");
+    this.filterConfig = config;
+
+    if (started.getAndDecrement() > 0) {
+      /**
+       * Allow override for testing purposes
+       */
+      String managerClassStr =
+          config.getInitParameter("session-manager-class");
+
+      // Otherwise default
+      if (managerClassStr == null) {
+        managerClassStr = GemfireSessionManager.class.getName();
+      }
+
+      try {
+        manager = (SessionManager) Class.forName(
+            managerClassStr).newInstance();
+        manager.start(config, this.getClass().getClassLoader());
+      } catch (Exception ex) {
+        LOG.error("Exception creating Session Manager", ex);
+      }
+
+      startingLatch.countDown();
+    } else {
+      try {
+        startingLatch.await();
+      } catch (InterruptedException iex) {
+      }
+
+      LOG.debug("SessionManager and listener initialization skipped - "
+          + "already done.");
+    }
+
+    LOG.info("Session Filter initialization complete");
+    LOG.debug("Filter class loader {}", this.getClass().getClassLoader());
+  }
+
+  /**
+   * Return a String representation of this object.
+   */
+  @Override
+  public String toString() {
+    if (filterConfig == null) {
+      return ("SessionCachingFilter()");
+    }
+    StringBuilder sb = new StringBuilder("SessionCachingFilter(");
+    sb.append(filterConfig);
+    sb.append(")");
+    return (sb.toString());
+
+  }
+
+
+  private void sendProcessingError(Throwable t, ServletResponse response) {
+    String stackTrace = getStackTrace(t);
+
+    if (stackTrace != null && !stackTrace.equals("")) {
+      try {
+        response.setContentType("text/html");
+        PrintStream ps = new PrintStream(response.getOutputStream());
+        PrintWriter pw = new PrintWriter(ps);
+        pw.print(
+            "<html>\n<head>\n<title>Error</title>\n</head>\n<body>\n"); //NOI18N
+
+        // PENDING! Localize this for next official release
+        pw.print("<h1>The resource did not process correctly</h1>\n<pre>\n");
+        pw.print(stackTrace);
+        pw.print("</pre></body>\n</html>"); //NOI18N
+        pw.close();
+        ps.close();
+        response.getOutputStream().close();
+      } catch (Exception ex) {
+      }
+    } else {
+      try {
+        PrintStream ps = new PrintStream(response.getOutputStream());
+        t.printStackTrace(ps);
+        ps.close();
+        response.getOutputStream().close();
+      } catch (Exception ex) {
+      }
+    }
+  }
+
+  public static String getStackTrace(Throwable t) {
+    String stackTrace = null;
+    try {
+      StringWriter sw = new StringWriter();
+      PrintWriter pw = new PrintWriter(sw);
+      t.printStackTrace(pw);
+      pw.close();
+      sw.close();
+      stackTrace = sw.getBuffer().toString();
+    } catch (Exception ex) {
+    }
+    return stackTrace;
+  }
+
+  /**
+   * Retrieve the SessionManager. This is only here so that tests can get access
+   * to the cache.
+   */
+  static SessionManager getSessionManager() {
+    return manager;
+  }
+
+  /**
+   * Return the GemFire session which wraps a native session
+   *
+   * @param nativeSession the native session for which the corresponding GemFire
+   *                      session should be returned.
+   * @return the GemFire session or null if no session maps to the native
+   * session
+   */
+  public static HttpSession getWrappingSession(HttpSession nativeSession) {
+        /*
+         * This is a special case where the GemFire session has been set as a
+         * ThreadLocal during session creation.
+         */
+    GemfireHttpSession gemfireSession = (GemfireHttpSession) ThreadLocalSession.get();
+    if (gemfireSession != null) {
+      gemfireSession.setNativeSession(nativeSession);
+      return gemfireSession;
+    }
+    return getSessionManager().getWrappingSession(nativeSession.getId());
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/db02660d/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/SessionListener.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/SessionListener.java b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/SessionListener.java
new file mode 100644
index 0000000..9726be0
--- /dev/null
+++ b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/SessionListener.java
@@ -0,0 +1,41 @@
+/*=========================================================================
+ * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+package com.gemstone.gemfire.modules.session.filter;
+
+import com.gemstone.gemfire.distributed.DistributedSystemDisconnectedException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.servlet.http.HttpSessionEvent;
+import javax.servlet.http.HttpSessionListener;
+
+public class SessionListener implements HttpSessionListener {
+
+  private static final Logger LOG =
+      LoggerFactory.getLogger(SessionListener.class.getName());
+
+  public void sessionCreated(HttpSessionEvent httpSessionEvent) {
+  }
+
+  /**
+   * This will receive events from the container using the native sessions.
+   */
+  public void sessionDestroyed(HttpSessionEvent event) {
+    String nativeId = event.getSession().getId();
+    try {
+      String sessionId = SessionCachingFilter.getSessionManager().destroyNativeSession(
+          nativeId);
+      LOG.debug(
+          "Received sessionDestroyed event for native session {} (wrapped by {})",
+          nativeId, sessionId);
+    } catch (DistributedSystemDisconnectedException dex) {
+      LOG.debug("Cache disconnected - unable to destroy native session {0}",
+          nativeId);
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/db02660d/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/installer/Installer.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/installer/Installer.java b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/installer/Installer.java
new file mode 100644
index 0000000..ee773d2
--- /dev/null
+++ b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/installer/Installer.java
@@ -0,0 +1,287 @@
+/*=========================================================================
+ * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+
+package com.gemstone.gemfire.modules.session.installer;
+
+import com.gemstone.gemfire.modules.session.installer.args.Argument;
+import com.gemstone.gemfire.modules.session.installer.args.ArgumentProcessor;
+import com.gemstone.gemfire.modules.session.installer.args.ArgumentValues;
+import com.gemstone.gemfire.modules.session.installer.args.UnknownArgumentHandler;
+import com.gemstone.gemfire.modules.session.installer.args.UsageException;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.transform.OutputKeys;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+import java.io.ByteArrayOutputStream;
+import java.io.FileInputStream;
+import java.io.InputStream;
+import java.io.OutputStream;
+
+/**
+ *
+ */
+public class Installer {
+
+  private static final String GEMFIRE_FILTER_CLASS =
+      "com.gemstone.gemfire.modules.session.filter.SessionCachingFilter";
+
+  private static final String GEMFIRE_LISTENER_CLASS =
+      "com.gemstone.gemfire.modules.session.filter.SessionListener";
+
+  private ArgumentValues argValues;
+
+  private static final Argument ARG_HELP =
+      new Argument("-h", false).
+          setDescription("Displays this help message.");
+
+  private static Argument ARG_GEMFIRE_PARAMETERS =
+      new Argument("-p", false, "param=value").
+          setDescription("Specific parameter for inclusion into the "
+              + "session filter definition as a regular "
+              + "init-param. Can be given multiple times.");
+
+  private static Argument ARG_CACHE_TYPE =
+      new Argument("-t", false, "cache-type").
+          setDescription(
+              "Type of cache. Must be one of 'peer-to-peer' or "
+                  + "'client-server'. Default is peer-to-peer.").
+          setDefaults("peer-to-peer");
+
+  private static Argument ARG_WEB_XML_FILE =
+      new Argument("-w", true, "web.xml file").
+          setDescription("The web.xml file to be modified.");
+
+
+  /**
+   * Class main method
+   *
+   * @param args Arguments passed in via the command line
+   * @throws Exception in the event of any errors
+   */
+  public static void main(final String[] args) throws Exception {
+    new Installer(args).process();
+  }
+
+  public static void log(String message) {
+    System.err.println(message);
+  }
+
+
+  public Installer(String[] args) throws Exception {
+    final ArgumentProcessor processor = new ArgumentProcessor("Installer");
+
+    argValues = null;
+    try {
+      // These are ordered so as to keep the options alphabetical
+      processor.addArgument(ARG_HELP);
+      processor.addArgument(ARG_GEMFIRE_PARAMETERS);
+      processor.addArgument(ARG_CACHE_TYPE);
+      processor.addArgument(ARG_WEB_XML_FILE);
+
+      processor.setUnknownArgumentHandler(new UnknownArgumentHandler() {
+        @Override
+        public void handleUnknownArgument(
+            final String form, final String[] params) {
+          log("Unknown argument being ignored: "
+              + form + " (" + params.length + " params)");
+          log("Use '-h' argument to display usage");
+        }
+      });
+      argValues = processor.process(args);
+
+      if (argValues.isDefined(ARG_HELP)) {
+        final UsageException usageException =
+            new UsageException("Usage requested by user");
+        usageException.setUsage(processor.getUsage());
+        throw (usageException);
+      }
+
+    } catch (UsageException ux) {
+      final StringBuilder error = new StringBuilder();
+      error.append("\nERROR: ");
+      error.append(ux.getMessage());
+      error.append("\n");
+      if (ux.getUsage() != null) {
+        error.append(ux.getUsage());
+      }
+      log(error.toString());
+      System.exit(2);
+    }
+
+  }
+
+
+  /**
+   * The main entry point for processing
+   *
+   * @throws Exception if any errors occur.
+   */
+  public void process() throws Exception {
+    String argInputFile = argValues.getFirstResult(ARG_WEB_XML_FILE);
+
+    ByteArrayOutputStream output = new ByteArrayOutputStream();
+    InputStream input = new FileInputStream(argInputFile);
+
+    processWebXml(input, output);
+    input.close();
+
+    System.out.println(output.toString());
+  }
+
+
+  private void processWebXml(final InputStream webXml,
+      final OutputStream out) throws Exception {
+
+    Document doc = createWebXmlDoc(webXml);
+    mangleWebXml(doc);
+
+    streamXML(doc, out);
+  }
+
+
+  private Document createWebXmlDoc(final InputStream webXml)
+      throws Exception {
+    Document doc;
+    final DocumentBuilderFactory factory =
+        DocumentBuilderFactory.newInstance();
+    final DocumentBuilder builder = factory.newDocumentBuilder();
+    doc = builder.parse(webXml);
+
+    return doc;
+  }
+
+
+  private Document mangleWebXml(final Document doc) {
+    final Element docElement = doc.getDocumentElement();
+    final NodeList nodelist = docElement.getChildNodes();
+    Node firstFilter = null;
+    Node displayElement = null;
+    Node afterDisplayElement = null;
+
+    for (int i = 0; i < nodelist.getLength(); i++) {
+      final Node node = nodelist.item(i);
+      final String name = node.getNodeName();
+      if ("display-name".equals(name)) {
+        displayElement = node;
+      } else {
+        if ("filter".equals(name)) {
+          if (firstFilter == null) {
+            firstFilter = node;
+          }
+        }
+        if (displayElement != null && afterDisplayElement == null) {
+          afterDisplayElement = node;
+        }
+      }
+    }
+
+    Node initParam;
+    final Element filter = doc.createElement("filter");
+    append(doc, filter, "filter-name", "gemfire-session-filter");
+    append(doc, filter, "filter-class", GEMFIRE_FILTER_CLASS);
+
+    // Set the type of cache
+    initParam = append(doc, filter, "init-param", null);
+    append(doc, initParam, "param-name", "cache-type");
+    append(doc, initParam, "param-value",
+        argValues.getFirstResult(ARG_CACHE_TYPE));
+
+
+    if (argValues.isDefined(ARG_GEMFIRE_PARAMETERS)) {
+      for (String[] val : argValues.getAllResults(ARG_GEMFIRE_PARAMETERS)) {
+        String gfParam = val[0];
+        int idx = gfParam.indexOf("=");
+        initParam = append(doc, filter, "init-param", null);
+        append(doc, initParam, "param-name", gfParam.substring(0, idx));
+        append(doc, initParam, "param-value", gfParam.substring(idx + 1));
+      }
+    }
+
+    Node first = firstFilter;
+    if (first == null) {
+      if (afterDisplayElement != null) {
+        first = afterDisplayElement;
+      }
+    }
+    if (first == null) {
+      first = docElement.getFirstChild();
+    }
+    docElement.insertBefore(filter, first);
+    final Element filterMapping = doc.createElement("filter-mapping");
+    append(doc, filterMapping, "filter-name", "gemfire-session-filter");
+    append(doc, filterMapping, "url-pattern", "/*");
+    append(doc, filterMapping, "dispatcher", "FORWARD");
+    append(doc, filterMapping, "dispatcher", "INCLUDE");
+    append(doc, filterMapping, "dispatcher", "REQUEST");
+    append(doc, filterMapping, "dispatcher", "ERROR");
+    final Element contextListener = doc.createElement("listener");
+    append(doc, contextListener, "listener-class", GEMFIRE_LISTENER_CLASS);
+    docElement.insertBefore(filterMapping, after(docElement, "filter"));
+    docElement.insertBefore(contextListener,
+        after(docElement, "filter-mapping"));
+    return doc;
+  }
+
+  private Node after(final Node parent, final String nodeName) {
+    final NodeList nodelist = parent.getChildNodes();
+    int index = -1;
+    for (int i = 0; i < nodelist.getLength(); i++) {
+      final Node node = nodelist.item(i);
+      final String name = node.getNodeName();
+      if (nodeName.equals(name)) {
+        index = i;
+      }
+    }
+    if (index == -1)
+      return null;
+    if (nodelist.getLength() > (index + 1)) {
+      return nodelist.item(index + 1);
+    }
+    return null;
+  }
+
+  private Node append(final Document doc, final Node parent,
+      final String element,
+      final String value) {
+    final Element child = doc.createElement(element);
+    if (value != null)
+      child.setTextContent(value);
+    parent.appendChild(child);
+    return child;
+  }
+
+  private void streamXML(final Document doc, final OutputStream out) {
+    try {// Use a Transformer for output
+      final TransformerFactory tFactory = TransformerFactory.newInstance();
+      final Transformer transformer = tFactory.newTransformer();
+      if (doc.getDoctype() != null) {
+        final String systemId = doc.getDoctype().getSystemId();
+        final String publicId = doc.getDoctype().getPublicId();
+        transformer.setOutputProperty(OutputKeys.DOCTYPE_PUBLIC, publicId);
+        transformer.setOutputProperty(OutputKeys.DOCTYPE_SYSTEM, systemId);
+      }
+      transformer.setOutputProperty(OutputKeys.INDENT, "yes");
+      transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount",
+          "4");
+      final DOMSource source = new DOMSource(doc);
+      final StreamResult result = new StreamResult(out);
+      transformer.transform(source, result);
+    } catch (final Exception e) {
+      e.printStackTrace();
+    }
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/db02660d/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/installer/JarClassLoader.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/installer/JarClassLoader.java b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/installer/JarClassLoader.java
new file mode 100644
index 0000000..1d850bf
--- /dev/null
+++ b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/installer/JarClassLoader.java
@@ -0,0 +1,114 @@
+/*=========================================================================
+ * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+package com.gemstone.gemfire.modules.session.installer;
+
+import java.io.Closeable;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.Enumeration;
+import java.util.jar.JarEntry;
+import java.util.jar.JarFile;
+
+/**
+ * Classloader, grabbed from the web, which allows finding classes in jars
+ * within jars. This is used to check whether a listener, as found in web.xml,
+ * is a ServletContextListener
+ */
+public class JarClassLoader extends URLClassLoader {
+
+  public JarClassLoader(URL[] urls, ClassLoader parent) {
+    super(urls, parent);
+
+    try {
+      for (URL url : urls) {
+        if (isJar(url.getFile())) {
+          addJarResource(new File(url.getPath()));
+        }
+      }
+    } catch (IOException e) {
+      e.printStackTrace();
+    }
+  }
+
+  private void addJarResource(File file) throws IOException {
+    JarFile jarFile = new JarFile(file);
+    addURL(file.toURL());
+    Enumeration<JarEntry> jarEntries = jarFile.entries();
+    while (jarEntries.hasMoreElements()) {
+      JarEntry jarEntry = jarEntries.nextElement();
+      if (!jarEntry.isDirectory() && isJar(jarEntry.getName())) {
+        addJarResource(jarEntryAsFile(jarFile, jarEntry));
+      }
+    }
+  }
+
+  @Override
+  protected synchronized Class<?> loadClass(String name, boolean resolve)
+      throws ClassNotFoundException {
+    try {
+      Class<?> clazz = findLoadedClass(name);
+      if (clazz == null) {
+        clazz = findClass(name);
+        if (resolve) {
+          resolveClass(clazz);
+        }
+      }
+      return clazz;
+    } catch (ClassNotFoundException e) {
+      return super.loadClass(name, resolve);
+    }
+  }
+
+  private static void close(Closeable closeable) {
+    if (closeable != null) {
+      try {
+        closeable.close();
+      } catch (IOException e) {
+        e.printStackTrace();
+      }
+    }
+  }
+
+  private static boolean isJar(String fileName) {
+    return fileName != null && (fileName.toLowerCase().endsWith(".jar") ||
+        fileName.toLowerCase().endsWith(".war") ||
+        fileName.toLowerCase().endsWith(".ear"));
+  }
+
+  private static File jarEntryAsFile(JarFile jarFile,
+      JarEntry jarEntry) throws IOException {
+    InputStream input = null;
+    OutputStream output = null;
+    try {
+      String name = jarEntry.getName().replace('/', '_');
+      int i = name.lastIndexOf(".");
+      String extension = i > -1 ? name.substring(i) : "";
+      File file = File.createTempFile(
+          name.substring(0, name.length() - extension.length()) + ".",
+          extension);
+      file.deleteOnExit();
+      input = jarFile.getInputStream(jarEntry);
+      output = new FileOutputStream(file);
+      int readCount;
+      byte[] buffer = new byte[4096];
+      while ((readCount = input.read(buffer)) != -1) {
+        output.write(buffer, 0, readCount);
+      }
+      return file;
+    } finally {
+      close(input);
+      close(output);
+    }
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/db02660d/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/installer/args/Argument.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/installer/args/Argument.java b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/installer/args/Argument.java
new file mode 100644
index 0000000..bb1a73d
--- /dev/null
+++ b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/installer/args/Argument.java
@@ -0,0 +1,265 @@
+/*=========================================================================
+ * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+package com.gemstone.gemfire.modules.session.installer.args;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Class representing a single command line argument.
+ */
+public class Argument {
+
+  /**
+   * Parameter names.
+   */
+  private final String[] paramNames;
+
+  /**
+   * Default values for the parameters when not explicitly set.
+   */
+  private String[] defaults;
+
+  /**
+   * Environment variable names forfor each parameter where values will be
+   * pulled in, if not explicitly provided and if the environment variable
+   * exists.
+   */
+  private String[] envVars;
+
+  /**
+   * Flag indicating whether this argument is required on the command line.
+   */
+  private final boolean required;
+
+  /**
+   * Handler used to hook into processing.
+   */
+  private ArgumentHandler handler;
+
+  /**
+   * List of all representation forms.
+   */
+  private final List<String> forms = new ArrayList<String>();
+
+  /**
+   * Usage description.
+   */
+  private String description;
+
+  ///////////////////////////////////////////////////////////////////////////
+  // Constructor:
+
+  /**
+   * Contructor to create an argument definition.
+   *
+   * @param primaryForm    the form of the argument (e.g., --foo).  Should start
+   *                       with a dash.
+   * @param argRequired    flag indicating whether or not the argument is
+   *                       required to be onthe command line
+   * @param parameterNames names of the parameters to this argument for use in
+   *                       the usage generation
+   */
+  public Argument(
+      final String primaryForm,
+      final boolean argRequired,
+      final String... parameterNames) {
+    forms.add(primaryForm);
+    paramNames = parameterNames;
+    required = argRequired;
+  }
+
+  /**
+   * Returns the number of parameters that this argument takes.
+   *
+   * @return parameter count
+   */
+  public int getParameterCount() {
+    return paramNames.length;
+  }
+
+  /**
+   * Returns the name of the parameter position requested.
+   *
+   * @param idx parameter index
+   * @return parameter name
+   */
+  public String getParameterName(final int idx) {
+    return paramNames[idx];
+  }
+
+  /**
+   * Returns whether or not this argument is required to be defined.
+   *
+   * @return true if required, false if optional
+   */
+  public boolean isRequired() {
+    return required;
+  }
+
+  /**
+   * Determines if the argument provisioning has been done via the environment.
+   */
+  public boolean isDefinedInEnv() {
+    if (envVars == null || paramNames.length == 0) {
+      return false;
+    }
+    for (String var : envVars) {
+      if (System.getenv(var) == null) {
+        return false;
+      }
+    }
+    return true;
+  }
+
+  /**
+   * Sets the argument handler.
+   *
+   * @param aHandler argument handler
+   * @return this argument (for chained calls)
+   */
+  public Argument setArgumentHandler(final ArgumentHandler aHandler) {
+    handler = aHandler;
+    return this;
+  }
+
+  /**
+   * Returns the argument handler.
+   *
+   * @return argument handler
+   */
+  public ArgumentHandler getArgumentHandler() {
+    return handler;
+  }
+
+  /**
+   * Adds a possible representation of the command line argument.
+   *
+   * @param aliasName additional form to accept
+   * @return this argument (for chained calls)
+   */
+  public Argument addForm(final String aliasName) {
+    forms.add(aliasName);
+    return this;
+  }
+
+  /**
+   * Returns the primary form of the argument.
+   *
+   * @return primary form
+   */
+  public String getPrimaryForm() {
+    if (forms.isEmpty()) {
+      return null;
+    } else {
+      return forms.get(0);
+    }
+  }
+
+  /**
+   * Returns a list of all valid representations of this command line argument.
+   *
+   * @return list of all registered forms
+   */
+  public List<String> getForms() {
+    return forms;
+  }
+
+  /**
+   * Sets a usage description for this argument.
+   *
+   * @param str usage description
+   * @return this argument (for chained calls)
+   */
+  public Argument setDescription(final String str) {
+    description = str;
+    return this;
+  }
+
+  /**
+   * Returns a usage description of this argument.
+   *
+   * @return description
+   */
+  public String getDescription() {
+    return description;
+  }
+
+  /**
+   * Sets the default values when no explicit values were provided.
+   *
+   * @param newDefaults default values for all argument parameters
+   * @return this argument (for chained calls)
+   */
+  public Argument setDefaults(final String... newDefaults) {
+    if (newDefaults.length != paramNames.length) {
+      throw (new IllegalArgumentException(
+          "Defaults array length provided is not the correct size"));
+    }
+    defaults = newDefaults;
+    return this;
+  }
+
+  /**
+   * Returns the defaults.
+   *
+   * @return default parameter values
+   */
+  public String[] getDefaults() {
+    return defaults;
+  }
+
+  /**
+   * Sets the environment variables which will be checked for values before
+   * falling back on the default values.
+   *
+   * @param newEnvVars environment variable name array
+   * @return this argument (for chained calls)
+   */
+  public Argument setEnvVars(final String... newEnvVars) {
+    if (newEnvVars.length != paramNames.length) {
+      throw (new IllegalArgumentException(
+          "Environment variables array length provided is not "
+              + "the correct size"));
+    }
+    envVars = newEnvVars;
+    return this;
+  }
+
+  /**
+   * Returns the environment variable names for each parameter.
+   *
+   * @return environment variable names
+   */
+  public String[] getEnvVars() {
+    return envVars;
+  }
+
+  /**
+   * Returns a human readable form.
+   *
+   * @return human readable string
+   */
+  @Override
+  public String toString() {
+    final StringBuilder builder = new StringBuilder();
+    builder.append("[Argument '");
+    builder.append(forms.get(0));
+    builder.append("'");
+    if (paramNames.length > 0) {
+      for (int i = 0; i < paramNames.length; i++) {
+        builder.append(" <");
+        builder.append(paramNames[i]);
+        builder.append(">");
+      }
+    }
+    builder.append("]");
+    return builder.toString();
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/db02660d/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/installer/args/ArgumentHandler.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/installer/args/ArgumentHandler.java b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/installer/args/ArgumentHandler.java
new file mode 100644
index 0000000..a165148
--- /dev/null
+++ b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/installer/args/ArgumentHandler.java
@@ -0,0 +1,28 @@
+/*=========================================================================
+ * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+package com.gemstone.gemfire.modules.session.installer.args;
+
+/**
+ * Interface specifying the requirements for objects wiching to be able to
+ * examine arguments (potentially tweaking parameters) at the time of parsing,
+ * thereby allowing for usage display to occur automatically.
+ */
+public interface ArgumentHandler {
+
+  /**
+   * Process the argument values specified.
+   *
+   * @param arg    argument definition
+   * @param form   form which was used on the command line
+   * @param params parameters supplied to the argument
+   * @throws UsageException when usage was suboptimal
+   */
+  void handleArgument(Argument arg, String form, String[] params)
+      throws UsageException;
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/db02660d/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/installer/args/ArgumentProcessor.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/installer/args/ArgumentProcessor.java b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/installer/args/ArgumentProcessor.java
new file mode 100644
index 0000000..950f2f0
--- /dev/null
+++ b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/installer/args/ArgumentProcessor.java
@@ -0,0 +1,387 @@
+/*=========================================================================
+ * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+package com.gemstone.gemfire.modules.session.installer.args;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.logging.Logger;
+
+/**
+ * This class is used to process command line arguments for Java programs in a
+ * flexible and powerful manner.
+ */
+public class ArgumentProcessor {
+  /**
+   * Logger.
+   */
+  private static final Logger LOG =
+      Logger.getLogger(ArgumentProcessor.class.getName());
+
+  /**
+   * Description line length.
+   */
+  private static final int LINE_LENGTH = 60;
+
+  /**
+   * Map containing all arguments defined, indexed by their unique IDs.
+   */
+  private final List<Argument> args = new ArrayList<Argument>();
+
+  /**
+   * Unknown argument handler.
+   */
+  private UnknownArgumentHandler handler;
+
+  /**
+   * Program name to display in usage.
+   */
+  private String programName;
+
+  ///////////////////////////////////////////////////////////////////////////
+  // Classes:
+
+  /**
+   * Structure used to represent an argument match.
+   */
+  private static class Match {
+    /**
+     * The argument which matched.
+     */
+    private final Argument arg;
+
+    /**
+     * The specific form which matched.
+     */
+    private final String form;
+
+    /**
+     * The parameters to the argument form.
+     */
+    private final String[] params;
+
+    /**
+     * Constructor.
+     *
+     * @param theArgument the argument which matched
+     * @param theForm     the form used
+     * @param theParams   the parameters supplied
+     */
+    public Match(
+        final Argument theArgument,
+        final String theForm, final String[] theParams) {
+      arg = theArgument;
+      form = theForm;
+      params = theParams;
+    }
+
+    /**
+     * Accessor.
+     *
+     * @return argument which matched
+     */
+    public Argument getArgument() {
+      return arg;
+    }
+
+    /**
+     * Accessor.
+     *
+     * @return form which was used
+     */
+    public String getForm() {
+      return form;
+    }
+
+    /**
+     * Accessor.
+     *
+     * @return parameters supplied
+     */
+    public String[] getParams() {
+      return params;
+    }
+  }
+
+  ///////////////////////////////////////////////////////////////////////////
+  // Constructors:
+
+  /**
+   * Creates a new Argument processor instance for te program name given.
+   *
+   * @param progName program name used in usage
+   */
+  public ArgumentProcessor(final String progName) {
+    programName = progName;
+  }
+
+
+  ///////////////////////////////////////////////////////////////////////////
+  // Public methods:
+
+  /**
+   * Adds a new argument.
+   *
+   * @param arg argument to add
+   */
+  public void addArgument(final Argument arg) {
+    args.add(arg);
+  }
+
+  /**
+   * Sets the handler to call when an unknown argument is encountered.
+   *
+   * @param aHandler unknown arg handler, or null to unset
+   */
+  public void setUnknownArgumentHandler(
+      final UnknownArgumentHandler aHandler) {
+    handler = aHandler;
+  }
+
+  /**
+   * Process the command line arguments provided.
+   *
+   * @param programArgs command line arguments supplied to program
+   * @return argument values parsed out of command line
+   * @throws UsageException when usge sucked
+   */
+  public ArgumentValues process(final String[] programArgs)
+      throws UsageException {
+    ArgumentHandler argHandler;
+    final ArgumentValues result = new ArgumentValues();
+    List<Argument> unmatched;
+    List<Match> matches;
+
+    // Find all argument matches and set postArgs
+    matches = checkMatches(programArgs, result);
+
+    // Find arguments which didnt match
+    unmatched = new ArrayList<Argument>();
+    unmatched.addAll(args);
+    for (Match match : matches) {
+      unmatched.remove(match.getArgument());
+    }
+
+    // Error on unmatched yet required args
+    for (Argument arg : unmatched) {
+      if (arg.isRequired() && !arg.isDefinedInEnv()) {
+        final UsageException usageException = new UsageException(
+            "Required argument not provided: " + arg);
+        usageException.setUsage(getUsage());
+        throw usageException;
+      }
+    }
+
+    // Handle the arguments
+    for (Match match : matches) {
+      final Argument arg = match.getArgument();
+      argHandler = arg.getArgumentHandler();
+      if (argHandler != null) {
+        argHandler.handleArgument(
+            arg, match.getForm(), match.getParams());
+      }
+      result.addResult(arg, match.getParams());
+    }
+
+    return result;
+  }
+
+
+  /**
+   * Generates command line usage text for display to user.
+   *
+   * @return usage to dusplay to user
+   */
+  public String getUsage() {
+    final StringBuilder builder = new StringBuilder();
+    List<String> descriptionLines;
+    final String blank20 = "                    ";
+
+    builder.append("\nUSAGE: ");
+    if (programName == null) {
+      builder.append("<program>");
+    } else {
+      builder.append(programName);
+    }
+    if (args.isEmpty()) {
+      builder.append("\nNo arguments supported.\n");
+    } else {
+      builder.append(" <args>\nWHERE <args>:\n\n");
+      for (Argument arg : args) {
+        for (String form : arg.getForms()) {
+          builder.append("    ");
+          builder.append(form);
+
+          for (int i = 0; i < arg.getParameterCount(); i++) {
+            builder.append(" <");
+            builder.append(arg.getParameterName(i));
+            builder.append(">");
+          }
+          builder.append("\n");
+        }
+
+        descriptionLines =
+            breakupString(arg.getDescription(), LINE_LENGTH);
+        if (descriptionLines.isEmpty()) {
+          builder.append(blank20);
+          builder.append("No argument description provided.");
+          builder.append("\n\n");
+        } else {
+          for (String line : descriptionLines) {
+            builder.append(blank20);
+            builder.append(line.trim());
+            builder.append("\n");
+          }
+          builder.append("\n");
+        }
+      }
+    }
+    builder.append("\n");
+
+    return builder.toString();
+  }
+
+
+  ///////////////////////////////////////////////////////////////////////////
+  // Private methods:
+
+  /**
+   * Builds a listof all argument matches and sets the postArgs array.
+   *
+   * @param programArgs command line arguments to search through
+   * @param values      values object in which to store results
+   * @return list of matches
+   * @throws UsageException when there is EBKAC
+   */
+  private List<Match> checkMatches(
+      final String[] programArgs, final ArgumentValues values)
+      throws UsageException {
+    final List<Match> result = new ArrayList<Match>();
+    Match match;
+    String[] params;
+    String[] postArgs;
+    int idx = 0;
+    int idx2;
+
+    while (idx < programArgs.length) {
+      // Check for end-of-parameters arg
+      if ("--".equals(programArgs[idx])) {
+        if (++idx < programArgs.length) {
+          postArgs = new String[programArgs.length - idx];
+          System.arraycopy(programArgs, idx,
+              postArgs, 0, postArgs.length);
+          values.setPostArgs(postArgs);
+        }
+        // We're done processing args'
+        break;
+      }
+
+      // Determine parameter count
+      idx2 = idx;
+      while ((idx2 + 1) < programArgs.length
+          && programArgs[idx2 + 1].charAt(0) != '-') {
+        idx2++;
+      }
+
+      // Generate parameter array
+      params = new String[idx2 - idx];
+      System.arraycopy(programArgs, idx + 1, params, 0, params.length);
+
+      LOG.fine("Arg: " + programArgs[idx]);
+      LOG.fine("Params: " + params.length);
+
+      // Find first argument matches
+      match = null;
+      for (Argument arg : args) {
+        match = checkMatch(programArgs[idx], arg, params);
+        if (match != null) {
+          result.add(match);
+          LOG.fine("Match found: ");
+          LOG.fine("     ID: " + arg);
+          LOG.fine("   Form: " + match.getForm());
+          break;
+        }
+      }
+      if (match == null) {
+        if (handler == null) {
+          final UsageException usageException = new UsageException(
+              "Unknown argument: " + programArgs[idx]
+                  + " with " + params.length + " parameters.");
+          usageException.setUsage(getUsage());
+          throw (usageException);
+        } else {
+          handler.handleUnknownArgument(programArgs[idx], params);
+        }
+      }
+
+      idx += params.length + 1;
+    }
+
+    return result;
+  }
+
+  /**
+   * Checks to see if an rgument form matches the suppies parameter list.
+   *
+   * @param argName argument name
+   * @param arg     argument
+   * @param params  parameters supplied
+   * @return match object on match, null otherwise
+   */
+  private Match checkMatch(
+      final String argName, final Argument arg, final String[] params) {
+    // Look for a matching form
+    for (String form : arg.getForms()) {
+      if (
+          form.equals(argName)
+              && arg.getParameterCount() == params.length) {
+        return new Match(arg, form, params);
+      }
+    }
+
+    return null;
+  }
+
+  /**
+   * Breaks up a string into sub-strings, each with a length equal to or less
+   * than the max length specified.
+   *
+   * @param str       string to break up
+   * @param maxLength maximum line length to use
+   * @return broken up string
+   */
+  private List<String> breakupString(
+      final String str, final int maxLength) {
+    final List<String> result = new ArrayList<String>();
+    int startIdx = -1;
+    int lastIdx;
+    int idx;
+
+    if (str == null) {
+      return result;
+    }
+
+    do {
+      idx = startIdx;
+      do {
+        lastIdx = idx;
+        idx = str.indexOf(' ', lastIdx + 1);
+        LOG.fine("startIdx=" + startIdx + "  lastIdx=" + lastIdx
+            + "  idx=" + idx);
+        if (idx < 0) {
+          // Canot break line up any further
+          result.add(str.substring(startIdx + 1));
+          return result;
+        }
+      } while ((idx - startIdx) <= maxLength);
+
+      result.add(str.substring(startIdx + 1, lastIdx));
+      startIdx = lastIdx;
+    } while (true);
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/db02660d/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/installer/args/ArgumentValues.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/installer/args/ArgumentValues.java b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/installer/args/ArgumentValues.java
new file mode 100644
index 0000000..7be926c
--- /dev/null
+++ b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/installer/args/ArgumentValues.java
@@ -0,0 +1,212 @@
+/*=========================================================================
+ * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+package com.gemstone.gemfire.modules.session.installer.args;
+
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * Result object capturing the result of processing command line arguments.
+ */
+public class ArgumentValues {
+
+  /**
+   * Storage location for all arguments found after the "--" pseudo-arg.
+   */
+  private String[] postArgs = new String[]{};
+
+  /**
+   * Storage location for the command line argument values.
+   */
+  private final Map<Argument, List<String[]>> values =
+      new LinkedHashMap<Argument, List<String[]>>();
+
+  /**
+   * Constructor.
+   */
+  ArgumentValues() {
+    // Empty.
+  }
+
+  /**
+   * Sets the post-arguments found after the "--" pseudo-argument.
+   *
+   * @param newPostArgs arguments defined after the special "--" argument
+   */
+  void setPostArgs(final String[] newPostArgs) {
+    postArgs = newPostArgs;
+  }
+
+  /**
+   * After processing the command line arguments, this method may be used to
+   * return all arguments which were excluded from processing by their placement
+   * after the "<code>--</code>" psuedo-argument.
+   *
+   * @return all unprocess arguments
+   */
+  public String[] getPostArgs() {
+    return postArgs;
+  }
+
+  /**
+   * Sets the data values found for a specific argument.
+   *
+   * @param arg         argument
+   * @param paramValues parameter values for the argument
+   */
+  public void addResult(final Argument arg, final String[] paramValues) {
+    List<String[]> list = values.get(arg);
+    if (list == null) {
+      list = new ArrayList<String[]>();
+      list.add(paramValues);
+      values.put(arg, list);
+    } else {
+      list.add(paramValues);
+    }
+  }
+
+  /**
+   * Returns a list of all defined arguments.
+   *
+   * @return set of arguments
+   */
+  public Set<Argument> getDefinedArguments() {
+    return values.keySet();
+  }
+
+  /**
+   * Counts the number of arguments defined on the command line which are in the
+   * list provided.
+   *
+   * @param ofThese the arguments to search for, or null to count all supplied
+   *                arguments
+   * @return count of the defined arguments
+   */
+  public int getDefinedCount(Argument... ofThese) {
+    if (ofThese.length == 0) {
+      return values.keySet().size();
+    }
+
+    int count = 0;
+    for (Argument arg : values.keySet()) {
+      boolean found = false;
+      for (int i = 0; !found && i < ofThese.length; i++) {
+        if (ofThese[i].equals(arg)) {
+          count++;
+          found = true;
+        }
+      }
+    }
+    return count;
+  }
+
+  /**
+   * Returns whetheror not the command line argument was actually provided on
+   * the command line.
+   *
+   * @param arg argument to query
+   * @return true if the argument is defined by the command line, false
+   * otherwise
+   */
+  public boolean isDefined(final Argument arg) {
+    final List<String[]> result = values.get(arg);
+    return (result != null);
+  }
+
+  /**
+   * Returns all results for the specified argument.  If a command line option
+   * is specified more than once, this is the method to use to get all values.
+   *
+   * @param arg argument to query
+   * @return list of all parameter lists defined for this argument
+   */
+  public List<String[]> getAllResults(final Argument arg) {
+    List<String[]> result = values.get(arg);
+
+    if (result == null) {
+      final String[] envVars = arg.getEnvVars();
+      final String[] defaults = arg.getDefaults();
+      final String[] vals = new String[arg.getParameterCount()];
+      boolean found = defaults != null;
+
+      for (int i = 0; i < arg.getParameterCount(); i++) {
+        if (defaults != null) {
+          vals[i] = defaults[i];
+        }
+        if (envVars != null) {
+          String val = System.getenv(envVars[i]);
+          if (val != null) {
+            found = true;
+            vals[i] = val;
+          }
+        }
+      }
+
+      if (found) {
+        result = new ArrayList<String[]>();
+        result.add(vals);
+      }
+    }
+    return result;
+  }
+
+  /**
+   * Convenience method to retrieve the first instance of the command line
+   * argument's values.
+   *
+   * @param arg argument to query
+   * @return first parameter list defined for this argument
+   */
+  public String[] getResult(final Argument arg) {
+    final List<String[]> all = getAllResults(arg);
+    if (all == null) {
+      return null;
+    } else {
+      return all.get(0);
+    }
+  }
+
+  /**
+   * Convenience method to return the first value of the first instance of the
+   * command line argument values for the specified argument.
+   *
+   * @param arg argument to query
+   * @return first parameter of the first list of parameters supplied
+   */
+  public String getFirstResult(final Argument arg) {
+    final String[] all = getResult(arg);
+    if (all == null) {
+      return null;
+    } else {
+      return all[0];
+    }
+  }
+
+  /**
+   * Convenience method to return the result of getFirstResult method as an
+   * integer.
+   *
+   * @param arg            argument to query
+   * @param undefinedValue value to return when argument is not defined or is
+   *                       illegally defined
+   * @return value specified, or default value provided
+   */
+  public int getFirstResultAsInt(
+      final Argument arg, final int undefinedValue) {
+    final String value = getFirstResult(arg);
+    if (value == null) {
+      return undefinedValue;
+    } else {
+      return Integer.parseInt(value);
+    }
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/db02660d/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/installer/args/URLArgumentHandler.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/installer/args/URLArgumentHandler.java b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/installer/args/URLArgumentHandler.java
new file mode 100644
index 0000000..f0800d4
--- /dev/null
+++ b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/installer/args/URLArgumentHandler.java
@@ -0,0 +1,67 @@
+/*=========================================================================
+ * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+package com.gemstone.gemfire.modules.session.installer.args;
+
+import java.io.File;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+/**
+ * Argument handler implementation which accepts file paths or URLs and
+ * normalizes the parameters to URLs.
+ */
+public class URLArgumentHandler implements ArgumentHandler {
+
+  /**
+   * Logger.
+   */
+  private static final Logger LOG =
+      Logger.getLogger(URLArgumentHandler.class.getName());
+
+  /**
+   * Ensure that the argument is either a file path or a properly formatted URL.
+   *  If it is a file path, convert to a URL.  If neither, throws a
+   * UsageException.
+   *
+   * @param arg        argument
+   * @param form       form used
+   * @param parameters parameters supplied
+   * @throws UsageException when file not found or not a workable URL
+   */
+  public void handleArgument(
+      final Argument arg,
+      final String form,
+      final String[] parameters)
+      throws UsageException {
+    final File file = new File(parameters[0]);
+    URL result = null;
+
+    if (file.exists()) {
+      try {
+        result = file.toURI().toURL();
+      } catch (MalformedURLException mux) {
+        LOG.log(Level.FINEST, "Caught Exception", mux);
+      }
+    }
+    if (result == null) {
+      try {
+        result = new URL(parameters[0]);
+      } catch (MalformedURLException mux) {
+        LOG.log(Level.FINEST, "Caught Exception", mux);
+      }
+    }
+    if (result == null) {
+      throw (new UsageException(
+          "Argument parameter value is not a valid file "
+              + "path or URL: " + arg));
+    }
+    parameters[0] = result.toString();
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/db02660d/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/installer/args/UnknownArgumentHandler.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/installer/args/UnknownArgumentHandler.java b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/installer/args/UnknownArgumentHandler.java
new file mode 100644
index 0000000..1cf0ecc
--- /dev/null
+++ b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/installer/args/UnknownArgumentHandler.java
@@ -0,0 +1,19 @@
+package com.gemstone.gemfire.modules.session.installer.args;
+
+/**
+ * Interface defining unknown argument handlers, given the opportunity to either
+ * ignore the issue or force the parameter to be dealt with.
+ */
+public interface UnknownArgumentHandler {
+
+  /**
+   * Called when an unknown argument is supplied.
+   *
+   * @param form   argument name used
+   * @param params parameters passed into it
+   * @throws UsageException when the user needs to fix it
+   */
+  void handleUnknownArgument(String form, String[] params)
+      throws UsageException;
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/db02660d/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/installer/args/UsageException.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/installer/args/UsageException.java b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/installer/args/UsageException.java
new file mode 100644
index 0000000..1d22dee
--- /dev/null
+++ b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/installer/args/UsageException.java
@@ -0,0 +1,79 @@
+/*=========================================================================
+ * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+package com.gemstone.gemfire.modules.session.installer.args;
+
+/**
+ * Invalid usage exception.
+ */
+public class UsageException extends Exception {
+
+  /**
+   * Serial format version.
+   */
+  private static final long serialVersionUID = 1L;
+
+  /**
+   * Stored usage message.
+   */
+  private String usage;
+
+  /**
+   * Creates a new UsageException.
+   */
+  public UsageException() {
+    super();
+  }
+
+  /**
+   * Creates a new UsageException.
+   *
+   * @param message description of exceptional condition
+   */
+  public UsageException(final String message) {
+    super(message);
+  }
+
+  /**
+   * Creates a new UsageException.
+   *
+   * @param message description of exceptional condition
+   * @param cause   provoking exception
+   */
+  public UsageException(final String message, final Throwable cause) {
+    super(message, cause);
+  }
+
+  /**
+   * Creates a new UsageException.
+   *
+   * @param cause provoking exception
+   */
+  public UsageException(final Throwable cause) {
+    super(cause);
+  }
+
+
+  /**
+   * Attaches a usage message to the exception for later consumption.
+   *
+   * @param usageText text to display to user to guide them to correct usage.
+   *                  This is generated and set by the <code>ArgsProcessor</code>.
+   */
+  public void setUsage(final String usageText) {
+    usage = usageText;
+  }
+
+  /**
+   * Returns the usage message previously set.
+   *
+   * @return message or null if not set.
+   */
+  public String getUsage() {
+    return usage;
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/db02660d/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/common/PeerToPeerSessionCache.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/common/PeerToPeerSessionCache.java b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/common/PeerToPeerSessionCache.java
index 7ba5e76..0139cca 100644
--- a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/common/PeerToPeerSessionCache.java
+++ b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/common/PeerToPeerSessionCache.java
@@ -130,10 +130,10 @@ public class PeerToPeerSessionCache extends AbstractSessionCache {
     if (region == null) {
       // Create the region
       region = RegionHelper.createRegion(cache, configuration);
-      LOG.info("Created new session region: " + region);
+      LOG.info("Created new session region: {}", region);
     } else {
       // Validate the existing region
-      LOG.info("Retrieved existing session region: " + region);
+      LOG.info("Retrieved existing session region: {}", region);
       RegionHelper.validateRegion(cache, configuration, region);
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/db02660d/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/ContextManager.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/ContextManager.java b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/ContextManager.java
deleted file mode 100644
index 4954376..0000000
--- a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/ContextManager.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-
-package com.gemstone.gemfire.modules.session.internal.filter;
-
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-import javax.servlet.ServletContext;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * This class is a singleton and manages the mapping of context paths to
- * original ServletContext objects as well as a mapping of paths to Cache
- * reference handles.
- */
-public class ContextManager {
-
-  /**
-   * Logger object
-   */
-  private static final Logger LOG =
-      LoggerFactory.getLogger(ContextManager.class.getName());
-
-  /**
-   * Mapping of context path to ServletContext object
-   */
-  private final ConcurrentMap<String, ServletContext> contextMap =
-      new ConcurrentHashMap<String, ServletContext>(16);
-
-  /**
-   * Our singleton reference
-   */
-  private static final ContextManager manager = new ContextManager();
-
-  private ContextManager() {
-    // This is a singleton
-    LOG.info("Initializing ContextManager");
-  }
-
-  /**
-   * Return our singleton instance
-   *
-   * @return
-   */
-  public static ContextManager getInstance() {
-    return manager;
-  }
-
-  /**
-   * Add a context to our collection
-   *
-   * @param context the {@code ServletContext} to add
-   */
-  public void putContext(ServletContext context) {
-    String path = context.getContextPath();
-    contextMap.put(path, context);
-    LOG.info("Adding context '{}' {}", path, context);
-  }
-
-  /**
-   * Remove a context from our collection
-   *
-   * @param context the context to remove
-   */
-  public void removeContext(ServletContext context) {
-    String path = context.getContextPath();
-    contextMap.remove(path);
-    LOG.info("Removing context '{}'", path);
-  }
-
-  /**
-   * Retrieve the context for a given path
-   *
-   * @param path
-   * @return the GemfireServletContext object or null if the path is not found
-   */
-  public ServletContext getContext(String path) {
-    ServletContext ctx = contextMap.get(path);
-    if (ctx == null) {
-      LOG.warn("No context for requested contextPath '{}'", path);
-    }
-    return ctx;
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/db02660d/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/AbstractListener.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/AbstractListener.java b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/AbstractListener.java
new file mode 100644
index 0000000..94dc07f
--- /dev/null
+++ b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/AbstractListener.java
@@ -0,0 +1,52 @@
+/*=========================================================================
+ * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package com.gemstone.gemfire.modules.session.internal.filter;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * @author jdeppe
+ */
+public abstract class AbstractListener {
+
+  protected final List<ListenerEventType> events =
+      new ArrayList<ListenerEventType>();
+
+  protected CountDownLatch latch;
+
+  public AbstractListener() {
+    this(1);
+  }
+
+  public AbstractListener(int numCalls) {
+    latch = new CountDownLatch(numCalls);
+    RendezvousManager.registerListener(this);
+  }
+
+  public synchronized void setLatch(int numCalls) {
+    latch = new CountDownLatch(numCalls);
+    events.clear();
+  }
+
+  public boolean await(long timeout,
+      TimeUnit unit) throws InterruptedException {
+    return latch.await(timeout, unit);
+  }
+
+  public List<ListenerEventType> getEvents() {
+    return events;
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/db02660d/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/Callback.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/Callback.java b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/Callback.java
new file mode 100644
index 0000000..ab74084
--- /dev/null
+++ b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/Callback.java
@@ -0,0 +1,17 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package com.gemstone.gemfire.modules.session.internal.filter;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * @author jdeppe
+ */
+public interface Callback {
+  public void call(HttpServletRequest request,
+      HttpServletResponse response);
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/db02660d/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/CallbackServlet.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/CallbackServlet.java b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/CallbackServlet.java
new file mode 100644
index 0000000..f9d2971
--- /dev/null
+++ b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/CallbackServlet.java
@@ -0,0 +1,88 @@
+/*=========================================================================
+ * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package com.gemstone.gemfire.modules.session.internal.filter;
+
+import java.io.IOException;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * @author jdeppe
+ */
+public class CallbackServlet extends HttpServlet {
+
+  private Callback callback;
+
+  /**
+   * Processes requests for both HTTP <code>GET</code> and <code>POST</code>
+   * methods.
+   *
+   * @param request  servlet request
+   * @param response servlet response
+   * @throws ServletException if a servlet-specific error occurs
+   * @throws IOException      if an I/O error occurs
+   */
+  protected void processRequest(HttpServletRequest request,
+      HttpServletResponse response)
+      throws ServletException, IOException {
+
+    if (callback != null) {
+      callback.call(request, response);
+    }
+  }
+
+  public void setCallback(Callback callback) {
+    this.callback = callback;
+  }
+
+  /**
+   * Handles the HTTP <code>GET</code> method.
+   *
+   * @param request  servlet request
+   * @param response servlet response
+   * @throws ServletException if a servlet-specific error occurs
+   * @throws IOException      if an I/O error occurs
+   */
+  @Override
+  protected void doGet(HttpServletRequest request, HttpServletResponse response)
+      throws ServletException, IOException {
+    processRequest(request, response);
+  }
+
+  /**
+   * Handles the HTTP <code>POST</code> method.
+   *
+   * @param request  servlet request
+   * @param response servlet response
+   * @throws ServletException if a servlet-specific error occurs
+   * @throws IOException      if an I/O error occurs
+   */
+  @Override
+  protected void doPost(HttpServletRequest request,
+      HttpServletResponse response)
+      throws ServletException, IOException {
+    processRequest(request, response);
+  }
+
+  /**
+   * Returns a short description of the servlet.
+   *
+   * @return a String containing servlet description
+   */
+  @Override
+  public String getServletInfo() {
+    return "Short description";
+  }
+
+}



[04/24] incubator-geode git commit: GEODE-14: Move GemFire Sessions module and relocate all packages to 'internal'

Posted by je...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/filter/IntegrationTest.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/filter/IntegrationTest.java b/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/filter/IntegrationTest.java
deleted file mode 100644
index 50b6425..0000000
--- a/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/filter/IntegrationTest.java
+++ /dev/null
@@ -1,1552 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-package com.gemstone.gemfire.modules.session.filter;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.util.ArrayList;
-import java.util.EnumSet;
-import java.util.Enumeration;
-import java.util.List;
-import java.util.StringTokenizer;
-import java.util.concurrent.TimeUnit;
-import javax.servlet.DispatcherType;
-import javax.servlet.RequestDispatcher;
-import javax.servlet.ServletException;
-import javax.servlet.http.Cookie;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpSession;
-
-import com.gemstone.gemfire.cache.Region;
-import com.gemstone.gemfire.modules.junit.PerTestClassLoaderRunner;
-import org.apache.jasper.servlet.JspServlet;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.eclipse.jetty.servlet.FilterHolder;
-import org.eclipse.jetty.servlet.ServletHolder;
-import org.eclipse.jetty.http.HttpTester;
-
-import static org.junit.Assert.*;
-
-/**
- * In-container testing using Jetty. This allows us to test context listener
- * events as well as dispatching actions.
- */
-@RunWith(PerTestClassLoaderRunner.class)
-public class IntegrationTest {
-
-  private MyServletTester tester;
-
-  private HttpTester.Request request;
-
-  private HttpTester.Response response;
-
-  private ServletHolder servletHolder;
-
-  private FilterHolder filterHolder;
-
-  private static final File tmpdir;
-
-  private static final String gemfire_log;
-
-  static {
-    // Create a per-user scratch directory
-    tmpdir = new File(System.getProperty("java.io.tmpdir"),
-        "gemfire_modules-" + System.getProperty("user.name"));
-    tmpdir.mkdirs();
-    tmpdir.deleteOnExit();
-
-    gemfire_log = tmpdir.getPath() +
-        System.getProperty("file.separator") + "gemfire_modules.log";
-  }
-
-  @Before
-  public void setUp() throws Exception {
-    request = HttpTester.newRequest();
-
-    tester = new MyServletTester();
-    tester.setContextPath("/test");
-
-    filterHolder = tester.addFilter(SessionCachingFilter.class, "/*",
-        EnumSet.of(DispatcherType.REQUEST));
-    filterHolder.setInitParameter("gemfire.property.mcast-port", "0");
-    filterHolder.setInitParameter("gemfire.property.writable-working-dir",
-        tmpdir.getPath());
-    filterHolder.setInitParameter("cache-type", "peer-to-peer");
-    filterHolder.setInitParameter("gemfire.property.log-file",
-        gemfire_log);
-
-    servletHolder = tester.addServlet(BasicServlet.class, "/hello");
-    servletHolder.setInitParameter("test.callback", "callback_1");
-
-    /**
-     * This starts the servlet. Our wrapped servlets *must* start
-     * immediately otherwise the ServletContext is not captured correctly.
-     */
-    servletHolder.setInitOrder(0);
-  }
-
-  @After
-  public void tearDown() throws Exception {
-    if (tester.isStarted()) {
-      ContextManager.getInstance().removeContext(
-          servletHolder.getServlet().getServletConfig().getServletContext());
-    }
-    tester.stop();
-  }
-
-  @Test
-  public void testSanity() throws Exception {
-    Callback c = new Callback() {
-      @Override
-      public void call(HttpServletRequest request, HttpServletResponse response)
-          throws IOException {
-        PrintWriter out = response.getWriter();
-        out.write("Hello World");
-      }
-    };
-
-    tester.setAttribute("callback_1", c);
-    tester.start();
-    ContextManager.getInstance().putContext(
-        servletHolder.getServlet().getServletConfig().getServletContext());
-
-    request.setMethod("GET");
-    request.setURI("/test/hello");
-    request.setHeader("Host", "tester");
-    request.setVersion("HTTP/1.0");
-
-    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
-
-    assertEquals(200, response.getStatus());
-    assertEquals("Hello World", response.getContent());
-  }
-
-  @Test
-  public void testSessionGenerated() throws Exception {
-    Callback c = new Callback() {
-      @Override
-      public void call(HttpServletRequest request, HttpServletResponse response)
-          throws IOException {
-        PrintWriter out = response.getWriter();
-        out.write(request.getSession().getId());
-      }
-    };
-
-    tester.setAttribute("callback_1", c);
-    tester.start();
-    ContextManager.getInstance().putContext(
-        servletHolder.getServlet().getServletConfig().getServletContext());
-
-    request.setMethod("GET");
-    request.setURI("/test/hello");
-    request.setHeader("Host", "tester");
-    request.setVersion("HTTP/1.0");
-
-    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
-
-    assertTrue("Not a correctly generated session id",
-        response.getContent().endsWith("-GF"));
-
-    List<Cookie> cookies = getCookies(response);
-    assertEquals("Session id != JSESSIONID from cookie",
-        response.getContent(), cookies.get(0).getValue());
-
-    Region r = getRegion();
-    assertNotNull("Session not found in region",
-        r.get(cookies.get(0).getValue()));
-  }
-
-
-  /**
-   * Test that getSession(false) does not create a new session
-   */
-  @Test
-  public void testSessionNotGenerated() throws Exception {
-    Callback c = new Callback() {
-      @Override
-      public void call(HttpServletRequest request, HttpServletResponse response)
-          throws IOException {
-        String output = "OK";
-        HttpSession s = request.getSession(false);
-        if (s != null) {
-          output = s.getId();
-        }
-        PrintWriter out = response.getWriter();
-        out.write(output);
-      }
-    };
-
-    tester.setAttribute("callback_1", c);
-    tester.start();
-    ContextManager.getInstance().putContext(
-        servletHolder.getServlet().getServletConfig().getServletContext());
-
-    request.setMethod("GET");
-    request.setURI("/test/hello");
-    request.setHeader("Host", "tester");
-    request.setVersion("HTTP/1.0");
-
-    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
-
-    assertEquals("Session should not have been created", "OK",
-        response.getContent());
-  }
-
-
-  @Test
-  public void testUnknownAttributeIsNull() throws Exception {
-    Callback c = new Callback() {
-      @Override
-      public void call(HttpServletRequest request, HttpServletResponse response)
-          throws IOException {
-        Object o = request.getSession().getAttribute("unknown");
-        PrintWriter out = response.getWriter();
-        if (o == null) {
-          out.write("null");
-        } else {
-          out.write(o.toString());
-        }
-      }
-    };
-
-    tester.setAttribute("callback_1", c);
-    tester.start();
-    ContextManager.getInstance().putContext(
-        servletHolder.getServlet().getServletConfig().getServletContext());
-
-    request.setMethod("GET");
-    request.setURI("/test/hello");
-    request.setHeader("Host", "tester");
-    request.setVersion("HTTP/1.0");
-
-    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
-
-    assertEquals("Unknown attribute should be null", "null",
-        response.getContent());
-  }
-
-
-  @Test
-  public void testSessionRemains1() throws Exception {
-    Callback c = new Callback() {
-      @Override
-      public void call(HttpServletRequest request, HttpServletResponse response)
-          throws IOException {
-        String output = "null";
-        HttpSession session = request.getSession();
-        if (session.isNew()) {
-          output = "new";
-          session.setAttribute("foo", output);
-        } else {
-          output = (String) session.getAttribute("foo");
-          if (output != null) {
-            output = "old";
-          }
-        }
-        PrintWriter out = response.getWriter();
-        out.write(output);
-      }
-    };
-
-    tester.setAttribute("callback_1", c);
-    tester.start();
-    ContextManager.getInstance().putContext(
-        servletHolder.getServlet().getServletConfig().getServletContext());
-
-    request.setMethod("GET");
-    request.setURI("/test/hello");
-    request.setHeader("Host", "tester");
-    request.setVersion("HTTP/1.0");
-
-    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
-
-    assertEquals("Session should be new", "new", response.getContent());
-
-    List<Cookie> cookies = getCookies(response);
-    request.setHeader("Cookie", "JSESSIONID=" + cookies.get(0).getValue());
-
-    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
-
-    assertEquals("Session should be old", "old", response.getContent());
-
-    List<Cookie> cookies2 = getCookies(response);
-    assertEquals("Session IDs should be the same", cookies.get(0).getValue(),
-        cookies2.get(0).getValue());
-
-    Region r = getRegion();
-    assertNotNull("Session object should exist in region",
-        r.get(cookies.get(0).getValue()));
-  }
-
-  /**
-   * Test that attributes are updated on the backend
-   */
-  @Test
-  public void testAttributesUpdatedInRegion() throws Exception {
-    Callback c_1 = new Callback() {
-      @Override
-      public void call(HttpServletRequest request, HttpServletResponse response)
-          throws IOException, ServletException {
-        request.getSession().setAttribute("foo", "bar");
-      }
-    };
-
-    // This is the callback used to invalidate the session
-    Callback c_2 = new Callback() {
-      @Override
-      public void call(HttpServletRequest request, HttpServletResponse response)
-          throws IOException, ServletException {
-        request.getSession().setAttribute("foo", "baz");
-      }
-    };
-
-    tester.setAttribute("callback_1", c_1);
-    tester.setAttribute("callback_2", c_2);
-
-    servletHolder.setInitParameter("test.callback", "callback_1");
-
-    ServletHolder sh2 = tester.addServlet(BasicServlet.class, "/request2");
-    sh2.setInitParameter("test.callback", "callback_2");
-
-    tester.start();
-    ContextManager.getInstance().putContext(
-        servletHolder.getServlet().getServletConfig().getServletContext());
-
-    request.setMethod("GET");
-    request.setURI("/test/hello");
-    request.setHeader("Host", "tester");
-    request.setVersion("HTTP/1.0");
-    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
-
-    List<Cookie> cookies = getCookies(response);
-
-    Region r = getRegion();
-    assertEquals("bar",
-        ((HttpSession) r.get(cookies.get(0).getValue())).getAttribute("foo"));
-
-    request.setHeader("Cookie", "JSESSIONID=" + cookies.get(0).getValue());
-    request.setURI("/test/request2");
-    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
-
-    assertEquals("baz",
-        ((HttpSession) r.get(cookies.get(0).getValue())).getAttribute(
-            "foo"));
-  }
-
-  /**
-   * Test setting an attribute to null deletes it
-   */
-  @Test
-  public void testSetAttributeNullDeletesIt() throws Exception {
-    Callback c_1 = new Callback() {
-      @Override
-      public void call(HttpServletRequest request, HttpServletResponse response)
-          throws IOException, ServletException {
-        request.getSession().setAttribute("foo", "bar");
-      }
-    };
-
-    // This is the callback used to invalidate the session
-    Callback c_2 = new Callback() {
-      @Override
-      public void call(HttpServletRequest request, HttpServletResponse response)
-          throws IOException, ServletException {
-        request.getSession().setAttribute("foo", null);
-      }
-    };
-
-    tester.setAttribute("callback_1", c_1);
-    tester.setAttribute("callback_2", c_2);
-
-    servletHolder.setInitParameter("test.callback", "callback_1");
-
-    ServletHolder sh2 = tester.addServlet(BasicServlet.class, "/request2");
-    sh2.setInitParameter("test.callback", "callback_2");
-
-    tester.start();
-    ContextManager.getInstance().putContext(
-        servletHolder.getServlet().getServletConfig().getServletContext());
-
-    request.setMethod("GET");
-    request.setURI("/test/hello");
-    request.setHeader("Host", "tester");
-    request.setVersion("HTTP/1.0");
-    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
-
-    List<Cookie> cookies = getCookies(response);
-
-    Region r = getRegion();
-    assertEquals("bar",
-        ((HttpSession) r.get(cookies.get(0).getValue())).getAttribute(
-            "foo"));
-
-    request.setHeader("Cookie", "JSESSIONID=" + cookies.get(0).getValue());
-    request.setURI("/test/request2");
-    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
-
-    assertNull(
-        ((HttpSession) r.get(cookies.get(0).getValue())).getAttribute(
-            "foo"));
-  }
-
-// Don't see how to do this currently as the SessionListener needs a full
-// web context to work in.
-
-//    /**
-//     * Test that sessions expire correctly
-//     */
-//    public void testSessionExpiration() throws Exception {
-//        Callback c_1 = new Callback() {
-//            @Override
-//            public void call(HttpServletRequest request, HttpServletResponse response)
-//                    throws IOException, ServletException {
-//                HttpSession s = request.getSession();
-//                s.setAttribute("foo", "bar");
-//                s.setMaxInactiveInterval(1);
-//
-//                PrintWriter out = response.getWriter();
-//                out.write(s.getId());
-//            }
-//        };
-//
-//        // This is the callback used to check if the session is still there
-//        Callback c_2 = new Callback() {
-//            @Override
-//            public void call(HttpServletRequest request, HttpServletResponse response)
-//                    throws IOException, ServletException {
-//                HttpSession s = request.getSession(false);
-//                String output;
-//                if (s == null) {
-//                    output = "null";
-//                } else {
-//                    output = s.getId();
-//                }
-//
-//                PrintWriter out = response.getWriter();
-//                out.write(output);
-//            }
-//        };
-//
-//        tester.addEventListener(new SessionListener());
-//        tester.setAttribute("callback_1", c_1);
-//        tester.setAttribute("callback_2", c_2);
-//
-//        servletHolder.setInitParameter("test.callback", "callback_1");
-//
-//        ServletHolder sh2 = tester.addServlet(BasicServlet.class, "/request2");
-//        sh2.setInitParameter("test.callback", "callback_2");
-//
-//        tester.start();
-//        ContextManager.getInstance().putContext(
-//                servletHolder.getServlet().getServletConfig().getServletContext());
-//
-//        request.setMethod("GET");
-//        request.setURI("/test/hello");
-//        request.setHeader("Host", "tester");
-//        request.setVersion("HTTP/1.0");
-//        response.parse(tester.getResponses(request.generate()));
-//
-//        String id = response.getContent();
-//
-//        // Wait for the session to expire
-//        Thread.sleep(2000);
-//
-//        request.setHeader("Cookie", "JSESSIONID=" + id);
-//        request.setURI("/test/request2");
-//        response.parse(tester.getResponses(request.generate()));
-//
-//        assertEquals("null", response.getContent());
-//
-//        Region r = getRegion();
-//        assertNull("Region should not contain session", r.get(id));
-//    }
-
-  /**
-   * Test that invalidating a session destroys it as well as the backend
-   * object.
-   */
-  @Test
-  public void testInvalidateSession1() throws Exception {
-    Callback c_1 = new Callback() {
-      @Override
-      public void call(HttpServletRequest request, HttpServletResponse response)
-          throws IOException, ServletException {
-        request.getSession().setAttribute("foo", "bar");
-      }
-    };
-
-    // This is the callback used to invalidate the session
-    Callback c_2 = new Callback() {
-      @Override
-      public void call(HttpServletRequest request, HttpServletResponse response)
-          throws IOException, ServletException {
-        request.getSession(false).invalidate();
-      }
-    };
-
-    tester.setAttribute("callback_1", c_1);
-    tester.setAttribute("callback_2", c_2);
-
-    servletHolder.setInitParameter("test.callback", "callback_1");
-
-    ServletHolder sh2 = tester.addServlet(BasicServlet.class, "/request2");
-    sh2.setInitParameter("test.callback", "callback_2");
-
-    tester.start();
-    ContextManager.getInstance().putContext(
-        servletHolder.getServlet().getServletConfig().getServletContext());
-
-    request.setMethod("GET");
-    request.setURI("/test/hello");
-    request.setHeader("Host", "tester");
-    request.setVersion("HTTP/1.0");
-    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
-
-    List<Cookie> cookies = getCookies(response);
-    Region r = getRegion();
-    assertEquals("bar",
-        ((HttpSession) r.get(cookies.get(0).getValue())).getAttribute("foo"));
-
-    request.setHeader("Cookie", "JSESSIONID=" + cookies.get(0).getValue());
-    request.setURI("/test/request2");
-    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
-
-    assertNull("Region should not contain session",
-        r.get(cookies.get(0).getValue()));
-  }
-
-  /**
-   * Test that invalidating a session throws an exception on subsequent access.
-   */
-  @Test
-  public void testInvalidateSession2() throws Exception {
-    Callback c_1 = new Callback() {
-      @Override
-      public void call(HttpServletRequest request, HttpServletResponse response)
-          throws IOException, ServletException {
-        HttpSession s = request.getSession();
-        s.invalidate();
-        PrintWriter out = response.getWriter();
-        try {
-          s.getAttribute("foo");
-        } catch (IllegalStateException iex) {
-          out.write("OK");
-        }
-      }
-    };
-
-    tester.setAttribute("callback_1", c_1);
-
-    servletHolder.setInitParameter("test.callback", "callback_1");
-
-    tester.start();
-    ContextManager.getInstance().putContext(
-        servletHolder.getServlet().getServletConfig().getServletContext());
-
-    request.setMethod("GET");
-    request.setURI("/test/hello");
-    request.setHeader("Host", "tester");
-    request.setVersion("HTTP/1.0");
-    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
-
-    assertEquals("OK", response.getContent());
-  }
-
-  /**
-   * Test that invalidating a session throws an exception on subsequent access.
-   */
-  @Test
-  public void testInvalidateSession3() throws Exception {
-    Callback c_1 = new Callback() {
-      @Override
-      public void call(HttpServletRequest request, HttpServletResponse response)
-          throws IOException, ServletException {
-        HttpSession s = request.getSession();
-        s.invalidate();
-        PrintWriter out = response.getWriter();
-        try {
-          s.getAttributeNames();
-        } catch (IllegalStateException iex) {
-          out.write("OK");
-        }
-      }
-    };
-
-    tester.setAttribute("callback_1", c_1);
-
-    servletHolder.setInitParameter("test.callback", "callback_1");
-
-    tester.start();
-    ContextManager.getInstance().putContext(
-        servletHolder.getServlet().getServletConfig().getServletContext());
-
-    request.setMethod("GET");
-    request.setURI("/test/hello");
-    request.setHeader("Host", "tester");
-    request.setVersion("HTTP/1.0");
-    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
-
-    assertEquals("OK", response.getContent());
-  }
-
-  /**
-   * Test that invalidating a session throws an exception on subsequent access.
-   */
-  @Test
-  public void testInvalidateSession4() throws Exception {
-    Callback c_1 = new Callback() {
-      @Override
-      public void call(HttpServletRequest request, HttpServletResponse response)
-          throws IOException, ServletException {
-        HttpSession s = request.getSession();
-        s.invalidate();
-        PrintWriter out = response.getWriter();
-        try {
-          s.getCreationTime();
-        } catch (IllegalStateException iex) {
-          out.write("OK");
-        }
-      }
-    };
-
-    tester.setAttribute("callback_1", c_1);
-
-    servletHolder.setInitParameter("test.callback", "callback_1");
-
-    tester.start();
-    ContextManager.getInstance().putContext(
-        servletHolder.getServlet().getServletConfig().getServletContext());
-
-    request.setMethod("GET");
-    request.setURI("/test/hello");
-    request.setHeader("Host", "tester");
-    request.setVersion("HTTP/1.0");
-    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
-
-    assertEquals("OK", response.getContent());
-  }
-
-  /**
-   * Test that invalidating a session does not throw an exception for subsequent
-   * getId calls.
-   */
-  @Test
-  public void testInvalidateSession5() throws Exception {
-    Callback c_1 = new Callback() {
-      @Override
-      public void call(HttpServletRequest request, HttpServletResponse response)
-          throws IOException, ServletException {
-        HttpSession s = request.getSession();
-        s.invalidate();
-        s.getId();
-        PrintWriter out = response.getWriter();
-        out.write("OK");
-      }
-    };
-
-    tester.setAttribute("callback_1", c_1);
-
-    servletHolder.setInitParameter("test.callback", "callback_1");
-
-    tester.start();
-    ContextManager.getInstance().putContext(
-        servletHolder.getServlet().getServletConfig().getServletContext());
-
-    request.setMethod("GET");
-    request.setURI("/test/hello");
-    request.setHeader("Host", "tester");
-    request.setVersion("HTTP/1.0");
-    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
-
-    assertEquals("OK", response.getContent());
-  }
-
-  /**
-   * Test that invalidating a session throws an exception on subsequent access.
-   */
-  @Test
-  public void testInvalidateSession6() throws Exception {
-    Callback c_1 = new Callback() {
-      @Override
-      public void call(HttpServletRequest request, HttpServletResponse response)
-          throws IOException, ServletException {
-        HttpSession s = request.getSession();
-        s.invalidate();
-        PrintWriter out = response.getWriter();
-        try {
-          s.getLastAccessedTime();
-        } catch (IllegalStateException iex) {
-          out.write("OK");
-        }
-      }
-    };
-
-    tester.setAttribute("callback_1", c_1);
-
-    servletHolder.setInitParameter("test.callback", "callback_1");
-
-    tester.start();
-    ContextManager.getInstance().putContext(
-        servletHolder.getServlet().getServletConfig().getServletContext());
-
-    request.setMethod("GET");
-    request.setURI("/test/hello");
-    request.setHeader("Host", "tester");
-    request.setVersion("HTTP/1.0");
-    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
-
-    assertEquals("OK", response.getContent());
-  }
-
-  /**
-   * Test that invalidating a session does not throw an exception for
-   * subsequent getMaxInactiveInterval calls.
-   */
-
-// I've commented this out for now as Jetty seems to want to throw an
-// Exception here where the HttpServlet api doesn't specify that.
-  @Test
-  public void testInvalidateSession7() throws Exception {
-    Callback c_1 = new Callback() {
-      @Override
-      public void call(HttpServletRequest request,
-          HttpServletResponse response) throws IOException, ServletException {
-        HttpSession s = request.getSession();
-        s.invalidate();
-        s.getMaxInactiveInterval();
-        PrintWriter out = response.getWriter();
-        out.write("OK");
-      }
-    };
-
-    tester.setAttribute("callback_1", c_1);
-
-    servletHolder.setInitParameter("test.callback", "callback_1");
-
-    tester.start();
-    ContextManager.getInstance().putContext(
-        servletHolder.getServlet().getServletConfig().getServletContext());
-
-    request.setMethod("GET");
-    request.setURI("/test/hello");
-    request.setHeader("Host", "tester");
-    request.setVersion("HTTP/1.0");
-    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
-
-    assertEquals("OK", response.getContent());
-  }
-
-  /**
-   * Test that invalidating a session does not throw an exception for subsequent
-   * getServletContext calls.
-   */
-  @Test
-  public void testInvalidateSession8() throws Exception {
-    Callback c_1 = new Callback() {
-      @Override
-      public void call(HttpServletRequest request, HttpServletResponse response)
-          throws IOException, ServletException {
-        HttpSession s = request.getSession();
-        s.invalidate();
-        s.getServletContext();
-        PrintWriter out = response.getWriter();
-        out.write("OK");
-      }
-    };
-
-    tester.setAttribute("callback_1", c_1);
-
-    servletHolder.setInitParameter("test.callback", "callback_1");
-
-    tester.start();
-    ContextManager.getInstance().putContext(
-        servletHolder.getServlet().getServletConfig().getServletContext());
-
-    request.setMethod("GET");
-    request.setURI("/test/hello");
-    request.setHeader("Host", "tester");
-    request.setVersion("HTTP/1.0");
-    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
-
-    assertEquals("OK", response.getContent());
-  }
-
-  /**
-   * Test that invalidating a session throws an exception on subsequent access.
-   */
-  @Test
-  public void testInvalidateSession9() throws Exception {
-    Callback c_1 = new Callback() {
-      @Override
-      public void call(HttpServletRequest request, HttpServletResponse response)
-          throws IOException, ServletException {
-        HttpSession s = request.getSession();
-        s.invalidate();
-        PrintWriter out = response.getWriter();
-        try {
-          s.isNew();
-        } catch (IllegalStateException iex) {
-          out.write("OK");
-        }
-      }
-    };
-
-    tester.setAttribute("callback_1", c_1);
-
-    servletHolder.setInitParameter("test.callback", "callback_1");
-
-    tester.start();
-    ContextManager.getInstance().putContext(
-        servletHolder.getServlet().getServletConfig().getServletContext());
-
-    request.setMethod("GET");
-    request.setURI("/test/hello");
-    request.setHeader("Host", "tester");
-    request.setVersion("HTTP/1.0");
-    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
-
-    assertEquals("OK", response.getContent());
-  }
-
-  /**
-   * Test that invalidating a session throws an exception on subsequent access.
-   */
-  @Test
-  public void testInvalidateSession10() throws Exception {
-    Callback c_1 = new Callback() {
-      @Override
-      public void call(HttpServletRequest request, HttpServletResponse response)
-          throws IOException, ServletException {
-        HttpSession s = request.getSession();
-        s.invalidate();
-        PrintWriter out = response.getWriter();
-        try {
-          s.removeAttribute("foo");
-        } catch (IllegalStateException iex) {
-          out.write("OK");
-        }
-      }
-    };
-
-    tester.setAttribute("callback_1", c_1);
-
-    servletHolder.setInitParameter("test.callback", "callback_1");
-
-    tester.start();
-    ContextManager.getInstance().putContext(
-        servletHolder.getServlet().getServletConfig().getServletContext());
-
-    request.setMethod("GET");
-    request.setURI("/test/hello");
-    request.setHeader("Host", "tester");
-    request.setVersion("HTTP/1.0");
-    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
-
-    assertEquals("OK", response.getContent());
-  }
-
-  /**
-   * Test that invalidating a session throws an exception on subsequent access.
-   */
-  @Test
-  public void testInvalidateSession11() throws Exception {
-    Callback c_1 = new Callback() {
-      @Override
-      public void call(HttpServletRequest request, HttpServletResponse response)
-          throws IOException, ServletException {
-        HttpSession s = request.getSession();
-        s.invalidate();
-        PrintWriter out = response.getWriter();
-        try {
-          s.setAttribute("foo", "bar");
-        } catch (IllegalStateException iex) {
-          out.write("OK");
-        }
-      }
-    };
-
-    tester.setAttribute("callback_1", c_1);
-
-    servletHolder.setInitParameter("test.callback", "callback_1");
-
-    tester.start();
-    ContextManager.getInstance().putContext(
-        servletHolder.getServlet().getServletConfig().getServletContext());
-
-    request.setMethod("GET");
-    request.setURI("/test/hello");
-    request.setHeader("Host", "tester");
-    request.setVersion("HTTP/1.0");
-    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
-
-    assertEquals("OK", response.getContent());
-  }
-
-  /**
-   * Test that invalidating a session does not throw an exception for subsequent
-   * setMaxInactiveInterval calls.
-   */
-  @Test
-  public void testInvalidateSession12() throws Exception {
-    Callback c_1 = new Callback() {
-      @Override
-      public void call(HttpServletRequest request, HttpServletResponse response)
-          throws IOException, ServletException {
-        HttpSession s = request.getSession();
-        s.invalidate();
-        s.setMaxInactiveInterval(1);
-        PrintWriter out = response.getWriter();
-        out.write("OK");
-      }
-    };
-
-    tester.setAttribute("callback_1", c_1);
-
-    servletHolder.setInitParameter("test.callback", "callback_1");
-
-    tester.start();
-    ContextManager.getInstance().putContext(
-        servletHolder.getServlet().getServletConfig().getServletContext());
-
-    request.setMethod("GET");
-    request.setURI("/test/hello");
-    request.setHeader("Host", "tester");
-    request.setVersion("HTTP/1.0");
-    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
-
-    assertEquals("OK", response.getContent());
-  }
-
-  /**
-   * Test that invalidating a session results in null being returned on
-   * subsequent getSession(false) calls.
-   */
-  @Test
-  public void testInvalidateSession13() throws Exception {
-    Callback c_1 = new Callback() {
-      @Override
-      public void call(HttpServletRequest request, HttpServletResponse response)
-          throws IOException, ServletException {
-        HttpSession s = request.getSession();
-        s.invalidate();
-        s = request.getSession(false);
-        PrintWriter out = response.getWriter();
-        if (s == null) {
-          out.write("OK");
-        } else {
-          out.write(s.toString());
-        }
-      }
-    };
-
-    tester.setAttribute("callback_1", c_1);
-
-    servletHolder.setInitParameter("test.callback", "callback_1");
-
-    tester.start();
-    ContextManager.getInstance().putContext(
-        servletHolder.getServlet().getServletConfig().getServletContext());
-
-    request.setMethod("GET");
-    request.setURI("/test/hello");
-    request.setHeader("Host", "tester");
-    request.setVersion("HTTP/1.0");
-    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
-
-    assertEquals("OK", response.getContent());
-  }
-
-
-  /**
-   * Test that we can invalidate and then recreate a new session
-   */
-  @Test
-  public void testInvalidateAndRecreateSession() throws Exception {
-    Callback c_1 = new Callback() {
-      @Override
-      public void call(HttpServletRequest request, HttpServletResponse response)
-          throws IOException, ServletException {
-
-        PrintWriter out = response.getWriter();
-        out.write(request.getSession().getId());
-      }
-    };
-
-    Callback c_2 = new Callback() {
-      @Override
-      public void call(HttpServletRequest request, HttpServletResponse response)
-          throws IOException, ServletException {
-        HttpSession s = request.getSession();
-        s.invalidate();
-
-        PrintWriter out = response.getWriter();
-        out.write(request.getSession().getId());
-      }
-    };
-
-    tester.setAttribute("callback_1", c_1);
-    tester.setAttribute("callback_2", c_2);
-
-    ServletHolder sh = tester.addServlet(BasicServlet.class, "/dispatch");
-    sh.setInitParameter("test.callback", "callback_2");
-
-    tester.start();
-    ContextManager.getInstance().putContext(
-        sh.getServlet().getServletConfig().getServletContext());
-
-    request.setMethod("GET");
-    request.setURI("/test/hello");
-    request.setHeader("Host", "tester");
-    request.setVersion("HTTP/1.0");
-
-    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
-    String session1 = response.getContent();
-
-    request.setHeader("Cookie", "JSESSIONID=" + session1);
-    request.setURI("/test/request2");
-    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
-
-    String session12 = response.getContent();
-    assertFalse("First and subsequent session ids must not be the same",
-        session1.equals(session12));
-  }
-
-
-  /**
-   * Test that creation time does not change on subsequent access
-   */
-  @Test
-  public void testGetCreationTime() throws Exception {
-    Callback c = new Callback() {
-      @Override
-      public void call(HttpServletRequest request, HttpServletResponse response)
-          throws IOException {
-        HttpSession session = request.getSession();
-        PrintWriter out = response.getWriter();
-        out.write(Long.toString(session.getCreationTime()));
-      }
-    };
-
-    tester.setAttribute("callback_1", c);
-    tester.start();
-    ContextManager.getInstance().putContext(
-        servletHolder.getServlet().getServletConfig().getServletContext());
-
-    request.setMethod("GET");
-    request.setURI("/test/hello");
-    request.setHeader("Host", "tester");
-    request.setVersion("HTTP/1.0");
-
-    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
-
-    long time1 = Long.parseLong(response.getContent());
-    assertTrue("Creation time should be positive", time1 > 0);
-
-    List<Cookie> cookies = getCookies(response);
-    request.setHeader("Cookie", "JSESSIONID=" + cookies.get(0).getValue());
-
-    try {
-      Thread.sleep(1000);
-    } catch (Exception ex) {
-    }
-
-    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
-    long time2 = Long.parseLong(response.getContent());
-    assertTrue("Creation time should be the same across requests",
-        time1 == time2);
-  }
-
-  /**
-   * Test that the last accessed time is updated on subsequent access
-   */
-  @Test
-  public void testGetLastAccessedTime() throws Exception {
-    Callback c = new Callback() {
-      @Override
-      public void call(HttpServletRequest request, HttpServletResponse response)
-          throws IOException {
-        HttpSession session = request.getSession();
-        PrintWriter out = response.getWriter();
-        out.write(Long.toString(session.getLastAccessedTime()));
-      }
-    };
-
-    tester.setAttribute("callback_1", c);
-    tester.start();
-    ContextManager.getInstance().putContext(
-        servletHolder.getServlet().getServletConfig().getServletContext());
-
-    request.setMethod("GET");
-    request.setURI("/test/hello");
-    request.setHeader("Host", "tester");
-    request.setVersion("HTTP/1.0");
-
-    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
-
-    long time1 = Long.parseLong(response.getContent());
-//        assertTrue("Last accessed time should be positive", time1 > 0);
-
-    List<Cookie> cookies = getCookies(response);
-    request.setHeader("Cookie", "JSESSIONID=" + cookies.get(0).getValue());
-
-    Thread.sleep(1000);
-
-    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
-    long time2 = Long.parseLong(response.getContent());
-    assertTrue("Last accessed time should be increasing across requests",
-        time2 > time1);
-  }
-
-  /**
-   * Test that the underlying native session remains the same across requests
-   */
-  @Test
-  public void testNativeSessionRemainsUnchanged() throws Exception {
-    Callback c = new Callback() {
-      @Override
-      public void call(HttpServletRequest request, HttpServletResponse response)
-          throws IOException {
-        GemfireHttpSession session = (GemfireHttpSession) request.getSession();
-        PrintWriter out = response.getWriter();
-        out.write(session.getNativeSession().getId());
-      }
-    };
-
-    tester.setAttribute("callback_1", c);
-    tester.start();
-    ContextManager.getInstance().putContext(
-        servletHolder.getServlet().getServletConfig().getServletContext());
-
-    request.setMethod("GET");
-    request.setURI("/test/hello");
-    request.setHeader("Host", "tester");
-    request.setVersion("HTTP/1.0");
-
-    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
-    String nativeSessionId = response.getContent();
-
-    List<Cookie> cookies = getCookies(response);
-    String sessionId = cookies.get(0).getValue();
-    Region r = getRegion();
-
-    assertEquals(
-        "Cached native session id does not match servlet returned native session id",
-        nativeSessionId,
-        ((GemfireHttpSession) r.get(sessionId)).getNativeSession().getId());
-
-    request.setHeader("Cookie", "JSESSIONID=" + cookies.get(0).getValue());
-    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
-
-    assertEquals(
-        "Underlying native sessions must remain the same across requests",
-        nativeSessionId,
-        ((GemfireHttpSession) r.get(sessionId)).getNativeSession().getId());
-  }
-
-  /**
-   * Test session id embedded in the URL
-   */
-  @Test
-  public void testSessionIdEmbeddedInUrl() throws Exception {
-    Callback c = new Callback() {
-      @Override
-      public void call(HttpServletRequest request, HttpServletResponse response)
-          throws IOException {
-        GemfireHttpSession session = (GemfireHttpSession) request.getSession();
-        PrintWriter out = response.getWriter();
-        out.write(session.getId());
-      }
-    };
-
-    tester.setAttribute("callback_1", c);
-    tester.start();
-    ContextManager.getInstance().putContext(
-        servletHolder.getServlet().getServletConfig().getServletContext());
-
-    request.setMethod("GET");
-    request.setURI("/test/hello");
-    request.setHeader("Host", "tester");
-    request.setVersion("HTTP/1.0");
-
-    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
-    List<Cookie> cookies = getCookies(response);
-    String sessionId = response.getContent();
-    assertEquals("Session ids should be the same", sessionId,
-        cookies.get(0).getValue());
-
-    request.setURI("/test/hello;jsessionid=" + sessionId);
-    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
-    cookies = getCookies(response);
-
-    assertEquals("Session ids should be the same", sessionId,
-        cookies.get(0).getValue());
-  }
-
-
-  /**
-   * Test that request forward dispatching works
-   */
-  @Test
-  public void testDispatchingForward1() throws Exception {
-    Callback c_1 = new Callback() {
-      @Override
-      public void call(HttpServletRequest request, HttpServletResponse response)
-          throws IOException, ServletException {
-        RequestDispatcher dispatcher = request.getRequestDispatcher("dispatch");
-        dispatcher.forward(request, response);
-
-        // This should not appear in the output
-        PrintWriter out = response.getWriter();
-        out.write("bang");
-      }
-    };
-
-    // This is the callback used by the forward servlet
-    Callback c_2 = new Callback() {
-      @Override
-      public void call(HttpServletRequest request, HttpServletResponse response)
-          throws IOException, ServletException {
-        PrintWriter out = response.getWriter();
-        out.write("dispatched");
-      }
-    };
-
-    tester.setAttribute("callback_1", c_1);
-    tester.setAttribute("callback_2", c_2);
-
-    ServletHolder sh = tester.addServlet(BasicServlet.class, "/dispatch");
-    sh.setInitParameter("test.callback", "callback_2");
-
-    tester.start();
-    ContextManager.getInstance().putContext(
-        sh.getServlet().getServletConfig().getServletContext());
-
-    request.setMethod("GET");
-    request.setURI("/test/hello");
-    request.setHeader("Host", "tester");
-    request.setVersion("HTTP/1.0");
-
-    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
-    assertEquals("dispatched", response.getContent());
-
-    ContextManager.getInstance().removeContext(
-        sh.getServlet().getServletConfig().getServletContext());
-  }
-
-
-  /**
-   * Test that request include dispatching works
-   */
-  @Test
-  public void testDispatchingInclude() throws Exception {
-    Callback c_1 = new Callback() {
-      @Override
-      public void call(HttpServletRequest request, HttpServletResponse response)
-          throws IOException, ServletException {
-        RequestDispatcher dispatcher = request.getRequestDispatcher("dispatch");
-        dispatcher.include(request, response);
-
-        // This *should* appear in the output
-        PrintWriter out = response.getWriter();
-        out.write("_bang");
-      }
-    };
-
-    // This is the callback used by the include servlet
-    Callback c_2 = new Callback() {
-      @Override
-      public void call(HttpServletRequest request, HttpServletResponse response)
-          throws IOException, ServletException {
-        PrintWriter out = response.getWriter();
-        out.write("dispatched");
-      }
-    };
-
-    tester.setAttribute("callback_1", c_1);
-    tester.setAttribute("callback_2", c_2);
-
-    ServletHolder sh = tester.addServlet(BasicServlet.class, "/dispatch");
-    sh.setInitParameter("test.callback", "callback_2");
-
-    tester.start();
-    ContextManager.getInstance().putContext(
-        sh.getServlet().getServletConfig().getServletContext());
-
-    request.setMethod("GET");
-    request.setURI("/test/hello");
-    request.setHeader("Host", "tester");
-    request.setVersion("HTTP/1.0");
-
-    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
-    assertEquals("dispatched_bang", response.getContent());
-
-    ContextManager.getInstance().removeContext(
-        sh.getServlet().getServletConfig().getServletContext());
-  }
-
-
-  /**
-   * Test to try and simulate a failover scenario
-   */
-  @Test
-  public void testFailover1() throws Exception {
-    Callback c_1 = new Callback() {
-      @Override
-      public void call(HttpServletRequest request, HttpServletResponse response)
-          throws IOException, ServletException {
-        HttpSession s = request.getSession();
-        s.setAttribute("foo", "bar");
-
-        PrintWriter out = response.getWriter();
-        out.write(request.getSession().getId());
-      }
-    };
-
-    Callback c_2 = new Callback() {
-      @Override
-      public void call(HttpServletRequest request, HttpServletResponse response)
-          throws IOException, ServletException {
-        HttpSession s = request.getSession();
-
-        PrintWriter out = response.getWriter();
-        out.write((String) s.getAttribute("foo"));
-      }
-    };
-
-    tester.setAttribute("callback_1", c_1);
-    tester.setAttribute("callback_2", c_2);
-
-    ServletHolder sh = tester.addServlet(BasicServlet.class, "/request2");
-    sh.setInitParameter("test.callback", "callback_2");
-
-    tester.start();
-    ContextManager.getInstance().putContext(
-        sh.getServlet().getServletConfig().getServletContext());
-
-    request.setMethod("GET");
-    request.setURI("/test/hello");
-    request.setHeader("Host", "tester");
-    request.setVersion("HTTP/1.0");
-
-    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
-    String id = response.getContent();
-
-    // Now we simulate the failover by removing the native session from
-    // the stored session
-    Region r = getRegion();
-    GemfireHttpSession sessObj = (GemfireHttpSession) r.get(id);
-    sessObj.setNativeSession(null);
-
-    r.put(id, sessObj);
-
-    request.setHeader("Cookie", "JSESSIONID=" + id);
-    request.setURI("/test/request2");
-    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
-
-    assertEquals("bar", response.getContent());
-  }
-
-  @Test
-  public void testHttpSessionListener1() throws Exception {
-    HttpSessionListenerImpl listener = new HttpSessionListenerImpl();
-    tester.getContext().getSessionHandler().addEventListener(listener);
-
-    Callback c = new Callback() {
-      @Override
-      public void call(HttpServletRequest request, HttpServletResponse response)
-          throws IOException {
-        HttpSession s = request.getSession();
-        // This is set in HttpSessionListenerImpl
-        String result = (String) s.getAttribute("gemfire-session-id");
-        response.getWriter().write(result);
-      }
-    };
-
-    tester.setAttribute("callback_1", c);
-    tester.start();
-    ContextManager.getInstance().putContext(
-        servletHolder.getServlet().getServletConfig().getServletContext());
-
-    request.setMethod("GET");
-    request.setURI("/test/hello");
-    request.setHeader("Host", "tester");
-    request.setVersion("HTTP/1.0");
-
-    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
-
-    assertEquals(200, response.getStatus());
-
-    List<Cookie> cookies = getCookies(response);
-
-//        AbstractListener listener = RendezvousManager.getListener();
-    tester.stop();
-
-    assertTrue("Timeout waiting for events",
-        listener.await(1, TimeUnit.SECONDS));
-    assertEquals(ListenerEventType.SESSION_CREATED,
-        listener.events.get(0));
-    assertEquals(ListenerEventType.SESSION_DESTROYED,
-        listener.events.get(1));
-    assertEquals(cookies.get(0).getValue(), response.getContent());
-  }
-
-  @Test
-  public void testHttpSessionListener2() throws Exception {
-    HttpSessionListenerImpl2 listener = new HttpSessionListenerImpl2();
-    tester.getContext().getSessionHandler().addEventListener(listener);
-
-    Callback c = new Callback() {
-      @Override
-      public void call(HttpServletRequest request, HttpServletResponse response)
-          throws IOException {
-        HttpSession s = request.getSession();
-        s.setAttribute("test01", "test01");
-        s = request.getSession(false);
-        s.invalidate();
-        response.getWriter().write(s.getId());
-      }
-    };
-
-    tester.setAttribute("callback_1", c);
-    tester.start();
-    ContextManager.getInstance().putContext(
-        servletHolder.getServlet().getServletConfig().getServletContext());
-
-    request.setMethod("GET");
-    request.setURI("/test/hello");
-    request.setHeader("Host", "tester");
-    request.setVersion("HTTP/1.0");
-
-    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
-
-    assertEquals(200, response.getStatus());
-
-    List<Cookie> cookies = getCookies(response);
-
-    tester.stop();
-
-    assertTrue("Timeout waiting for events",
-        listener.await(1, TimeUnit.SECONDS));
-    assertEquals(ListenerEventType.SESSION_CREATED,
-        listener.events.get(0));
-    assertEquals(ListenerEventType.SESSION_DESTROYED,
-        listener.events.get(1));
-    assertEquals(cookies.get(0).getValue(), response.getContent());
-  }
-
-
-
-
-//  @Test
-  public void testJsp() throws Exception {
-    tester.setResourceBase("target/test-classes");
-    ServletHolder jspHolder = tester.addServlet(JspServlet.class, "/test/*");
-    jspHolder.setInitOrder(1);
-
-    jspHolder.setInitParameter("scratchdir", tmpdir.getPath());
-
-    Callback c_1 = new Callback() {
-      @Override
-      public void call(HttpServletRequest request, HttpServletResponse response)
-          throws IOException, ServletException {
-        request.getSession().setAttribute("foo", "bar");
-        request.setAttribute("foo", "baz");
-        RequestDispatcher dispatcher = request.getRequestDispatcher(
-            "pagecontext.jsp");
-        dispatcher.forward(request, response);
-      }
-    };
-
-    tester.getContext().setClassLoader(Thread.currentThread().getContextClassLoader());
-    tester.setAttribute("callback_1", c_1);
-
-    tester.start();
-
-    request.setMethod("GET");
-    request.setURI("/test/hello");
-    request.setHeader("Host", "tester");
-    request.setVersion("HTTP/1.0");
-
-    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
-
-    assertEquals(200, response.getStatus());
-    assertEquals("baz", response.getContent().trim());
-  }
-
-
-  ////////////////////////////////////////////////////////////////////
-  // Private methods
-
-  /**
-   * Why doesn't HttpTester do this already??
-   */
-  private List<Cookie> getCookies(HttpTester.Response response) {
-    List<Cookie> cookies = new ArrayList<Cookie>();
-
-    Enumeration e = response.getValues("Set-Cookie");
-
-    while (e != null && e.hasMoreElements()) {
-      String header = (String) e.nextElement();
-      Cookie c = null;
-
-      StringTokenizer st = new StringTokenizer(header, ";");
-      while (st.hasMoreTokens()) {
-        String[] split = st.nextToken().split("=");
-        String param = split[0].trim();
-        String value = null;
-        if (split.length > 1) {
-          value = split[1].trim();
-        }
-        if ("version".equalsIgnoreCase(param)) {
-          c.setVersion(Integer.parseInt(value));
-        } else if ("comment".equalsIgnoreCase(param)) {
-          c.setComment(value);
-        } else if ("domain".equalsIgnoreCase(param)) {
-          c.setDomain(value);
-        } else if ("max-age".equalsIgnoreCase(param)) {
-          c.setMaxAge(Integer.parseInt(value));
-        } else if ("discard".equalsIgnoreCase(param)) {
-          c.setMaxAge(-1);
-        } else if ("path".equalsIgnoreCase(param)) {
-          c.setPath(value);
-        } else if ("secure".equalsIgnoreCase(param)) {
-          c.setSecure(true);
-        } else if ("httponly".equalsIgnoreCase(param)) {
-          // Ignored??
-        } else {
-          if (c == null) {
-            c = new Cookie(param, value);
-          } else {
-            throw new IllegalStateException("Unknown cookie param: " + param);
-          }
-        }
-      }
-
-      if (c != null) {
-        cookies.add(c);
-      }
-    }
-
-    return cookies;
-  }
-
-  private Region getRegion() {
-    // Yuck...
-    return ((GemfireSessionManager) ((SessionCachingFilter) filterHolder.getFilter()).getSessionManager()).getCache().getCache().getRegion(
-        "gemfire_modules_sessions");
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/filter/MyServletTester.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/filter/MyServletTester.java b/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/filter/MyServletTester.java
deleted file mode 100644
index 43aed76..0000000
--- a/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/filter/MyServletTester.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-
-package com.gemstone.gemfire.modules.session.filter;
-
-import org.eclipse.jetty.servlet.ServletTester;
-
-/**
- * Extend the base ServletTester class with a couple of helper methods. This
- * depends on a patched ServletTester class which exposes the _server variable
- * as package-private.
- */
-public class MyServletTester extends ServletTester {
-
-  public boolean isStarted() {
-//    return _server.isStarted();
-    return false;
-  }
-
-  public boolean isStopped() {
-//    return _server.isStopped();
-    return false;
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/filter/ServletContextListenerImpl.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/filter/ServletContextListenerImpl.java b/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/filter/ServletContextListenerImpl.java
deleted file mode 100644
index 0eae4d5..0000000
--- a/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/filter/ServletContextListenerImpl.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-
-package com.gemstone.gemfire.modules.session.filter;
-
-import com.gemstone.gemfire.modules.session.filter.ListenerEventType;
-
-import javax.servlet.ServletContextEvent;
-import javax.servlet.ServletContextListener;
-
-/**
- * @author jdeppe
- */
-public class ServletContextListenerImpl extends AbstractListener
-    implements ServletContextListener {
-
-  /**
-   * This is a 'custom' constructor which sets our latch count to 2. This is
-   * done because the earliest point, within our test code, where we can get a
-   * reference to the listener (in order to reset the latch count) an event
-   * *may* (more than likely) already have been fired.
-   */
-  public ServletContextListenerImpl() {
-    super(2);
-  }
-
-  @Override
-  public void contextInitialized(ServletContextEvent sce) {
-    events.add(ListenerEventType.SERVLET_CONTEXT_INITIALIZED);
-    latch.countDown();
-  }
-
-  @Override
-  public void contextDestroyed(ServletContextEvent sce) {
-    events.add(ListenerEventType.SERVLET_CONTEXT_DESTROYED);
-    latch.countDown();
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/AbstractListener.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/AbstractListener.java b/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/AbstractListener.java
new file mode 100644
index 0000000..e211724
--- /dev/null
+++ b/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/AbstractListener.java
@@ -0,0 +1,50 @@
+/*=========================================================================
+ * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package com.gemstone.gemfire.modules.session.internal.filter;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * @author jdeppe
+ */
+public abstract class AbstractListener {
+
+  protected final List<ListenerEventType> events =
+      new ArrayList<ListenerEventType>();
+
+  protected CountDownLatch latch;
+
+  public AbstractListener() {
+    this(1);
+  }
+
+  public AbstractListener(int numCalls) {
+    latch = new CountDownLatch(numCalls);
+  }
+
+  public void setLatch(int numCalls) {
+    latch = new CountDownLatch(numCalls);
+  }
+
+  public boolean await(long timeout,
+      TimeUnit unit) throws InterruptedException {
+    return latch.await(timeout, unit);
+  }
+
+  public List<ListenerEventType> getEvents() {
+    return events;
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/BasicServlet.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/BasicServlet.java b/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/BasicServlet.java
new file mode 100644
index 0000000..2c1d7e4
--- /dev/null
+++ b/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/BasicServlet.java
@@ -0,0 +1,46 @@
+/*=========================================================================
+ * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package com.gemstone.gemfire.modules.session.internal.filter;
+
+import java.io.IOException;
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.eclipse.jetty.servlet.DefaultServlet;
+/**
+ *
+ */
+public class BasicServlet extends DefaultServlet {
+
+  Callback callback = null;
+
+  @Override
+  public void doGet(HttpServletRequest request, HttpServletResponse response)
+      throws IOException, ServletException {
+
+    if (callback != null) {
+      callback.call(request, response);
+    }
+  }
+
+  @Override
+  public void init(ServletConfig config) throws ServletException {
+    super.init(config);
+    ServletContext context = config.getServletContext();
+
+    String cbInitParam = config.getInitParameter("test.callback");
+    callback = (Callback) context.getAttribute(cbInitParam);
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/Callback.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/Callback.java b/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/Callback.java
new file mode 100644
index 0000000..dfda671
--- /dev/null
+++ b/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/Callback.java
@@ -0,0 +1,26 @@
+/*=========================================================================
+ * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package com.gemstone.gemfire.modules.session.internal.filter;
+
+import java.io.IOException;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * @author jdeppe
+ */
+public interface Callback {
+  public void call(HttpServletRequest request,
+      HttpServletResponse response) throws IOException, ServletException;
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionListenerImpl.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionListenerImpl.java b/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionListenerImpl.java
new file mode 100644
index 0000000..6cbd75b
--- /dev/null
+++ b/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionListenerImpl.java
@@ -0,0 +1,39 @@
+/*=========================================================================
+ * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package com.gemstone.gemfire.modules.session.internal.filter;
+
+import javax.servlet.http.HttpSession;
+import javax.servlet.http.HttpSessionEvent;
+import javax.servlet.http.HttpSessionListener;
+
+/**
+ * @author jdeppe
+ */
+public class HttpSessionListenerImpl extends AbstractListener
+    implements HttpSessionListener {
+
+  @Override
+  public void sessionCreated(HttpSessionEvent se) {
+    HttpSession gfeSession = SessionCachingFilter.getWrappingSession(
+        se.getSession());
+    gfeSession.setAttribute("gemfire-session-id", gfeSession.getId());
+    events.add(ListenerEventType.SESSION_CREATED);
+    latch.countDown();
+  }
+
+  @Override
+  public void sessionDestroyed(HttpSessionEvent se) {
+    events.add(ListenerEventType.SESSION_DESTROYED);
+    latch.countDown();
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionListenerImpl2.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionListenerImpl2.java b/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionListenerImpl2.java
new file mode 100644
index 0000000..154414a
--- /dev/null
+++ b/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionListenerImpl2.java
@@ -0,0 +1,39 @@
+/*=========================================================================
+ * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package com.gemstone.gemfire.modules.session.internal.filter;
+
+import javax.servlet.http.HttpSession;
+import javax.servlet.http.HttpSessionEvent;
+import javax.servlet.http.HttpSessionListener;
+
+/**
+ * @author jdeppe
+ */
+public class HttpSessionListenerImpl2 extends AbstractListener
+    implements HttpSessionListener {
+
+  @Override
+  public void sessionCreated(HttpSessionEvent se) {
+    events.add(ListenerEventType.SESSION_CREATED);
+    latch.countDown();
+  }
+
+  @Override
+  public void sessionDestroyed(HttpSessionEvent se) {
+    HttpSession gfeSession = SessionCachingFilter.getWrappingSession(
+        se.getSession());
+    assert (gfeSession != null);
+    events.add(ListenerEventType.SESSION_DESTROYED);
+    latch.countDown();
+  }
+}


[22/24] incubator-geode git commit: GEODE-14: Adding session replication assembly module

Posted by je...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/65a03287/extensions/gemfire-modules-assembly/release/3rdparty_license/open_source_licenses-VMware_vFabric_GemFire_Module_7.0.txt
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-assembly/release/3rdparty_license/open_source_licenses-VMware_vFabric_GemFire_Module_7.0.txt b/extensions/gemfire-modules-assembly/release/3rdparty_license/open_source_licenses-VMware_vFabric_GemFire_Module_7.0.txt
new file mode 100755
index 0000000..9e1ddef
--- /dev/null
+++ b/extensions/gemfire-modules-assembly/release/3rdparty_license/open_source_licenses-VMware_vFabric_GemFire_Module_7.0.txt
@@ -0,0 +1,471 @@
+open_source_license.txt
+
+VMware vFabric GemFire HTTP Session Management Module 7.0 GA
+	
+
+===========================================================================
+
+The following copyright statements and licenses apply to various open
+source software components (or portions thereof) that are distributed with
+this VMware software products.
+
+The VMware Product may also include other VMware components, which may contain additional open 
+source software packages. One or more such open_source_licenses.txt files may therefore 
+accompany this VMware Product. 
+
+The VMware product that includes this file does not necessarily use all the
+open source software components referred to below and may also only use
+portions of a given component.
+
+
+=============== TABLE OF CONTENTS =============================
+
+
+The following is a listing of the open source components detailed in this
+document.  This list is provided for your convenience; please read further if
+you wish to review the copyright notice(s) and the full text of the license
+associated with each component.
+
+
+
+SECTION 1: BSD-STYLE, MIT-STYLE, OR SIMILAR STYLE LICENSES
+
+   >>> slf4j-1.5.8
+
+
+
+SECTION 2: Common Development and Distribution License, V1.0
+
+   >>> servlet-api-2.5
+
+
+
+APPENDIX. Standard License Files
+
+   >>> Common Development and Distribution License, V1.0
+
+
+
+
+
+--------------- SECTION 1:  BSD-STYLE, MIT-STYLE, OR SIMILAR STYLE LICENSES ----------
+
+BSD-STYLE, MIT-STYLE, OR SIMILAR STYLE LICENSES are applicable to the following component(s).
+
+
+>>> slf4j-1.5.8
+
+Copyright (c) 2004-2008 QOS.ch
+All rights reserved.
+
+Permission is hereby granted, free  of charge, to any person obtaining
+a  copy  of this  software  and  associated  documentation files  (the
+"Software"), to  deal in  the Software without  restriction, including
+without limitation  the rights to  use, copy, modify,  merge, publish,
+distribute,  sublicense, and/or sell  copies of  the Software,  and to
+permit persons to whom the Software  is furnished to do so, subject to
+the following conditions:
+
+The  above  copyright  notice  and  this permission  notice  shall  be
+included in all copies or substantial portions of the Software.
+
+THE  SOFTWARE IS  PROVIDED  "AS  IS", WITHOUT  WARRANTY  OF ANY  KIND,
+EXPRESS OR  IMPLIED, INCLUDING  BUT NOT LIMITED  TO THE  WARRANTIES OF
+MERCHANTABILITY,    FITNESS    FOR    A   PARTICULAR    PURPOSE    AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE,  ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+
+--------------- SECTION 2: Common Development and Distribution License, V1.0 ----------
+
+Common Development and Distribution License, V1.0 is applicable to the following component(s).
+
+
+>>> servlet-api-2.5
+
+The contents of this file are subject to the terms 
+of the Common Development and Distribution License 
+(the "License"). You may not use this file except 
+in compliance with the License. 
+ 
+You can obtain a copy of the license at 
+glassfish/bootstrap/legal/CDDLv1.0.txt or 
+https://glassfish.dev.java.net/public/CDDLv1.0.html. 
+See the License for the specific language governing 
+permissions and limitations under the License. 
+ 
+When distributing Covered Code, include this CDDL 
+HEADER in each file and include the License file at 
+glassfish/bootstrap/legal/CDDLv1.0.txt. If applicable, 
+add the following below this CDDL HEADER, with the 
+fields enclosed by brackets "[]" replaced with your 
+own identifying information: Portions Copyright [yyyy] 
+[name of copyright owner] 
+ 
+Copyright 2005 Sun Microsystems, Inc. All rights reserved. 
+ 
+Portions Copyright Apache Software Foundation.
+
+
+
+
+=============== APPENDIX. Standard License Files ============== 
+
+
+
+--------- SECTION 1: Common Development and Distribution License, V1.0 -----------
+
+COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
+
+1. Definitions.
+
+1.1. "Contributor" means each individual or entity that creates or
+contributes to the creation of Modifications.
+
+1.2. "Contributor Version" means the combination of the Original Software,
+prior Modifications used by a Contributor (if any), and the Modifications
+made by that particular Contributor.
+
+1.3. "Covered Software" means (a) the Original Software, or (b)
+Modifications, or (c) the combination of files containing Original
+Software with files containing Modifications, in each case including
+portions thereof.
+
+1.4. "Executable" means the Covered Software in any form other than
+Source Code.
+
+1.5. "Initial Developer" means the individual or entity that first makes
+Original Software available under this License.
+
+1.6. "Larger Work" means a work which combines Covered Software or
+portions thereof with code not governed by the terms of this License.
+
+1.7. "License" means this document.
+
+1.8. "Licensable" means having the right to grant, to the maximum extent
+possible, whether at the time of the initial grant or subsequently
+acquired, any and all of the rights conveyed herein.
+
+1.9. "Modifications" means the Source Code and Executable form of any
+of the following:
+
+    A. Any file that results from an addition to, deletion from or
+    modification of the contents of a file containing Original Software
+    or previous Modifications;
+
+    B. Any new file that contains any part of the Original Software or
+    previous Modification; or
+
+    C. Any new file that is contributed or otherwise made available
+    under the terms of this License.
+
+1.10. "Original Software" means the Source Code and Executable form of
+computer software code that is originally released under this License.
+
+1.11. "Patent Claims" means any patent claim(s), now owned or hereafter
+acquired, including without limitation, method, process, and apparatus
+claims, in any patent Licensable by grantor.
+
+1.12. "Source Code" means (a) the common form of computer software code
+in which modifications are made and (b) associated documentation included
+in or with such code.
+
+1.13. "You" (or "Your") means an individual or a legal entity exercising
+rights under, and complying with all of the terms of, this License. For
+legal entities, "You" includes any entity which controls, is controlled
+by, or is under common control with You. For purposes of this definition,
+"control" means (a) the power, direct or indirect, to cause the direction
+or management of such entity, whether by contract or otherwise, or (b)
+ownership of more than fifty percent (50%) of the outstanding shares or
+beneficial ownership of such entity.
+
+2. License Grants. 
+
+2.1. The Initial Developer Grant.
+
+Conditioned upon Your compliance with Section 3.1 below and subject to
+third party intellectual property claims, the Initial Developer hereby
+grants You a world-wide, royalty-free, non-exclusive license:
+
+    (a) under intellectual property rights (other than patent or
+    trademark) Licensable by Initial Developer, to use, reproduce, modify,
+    display, perform, sublicense and distribute the Original Software
+    (or portions thereof), with or without Modifications, and/or as part
+    of a Larger Work; and
+
+    (b) under Patent Claims infringed by the making, using or selling
+    of Original Software, to make, have made, use, practice, sell, and
+    offer for sale, and/or otherwise dispose of the Original Software
+    (or portions thereof).
+
+    (c) The licenses granted in Sections 2.1(a) and (b) are effective
+    on the date Initial Developer first distributes or otherwise makes
+    the Original Software available to a third party under the terms of
+    this License.
+
+    (d) Notwithstanding Section 2.1(b) above, no patent license is
+    granted: (1) for code that You delete from the Original Software,
+    or (2) for infringements caused by: (i) the modification of the
+    Original Software, or (ii) the combination of the Original Software
+    with other software or devices.
+
+2.2. Contributor Grant.
+
+Conditioned upon Your compliance with Section 3.1 below and subject to
+third party intellectual property claims, each Contributor hereby grants
+You a world-wide, royalty-free, non-exclusive license:
+
+    (a) under intellectual property rights (other than patent or
+    trademark) Licensable by Contributor to use, reproduce, modify,
+    display, perform, sublicense and distribute the Modifications created
+    by such Contributor (or portions thereof), either on an unmodified
+    basis, with other Modifications, as Covered Software and/or as part
+    of a Larger Work; and
+
+    (b) under Patent Claims infringed by the making, using, or selling
+    of Modifications made by that Contributor either alone and/or
+    in combination with its Contributor Version (or portions of such
+    combination), to make, use, sell, offer for sale, have made, and/or
+    otherwise dispose of: (1) Modifications made by that Contributor
+    (or portions thereof); and (2) the combination of Modifications
+    made by that Contributor with its Contributor Version (or portions
+    of such combination).
+
+    (c) The licenses granted in Sections 2.2(a) and 2.2(b) are effective
+    on the date Contributor first distributes or otherwise makes the
+    Modifications available to a third party.
+
+    (d) Notwithstanding Section 2.2(b) above, no patent license is
+    granted: (1) for any code that Contributor has deleted from the
+    Contributor Version; (2) for infringements caused by: (i) third
+    party modifications of Contributor Version, or (ii) the combination
+    of Modifications made by that Contributor with other software
+    (except as part of the Contributor Version) or other devices; or (3)
+    under Patent Claims infringed by Covered Software in the absence of
+    Modifications made by that Contributor.
+
+3. Distribution Obligations.
+
+3.1. Availability of Source Code.
+
+Any Covered Software that You distribute or otherwise make available
+in Executable form must also be made available in Source Code form and
+that Source Code form must be distributed only under the terms of this
+License. You must include a copy of this License with every copy of the
+Source Code form of the Covered Software You distribute or otherwise make
+available. You must inform recipients of any such Covered Software in
+Executable form as to how they can obtain such Covered Software in Source
+Code form in a reasonable manner on or through a medium customarily used
+for software exchange.
+
+3.2. Modifications.
+
+The Modifications that You create or to which You contribute are governed
+by the terms of this License. You represent that You believe Your
+Modifications are Your original creation(s) and/or You have sufficient
+rights to grant the rights conveyed by this License.
+
+3.3. Required Notices.
+
+You must include a notice in each of Your Modifications that identifies
+You as the Contributor of the Modification.  You may not remove or alter
+any copyright, patent or trademark notices contained within the Covered
+Software, or any notices of licensing or any descriptive text giving
+attribution to any Contributor or the Initial Developer.
+
+3.4. Application of Additional Terms.
+
+You may not offer or impose any terms on any Covered Software in Source
+Code form that alters or restricts the applicable version of this License
+or the recipients' rights hereunder. You may choose to offer, and to
+charge a fee for, warranty, support, indemnity or liability obligations to
+one or more recipients of Covered Software.  However, you may do so only
+on Your own behalf, and not on behalf of the Initial Developer or any
+Contributor. You must make it absolutely clear that any such warranty,
+support, indemnity or liability obligation is offered by You alone, and
+You hereby agree to indemnify the Initial Developer and every Contributor
+for any liability incurred by the Initial Developer or such Contributor
+as a result of warranty, support, indemnity or liability terms You offer.
+
+3.5. Distribution of Executable Versions.
+
+You may distribute the Executable form of the Covered Software under the
+terms of this License or under the terms of a license of Your choice,
+which may contain terms different from this License, provided that You are
+in compliance with the terms of this License and that the license for the
+Executable form does not attempt to limit or alter the recipient's rights
+in the Source Code form from the rights set forth in this License. If
+You distribute the Covered Software in Executable form under a different
+license, You must make it absolutely clear that any terms which differ
+from this License are offered by You alone, not by the Initial Developer
+or Contributor. You hereby agree to indemnify the Initial Developer and
+every Contributor for any liability incurred by the Initial Developer
+or such Contributor as a result of any such terms You offer.
+
+3.6. Larger Works.
+
+You may create a Larger Work by combining Covered Software with other code
+not governed by the terms of this License and distribute the Larger Work
+as a single product. In such a case, You must make sure the requirements
+of this License are fulfilled for the Covered Software.
+
+4. Versions of the License. 
+
+4.1. New Versions.
+
+Sun Microsystems, Inc. is the initial license steward and may publish
+revised and/or new versions of this License from time to time. Each
+version will be given a distinguishing version number. Except as provided
+in Section 4.3, no one other than the license steward has the right to
+modify this License.
+
+4.2. Effect of New Versions.
+
+You may always continue to use, distribute or otherwise make the Covered
+Software available under the terms of the version of the License under
+which You originally received the Covered Software. If the Initial
+Developer includes a notice in the Original Software prohibiting it
+from being distributed or otherwise made available under any subsequent
+version of the License, You must distribute and make the Covered Software
+available under the terms of the version of the License under which You
+originally received the Covered Software. Otherwise, You may also choose
+to use, distribute or otherwise make the Covered Software available
+under the terms of any subsequent version of the License published by
+the license steward.
+
+4.3. Modified Versions.
+
+When You are an Initial Developer and You want to create a new license
+for Your Original Software, You may create and use a modified version of
+this License if You: (a) rename the license and remove any references
+to the name of the license steward (except to note that the license
+differs from this License); and (b) otherwise make it clear that the
+license contains terms which differ from this License.
+
+5. DISCLAIMER OF WARRANTY.
+
+COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+WITHOUT LIMITATION, WARRANTIES THAT THE COVERED SOFTWARE IS FREE OF
+DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE
+ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED SOFTWARE
+IS WITH YOU. SHOULD ANY COVERED SOFTWARE PROVE DEFECTIVE IN ANY RESPECT,
+YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST
+OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF
+WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY
+COVERED SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
+
+6. TERMINATION. 
+
+6.1. This License and the rights granted hereunder will terminate
+automatically if You fail to comply with terms herein and fail to cure
+such breach within 30 days of becoming aware of the breach. Provisions
+which, by their nature, must remain in effect beyond the termination of
+this License shall survive.
+
+6.2. If You assert a patent infringement claim (excluding declaratory
+judgment actions) against Initial Developer or a Contributor (the
+Initial Developer or Contributor against whom You assert such claim is
+referred to as "Participant") alleging that the Participant Software
+(meaning the Contributor Version where the Participant is a Contributor
+or the Original Software where the Participant is the Initial Developer)
+directly or indirectly infringes any patent, then any and all rights
+granted directly or indirectly to You by such Participant, the Initial
+Developer (if the Initial Developer is not the Participant) and all
+Contributors under Sections 2.1 and/or 2.2 of this License shall, upon 60
+days notice from Participant terminate prospectively and automatically
+at the expiration of such 60 day notice period, unless if within such
+60 day period You withdraw Your claim with respect to the Participant
+Software against such Participant either unilaterally or pursuant to a
+written agreement with Participant.
+
+6.3. In the event of termination under Sections 6.1 or 6.2 above, all end
+user licenses that have been validly granted by You or any distributor
+hereunder prior to termination (excluding licenses granted to You by
+any distributor) shall survive termination.
+
+7. LIMITATION OF LIABILITY.
+
+UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING
+NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL DEVELOPER, ANY
+OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED SOFTWARE, OR ANY SUPPLIER
+OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL,
+INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT
+LIMITATION, DAMAGES FOR LOST PROFITS, LOSS OF GOODWILL, WORK STOPPAGE,
+COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES
+OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY
+OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY
+FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH PARTY'S NEGLIGENCE TO
+THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS
+DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL
+DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
+
+8. U.S. GOVERNMENT END USERS.
+
+The Covered Software is a "commercial item," as that term is defined
+in 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer
+software" (as that term is defined at 48 C.F.R.  252.227-7014(a)(1)) and
+"commercial computer software documentation" as such terms are used in
+48 C.F.R. 12.212 (Sept.  1995). Consistent with 48 C.F.R. 12.212 and 48
+C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End
+Users acquire Covered Software with only those rights set forth herein.
+This U.S. Government Rights clause is in lieu of, and supersedes, any
+other FAR, DFAR, or other clause or provision that addresses Government
+rights in computer software under this License.
+
+9. MISCELLANEOUS.
+
+This License represents the complete agreement concerning subject matter
+hereof. If any provision of this License is held to be unenforceable,
+such provision shall be reformed only to the extent necessary to make it
+enforceable. This License shall be governed by the law of the jurisdiction
+specified in a notice contained within the Original Software (except to
+the extent applicable law, if any, provides otherwise), excluding such
+jurisdiction's conflict-of-law provisions. Any litigation relating to
+this License shall be subject to the jurisdiction of the courts located
+in the jurisdiction and venue specified in a notice contained within
+the Original Software, with the losing party responsible for costs,
+including, without limitation, court costs and reasonable attorneys'
+fees and expenses. The application of the United Nations Convention on
+Contracts for the International Sale of Goods is expressly excluded. Any
+law or regulation which provides that the language of a contract shall
+be construed against the drafter shall not apply to this License.
+You agree that You alone are responsible for compliance with the United
+States export administration regulations (and the export control laws and
+regulation of any other countries) when You use, distribute or otherwise
+make available any Covered Software.
+
+10. RESPONSIBILITY FOR CLAIMS.
+
+As between Initial Developer and the Contributors, each party is
+responsible for claims and damages arising, directly or indirectly, out
+of its utilization of rights under this License and You agree to work
+with Initial Developer and Contributors to distribute such responsibility
+on an equitable basis. Nothing herein is intended or shall be deemed to
+constitute any admission of liability.
+
+
+
+===========================================================================
+
+To the extent any open source components are licensed under the
+GPL and/or LGPL, or other similar licenses that require the
+source code and/or modifications to source code to be made
+available (as would be noted above), you may obtain a copy of
+the source code corresponding to the binaries for such open
+source components and modifications thereto, if any, (the
+"Source Files"), by downloading the Source Files from VMware's website at
+http://www.vmware.com/download/open_source.html, or by sending a request, with
+your name and address to: VMware, Inc., 3401 Hillview Avenue,
+Palo Alto, CA 94304,United States of America. All such
+requests should clearly specify: OPEN SOURCE FILES REQUEST,
+Attention General Counsel. VMware shall mail a copy of the
+Source Files to you on a CD or equivalent physical medium. This
+offer to obtain a copy of the Source Files is valid for three
+years from the date you acquired this Software product. Alternatively,
+the Source Files may accompany the VMware product.
+
+
+[GFEHTTPMODULE70GAKR100512]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/65a03287/extensions/gemfire-modules-assembly/release/3rdparty_license/open_source_licenses-VMware_vFabric_GemFire_Modules_7.0.1.txt
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-assembly/release/3rdparty_license/open_source_licenses-VMware_vFabric_GemFire_Modules_7.0.1.txt b/extensions/gemfire-modules-assembly/release/3rdparty_license/open_source_licenses-VMware_vFabric_GemFire_Modules_7.0.1.txt
new file mode 100755
index 0000000..c510712
--- /dev/null
+++ b/extensions/gemfire-modules-assembly/release/3rdparty_license/open_source_licenses-VMware_vFabric_GemFire_Modules_7.0.1.txt
@@ -0,0 +1,474 @@
+open_source_license.txt
+
+VMware vFabric GemFire HTTP Session Management Module 7.0.1 GA
+
+
+===========================================================================
+
+The following copyright statements and licenses apply to various open
+source software components (or portions thereof) that are distributed with
+this VMware software products.
+
+The VMware Product may also include other VMware components, which may contain additional open 
+source software packages. One or more such open_source_licenses.txt files may therefore 
+accompany this VMware Product. 
+
+The VMware product that includes this file does not necessarily use all the
+open source software components referred to below and may also only use
+portions of a given component.
+
+
+=============== TABLE OF CONTENTS =============================
+
+
+The following is a listing of the open source components detailed in this
+document.  This list is provided for your convenience; please read further if
+you wish to review the copyright notice(s) and the full text of the license
+associated with each component.
+
+
+
+
+
+SECTION 1: BSD-STYLE, MIT-STYLE, OR SIMILAR STYLE LICENSES
+
+   >>> slf4j-1.5.8
+
+
+
+SECTION 2: Common Development and Distribution License, V1.0
+
+   >>> servlet-api-2.5
+
+
+
+
+APPENDIX. Standard License Files
+
+   >>> Common Development and Distribution License, V1.0
+
+
+
+
+
+--------------- SECTION 1:  BSD-STYLE, MIT-STYLE, OR SIMILAR STYLE LICENSES ----------
+
+BSD-STYLE, MIT-STYLE, OR SIMILAR STYLE LICENSES are applicable to the following component(s).
+
+
+>>> slf4j-1.5.8
+
+Copyright (c) 2004-2008 QOS.ch
+All rights reserved.
+
+Permission is hereby granted, free  of charge, to any person obtaining
+a  copy  of this  software  and  associated  documentation files  (the
+"Software"), to  deal in  the Software without  restriction, including
+without limitation  the rights to  use, copy, modify,  merge, publish,
+distribute,  sublicense, and/or sell  copies of  the Software,  and to
+permit persons to whom the Software  is furnished to do so, subject to
+the following conditions:
+
+The  above  copyright  notice  and  this permission  notice  shall  be
+included in all copies or substantial portions of the Software.
+
+THE  SOFTWARE IS  PROVIDED  "AS  IS", WITHOUT  WARRANTY  OF ANY  KIND,
+EXPRESS OR  IMPLIED, INCLUDING  BUT NOT LIMITED  TO THE  WARRANTIES OF
+MERCHANTABILITY,    FITNESS    FOR    A   PARTICULAR    PURPOSE    AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE,  ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+
+--------------- SECTION 2: Common Development and Distribution License, V1.0 ----------
+
+Common Development and Distribution License, V1.0 is applicable to the following component(s).
+
+
+>>> servlet-api-2.5
+
+The contents of this file are subject to the terms 
+of the Common Development and Distribution License 
+(the "License"). You may not use this file except 
+in compliance with the License. 
+ 
+You can obtain a copy of the license at 
+glassfish/bootstrap/legal/CDDLv1.0.txt or 
+https://glassfish.dev.java.net/public/CDDLv1.0.html. 
+See the License for the specific language governing 
+permissions and limitations under the License. 
+ 
+When distributing Covered Code, include this CDDL 
+HEADER in each file and include the License file at 
+glassfish/bootstrap/legal/CDDLv1.0.txt. If applicable, 
+add the following below this CDDL HEADER, with the 
+fields enclosed by brackets "[]" replaced with your 
+own identifying information: Portions Copyright [yyyy] 
+[name of copyright owner] 
+ 
+Copyright 2005 Sun Microsystems, Inc. All rights reserved. 
+ 
+Portions Copyright Apache Software Foundation.
+
+
+
+
+=============== APPENDIX. Standard License Files ============== 
+
+
+
+--------------- SECTION 1: Common Development and Distribution License, V1.0 -----------
+
+COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
+
+1. Definitions.
+
+1.1. "Contributor" means each individual or entity that creates or
+contributes to the creation of Modifications.
+
+1.2. "Contributor Version" means the combination of the Original Software,
+prior Modifications used by a Contributor (if any), and the Modifications
+made by that particular Contributor.
+
+1.3. "Covered Software" means (a) the Original Software, or (b)
+Modifications, or (c) the combination of files containing Original
+Software with files containing Modifications, in each case including
+portions thereof.
+
+1.4. "Executable" means the Covered Software in any form other than
+Source Code.
+
+1.5. "Initial Developer" means the individual or entity that first makes
+Original Software available under this License.
+
+1.6. "Larger Work" means a work which combines Covered Software or
+portions thereof with code not governed by the terms of this License.
+
+1.7. "License" means this document.
+
+1.8. "Licensable" means having the right to grant, to the maximum extent
+possible, whether at the time of the initial grant or subsequently
+acquired, any and all of the rights conveyed herein.
+
+1.9. "Modifications" means the Source Code and Executable form of any
+of the following:
+
+    A. Any file that results from an addition to, deletion from or
+    modification of the contents of a file containing Original Software
+    or previous Modifications;
+
+    B. Any new file that contains any part of the Original Software or
+    previous Modification; or
+
+    C. Any new file that is contributed or otherwise made available
+    under the terms of this License.
+
+1.10. "Original Software" means the Source Code and Executable form of
+computer software code that is originally released under this License.
+
+1.11. "Patent Claims" means any patent claim(s), now owned or hereafter
+acquired, including without limitation, method, process, and apparatus
+claims, in any patent Licensable by grantor.
+
+1.12. "Source Code" means (a) the common form of computer software code
+in which modifications are made and (b) associated documentation included
+in or with such code.
+
+1.13. "You" (or "Your") means an individual or a legal entity exercising
+rights under, and complying with all of the terms of, this License. For
+legal entities, "You" includes any entity which controls, is controlled
+by, or is under common control with You. For purposes of this definition,
+"control" means (a) the power, direct or indirect, to cause the direction
+or management of such entity, whether by contract or otherwise, or (b)
+ownership of more than fifty percent (50%) of the outstanding shares or
+beneficial ownership of such entity.
+
+2. License Grants. 
+
+2.1. The Initial Developer Grant.
+
+Conditioned upon Your compliance with Section 3.1 below and subject to
+third party intellectual property claims, the Initial Developer hereby
+grants You a world-wide, royalty-free, non-exclusive license:
+
+    (a) under intellectual property rights (other than patent or
+    trademark) Licensable by Initial Developer, to use, reproduce, modify,
+    display, perform, sublicense and distribute the Original Software
+    (or portions thereof), with or without Modifications, and/or as part
+    of a Larger Work; and
+
+    (b) under Patent Claims infringed by the making, using or selling
+    of Original Software, to make, have made, use, practice, sell, and
+    offer for sale, and/or otherwise dispose of the Original Software
+    (or portions thereof).
+
+    (c) The licenses granted in Sections 2.1(a) and (b) are effective
+    on the date Initial Developer first distributes or otherwise makes
+    the Original Software available to a third party under the terms of
+    this License.
+
+    (d) Notwithstanding Section 2.1(b) above, no patent license is
+    granted: (1) for code that You delete from the Original Software,
+    or (2) for infringements caused by: (i) the modification of the
+    Original Software, or (ii) the combination of the Original Software
+    with other software or devices.
+
+2.2. Contributor Grant.
+
+Conditioned upon Your compliance with Section 3.1 below and subject to
+third party intellectual property claims, each Contributor hereby grants
+You a world-wide, royalty-free, non-exclusive license:
+
+    (a) under intellectual property rights (other than patent or
+    trademark) Licensable by Contributor to use, reproduce, modify,
+    display, perform, sublicense and distribute the Modifications created
+    by such Contributor (or portions thereof), either on an unmodified
+    basis, with other Modifications, as Covered Software and/or as part
+    of a Larger Work; and
+
+    (b) under Patent Claims infringed by the making, using, or selling
+    of Modifications made by that Contributor either alone and/or
+    in combination with its Contributor Version (or portions of such
+    combination), to make, use, sell, offer for sale, have made, and/or
+    otherwise dispose of: (1) Modifications made by that Contributor
+    (or portions thereof); and (2) the combination of Modifications
+    made by that Contributor with its Contributor Version (or portions
+    of such combination).
+
+    (c) The licenses granted in Sections 2.2(a) and 2.2(b) are effective
+    on the date Contributor first distributes or otherwise makes the
+    Modifications available to a third party.
+
+    (d) Notwithstanding Section 2.2(b) above, no patent license is
+    granted: (1) for any code that Contributor has deleted from the
+    Contributor Version; (2) for infringements caused by: (i) third
+    party modifications of Contributor Version, or (ii) the combination
+    of Modifications made by that Contributor with other software
+    (except as part of the Contributor Version) or other devices; or (3)
+    under Patent Claims infringed by Covered Software in the absence of
+    Modifications made by that Contributor.
+
+3. Distribution Obligations.
+
+3.1. Availability of Source Code.
+
+Any Covered Software that You distribute or otherwise make available
+in Executable form must also be made available in Source Code form and
+that Source Code form must be distributed only under the terms of this
+License. You must include a copy of this License with every copy of the
+Source Code form of the Covered Software You distribute or otherwise make
+available. You must inform recipients of any such Covered Software in
+Executable form as to how they can obtain such Covered Software in Source
+Code form in a reasonable manner on or through a medium customarily used
+for software exchange.
+
+3.2. Modifications.
+
+The Modifications that You create or to which You contribute are governed
+by the terms of this License. You represent that You believe Your
+Modifications are Your original creation(s) and/or You have sufficient
+rights to grant the rights conveyed by this License.
+
+3.3. Required Notices.
+
+You must include a notice in each of Your Modifications that identifies
+You as the Contributor of the Modification.  You may not remove or alter
+any copyright, patent or trademark notices contained within the Covered
+Software, or any notices of licensing or any descriptive text giving
+attribution to any Contributor or the Initial Developer.
+
+3.4. Application of Additional Terms.
+
+You may not offer or impose any terms on any Covered Software in Source
+Code form that alters or restricts the applicable version of this License
+or the recipients' rights hereunder. You may choose to offer, and to
+charge a fee for, warranty, support, indemnity or liability obligations to
+one or more recipients of Covered Software.  However, you may do so only
+on Your own behalf, and not on behalf of the Initial Developer or any
+Contributor. You must make it absolutely clear that any such warranty,
+support, indemnity or liability obligation is offered by You alone, and
+You hereby agree to indemnify the Initial Developer and every Contributor
+for any liability incurred by the Initial Developer or such Contributor
+as a result of warranty, support, indemnity or liability terms You offer.
+
+3.5. Distribution of Executable Versions.
+
+You may distribute the Executable form of the Covered Software under the
+terms of this License or under the terms of a license of Your choice,
+which may contain terms different from this License, provided that You are
+in compliance with the terms of this License and that the license for the
+Executable form does not attempt to limit or alter the recipient's rights
+in the Source Code form from the rights set forth in this License. If
+You distribute the Covered Software in Executable form under a different
+license, You must make it absolutely clear that any terms which differ
+from this License are offered by You alone, not by the Initial Developer
+or Contributor. You hereby agree to indemnify the Initial Developer and
+every Contributor for any liability incurred by the Initial Developer
+or such Contributor as a result of any such terms You offer.
+
+3.6. Larger Works.
+
+You may create a Larger Work by combining Covered Software with other code
+not governed by the terms of this License and distribute the Larger Work
+as a single product. In such a case, You must make sure the requirements
+of this License are fulfilled for the Covered Software.
+
+4. Versions of the License. 
+
+4.1. New Versions.
+
+Sun Microsystems, Inc. is the initial license steward and may publish
+revised and/or new versions of this License from time to time. Each
+version will be given a distinguishing version number. Except as provided
+in Section 4.3, no one other than the license steward has the right to
+modify this License.
+
+4.2. Effect of New Versions.
+
+You may always continue to use, distribute or otherwise make the Covered
+Software available under the terms of the version of the License under
+which You originally received the Covered Software. If the Initial
+Developer includes a notice in the Original Software prohibiting it
+from being distributed or otherwise made available under any subsequent
+version of the License, You must distribute and make the Covered Software
+available under the terms of the version of the License under which You
+originally received the Covered Software. Otherwise, You may also choose
+to use, distribute or otherwise make the Covered Software available
+under the terms of any subsequent version of the License published by
+the license steward.
+
+4.3. Modified Versions.
+
+When You are an Initial Developer and You want to create a new license
+for Your Original Software, You may create and use a modified version of
+this License if You: (a) rename the license and remove any references
+to the name of the license steward (except to note that the license
+differs from this License); and (b) otherwise make it clear that the
+license contains terms which differ from this License.
+
+5. DISCLAIMER OF WARRANTY.
+
+COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+WITHOUT LIMITATION, WARRANTIES THAT THE COVERED SOFTWARE IS FREE OF
+DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE
+ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED SOFTWARE
+IS WITH YOU. SHOULD ANY COVERED SOFTWARE PROVE DEFECTIVE IN ANY RESPECT,
+YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST
+OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF
+WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY
+COVERED SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
+
+6. TERMINATION. 
+
+6.1. This License and the rights granted hereunder will terminate
+automatically if You fail to comply with terms herein and fail to cure
+such breach within 30 days of becoming aware of the breach. Provisions
+which, by their nature, must remain in effect beyond the termination of
+this License shall survive.
+
+6.2. If You assert a patent infringement claim (excluding declaratory
+judgment actions) against Initial Developer or a Contributor (the
+Initial Developer or Contributor against whom You assert such claim is
+referred to as "Participant") alleging that the Participant Software
+(meaning the Contributor Version where the Participant is a Contributor
+or the Original Software where the Participant is the Initial Developer)
+directly or indirectly infringes any patent, then any and all rights
+granted directly or indirectly to You by such Participant, the Initial
+Developer (if the Initial Developer is not the Participant) and all
+Contributors under Sections 2.1 and/or 2.2 of this License shall, upon 60
+days notice from Participant terminate prospectively and automatically
+at the expiration of such 60 day notice period, unless if within such
+60 day period You withdraw Your claim with respect to the Participant
+Software against such Participant either unilaterally or pursuant to a
+written agreement with Participant.
+
+6.3. In the event of termination under Sections 6.1 or 6.2 above, all end
+user licenses that have been validly granted by You or any distributor
+hereunder prior to termination (excluding licenses granted to You by
+any distributor) shall survive termination.
+
+7. LIMITATION OF LIABILITY.
+
+UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING
+NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL DEVELOPER, ANY
+OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED SOFTWARE, OR ANY SUPPLIER
+OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL,
+INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT
+LIMITATION, DAMAGES FOR LOST PROFITS, LOSS OF GOODWILL, WORK STOPPAGE,
+COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES
+OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY
+OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY
+FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH PARTY'S NEGLIGENCE TO
+THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS
+DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL
+DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
+
+8. U.S. GOVERNMENT END USERS.
+
+The Covered Software is a "commercial item," as that term is defined
+in 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer
+software" (as that term is defined at 48 C.F.R.  252.227-7014(a)(1)) and
+"commercial computer software documentation" as such terms are used in
+48 C.F.R. 12.212 (Sept.  1995). Consistent with 48 C.F.R. 12.212 and 48
+C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End
+Users acquire Covered Software with only those rights set forth herein.
+This U.S. Government Rights clause is in lieu of, and supersedes, any
+other FAR, DFAR, or other clause or provision that addresses Government
+rights in computer software under this License.
+
+9. MISCELLANEOUS.
+
+This License represents the complete agreement concerning subject matter
+hereof. If any provision of this License is held to be unenforceable,
+such provision shall be reformed only to the extent necessary to make it
+enforceable. This License shall be governed by the law of the jurisdiction
+specified in a notice contained within the Original Software (except to
+the extent applicable law, if any, provides otherwise), excluding such
+jurisdiction's conflict-of-law provisions. Any litigation relating to
+this License shall be subject to the jurisdiction of the courts located
+in the jurisdiction and venue specified in a notice contained within
+the Original Software, with the losing party responsible for costs,
+including, without limitation, court costs and reasonable attorneys'
+fees and expenses. The application of the United Nations Convention on
+Contracts for the International Sale of Goods is expressly excluded. Any
+law or regulation which provides that the language of a contract shall
+be construed against the drafter shall not apply to this License.
+You agree that You alone are responsible for compliance with the United
+States export administration regulations (and the export control laws and
+regulation of any other countries) when You use, distribute or otherwise
+make available any Covered Software.
+
+10. RESPONSIBILITY FOR CLAIMS.
+
+As between Initial Developer and the Contributors, each party is
+responsible for claims and damages arising, directly or indirectly, out
+of its utilization of rights under this License and You agree to work
+with Initial Developer and Contributors to distribute such responsibility
+on an equitable basis. Nothing herein is intended or shall be deemed to
+constitute any admission of liability.
+
+
+
+===========================================================================
+
+To the extent any open source components are licensed under the
+GPL and/or LGPL, or other similar licenses that require the
+source code and/or modifications to source code to be made
+available (as would be noted above), you may obtain a copy of
+the source code corresponding to the binaries for such open
+source components and modifications thereto, if any, (the
+"Source Files"), by downloading the Source Files from VMware's website at
+http://www.vmware.com/download/open_source.html, or by sending a request, with
+your name and address to: VMware, Inc., 3401 Hillview Avenue,
+Palo Alto, CA 94304,United States of America. All such
+requests should clearly specify: OPEN SOURCE FILES REQUEST,
+Attention General Counsel. VMware shall mail a copy of the
+Source Files to you on a CD or equivalent physical medium. This
+offer to obtain a copy of the Source Files is valid for three
+years from the date you acquired this Software product. Alternatively,
+the Source Files may accompany the VMware product.
+
+
+[GFEHTTPMODULE701GAKD021813]



[07/24] incubator-geode git commit: GEODE-14: Move GemFire Sessions module and relocate all packages to 'internal'

Posted by je...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/ListenerEventType.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/ListenerEventType.java b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/ListenerEventType.java
new file mode 100644
index 0000000..0060a89
--- /dev/null
+++ b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/ListenerEventType.java
@@ -0,0 +1,70 @@
+/*=========================================================================
+ * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package com.gemstone.gemfire.modules.session.internal.filter;
+
+/**
+ * Enumeration of all possible event types which can be listened for.
+ */
+public enum ListenerEventType {
+
+  /**
+   * HttpSessionAttributeListener
+   */
+  SESSION_ATTRIBUTE_ADDED,
+  SESSION_ATTRIBUTE_REMOVED,
+  SESSION_ATTRIBUTE_REPLACED,
+
+  /**
+   * HttpSessionBindingListener
+   */
+  SESSION_VALUE_BOUND,
+  SESSION_VALUE_UNBOUND,
+
+  /**
+   * HttpSessionListener
+   */
+  SESSION_CREATED,
+  SESSION_DESTROYED,
+
+  /**
+   * HttpSessionActivationListener
+   */
+  SESSION_WILL_ACTIVATE,
+  SESSION_DID_PASSIVATE,
+
+  /**
+   * ServletContextListener
+   */
+  SERVLET_CONTEXT_INITIALIZED,
+  SERVLET_CONTEXT_DESTROYED,
+
+  /**
+   * ServletContextAttributeListener
+   */
+  SERVLET_CONTEXT_ATTRIBUTE_ADDED,
+  SERVLET_CONTEXT_ATTRIBUTE_REMOVED,
+  SERVLET_CONTEXT_ATTRIBUTE_REPLACED,
+
+  /**
+   * ServletRequestListener
+   */
+  SERVLET_REQUEST_DESTROYED,
+  SERVLET_REQUEST_INITIALIZED,
+
+  /**
+   * ServletRequestAttributeListener
+   */
+  SERVLET_REQUEST_ATTRIBUTE_ADDED,
+  SERVLET_REQUEST_ATTRIBUTE_REMOVED,
+  SERVLET_REQUEST_ATTRIBUTE_REPLACED;
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/SessionManager.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/SessionManager.java b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/SessionManager.java
new file mode 100644
index 0000000..a01c793
--- /dev/null
+++ b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/SessionManager.java
@@ -0,0 +1,101 @@
+/*=========================================================================
+ * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+
+package com.gemstone.gemfire.modules.session.internal.filter;
+
+import javax.servlet.http.HttpSession;
+
+/**
+ * Interface to session management. This class would be responsible for creating
+ * new sessions.
+ */
+public interface SessionManager {
+
+  /**
+   * Start the manager possibly using the config passed in.
+   *
+   * @param config Config object specific to individual implementations.
+   * @param loader This is a hack. When the manager is started it wants to be
+   *               able to determine if the cache, which it would create, and
+   *               the filter which starts everything, are defined by the same
+   *               classloader. This is so that during shutdown, the manager can
+   *               decide whether or not to also stop the cache. This option
+   *               allows the filter's classloader to be passed in.
+   */
+  public void start(Object config, ClassLoader loader);
+
+  /**
+   * Stop the session manager and free up any resources.
+   */
+  public void stop();
+
+  /**
+   * Write the session to the region
+   *
+   * @param session the session to write
+   */
+  public void putSession(HttpSession session);
+
+  /**
+   * Return a session if it exists or null otherwise
+   *
+   * @param id The session id to attempt to retrieve
+   * @return a HttpSession object if a session was found otherwise null.
+   */
+  public HttpSession getSession(String id);
+
+  /**
+   * Create a new session, wrapping a container session.
+   *
+   * @param nativeSession
+   * @return the HttpSession object
+   */
+  public HttpSession wrapSession(HttpSession nativeSession);
+
+  /**
+   * Get the wrapped (GemFire) session from a native session id. This method
+   * would typically be used from within session/http event listeners which
+   * receive the original session id.
+   *
+   * @param nativeId
+   * @return the wrapped GemFire session which maps the native session
+   */
+  public HttpSession getWrappingSession(String nativeId);
+
+  /**
+   * Destroy the session associated with the given id.
+   *
+   * @param id The id of the session to destroy.
+   */
+  public void destroySession(String id);
+
+  /**
+   * Destroy the session associated with a given native session
+   *
+   * @param id the id of the native session
+   * @return the corresponding Gemfire session which wrapped the native session
+   * and was destroyed.
+   */
+  public String destroyNativeSession(String id);
+
+  /**
+   * Returns the cookie name used to hold the session id. By default this is
+   * JSESSIONID.
+   *
+   * @return the name of the cookie which contains the session id
+   */
+  public String getSessionCookieName();
+
+  /**
+   * Get the JVM Id - this is a unique string used internally to identify who
+   * last touched a session.
+   *
+   * @return the jvm id
+   */
+  public String getJvmId();
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/attributes/AbstractDeltaSessionAttributes.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/attributes/AbstractDeltaSessionAttributes.java b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/attributes/AbstractDeltaSessionAttributes.java
new file mode 100644
index 0000000..096e63b
--- /dev/null
+++ b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/attributes/AbstractDeltaSessionAttributes.java
@@ -0,0 +1,97 @@
+/*=========================================================================
+ * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+package com.gemstone.gemfire.modules.session.internal.filter.attributes;
+
+import com.gemstone.gemfire.DataSerializer;
+import com.gemstone.gemfire.Delta;
+import com.gemstone.gemfire.InvalidDeltaException;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * This abstract class contains the structures and methods to handle delta
+ * updates to attributes.
+ */
+public abstract class AbstractDeltaSessionAttributes
+    extends AbstractSessionAttributes implements Delta {
+
+  private static final Logger LOG =
+      LoggerFactory.getLogger(AbstractDeltaSessionAttributes.class.getName());
+
+  /**
+   * This map holds the updates to attributes
+   */
+  protected transient Map<String, DeltaEvent> deltas =
+      Collections.synchronizedMap(new HashMap<String, DeltaEvent>());
+
+  @Override
+  public boolean hasDelta() {
+    return true;
+  }
+
+  @Override
+  public void toDelta(DataOutput out) throws IOException {
+    out.writeInt(maxInactiveInterval);
+    out.writeLong(lastAccessedTime);
+
+    synchronized (deltas) {
+      DataSerializer.writeInteger(deltas.size(), out);
+      for (Map.Entry<String, DeltaEvent> e : deltas.entrySet()) {
+        DataSerializer.writeString(e.getKey(), out);
+        DataSerializer.writeObject(e.getValue(), out);
+      }
+      deltas.clear();
+    }
+
+    out.writeUTF(jvmOwnerId);
+  }
+
+  @Override
+  public void fromDelta(DataInput in)
+      throws IOException, InvalidDeltaException {
+    maxInactiveInterval = in.readInt();
+    lastAccessedTime = in.readLong();
+    Map<String, DeltaEvent> localDeltas = new HashMap<String, DeltaEvent>();
+    try {
+      int size = DataSerializer.readInteger(in);
+      for (int i = 0; i < size; i++) {
+        String key = DataSerializer.readString(in);
+        DeltaEvent evt = DataSerializer.readObject(in);
+        localDeltas.put(key, evt);
+      }
+    } catch (ClassNotFoundException ex) {
+      LOG.error("Unable to de-serialize delta events", ex);
+      return;
+    }
+
+    LOG.debug("Processing {} delta events for {}",
+        localDeltas.size(), session);
+    for (DeltaEvent e : localDeltas.values()) {
+      if (e.isUpdate()) {
+        attributes.put(e.getName(), e.getValue());
+        if (session.getNativeSession() != null) {
+          session.getNativeSession().setAttribute(e.getName(), e.getValue());
+        }
+      } else {
+        attributes.remove(e.getName());
+        if (session.getNativeSession() != null) {
+          session.getNativeSession().setAttribute(e.getName(), null);
+        }
+      }
+    }
+    jvmOwnerId = in.readUTF();
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/attributes/AbstractSessionAttributes.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/attributes/AbstractSessionAttributes.java b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/attributes/AbstractSessionAttributes.java
new file mode 100644
index 0000000..b5effb4
--- /dev/null
+++ b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/attributes/AbstractSessionAttributes.java
@@ -0,0 +1,179 @@
+/*=========================================================================
+ * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+
+package com.gemstone.gemfire.modules.session.internal.filter.attributes;
+
+import com.gemstone.gemfire.DataSerializer;
+import com.gemstone.gemfire.internal.util.BlobHelper;
+import com.gemstone.gemfire.modules.session.internal.filter.GemfireHttpSession;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Abstract implementation for attributes. Should be sub-classed to provide
+ * differing implementations for synchronous or delta propagation. The backing
+ * store used is defined by the session manager.
+ */
+public abstract class AbstractSessionAttributes implements SessionAttributes {
+
+  private static final Logger LOG =
+      LoggerFactory.getLogger(AbstractSessionAttributes.class.getName());
+
+  /**
+   * Internal attribute store.
+   */
+  protected Map<String, Object> attributes =
+      Collections.synchronizedMap(new HashMap<String, Object>());
+
+  /**
+   * The session to which these attributes belong
+   */
+  protected transient GemfireHttpSession session;
+
+  /**
+   * The last accessed time
+   */
+  protected long lastAccessedTime;
+
+  /**
+   * The maximum inactive interval. Default is 1800 seconds.
+   */
+  protected int maxInactiveInterval = 60 * 30;
+
+  /**
+   * The JVM Id who last committed these attributes
+   */
+  protected String jvmOwnerId;
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  public void setSession(GemfireHttpSession session) {
+    this.session = session;
+  }
+
+  /**
+   * {@inheritDoc} The actual de-serialization of any domain objects is deferred
+   * until the point at which they are actually retrieved by the application
+   * layer.
+   */
+  @Override
+  public Object getAttribute(String name) {
+    Object value = attributes.get(name);
+
+    // If the value is a byte[] (meaning it came from the server),
+    // deserialize it and re-add it to attributes map before returning it.
+    if (value instanceof byte[]) {
+      try {
+        value = BlobHelper.deserializeBlob((byte[]) value);
+        attributes.put(name, value);
+      } catch (Exception iox) {
+        LOG.error("Attribute '" + name +
+            " contains a byte[] that cannot be deserialized due "
+            + "to the following exception", iox);
+      }
+    }
+
+    return value;
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  public Set<String> getAttributeNames() {
+    return attributes.keySet();
+  }
+
+  /**
+   * {@inheritDoc} +
+   */
+  @Override
+  public void setMaxInactiveInterval(int interval) {
+    maxInactiveInterval = interval;
+  }
+
+  @Override
+  public int getMaxIntactiveInterval() {
+    return maxInactiveInterval;
+  }
+
+  @Override
+  public void setLastAccessedTime(long time) {
+    lastAccessedTime = time;
+  }
+
+  @Override
+  public long getLastAccessedTime() {
+    return lastAccessedTime;
+  }
+
+  /**
+   * {@inheritDoc} This method calls back into the session to flush the whole
+   * session including its attributes.
+   */
+  @Override
+  public void flush() {
+    session.putInRegion();
+  }
+
+  /**
+   * Use DeltaEvents to propagate the actual attribute data - DeltaEvents turn
+   * the values into byte arrays which means that the actual domain classes are
+   * not required on the server.
+   */
+  @Override
+  public void toData(DataOutput out) throws IOException {
+    out.writeInt(maxInactiveInterval);
+    out.writeLong(lastAccessedTime);
+
+    synchronized (attributes) {
+      out.writeInt(attributes.size());
+      for (Map.Entry<String, Object> entry : attributes.entrySet()) {
+        DeltaEvent delta = new DeltaEvent(true, entry.getKey(),
+            entry.getValue());
+        DataSerializer.writeObject(delta, out);
+      }
+    }
+
+    out.writeUTF(jvmOwnerId);
+  }
+
+  @Override
+  public void fromData(
+      DataInput in) throws IOException, ClassNotFoundException {
+    maxInactiveInterval = in.readInt();
+    lastAccessedTime = in.readLong();
+    int size = in.readInt();
+    while (size-- > 0) {
+      DeltaEvent event = DataSerializer.readObject(in);
+      attributes.put(event.getName(), event.getValue());
+    }
+    jvmOwnerId = in.readUTF();
+  }
+
+  @Override
+  public void setJvmOwnerId(String jvmId) {
+    this.jvmOwnerId = jvmId;
+  }
+
+  @Override
+  public String getJvmOwnerId() {
+    return jvmOwnerId;
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/attributes/DeltaEvent.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/attributes/DeltaEvent.java b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/attributes/DeltaEvent.java
new file mode 100644
index 0000000..455ba59
--- /dev/null
+++ b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/attributes/DeltaEvent.java
@@ -0,0 +1,109 @@
+/*=========================================================================
+ * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+package com.gemstone.gemfire.modules.session.internal.filter.attributes;
+
+import com.gemstone.gemfire.DataSerializable;
+import com.gemstone.gemfire.DataSerializer;
+import com.gemstone.gemfire.internal.util.BlobHelper;
+import com.gemstone.gemfire.modules.session.internal.filter.GemfireHttpSession;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+
+/**
+ * Capture the update to a particular name
+ */
+public class DeltaEvent implements DataSerializable {
+
+  private static final Logger LOG =
+      LoggerFactory.getLogger(DeltaEvent.class.getName());
+  /**
+   * The event is either an update (true) or a remove (false)
+   */
+  private boolean update;
+
+  private String name;
+
+  private Object value = null;
+
+  private GemfireHttpSession session = null;
+
+  /**
+   * Constructor for de-serialization only
+   */
+  public DeltaEvent() {
+  }
+
+  /**
+   * Constructor which creates a 'deferred' event. This is used when the value
+   * should only be applied when the object is serialized.
+   *
+   * @param session   the session from which the value ultimately will be
+   *                  retrieved
+   * @param attribute the name of the attribute
+   */
+  public DeltaEvent(GemfireHttpSession session, String attribute) {
+    this.session = session;
+    this.name = attribute;
+    this.update = true;
+  }
+
+  public DeltaEvent(boolean update, String attribute, Object value) {
+    this.update = update;
+    this.name = attribute;
+    this.value = value;
+    blobifyValue();
+  }
+
+  private void blobifyValue() {
+    if (value instanceof byte[]) {
+      LOG.warn("Session attribute is already a byte[] - problems may "
+          + "occur transmitting this delta.");
+    }
+    try {
+      value = BlobHelper.serializeToBlob(value);
+    } catch (IOException iox) {
+      LOG.error("Attribute '" + name + "' value: " + value
+          + " cannot be serialized due to the following exception", iox);
+    }
+  }
+
+  public boolean isUpdate() {
+    return update;
+  }
+
+  public String getName() {
+    return name;
+  }
+
+  public Object getValue() {
+    return value;
+  }
+
+  @Override
+  public void toData(DataOutput out) throws IOException {
+    if (session != null) {
+      value = session.getNativeSession().getAttribute(name);
+      blobifyValue();
+    }
+    out.writeBoolean(update);
+    DataSerializer.writeString(name, out);
+    DataSerializer.writeObject(value, out);
+  }
+
+  @Override
+  public void fromData(
+      DataInput in) throws IOException, ClassNotFoundException {
+    update = in.readBoolean();
+    name = DataSerializer.readString(in);
+    value = DataSerializer.readObject(in);
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/attributes/DeltaQueuedSessionAttributes.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/attributes/DeltaQueuedSessionAttributes.java b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/attributes/DeltaQueuedSessionAttributes.java
new file mode 100644
index 0000000..0c8bd57
--- /dev/null
+++ b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/attributes/DeltaQueuedSessionAttributes.java
@@ -0,0 +1,84 @@
+/*=========================================================================
+ * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+package com.gemstone.gemfire.modules.session.internal.filter.attributes;
+
+import com.gemstone.gemfire.DataSerializable;
+import com.gemstone.gemfire.Instantiator;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * This class implements delayed attribute delta propagation. Updates to
+ * attributes are only propagated once the session goes out of scope - i.e. as
+ * the request is done being processed.
+ */
+public class DeltaQueuedSessionAttributes extends AbstractDeltaSessionAttributes {
+
+  private static final Logger LOG =
+      LoggerFactory.getLogger(DeltaQueuedSessionAttributes.class.getName());
+
+  private Trigger trigger = Trigger.SET;
+
+  private enum Trigger {
+    SET,
+    SET_AND_GET;
+  }
+
+  /**
+   * Register ourselves for de-serialization
+   */
+  static {
+    Instantiator.register(
+        new Instantiator(DeltaQueuedSessionAttributes.class, 3479) {
+          @Override
+          public DataSerializable newInstance() {
+            return new DeltaQueuedSessionAttributes();
+          }
+        });
+  }
+
+  /**
+   * Default constructor
+   */
+  public DeltaQueuedSessionAttributes() {
+  }
+
+  public void setReplicationTrigger(String trigger) {
+    this.trigger = Trigger.valueOf(trigger.toUpperCase());
+  }
+
+  @Override
+  public Object getAttribute(String attr) {
+    if (trigger == Trigger.SET_AND_GET) {
+      deltas.put(attr, new DeltaEvent(session, attr));
+    }
+    return super.getAttribute(attr);
+  }
+
+  /**
+   * {@inheritDoc} Put an attribute, setting the dirty flag. The changes are
+   * flushed at the end of filter processing.
+   */
+  @Override
+  public Object putAttribute(String attr, Object value) {
+    Object obj = attributes.put(attr, value);
+    deltas.put(attr, new DeltaEvent(true, attr, value));
+    return obj;
+  }
+
+  /**
+   * {@inheritDoc} Remove an attribute, setting the dirty flag. The changes are
+   * flushed at the end of filter processing.
+   */
+  @Override
+  public Object removeAttribute(String attr) {
+    Object obj = attributes.remove(attr);
+    deltas.put(attr, new DeltaEvent(false, attr, null));
+    return obj;
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/attributes/DeltaSessionAttributes.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/attributes/DeltaSessionAttributes.java b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/attributes/DeltaSessionAttributes.java
new file mode 100644
index 0000000..0c11c46
--- /dev/null
+++ b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/attributes/DeltaSessionAttributes.java
@@ -0,0 +1,65 @@
+/*=========================================================================
+ * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+package com.gemstone.gemfire.modules.session.internal.filter.attributes;
+
+import com.gemstone.gemfire.DataSerializable;
+import com.gemstone.gemfire.Instantiator;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * This class implements synchronous attribute delta propagation. Updates to
+ * attributes are immediately propagated.
+ */
+public class DeltaSessionAttributes extends AbstractDeltaSessionAttributes {
+
+  private static final Logger LOG =
+      LoggerFactory.getLogger(DeltaSessionAttributes.class.getName());
+
+  /**
+   * Register ourselves for de-serialization
+   */
+  static {
+    Instantiator.register(new Instantiator(DeltaSessionAttributes.class, 347) {
+      @Override
+      public DataSerializable newInstance() {
+        return new DeltaSessionAttributes();
+      }
+    });
+  }
+
+  /**
+   * Default constructor
+   */
+  public DeltaSessionAttributes() {
+  }
+
+  /**
+   * {@inheritDoc} Put an attribute, setting the dirty flag and immediately
+   * flushing the delta queue.
+   */
+  @Override
+  public Object putAttribute(String attr, Object value) {
+    Object obj = attributes.put(attr, value);
+    deltas.put(attr, new DeltaEvent(true, attr, value));
+    flush();
+    return obj;
+  }
+
+  /**
+   * {@inheritDoc} Remove an attribute, setting the dirty flag and immediately
+   * flushing the delta queue.
+   */
+  @Override
+  public Object removeAttribute(String attr) {
+    Object obj = attributes.remove(attr);
+    deltas.put(attr, new DeltaEvent(false, attr, null));
+    flush();
+    return obj;
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/attributes/ImmediateSessionAttributes.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/attributes/ImmediateSessionAttributes.java b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/attributes/ImmediateSessionAttributes.java
new file mode 100644
index 0000000..8bde765
--- /dev/null
+++ b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/attributes/ImmediateSessionAttributes.java
@@ -0,0 +1,58 @@
+/*=========================================================================
+ * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+package com.gemstone.gemfire.modules.session.internal.filter.attributes;
+
+import com.gemstone.gemfire.DataSerializable;
+import com.gemstone.gemfire.Instantiator;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * This class implements immediately transmitted attributes. All attributes are
+ * transmitted for every attribute update. This is bound to be a performance hit
+ * in some cases but ensures much higher data availability.
+ */
+public class ImmediateSessionAttributes extends AbstractSessionAttributes {
+
+  private static final Logger LOG =
+      LoggerFactory.getLogger(ImmediateSessionAttributes.class.getName());
+
+  /**
+   * Register ourselves for de-serialization
+   */
+  static {
+    Instantiator.register(
+        new Instantiator(ImmediateSessionAttributes.class, 347) {
+          @Override
+          public DataSerializable newInstance() {
+            return new ImmediateSessionAttributes();
+          }
+        });
+  }
+
+  /**
+   * Default constructor
+   */
+  public ImmediateSessionAttributes() {
+  }
+
+  @Override
+  public Object putAttribute(String attr, Object value) {
+    Object obj = attributes.put(attr, value);
+    flush();
+    return obj;
+  }
+
+  @Override
+  public Object removeAttribute(String attr) {
+    Object obj = attributes.remove(attr);
+    flush();
+    return obj;
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/attributes/QueuedSessionAttributes.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/attributes/QueuedSessionAttributes.java b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/attributes/QueuedSessionAttributes.java
new file mode 100644
index 0000000..85d19ab
--- /dev/null
+++ b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/attributes/QueuedSessionAttributes.java
@@ -0,0 +1,55 @@
+/*=========================================================================
+ * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+package com.gemstone.gemfire.modules.session.internal.filter.attributes;
+
+import com.gemstone.gemfire.DataSerializable;
+import com.gemstone.gemfire.Instantiator;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * This class implements an attribute container which delays sending updates
+ * until the session goes out of scope. All attributes are transmitted during
+ * the update.
+ */
+public class QueuedSessionAttributes extends AbstractSessionAttributes {
+
+  private static final Logger LOG =
+      LoggerFactory.getLogger(QueuedSessionAttributes.class.getName());
+
+  /**
+   * Register ourselves for de-serialization
+   */
+  static {
+    Instantiator.register(new Instantiator(QueuedSessionAttributes.class, 347) {
+      @Override
+      public DataSerializable newInstance() {
+        return new QueuedSessionAttributes();
+      }
+    });
+  }
+
+  /**
+   * Default constructor
+   */
+  public QueuedSessionAttributes() {
+  }
+
+  @Override
+  public Object putAttribute(String attr, Object value) {
+    Object obj = attributes.put(attr, value);
+    return obj;
+  }
+
+  @Override
+  public Object removeAttribute(String attr) {
+    Object obj = attributes.remove(attr);
+    return obj;
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/attributes/SessionAttributes.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/attributes/SessionAttributes.java b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/attributes/SessionAttributes.java
new file mode 100644
index 0000000..cf16e14
--- /dev/null
+++ b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/attributes/SessionAttributes.java
@@ -0,0 +1,111 @@
+/*=========================================================================
+ * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+
+package com.gemstone.gemfire.modules.session.internal.filter.attributes;
+
+import com.gemstone.gemfire.DataSerializable;
+import com.gemstone.gemfire.modules.session.internal.filter.GemfireHttpSession;
+
+import java.util.Set;
+
+/**
+ * Interface for session attribute storage. In reality, this interface is
+ * responsible for anything, in the session which needs to be propagated for
+ * caching - as such it also includes other 'attributes' such as
+ * maxInactiveInterval and lastAccessedTime
+ */
+public interface SessionAttributes extends DataSerializable {
+
+  /**
+   * Set the session to which these attributes belong.
+   *
+   * @param session the session to set
+   */
+  public void setSession(GemfireHttpSession session);
+
+  /**
+   * Set an attribute value.
+   *
+   * @param attr  the name of the attribute to set
+   * @param value the value for the attribute
+   * @return the value object
+   */
+  public Object putAttribute(String attr, Object value);
+
+  /**
+   * Retrieve an attribute's value.
+   *
+   * @param attr the name of the attribute
+   * @return the object associated with the attribute or null if none exists.
+   */
+  public Object getAttribute(String attr);
+
+  /**
+   * Remove the named attribute.
+   *
+   * @param attr the name of the attribute to remove
+   * @return the value of the attribute removed or null if the named attribute
+   * did not exist.
+   */
+  public Object removeAttribute(String attr);
+
+  /**
+   * Return a set of all attribute names.
+   *
+   * @return a set of all attribute names
+   */
+  public Set<String> getAttributeNames();
+
+  /**
+   * Set the max inactive interval for replication to other systems
+   *
+   * @param interval the time interval in seconds
+   */
+  public void setMaxInactiveInterval(int interval);
+
+  /**
+   * Retrieve the max inactive interval
+   *
+   * @return the max inactive interval in seconds
+   */
+  public int getMaxIntactiveInterval();
+
+  /**
+   * Set the last accessed time for replication to other systems
+   *
+   * @param time the last accessed time in milliseconds
+   */
+  public void setLastAccessedTime(long time);
+
+  /**
+   * Return the last accessed time in milliseconds
+   *
+   * @return the last accessed time
+   */
+  public long getLastAccessedTime();
+
+  /**
+   * Explicitly flush the attributes to backing store.
+   */
+  public void flush();
+
+  /**
+   * Return the last jvm which 'owned' these attributes
+   *
+   * @return the jvmId
+   */
+  public String getJvmOwnerId();
+
+  /**
+   * Set the jvmId. This is set every time the attributes are flushed to the
+   * cache.
+   *
+   * @param jvmId
+   */
+  public void setJvmOwnerId(String jvmId);
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/util/NamedThreadFactory.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/util/NamedThreadFactory.java b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/util/NamedThreadFactory.java
new file mode 100644
index 0000000..4771f76
--- /dev/null
+++ b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/util/NamedThreadFactory.java
@@ -0,0 +1,59 @@
+/*=========================================================================
+ * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+
+package com.gemstone.gemfire.modules.session.internal.filter.util;
+
+import java.lang.Thread.UncaughtExceptionHandler;
+import java.util.concurrent.ThreadFactory;
+import java.util.concurrent.atomic.AtomicLong;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+/**
+ * Factory to create named threads for easy identification at runtime.
+ */
+public class NamedThreadFactory implements ThreadFactory {
+
+  private static final Logger LOG = Logger.getLogger(
+      NamedThreadFactory.class.getName());
+
+  private final String id;
+
+  private final AtomicLong serial = new AtomicLong();
+
+  /**
+   * Create a new thread factory, using the specified pool ID as a basis for
+   * naming each thread.
+   *
+   * @param poolID pool name/ID
+   */
+  public NamedThreadFactory(final String poolID) {
+    id = poolID;
+  }
+
+  /**
+   * {@inheritDoc}
+   * <p/>
+   * This implementation sets the name of the thread, sets the thread to be a
+   * daemon thread, and adds an uncaught exception handler.
+   */
+  @Override
+  public Thread newThread(Runnable r) {
+    Thread thr = new Thread(r);
+    thr.setDaemon(true);
+    thr.setName(id + " - " + serial.incrementAndGet());
+    thr.setUncaughtExceptionHandler(new UncaughtExceptionHandler() {
+      @Override
+      public void uncaughtException(Thread t, Throwable e) {
+        LOG.log(Level.WARNING,
+            "Uncaught Exception in thread: " + t.getName(), e);
+      }
+    });
+    return thr;
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/util/ThreadLocalSession.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/util/ThreadLocalSession.java b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/util/ThreadLocalSession.java
new file mode 100644
index 0000000..c0bc625
--- /dev/null
+++ b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/util/ThreadLocalSession.java
@@ -0,0 +1,29 @@
+/*=========================================================================
+ * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+package com.gemstone.gemfire.modules.session.internal.filter.util;
+
+import javax.servlet.http.HttpSession;
+
+/**
+ */
+public class ThreadLocalSession {
+  private static ThreadLocal<HttpSession> threadLocal =
+      new ThreadLocal<HttpSession>();
+
+  public static HttpSession get() {
+    return threadLocal.get();
+  }
+
+  public static void set(HttpSession session) {
+    threadLocal.set(session);
+  }
+
+  public static void remove() {
+    threadLocal.remove();
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/util/TypeAwareMap.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/util/TypeAwareMap.java b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/util/TypeAwareMap.java
new file mode 100644
index 0000000..e65245b
--- /dev/null
+++ b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/util/TypeAwareMap.java
@@ -0,0 +1,45 @@
+/*=========================================================================
+ * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package com.gemstone.gemfire.modules.session.internal.filter.util;
+
+import com.gemstone.gemfire.modules.session.internal.common.CacheProperty;
+
+import java.util.HashMap;
+
+/**
+ *
+ */
+public class TypeAwareMap<K extends CacheProperty, Object> extends HashMap {
+
+  private Class<K> keyType;
+
+  public TypeAwareMap(Class<K> keyType) {
+    super();
+    this.keyType = keyType;
+  }
+
+  public Object put(K key, Object value) {
+    if (!key.getClazz().isAssignableFrom(value.getClass())) {
+      if (key.getClazz() == Boolean.class) {
+        return (Object) super.put(key, Boolean.valueOf((String) value));
+      } else if (key.getClazz() == Integer.class) {
+        return (Object) super.put(key, Integer.valueOf((String) value));
+      } else {
+        throw new IllegalArgumentException("Value is not of type " +
+            key.getClazz().getName());
+      }
+    }
+
+    return (Object) super.put(key, value);
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/jmx/SessionStatistics.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/jmx/SessionStatistics.java b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/jmx/SessionStatistics.java
new file mode 100644
index 0000000..0119e06
--- /dev/null
+++ b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/jmx/SessionStatistics.java
@@ -0,0 +1,69 @@
+/*=========================================================================
+ * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+
+package com.gemstone.gemfire.modules.session.internal.jmx;
+
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.concurrent.atomic.AtomicLong;
+
+/**
+ * Class to manage session statistics
+ */
+public class SessionStatistics implements SessionStatisticsMXBean {
+
+  private AtomicInteger activeSessions = new AtomicInteger(0);
+
+  private AtomicInteger totalSessions = new AtomicInteger(0);
+
+  private AtomicLong regionUpdates = new AtomicLong(0);
+
+  @Override
+  public int getActiveSessions() {
+    return activeSessions.get();
+  }
+
+  @Override
+  public int getTotalSessions() {
+    return totalSessions.get();
+  }
+
+  @Override
+  public long getRegionUpdates() {
+    return regionUpdates.get();
+  }
+
+  public void setActiveSessions(int sessions) {
+    activeSessions.set(sessions);
+  }
+
+  public void setTotalSessions(int sessions) {
+    totalSessions.set(sessions);
+  }
+
+  public void incActiveSessions() {
+    activeSessions.incrementAndGet();
+    totalSessions.incrementAndGet();
+  }
+
+  public void decActiveSessions() {
+    activeSessions.decrementAndGet();
+  }
+
+  public void incTotalSessions() {
+    totalSessions.incrementAndGet();
+  }
+
+  public void decTotalSessions() {
+    totalSessions.decrementAndGet();
+  }
+
+  public void incRegionUpdates() {
+    regionUpdates.incrementAndGet();
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/jmx/SessionStatisticsMXBean.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/jmx/SessionStatisticsMXBean.java b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/jmx/SessionStatisticsMXBean.java
new file mode 100644
index 0000000..a468320
--- /dev/null
+++ b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/jmx/SessionStatisticsMXBean.java
@@ -0,0 +1,14 @@
+
+package com.gemstone.gemfire.modules.session.internal.jmx;
+
+/**
+ * MXBean interface to retrieve Session statistics
+ */
+public interface SessionStatisticsMXBean {
+
+  public int getActiveSessions();
+
+  public int getTotalSessions();
+
+  public long getRegionUpdates();
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/extensions/gemfire-modules-session/src/test/resources/log4j.properties
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/test/resources/log4j.properties b/extensions/gemfire-modules-session/src/test/resources/log4j.properties
new file mode 100644
index 0000000..b346714
--- /dev/null
+++ b/extensions/gemfire-modules-session/src/test/resources/log4j.properties
@@ -0,0 +1,12 @@
+# To change this template, choose Tools | Templates
+# and open the template in the editor.
+
+# Set root logger level to DEBUG and its only appender to A1.
+log4j.rootLogger=DEBUG, A1
+
+# A1 is set to be a ConsoleAppender.
+log4j.appender.A1=org.apache.log4j.ConsoleAppender
+
+# A1 uses PatternLayout.
+log4j.appender.A1.layout=org.apache.log4j.PatternLayout
+log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session-external/src/main/java/com/gemstone/gemfire/modules/session/filter/SessionCachingFilter.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-external/src/main/java/com/gemstone/gemfire/modules/session/filter/SessionCachingFilter.java b/modules/gemfire-modules-session-external/src/main/java/com/gemstone/gemfire/modules/session/filter/SessionCachingFilter.java
deleted file mode 100644
index 191eb49..0000000
--- a/modules/gemfire-modules-session-external/src/main/java/com/gemstone/gemfire/modules/session/filter/SessionCachingFilter.java
+++ /dev/null
@@ -1,639 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-package com.gemstone.gemfire.modules.session.filter;
-
-import com.gemstone.gemfire.modules.session.filter.util.ThreadLocalSession;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.servlet.Filter;
-import javax.servlet.FilterChain;
-import javax.servlet.FilterConfig;
-import javax.servlet.ServletException;
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
-import javax.servlet.http.Cookie;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletRequestWrapper;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpServletResponseWrapper;
-import javax.servlet.http.HttpSession;
-import java.io.IOException;
-import java.io.PrintStream;
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.security.Principal;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.atomic.AtomicInteger;
-
-/**
- * Primary class which orchestrates everything. This is the class which gets
- * configured in the web.xml.
- */
-public class SessionCachingFilter implements Filter {
-
-  /**
-   * Logger instance
-   */
-  private static final Logger LOG =
-      LoggerFactory.getLogger(SessionCachingFilter.class.getName());
-
-  /**
-   * The filter configuration object we are associated with.  If this value is
-   * null, this filter instance is not currently configured.
-   */
-  private FilterConfig filterConfig = null;
-
-  /**
-   * Some containers will want to instantiate multiple instances of this filter,
-   * but we only need one SessionManager
-   */
-  private static SessionManager manager = null;
-
-  /**
-   * Can be overridden during testing.
-   */
-  private static AtomicInteger started =
-      new AtomicInteger(
-          Integer.getInteger("gemfire.override.session.manager.count", 1));
-
-  private static int percentInactiveTimeTriggerRebuild =
-      Integer.getInteger("gemfire.session.inactive.trigger.rebuild", 80);
-
-  /**
-   * This latch ensures that at least one thread/instance has fired up the
-   * session manager before any other threads complete the init method.
-   */
-  private static CountDownLatch startingLatch = new CountDownLatch(1);
-
-  /**
-   * This request wrapper class extends the support class
-   * HttpServletRequestWrapper, which implements all the methods in the
-   * HttpServletRequest interface, as delegations to the wrapped request. You
-   * only need to override the methods that you need to change. You can get
-   * access to the wrapped request using the method getRequest()
-   */
-  public static class RequestWrapper extends HttpServletRequestWrapper {
-
-    private static final String URL_SESSION_IDENTIFIER = ";jsessionid=";
-
-    private ResponseWrapper response;
-
-    private boolean sessionFromCookie = false;
-
-    private boolean sessionFromURL = false;
-
-    private String requestedSessionId = null;
-
-    private GemfireHttpSession session = null;
-
-    private SessionManager manager;
-
-    private HttpServletRequest outerRequest = null;
-
-    /**
-     * Need to save this in case we need the original {@code RequestDispatcher}
-     */
-    private HttpServletRequest originalRequest;
-
-    public RequestWrapper(SessionManager manager,
-        HttpServletRequest request,
-        ResponseWrapper response) {
-
-      super(request);
-      this.response = response;
-      this.manager = manager;
-      this.originalRequest = request;
-
-      final Cookie[] cookies = request.getCookies();
-      if (cookies != null) {
-        for (final Cookie cookie : cookies) {
-          if (cookie.getName().equalsIgnoreCase(
-              manager.getSessionCookieName()) &&
-              cookie.getValue().endsWith("-GF")) {
-            requestedSessionId = cookie.getValue();
-            sessionFromCookie = true;
-
-            LOG.debug("Cookie contains sessionId: {}",
-                requestedSessionId);
-          }
-        }
-      }
-
-      if (requestedSessionId == null) {
-        requestedSessionId = extractSessionId();
-        LOG.debug("Extracted sessionId from URL {}", requestedSessionId);
-        if (requestedSessionId != null) {
-          sessionFromURL = true;
-        }
-      }
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public HttpSession getSession() {
-      return getSession(true);
-    }
-
-    /**
-     * Create our own sessions. TODO: Handle invalidated sessions
-     *
-     * @return a HttpSession
-     */
-    @Override
-    public HttpSession getSession(boolean create) {
-      if (session != null && session.isValid()) {
-        session.setIsNew(false);
-        session.updateAccessTime();
-                /*
-                 * This is a massively gross hack. Currently, there is no way
-                 * to actually update the last accessed time for a session, so
-                 * what we do here is once we're into X% of the session's TTL
-                 * we grab a new session from the container.
-                 *
-                 * (inactive * 1000) * (pct / 100) ==> (inactive * 10 * pct)
-                 */
-        if (session.getLastAccessedTime() - session.getCreationTime() >
-            (session.getMaxInactiveInterval() * 10 * percentInactiveTimeTriggerRebuild)) {
-          HttpSession nativeSession = super.getSession();
-          session.failoverSession(nativeSession);
-        }
-        return session;
-      }
-
-      if (requestedSessionId != null) {
-        session = (GemfireHttpSession) manager.getSession(
-            requestedSessionId);
-        if (session != null) {
-          session.setIsNew(false);
-          // This means we've failed over to another node
-          if (session.getNativeSession() == null) {
-            try {
-              ThreadLocalSession.set(session);
-              HttpSession nativeSession = super.getSession();
-              session.failoverSession(nativeSession);
-              session.putInRegion();
-            } finally {
-              ThreadLocalSession.remove();
-            }
-          }
-        }
-      }
-
-      if (session == null || !session.isValid()) {
-        if (create) {
-          try {
-            session = (GemfireHttpSession) manager.wrapSession(null);
-            ThreadLocalSession.set(session);
-            HttpSession nativeSession = super.getSession();
-            if (session.getNativeSession() == null) {
-              session.setNativeSession(nativeSession);
-            } else {
-              assert (session.getNativeSession() == nativeSession);
-            }
-            session.setIsNew(true);
-            manager.putSession(session);
-          } finally {
-            ThreadLocalSession.remove();
-          }
-        } else {
-          // create is false, and session is either null or not valid.
-          // The spec says return a null:
-          return null;
-        }
-      }
-
-      if (session != null) {
-        addSessionCookie(response);
-        session.updateAccessTime();
-      }
-
-      return session;
-    }
-
-    private void addSessionCookie(HttpServletResponse response) {
-      // Don't bother if the response is already committed
-      if (response.isCommitted()) {
-        return;
-      }
-
-      // Get the existing cookies
-      Cookie[] cookies = getCookies();
-
-      Cookie cookie = new Cookie(manager.getSessionCookieName(),
-          session.getId());
-      cookie.setPath("".equals(getContextPath()) ? "/" : getContextPath());
-      // Clear out all old cookies and just set ours
-      response.addCookie(cookie);
-
-      // Replace all other cookies which aren't JSESSIONIDs
-      if (cookies != null) {
-        for (Cookie c : cookies) {
-          if (manager.getSessionCookieName().equals(c.getName())) {
-            continue;
-          }
-          response.addCookie(c);
-        }
-      }
-
-    }
-
-    private String getCookieString(Cookie c) {
-      StringBuilder cookie = new StringBuilder();
-      cookie.append(c.getName()).append("=").append(c.getValue());
-
-      if (c.getPath() != null) {
-        cookie.append("; ").append("Path=").append(c.getPath());
-      }
-      if (c.getDomain() != null) {
-        cookie.append("; ").append("Domain=").append(c.getDomain());
-      }
-      if (c.getSecure()) {
-        cookie.append("; ").append("Secure");
-      }
-
-      cookie.append("; HttpOnly");
-
-      return cookie.toString();
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public boolean isRequestedSessionIdFromCookie() {
-      return sessionFromCookie;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public boolean isRequestedSessionIdFromURL() {
-      return sessionFromURL;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public String getRequestedSessionId() {
-      if (requestedSessionId != null) {
-        return requestedSessionId;
-      } else {
-        return super.getRequestedSessionId();
-      }
-    }
-
-        /*
-         * Hmmm... not sure if this is right or even good to do. So, in some
-         * cases - for ex. using a Spring security filter, we have 3 possible
-         * wrappers to deal with - the original, this one and one created by
-         * Spring. When a servlet or JSP is forwarded to the original request
-         * is passed in, but then this (the wrapped) request is used by the JSP.
-         * In some cases, the outer wrapper also contains information relevant
-         * to the request - in this case security info. So here we allow access
-         * to that. There's probably a better way....
-         */
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public Principal getUserPrincipal() {
-      if (outerRequest != null) {
-        return outerRequest.getUserPrincipal();
-      } else {
-        return super.getUserPrincipal();
-      }
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public String getRemoteUser() {
-      if (outerRequest != null) {
-        return outerRequest.getRemoteUser();
-      } else {
-        return super.getRemoteUser();
-      }
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public boolean isUserInRole(String role) {
-      if (outerRequest != null) {
-        return outerRequest.isUserInRole(role);
-      } else {
-        return super.isUserInRole(role);
-      }
-    }
-
-    //////////////////////////////////////////////////////////////
-    // Non-API methods
-
-    void setOuterWrapper(HttpServletRequest outer) {
-      this.outerRequest = outer;
-    }
-
-    //////////////////////////////////////////////////////////////
-    // Private methods
-    private String extractSessionId() {
-      final int prefix = getRequestURL().indexOf(URL_SESSION_IDENTIFIER);
-      if (prefix != -1) {
-        final int start = prefix + URL_SESSION_IDENTIFIER.length();
-        int suffix = getRequestURL().indexOf("?", start);
-        if (suffix < 0) {
-          suffix = getRequestURL().indexOf("#", start);
-        }
-        if (suffix <= prefix) {
-          return getRequestURL().substring(start);
-        }
-        return getRequestURL().substring(start, suffix);
-      }
-      return null;
-    }
-  }
-
-  /**
-   * This response wrapper class extends the support class
-   * HttpServletResponseWrapper, which implements all the methods in the
-   * HttpServletResponse interface, as delegations to the wrapped response. You
-   * only need to override the methods that you need to change. You can get
-   * access to the wrapped response using the method getResponse()
-   */
-  class ResponseWrapper extends HttpServletResponseWrapper {
-
-    HttpServletResponse originalResponse;
-
-    public ResponseWrapper(HttpServletResponse response) throws IOException {
-      super(response);
-      originalResponse = response;
-    }
-
-    public HttpServletResponse getOriginalResponse() {
-      return originalResponse;
-    }
-
-    @Override
-    public void setHeader(String name, String value) {
-      super.setHeader(name, value);
-    }
-
-    @Override
-    public void setIntHeader(String name, int value) {
-      super.setIntHeader(name, value);
-    }
-  }
-
-
-  public SessionCachingFilter() {
-  }
-
-  /**
-   * @param request  The servlet request we are processing
-   * @param response The servlet response we are creating
-   * @param chain    The filter chain we are processing
-   * @throws IOException      if an input/output error occurs
-   * @throws ServletException if a servlet error occurs
-   */
-  @Override
-  public void doFilter(ServletRequest request, ServletResponse response,
-      FilterChain chain)
-      throws IOException, ServletException {
-
-    HttpServletRequest httpReq = (HttpServletRequest) request;
-    HttpServletResponse httpResp = (HttpServletResponse) response;
-
-    /**
-     * Early out if this isn't the right kind of request. We might see a
-     * RequestWrapper instance during a forward or include request.
-     */
-    if (request instanceof RequestWrapper ||
-        !(request instanceof HttpServletRequest)) {
-      LOG.debug("Handling already-wrapped request");
-      chain.doFilter(request, response);
-      return;
-    }
-
-    // Create wrappers for the request and response objects.
-    // Using these, you can extend the capabilities of the
-    // request and response, for example, allow setting parameters
-    // on the request before sending the request to the rest of the filter chain,
-    // or keep track of the cookies that are set on the response.
-    //
-    // Caveat: some servers do not handle wrappers very well for forward or
-    // include requests.
-
-    ResponseWrapper wrappedResponse = new ResponseWrapper(httpResp);
-    final RequestWrapper wrappedRequest =
-        new RequestWrapper(manager, httpReq, wrappedResponse);
-
-    Throwable problem = null;
-
-    try {
-      chain.doFilter(wrappedRequest, wrappedResponse);
-    } catch (Throwable t) {
-      // If an exception is thrown somewhere down the filter chain,
-      // we still want to execute our after processing, and then
-      // rethrow the problem after that.
-      problem = t;
-      LOG.error("Exception processing filter chain", t);
-    }
-
-    GemfireHttpSession session =
-        (GemfireHttpSession) wrappedRequest.getSession(false);
-
-    // If there was a problem, we want to rethrow it if it is
-    // a known type, otherwise log it.
-    if (problem != null) {
-      if (problem instanceof ServletException) {
-        throw (ServletException) problem;
-      }
-      if (problem instanceof IOException) {
-        throw (IOException) problem;
-      }
-      sendProcessingError(problem, response);
-    }
-
-    /**
-     * Commit any updates. What actually happens at that point is
-     * dependent on the type of attributes defined for use by the sessions.
-     */
-    if (session != null) {
-      session.commit();
-    }
-  }
-
-  /**
-   * Return the filter configuration object for this filter.
-   */
-  public FilterConfig getFilterConfig() {
-    return (this.filterConfig);
-  }
-
-  /**
-   * Set the filter configuration object for this filter.
-   *
-   * @param filterConfig The filter configuration object
-   */
-  public void setFilterConfig(FilterConfig filterConfig) {
-    this.filterConfig = filterConfig;
-  }
-
-  /**
-   * Destroy method for this filter
-   */
-  @Override
-  public void destroy() {
-    if (manager != null) {
-      manager.stop();
-    }
-  }
-
-  /**
-   * This is where all the initialization happens.
-   *
-   * @param config
-   * @throws ServletException
-   */
-  @Override
-  public void init(final FilterConfig config) {
-    LOG.info("Starting Session Filter initialization");
-    this.filterConfig = config;
-
-    if (started.getAndDecrement() > 0) {
-      /**
-       * Allow override for testing purposes
-       */
-      String managerClassStr =
-          config.getInitParameter("session-manager-class");
-
-      // Otherwise default
-      if (managerClassStr == null) {
-        managerClassStr = GemfireSessionManager.class.getName();
-      }
-
-      try {
-        manager = (SessionManager) Class.forName(
-            managerClassStr).newInstance();
-        manager.start(config, this.getClass().getClassLoader());
-      } catch (Exception ex) {
-        LOG.error("Exception creating Session Manager", ex);
-      }
-
-      startingLatch.countDown();
-    } else {
-      try {
-        startingLatch.await();
-      } catch (InterruptedException iex) {
-      }
-
-      LOG.debug("SessionManager and listener initialization skipped - "
-          + "already done.");
-    }
-
-    LOG.info("Session Filter initialization complete");
-    LOG.debug("Filter class loader {}", this.getClass().getClassLoader());
-  }
-
-  /**
-   * Return a String representation of this object.
-   */
-  @Override
-  public String toString() {
-    if (filterConfig == null) {
-      return ("SessionCachingFilter()");
-    }
-    StringBuilder sb = new StringBuilder("SessionCachingFilter(");
-    sb.append(filterConfig);
-    sb.append(")");
-    return (sb.toString());
-
-  }
-
-
-  private void sendProcessingError(Throwable t, ServletResponse response) {
-    String stackTrace = getStackTrace(t);
-
-    if (stackTrace != null && !stackTrace.equals("")) {
-      try {
-        response.setContentType("text/html");
-        PrintStream ps = new PrintStream(response.getOutputStream());
-        PrintWriter pw = new PrintWriter(ps);
-        pw.print(
-            "<html>\n<head>\n<title>Error</title>\n</head>\n<body>\n"); //NOI18N
-
-        // PENDING! Localize this for next official release
-        pw.print("<h1>The resource did not process correctly</h1>\n<pre>\n");
-        pw.print(stackTrace);
-        pw.print("</pre></body>\n</html>"); //NOI18N
-        pw.close();
-        ps.close();
-        response.getOutputStream().close();
-      } catch (Exception ex) {
-      }
-    } else {
-      try {
-        PrintStream ps = new PrintStream(response.getOutputStream());
-        t.printStackTrace(ps);
-        ps.close();
-        response.getOutputStream().close();
-      } catch (Exception ex) {
-      }
-    }
-  }
-
-  public static String getStackTrace(Throwable t) {
-    String stackTrace = null;
-    try {
-      StringWriter sw = new StringWriter();
-      PrintWriter pw = new PrintWriter(sw);
-      t.printStackTrace(pw);
-      pw.close();
-      sw.close();
-      stackTrace = sw.getBuffer().toString();
-    } catch (Exception ex) {
-    }
-    return stackTrace;
-  }
-
-  /**
-   * Retrieve the SessionManager. This is only here so that tests can get access
-   * to the cache.
-   */
-  static SessionManager getSessionManager() {
-    return manager;
-  }
-
-  /**
-   * Return the GemFire session which wraps a native session
-   *
-   * @param nativeSession the native session for which the corresponding GemFire
-   *                      session should be returned.
-   * @return the GemFire session or null if no session maps to the native
-   * session
-   */
-  public static HttpSession getWrappingSession(HttpSession nativeSession) {
-        /*
-         * This is a special case where the GemFire session has been set as a
-         * ThreadLocal during session creation.
-         */
-    GemfireHttpSession gemfireSession = (GemfireHttpSession) ThreadLocalSession.get();
-    if (gemfireSession != null) {
-      gemfireSession.setNativeSession(nativeSession);
-      return gemfireSession;
-    }
-    return getSessionManager().getWrappingSession(nativeSession.getId());
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session-external/src/main/java/com/gemstone/gemfire/modules/session/filter/SessionListener.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-external/src/main/java/com/gemstone/gemfire/modules/session/filter/SessionListener.java b/modules/gemfire-modules-session-external/src/main/java/com/gemstone/gemfire/modules/session/filter/SessionListener.java
deleted file mode 100644
index 9726be0..0000000
--- a/modules/gemfire-modules-session-external/src/main/java/com/gemstone/gemfire/modules/session/filter/SessionListener.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-package com.gemstone.gemfire.modules.session.filter;
-
-import com.gemstone.gemfire.distributed.DistributedSystemDisconnectedException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.servlet.http.HttpSessionEvent;
-import javax.servlet.http.HttpSessionListener;
-
-public class SessionListener implements HttpSessionListener {
-
-  private static final Logger LOG =
-      LoggerFactory.getLogger(SessionListener.class.getName());
-
-  public void sessionCreated(HttpSessionEvent httpSessionEvent) {
-  }
-
-  /**
-   * This will receive events from the container using the native sessions.
-   */
-  public void sessionDestroyed(HttpSessionEvent event) {
-    String nativeId = event.getSession().getId();
-    try {
-      String sessionId = SessionCachingFilter.getSessionManager().destroyNativeSession(
-          nativeId);
-      LOG.debug(
-          "Received sessionDestroyed event for native session {} (wrapped by {})",
-          nativeId, sessionId);
-    } catch (DistributedSystemDisconnectedException dex) {
-      LOG.debug("Cache disconnected - unable to destroy native session {0}",
-          nativeId);
-    }
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session-external/src/main/java/com/gemstone/gemfire/modules/session/installer/Installer.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-external/src/main/java/com/gemstone/gemfire/modules/session/installer/Installer.java b/modules/gemfire-modules-session-external/src/main/java/com/gemstone/gemfire/modules/session/installer/Installer.java
index ee773d2..57bdde6 100644
--- a/modules/gemfire-modules-session-external/src/main/java/com/gemstone/gemfire/modules/session/installer/Installer.java
+++ b/modules/gemfire-modules-session-external/src/main/java/com/gemstone/gemfire/modules/session/installer/Installer.java
@@ -36,10 +36,10 @@ import java.io.OutputStream;
 public class Installer {
 
   private static final String GEMFIRE_FILTER_CLASS =
-      "com.gemstone.gemfire.modules.session.filter.SessionCachingFilter";
+      "com.gemstone.gemfire.modules.session.filter.internal.SessionCachingFilter";
 
   private static final String GEMFIRE_LISTENER_CLASS =
-      "com.gemstone.gemfire.modules.session.filter.SessionListener";
+      "com.gemstone.gemfire.modules.session.filter.internal.SessionListener";
 
   private ArgumentValues argValues;
 


[08/24] incubator-geode git commit: GEODE-14: Move GemFire Sessions module and relocate all packages to 'internal'

Posted by je...@apache.org.
GEODE-14: Move GemFire Sessions module and relocate all packages to 'internal'


Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/92ee6a79
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/92ee6a79
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/92ee6a79

Branch: refs/heads/feature/GEODE-14
Commit: 92ee6a7917e2fc37586984ec295a7198d4eb088d
Parents: ed3be77
Author: Jens Deppe <jd...@pivotal.io>
Authored: Mon Dec 28 07:46:37 2015 -0800
Committer: Jens Deppe <jd...@pivotal.io>
Committed: Mon Dec 28 07:46:37 2015 -0800

----------------------------------------------------------------------
 extensions/gemfire-modules-session/build.gradle |    4 +
 extensions/gemfire-modules-session/pom.xml      |   46 +
 .../release/bin/cacheserver.bat                 |   33 +
 .../release/bin/cacheserver.sh                  |   33 +
 .../release/bin/gemfire.bat                     |   23 +
 .../release/bin/gemfire.sh                      |   41 +
 .../release/bin/setenv.properties               |    6 +
 .../release/conf/cache-client.xml               |   25 +
 .../release/conf/cache-peer.xml                 |   33 +
 .../release/conf/cache-server.xml               |   59 +
 .../internal/common/AbstractSessionCache.java   |   92 ++
 .../session/internal/common/CacheProperty.java  |   56 +
 .../common/ClientServerSessionCache.java        |  176 ++
 .../internal/common/PeerToPeerSessionCache.java |  174 ++
 .../session/internal/common/SessionCache.java   |   59 +
 .../common/SessionExpirationCacheListener.java  |   43 +
 .../session/internal/filter/Constants.java      |   14 +
 .../session/internal/filter/ContextManager.java |   95 ++
 .../internal/filter/DummySessionManager.java    |  127 ++
 .../internal/filter/GemfireHttpSession.java     |  517 ++++++
 .../filter/GemfireSessionException.java         |   36 +
 .../internal/filter/GemfireSessionManager.java  |  502 ++++++
 .../internal/filter/ListenerEventType.java      |   70 +
 .../session/internal/filter/SessionManager.java |  101 ++
 .../AbstractDeltaSessionAttributes.java         |   97 ++
 .../attributes/AbstractSessionAttributes.java   |  179 ++
 .../internal/filter/attributes/DeltaEvent.java  |  109 ++
 .../DeltaQueuedSessionAttributes.java           |   84 +
 .../attributes/DeltaSessionAttributes.java      |   65 +
 .../attributes/ImmediateSessionAttributes.java  |   58 +
 .../attributes/QueuedSessionAttributes.java     |   55 +
 .../filter/attributes/SessionAttributes.java    |  111 ++
 .../filter/util/NamedThreadFactory.java         |   59 +
 .../filter/util/ThreadLocalSession.java         |   29 +
 .../internal/filter/util/TypeAwareMap.java      |   45 +
 .../session/internal/jmx/SessionStatistics.java |   69 +
 .../internal/jmx/SessionStatisticsMXBean.java   |   14 +
 .../src/test/resources/log4j.properties         |   12 +
 .../session/filter/SessionCachingFilter.java    |  639 -------
 .../modules/session/filter/SessionListener.java |   41 -
 .../modules/session/installer/Installer.java    |    4 +-
 .../internal/filter/SessionCachingFilter.java   |  639 +++++++
 .../internal/filter/SessionListener.java        |   41 +
 .../session/filter/AbstractListener.java        |   52 -
 .../modules/session/filter/Callback.java        |   17 -
 .../modules/session/filter/CallbackServlet.java |   88 -
 .../modules/session/filter/CommonTests.java     |  583 -------
 .../session/filter/GemfireCacheTest.java        |   46 -
 .../session/filter/GemfireLocalCacheTest.java   |   67 -
 .../HttpSessionAttributeListenerImpl.java       |   37 -
 .../filter/HttpSessionBindingListenerImpl.java  |   40 -
 .../session/filter/HttpSessionListenerImpl.java |   35 -
 .../session/filter/RendezvousManager.java       |   37 -
 .../ServletRequestAttributeListenerImpl.java    |   42 -
 .../filter/ServletRequestListenerImpl.java      |   36 -
 .../session/filter/SessionTestSuite1.java       |   69 -
 .../session/filter/SessionTestSuite2.java       |   68 -
 .../session/filter/SessionUberSuite.java        |   40 -
 .../internal/filter/AbstractListener.java       |   52 +
 .../session/internal/filter/Callback.java       |   17 +
 .../internal/filter/CallbackServlet.java        |   88 +
 .../session/internal/filter/CommonTests.java    |  582 +++++++
 .../internal/filter/GemfireCacheTest.java       |   46 +
 .../internal/filter/GemfireLocalCacheTest.java  |   62 +
 .../HttpSessionAttributeListenerImpl.java       |   37 +
 .../filter/HttpSessionBindingListenerImpl.java  |   40 +
 .../filter/HttpSessionListenerImpl.java         |   33 +
 .../internal/filter/RendezvousManager.java      |   37 +
 .../ServletRequestAttributeListenerImpl.java    |   40 +
 .../filter/ServletRequestListenerImpl.java      |   34 +
 .../internal/filter/SessionTestSuite1.java      |   69 +
 .../internal/filter/SessionTestSuite2.java      |   68 +
 .../internal/filter/SessionUberSuite.java       |   30 +
 .../session/filter/AbstractListener.java        |   50 -
 .../modules/session/filter/BasicServlet.java    |   46 -
 .../modules/session/filter/Callback.java        |   26 -
 .../session/filter/HttpSessionListenerImpl.java |   39 -
 .../filter/HttpSessionListenerImpl2.java        |   39 -
 .../modules/session/filter/IntegrationTest.java | 1552 ------------------
 .../modules/session/filter/MyServletTester.java |   33 -
 .../filter/ServletContextListenerImpl.java      |   48 -
 .../internal/filter/AbstractListener.java       |   50 +
 .../session/internal/filter/BasicServlet.java   |   46 +
 .../session/internal/filter/Callback.java       |   26 +
 .../filter/HttpSessionListenerImpl.java         |   39 +
 .../filter/HttpSessionListenerImpl2.java        |   39 +
 .../internal/filter/IntegrationTest.java        | 1552 ++++++++++++++++++
 .../internal/filter/MyServletTester.java        |   33 +
 .../filter/ServletContextListenerImpl.java      |   46 +
 modules/gemfire-modules-session/build.gradle    |    3 -
 modules/gemfire-modules-session/pom.xml         |   46 -
 modules/gemfire-modules-session/profiles.xml    |   18 -
 .../release/bin/cacheserver.bat                 |   33 -
 .../release/bin/cacheserver.sh                  |   33 -
 .../release/bin/gemfire.bat                     |   23 -
 .../release/bin/gemfire.sh                      |   41 -
 .../release/bin/setenv.properties               |    6 -
 .../release/conf/cache-client.xml               |   25 -
 .../release/conf/cache-peer.xml                 |   33 -
 .../release/conf/cache-server.xml               |   59 -
 .../session/common/AbstractSessionCache.java    |   92 --
 .../modules/session/common/CacheProperty.java   |   56 -
 .../common/ClientServerSessionCache.java        |  176 --
 .../session/common/PeerToPeerSessionCache.java  |  174 --
 .../modules/session/common/SessionCache.java    |   59 -
 .../common/SessionExpirationCacheListener.java  |   43 -
 .../modules/session/filter/Constants.java       |   14 -
 .../modules/session/filter/ContextManager.java  |   95 --
 .../session/filter/DummySessionManager.java     |  128 --
 .../session/filter/GemfireHttpSession.java      |  517 ------
 .../session/filter/GemfireSessionException.java |   36 -
 .../session/filter/GemfireSessionManager.java   |  503 ------
 .../session/filter/ListenerEventType.java       |   70 -
 .../modules/session/filter/SessionManager.java  |  101 --
 .../AbstractDeltaSessionAttributes.java         |   97 --
 .../attributes/AbstractSessionAttributes.java   |  179 --
 .../session/filter/attributes/DeltaEvent.java   |  109 --
 .../DeltaQueuedSessionAttributes.java           |   84 -
 .../attributes/DeltaSessionAttributes.java      |   65 -
 .../attributes/ImmediateSessionAttributes.java  |   63 -
 .../attributes/QueuedSessionAttributes.java     |   60 -
 .../filter/attributes/SessionAttributes.java    |  111 --
 .../session/filter/util/NamedThreadFactory.java |   59 -
 .../session/filter/util/ThreadLocalSession.java |   29 -
 .../session/filter/util/TypeAwareMap.java       |   45 -
 .../modules/session/jmx/SessionStatistics.java  |   69 -
 .../session/jmx/SessionStatisticsMXBean.java    |   14 -
 .../src/test/resources/log4j.properties         |   12 -
 settings.gradle                                 |    1 +
 129 files changed, 7100 insertions(+), 7152 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/extensions/gemfire-modules-session/build.gradle
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/build.gradle b/extensions/gemfire-modules-session/build.gradle
new file mode 100644
index 0000000..156f204
--- /dev/null
+++ b/extensions/gemfire-modules-session/build.gradle
@@ -0,0 +1,4 @@
+dependencies {
+  compile project(':extensions/gemfire-modules')
+  compile project(':gemfire-core')
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/extensions/gemfire-modules-session/pom.xml
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/pom.xml b/extensions/gemfire-modules-session/pom.xml
new file mode 100644
index 0000000..b274ab3
--- /dev/null
+++ b/extensions/gemfire-modules-session/pom.xml
@@ -0,0 +1,46 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>com.gemstone</groupId>
+  <artifactId>gemfire-modules-session</artifactId>
+  <packaging>jar</packaging>
+  <version>${gemfire.modules.version}</version>
+  <url>http://maven.apache.org</url>
+  <name>gemfire-modules-session</name>
+
+  <parent>
+    <groupId>com.gemstone</groupId>
+    <artifactId>gemfire-modules-parent</artifactId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+
+  <dependencies>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+    </dependency>
+
+    <dependency>
+      <groupId>javax.servlet</groupId>
+      <artifactId>servlet-api</artifactId>
+    </dependency>
+
+    <dependency>
+      <groupId>com.gemstone</groupId>
+      <artifactId>gemfire-modules</artifactId>
+    </dependency>
+
+    <dependency>
+      <groupId>com.gemstone.gemfire</groupId>
+      <artifactId>gemfire</artifactId>
+    </dependency>
+
+    <!--<dependency>-->
+      <!--<groupId>org.slf4j</groupId>-->
+      <!--<artifactId>slf4j-log4j12</artifactId>-->
+      <!--<scope>compile</scope>-->
+    <!--</dependency>-->
+
+  </dependencies>
+</project>

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/extensions/gemfire-modules-session/release/bin/cacheserver.bat
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/release/bin/cacheserver.bat b/extensions/gemfire-modules-session/release/bin/cacheserver.bat
new file mode 100755
index 0000000..2632dc7
--- /dev/null
+++ b/extensions/gemfire-modules-session/release/bin/cacheserver.bat
@@ -0,0 +1,33 @@
+@setlocal enableextensions
+@set scriptdir=%~dp0
+@set gf=%scriptdir:\bin\=%
+@if exist "%gf%\lib\gemfire.jar" @goto gfok
+@echo Could not determine GEMFIRE location
+@verify other 2>nul
+@goto done
+:gfok
+
+@REM Initialize classpath
+
+@REM Add GemFire classes
+@set GEMFIRE_JARS=%gf%/lib/gemfire.jar;%gf%/lib/antlr.jar;%gf%/lib/mail.jar
+
+@REM Add Tomcat classes
+@set GEMFIRE_JARS=%GEMFIRE_JARS%;%gf%/lib/servlet-api.jar;%gf%/lib/catalina.jar;%gf%/lib/${artifact.artifactId}-${artifact.version}.jar;%gf%/bin/tomcat-juli.jar
+
+@REM Add conf directory
+@set GEMFIRE_JARS=%GEMFIRE_JARS%;%gf%/conf
+
+@if defined CLASSPATH set GEMFIRE_JARS=%GEMFIRE_JARS%;%CLASSPATH%
+
+@if not defined GF_JAVA (
+@REM %GF_JAVA% is not defined, assume it is on the PATH
+@set GF_JAVA=java
+)
+
+@"%GF_JAVA%" %JAVA_ARGS% -classpath "%GEMFIRE_JARS%" com.gemstone.gemfire.internal.cache.CacheServerLauncher %*
+:done
+@set scriptdir=
+@set gf=
+@set GEMFIRE_JARS=
+

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/extensions/gemfire-modules-session/release/bin/cacheserver.sh
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/release/bin/cacheserver.sh b/extensions/gemfire-modules-session/release/bin/cacheserver.sh
new file mode 100755
index 0000000..e395001
--- /dev/null
+++ b/extensions/gemfire-modules-session/release/bin/cacheserver.sh
@@ -0,0 +1,33 @@
+#!/bin/bash
+# Set GEMFIRE to the product toplevel directory
+GEMFIRE=`dirname $0`
+OLDPWD=$PWD
+cd $GEMFIRE
+GEMFIRE=`dirname $PWD`
+cd $OLDPWD
+
+if [ "x$WINDIR" != "x" ]; then
+  echo "ERROR: The variable WINDIR is set indicating this script is running in a Windows OS, please use the .bat file version instead."
+  exit 1
+fi
+
+GEMFIRE_JARS=$GEMFIRE/lib/gemfire-[0-9]*.jar
+if [ ! -f ${GEMFIRE_JARS} ]; then
+  echo "ERROR: Could not determine GEMFIRE location."
+  exit 1
+fi
+
+# Initialize classpath
+GEMFIRE_JARS=$GEMFIRE_JARS:$GEMFIRE/lib/gemfire-modules-[0-9]*
+GEMFIRE_JARS=$GEMFIRE_JARS:$GEMFIRE/lib/servlet-api-[0-9]*
+GEMFIRE_JARS=$GEMFIRE_JARS:$GEMFIRE/lib/slf4j-api-[0-9]*
+GEMFIRE_JARS=$GEMFIRE_JARS:$GEMFIRE/lib/slf4j-jdk14-[0-9]*
+
+# Add configuration
+GEMFIRE_JARS=$GEMFIRE_JARS:$GEMFIRE/conf
+
+if [ "x$CLASSPATH" != "x" ]; then
+  GEMFIRE_JARS=$GEMFIRE_JARS:$CLASSPATH
+fi
+
+${GF_JAVA:-java} ${JAVA_ARGS} -classpath ${GEMFIRE_JARS} com.gemstone.gemfire.internal.cache.CacheServerLauncher "$@"

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/extensions/gemfire-modules-session/release/bin/gemfire.bat
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/release/bin/gemfire.bat b/extensions/gemfire-modules-session/release/bin/gemfire.bat
new file mode 100755
index 0000000..96d2564
--- /dev/null
+++ b/extensions/gemfire-modules-session/release/bin/gemfire.bat
@@ -0,0 +1,23 @@
+@setlocal enableextensions
+@set scriptdir=%~dp0
+@set gf=%scriptdir:\bin\=%
+@if exist "%gf%\lib\gemfire.jar" @goto gfok
+@echo Could not determine GEMFIRE location
+@verify other 2>nul
+@goto done
+:gfok
+
+@set GEMFIRE_JARS=%gf%/lib/gemfire.jar;%gf%/lib/antlr.jar;%gf%/lib/mail.jar
+@if defined CLASSPATH set GEMFIRE_JARS=%GEMFIRE_JARS%;%CLASSPATH%
+
+@if not defined GF_JAVA (
+@REM %GF_JAVA% is not defined, assume it is on the PATH
+@set GF_JAVA=java
+)
+
+@"%GF_JAVA%" %JAVA_ARGS% -classpath "%GEMFIRE_JARS%" com.gemstone.gemfire.internal.SystemAdmin %*
+:done
+@set scriptdir=
+@set gf=
+@set GEMFIRE_JARS=
+

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/extensions/gemfire-modules-session/release/bin/gemfire.sh
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/release/bin/gemfire.sh b/extensions/gemfire-modules-session/release/bin/gemfire.sh
new file mode 100755
index 0000000..fa5f4cd
--- /dev/null
+++ b/extensions/gemfire-modules-session/release/bin/gemfire.sh
@@ -0,0 +1,41 @@
+#!/bin/bash
+# Set GEMFIRE to the product toplevel directory
+GEMFIRE=`dirname $0`
+OLDPWD=$PWD
+cd $GEMFIRE
+GEMFIRE=`dirname $PWD`
+cd $OLDPWD
+
+if [ "x$WINDIR" != "x" ]; then
+  echo "ERROR: The variable WINDIR is set indicating this script is running in a Windows OS, please use the .bat file version instead."
+  exit 1
+fi
+
+if [ ! -f $GEMFIRE/lib/gemfire.jar ]; then
+  echo "ERROR: Could not determine GEMFIRE location."
+  exit 1
+fi
+
+GEMFIRE_JARS=$GEMFIRE/lib/gemfire.jar:$GEMFIRE/lib/antlr.jar
+
+if [ "x$CLASSPATH" != "x" ]; then
+  GEMFIRE_JARS=$GEMFIRE_JARS:$CLASSPATH
+fi
+
+# Command line args that start with -J will be passed to the java vm in JARGS.
+# See java --help for a listing of valid vm args.
+# Example: -J-Xmx1g sets the max heap size to 1 gigabyte.
+
+JARGS=
+GEMFIRE_ARGS=
+for i in "$@"
+do
+  if [ "-J" == "${i:0:2}" ]
+  then
+    JARGS="${JARGS} \"${i#-J}\""
+  else
+    GEMFIRE_ARGS="${GEMFIRE_ARGS} \"${i}\""
+  fi
+done
+
+eval ${GF_JAVA:-java} ${JAVA_ARGS} ${JARGS} -classpath ${GEMFIRE_JARS} com.gemstone.gemfire.internal.SystemAdmin ${GEMFIRE_ARGS}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/extensions/gemfire-modules-session/release/bin/setenv.properties
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/release/bin/setenv.properties b/extensions/gemfire-modules-session/release/bin/setenv.properties
new file mode 100644
index 0000000..fc8918b
--- /dev/null
+++ b/extensions/gemfire-modules-session/release/bin/setenv.properties
@@ -0,0 +1,6 @@
+java.opt.1=-Xms${initial.vm.heap.size.mb:512}M
+java.opt.2=-Xmx${maximum.vm.heap.size.mb:512}M
+java.opt.hotspot.1=-XX:+UseParNewGC
+java.opt.hotspot.2=-XX:+UseConcMarkSweepGC
+java.opt.hotspot.3=-XX:CMSInitiatingOccupancyFraction=${cms.initiating.heap.percentage:50}
+java.opt.j9.1=-Xgcpolicy:gencon
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/extensions/gemfire-modules-session/release/conf/cache-client.xml
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/release/conf/cache-client.xml b/extensions/gemfire-modules-session/release/conf/cache-client.xml
new file mode 100755
index 0000000..c8444b2
--- /dev/null
+++ b/extensions/gemfire-modules-session/release/conf/cache-client.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE client-cache PUBLIC
+  "-//GemStone Systems, Inc.//GemFire Declarative Caching 6.5//EN"
+  "http://www.gemstone.com/dtd/cache6_6.dtd">
+  
+<client-cache>
+
+  <!-- The default pool connects to a cache server running on  localhost at
+       port 40404. To connect to a different server host and port, modify
+       the following pool server host and port. -->
+  <pool name="sessions" subscription-enabled="true">
+    <server host="localhost" port="40404"/>
+  </pool>
+
+  <!-- To configure the client to use a locator instead of a server, replace
+       the server pool above with the locator pool below and modify the locator
+       host and port as necessary. -->
+  <!--
+  <pool name="sessions" subscription-enabled="true">
+    <locator host="localhost" port="10334"/>
+  </pool>
+  -->
+  
+</client-cache>

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/extensions/gemfire-modules-session/release/conf/cache-peer.xml
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/release/conf/cache-peer.xml b/extensions/gemfire-modules-session/release/conf/cache-peer.xml
new file mode 100755
index 0000000..1a49637
--- /dev/null
+++ b/extensions/gemfire-modules-session/release/conf/cache-peer.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE cache PUBLIC
+  "-//GemStone Systems, Inc.//GemFire Declarative Caching 6.5//EN"
+  "http://www.gemstone.com/dtd/cache6_6.dtd">
+  
+<cache>
+
+  <!-- Uncomment the following disk-store element to modify the default disk store directory -->
+  <!--
+  <disk-store name="DEFAULT">
+    <disk-dirs>
+      <disk-dir>/path/to/persistent/data</disk-dir>
+    </disk-dirs>
+  </disk-store>
+  -->
+
+  <!-- This is the definition of the default session region -->
+  <!--
+  <region name="gemfire_modules_sessions">
+    <region-attributes scope="distributed-ack" enable-gateway="false" data-policy="replicate" statistics-enabled="true">
+      <entry-idle-time>
+        <expiration-attributes timeout="0" action="invalidate">
+          <custom-expiry>
+            <class-name>com.gemstone.gemfire.modules.util.SessionCustomExpiry</class-name>
+          </custom-expiry>
+        </expiration-attributes>
+      </entry-idle-time>
+    </region-attributes>
+  </region>
+  -->
+  
+</cache>

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/extensions/gemfire-modules-session/release/conf/cache-server.xml
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/release/conf/cache-server.xml b/extensions/gemfire-modules-session/release/conf/cache-server.xml
new file mode 100755
index 0000000..6ee2223
--- /dev/null
+++ b/extensions/gemfire-modules-session/release/conf/cache-server.xml
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE cache PUBLIC
+  "-//GemStone Systems, Inc.//GemFire Declarative Caching 6.5//EN"
+  "http://www.gemstone.com/dtd/cache6_6.dtd">
+  
+<cache>
+
+  <!-- Uncomment the following gateway-hub element to create a gateway hub -->
+  <!--
+  <gateway-hub id="NY" port="11110">
+    <gateway id="LN">
+      <gateway-endpoint id="LN-1" host="localhost" port="22220"/>
+      <gateway-queue disk-store-name="NY_GATEWAY"/>
+    </gateway>
+  </gateway-hub>
+  -->
+
+  <!-- Uncomment the following cache-server element to modify the listen port -->
+  <!--
+  <cache-server port="44444"/>
+  -->
+
+  <!-- Uncomment the following disk-store element to modify the default disk store directory -->
+  <!--
+  <disk-store name="DEFAULT">
+    <disk-dirs>
+      <disk-dir>/path/to/persistent/data</disk-dir>
+    </disk-dirs>
+  </disk-store>
+  -->
+  
+  <!-- Uncomment the following disk-store element to create the NY_GATEWAY disk store
+       (for the gateway-hub element defined above) -->
+  <!--
+  <disk-store name="NY_GATEWAY">
+    <disk-dirs>
+      <disk-dir>/path/to/persistent/data</disk-dir>
+    </disk-dirs>
+  </disk-store>
+  -->
+  
+  <!-- This is the definition of the default session region -->
+  <!--
+  <region name="gemfire_modules_sessions">
+    <region-attributes enable-gateway="false" data-policy="partition" statistics-enabled="true">
+      <entry-idle-time>
+        <expiration-attributes timeout="0" action="invalidate">
+          <custom-expiry>
+            <class-name>com.gemstone.gemfire.modules.util.SessionCustomExpiry</class-name>
+          </custom-expiry>
+        </expiration-attributes>
+      </entry-idle-time>
+      <partition-attributes redundant-copies="1" total-num-buckets="113"/>
+    </region-attributes>
+  </region>
+  -->
+
+</cache>

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/common/AbstractSessionCache.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/common/AbstractSessionCache.java b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/common/AbstractSessionCache.java
new file mode 100644
index 0000000..bc06465
--- /dev/null
+++ b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/common/AbstractSessionCache.java
@@ -0,0 +1,92 @@
+/*=========================================================================
+ * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+package com.gemstone.gemfire.modules.session.internal.common;
+
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.modules.session.catalina.internal.DeltaSessionStatistics;
+import com.gemstone.gemfire.modules.session.internal.filter.util.TypeAwareMap;
+import com.gemstone.gemfire.modules.util.RegionConfiguration;
+
+import java.util.Map;
+import javax.servlet.http.HttpSession;
+
+public abstract class AbstractSessionCache implements SessionCache {
+
+  /**
+   * The sessionRegion is the <code>Region</code> that actually stores and
+   * replicates the <code>Session</code>s.
+   */
+  protected Region<String, HttpSession> sessionRegion;
+
+  /**
+   * The operatingRegion is the <code>Region</code> used to do HTTP operations.
+   * if local cache is enabled, then this will be the local <code>Region</code>;
+   * otherwise, it will be the session <code>Region</code>.
+   */
+  protected Region<String, HttpSession> operatingRegion;
+
+  protected Map<CacheProperty, Object> properties =
+      new TypeAwareMap<CacheProperty, Object>(CacheProperty.class);
+
+  protected DeltaSessionStatistics statistics;
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  public void stop() {
+    sessionRegion.close();
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  public Region<String, HttpSession> getOperatingRegion() {
+    return this.operatingRegion;
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  public Region<String, HttpSession> getSessionRegion() {
+    return this.sessionRegion;
+  }
+
+  protected void createStatistics() {
+    this.statistics =
+        new DeltaSessionStatistics(getCache().getDistributedSystem(),
+            (String) properties.get(CacheProperty.STATISTICS_NAME));
+  }
+
+  /**
+   * Build up a {@code RegionConfiguraton} object from parameters originally
+   * passed in as filter initialization parameters.
+   *
+   * @return a {@code RegionConfiguration} object
+   */
+  protected RegionConfiguration createRegionConfiguration() {
+    RegionConfiguration configuration = new RegionConfiguration();
+
+    configuration.setRegionName(
+        (String) properties.get(CacheProperty.REGION_NAME));
+    configuration.setRegionAttributesId(
+        (String) properties.get(CacheProperty.REGION_ATTRIBUTES_ID));
+
+    configuration.setEnableGatewayDeltaReplication(
+        (Boolean) properties.get(
+            CacheProperty.ENABLE_GATEWAY_DELTA_REPLICATION));
+    configuration.setEnableGatewayReplication(
+        (Boolean) properties.get(CacheProperty.ENABLE_GATEWAY_REPLICATION));
+    configuration.setEnableDebugListener(
+        (Boolean) properties.get(CacheProperty.ENABLE_DEBUG_LISTENER));
+
+    return configuration;
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/common/CacheProperty.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/common/CacheProperty.java b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/common/CacheProperty.java
new file mode 100644
index 0000000..5abd0b6
--- /dev/null
+++ b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/common/CacheProperty.java
@@ -0,0 +1,56 @@
+/*=========================================================================
+ * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+
+package com.gemstone.gemfire.modules.session.internal.common;
+
+/**
+ * Used to define cache properties
+ */
+public enum CacheProperty {
+
+  ENABLE_DEBUG_LISTENER(Boolean.class),
+
+  ENABLE_GATEWAY_REPLICATION(Boolean.class),
+
+  ENABLE_GATEWAY_DELTA_REPLICATION(Boolean.class),
+
+  ENABLE_LOCAL_CACHE(Boolean.class),
+
+  REGION_NAME(String.class),
+
+  REGION_ATTRIBUTES_ID(String.class),
+
+  STATISTICS_NAME(String.class),
+
+  /**
+   * This parameter can take the following values which match the respective
+   * attribute container classes
+   * <p/>
+   * delta_queued     : QueuedDeltaSessionAttributes delta_immediate  :
+   * DeltaSessionAttributes immediate        : ImmediateSessionAttributes queued
+   * : QueuedSessionAttributes
+   */
+  SESSION_DELTA_POLICY(String.class),
+
+  /**
+   * This parameter can take the following values:
+   * <p/>
+   * set (default) set_and_get
+   */
+  REPLICATION_TRIGGER(String.class);
+
+  Class clazz;
+
+  CacheProperty(Class clazz) {
+    this.clazz = clazz;
+  }
+
+  public Class getClazz() {
+    return clazz;
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/common/ClientServerSessionCache.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/common/ClientServerSessionCache.java b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/common/ClientServerSessionCache.java
new file mode 100644
index 0000000..a21ea2f
--- /dev/null
+++ b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/common/ClientServerSessionCache.java
@@ -0,0 +1,176 @@
+/*=========================================================================
+ * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+package com.gemstone.gemfire.modules.session.internal.common;
+
+import com.gemstone.gemfire.cache.GemFireCache;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionShortcut;
+import com.gemstone.gemfire.cache.client.ClientCache;
+import com.gemstone.gemfire.cache.client.ClientRegionFactory;
+import com.gemstone.gemfire.cache.client.ClientRegionShortcut;
+import com.gemstone.gemfire.cache.execute.Execution;
+import com.gemstone.gemfire.cache.execute.FunctionService;
+import com.gemstone.gemfire.cache.execute.ResultCollector;
+import com.gemstone.gemfire.modules.util.BootstrappingFunction;
+import com.gemstone.gemfire.modules.util.CreateRegionFunction;
+import com.gemstone.gemfire.modules.util.RegionConfiguration;
+import com.gemstone.gemfire.modules.util.RegionStatus;
+
+import java.util.List;
+import java.util.Map;
+import javax.servlet.http.HttpSession;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Class which defines a client/server cache.
+ */
+public class ClientServerSessionCache extends AbstractSessionCache {
+
+  private static final Logger LOG =
+      LoggerFactory.getLogger(PeerToPeerSessionCache.class.getName());
+
+  private ClientCache cache;
+
+  protected static final String DEFAULT_REGION_ATTRIBUTES_ID =
+      RegionShortcut.PARTITION_REDUNDANT.toString();
+
+  protected static final Boolean DEFAULT_ENABLE_LOCAL_CACHE = true;
+
+  /**
+   * Constructor
+   *
+   * @param cache
+   * @param properties
+   */
+  public ClientServerSessionCache(ClientCache cache,
+      Map<CacheProperty, Object> properties) {
+    super();
+    this.cache = cache;
+
+    /**
+     * Set some default properties for this cache if they haven't already
+     * been set
+     */
+    this.properties.put(CacheProperty.REGION_ATTRIBUTES_ID,
+        DEFAULT_REGION_ATTRIBUTES_ID);
+    this.properties.put(CacheProperty.ENABLE_LOCAL_CACHE,
+        DEFAULT_ENABLE_LOCAL_CACHE);
+    this.properties.putAll(properties);
+  }
+
+  @Override
+  public void initialize() {
+    // Bootstrap the servers
+    bootstrapServers();
+
+    // Create or retrieve the region
+    createOrRetrieveRegion();
+
+    // Set the session region directly as the operating region since there is no difference
+    // between the local cache region and the session region.
+    operatingRegion = sessionRegion;
+
+    // Create or retrieve the statistics
+    createStatistics();
+  }
+
+  @Override
+  public GemFireCache getCache() {
+    return cache;
+  }
+
+  @Override
+  public boolean isClientServer() {
+    return true;
+  }
+
+
+  ////////////////////////////////////////////////////////////////////////
+  // Private methods
+
+  private void bootstrapServers() {
+    Execution execution = FunctionService.onServers(this.cache);
+    ResultCollector collector = execution.execute(new BootstrappingFunction());
+    // Get the result. Nothing is being done with it.
+    try {
+      collector.getResult();
+    } catch (Exception e) {
+      // If an exception occurs in the function, log it.
+      LOG.warn("Caught unexpected exception:", e);
+    }
+  }
+
+  private void createOrRetrieveRegion() {
+    // Retrieve the local session region
+    this.sessionRegion =
+        this.cache.getRegion(
+            (String) properties.get(CacheProperty.REGION_NAME));
+
+    // If necessary, create the regions on the server and client
+    if (this.sessionRegion == null) {
+      // Create the PR on the servers
+      createSessionRegionOnServers();
+
+      // Create the region on the client
+      this.sessionRegion = createLocalSessionRegion();
+      LOG.debug("Created session region: " + this.sessionRegion);
+    } else {
+      LOG.debug("Retrieved session region: " + this.sessionRegion);
+    }
+  }
+
+  private void createSessionRegionOnServers() {
+    // Create the RegionConfiguration
+    RegionConfiguration configuration = createRegionConfiguration();
+
+    // Send it to the server tier
+    Execution execution = FunctionService.onServer(this.cache).withArgs(
+        configuration);
+    ResultCollector collector = execution.execute(CreateRegionFunction.ID);
+
+    // Verify the region was successfully created on the servers
+    List<RegionStatus> results = (List<RegionStatus>) collector.getResult();
+    for (RegionStatus status : results) {
+      if (status == RegionStatus.INVALID) {
+        StringBuilder builder = new StringBuilder();
+        builder.append(
+            "An exception occurred on the server while attempting to create or validate region named ");
+        builder.append(properties.get(CacheProperty.REGION_NAME));
+        builder.append(". See the server log for additional details.");
+        throw new IllegalStateException(builder.toString());
+      }
+    }
+  }
+
+  private Region<String, HttpSession> createLocalSessionRegion() {
+    ClientRegionFactory<String, HttpSession> factory = null;
+    boolean enableLocalCache =
+        (Boolean) properties.get(CacheProperty.ENABLE_LOCAL_CACHE);
+
+    String regionName = (String) properties.get(CacheProperty.REGION_NAME);
+    if (enableLocalCache) {
+      // Create the region factory with caching and heap LRU enabled
+      factory = ((ClientCache) this.cache).
+          createClientRegionFactory(
+              ClientRegionShortcut.CACHING_PROXY_HEAP_LRU);
+      LOG.info("Created new local client session region: {}", regionName);
+    } else {
+      // Create the region factory without caching enabled
+      factory = ((ClientCache) this.cache).createClientRegionFactory(
+          ClientRegionShortcut.PROXY);
+      LOG.info(
+          "Created new local client (uncached) session region: {} without any session expiry",
+          regionName);
+    }
+
+    // Create the region
+    return factory.create(regionName);
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/common/PeerToPeerSessionCache.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/common/PeerToPeerSessionCache.java b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/common/PeerToPeerSessionCache.java
new file mode 100644
index 0000000..7ba5e76
--- /dev/null
+++ b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/common/PeerToPeerSessionCache.java
@@ -0,0 +1,174 @@
+/*=========================================================================
+ * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+package com.gemstone.gemfire.modules.session.internal.common;
+
+import com.gemstone.gemfire.cache.Cache;
+import com.gemstone.gemfire.cache.GemFireCache;
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.cache.RegionFactory;
+import com.gemstone.gemfire.cache.RegionShortcut;
+import com.gemstone.gemfire.cache.execute.FunctionService;
+import com.gemstone.gemfire.modules.session.catalina.callback.LocalSessionCacheLoader;
+import com.gemstone.gemfire.modules.session.catalina.callback.LocalSessionCacheWriter;
+import com.gemstone.gemfire.modules.util.RegionConfiguration;
+import com.gemstone.gemfire.modules.util.RegionHelper;
+import com.gemstone.gemfire.modules.util.TouchPartitionedRegionEntriesFunction;
+import com.gemstone.gemfire.modules.util.TouchReplicatedRegionEntriesFunction;
+
+import java.util.Map;
+import javax.servlet.http.HttpSession;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Class which defines a peer-to-peer cache
+ */
+public class PeerToPeerSessionCache extends AbstractSessionCache {
+
+  private static final Logger LOG =
+      LoggerFactory.getLogger(PeerToPeerSessionCache.class.getName());
+
+  private Cache cache;
+
+  private static final String DEFAULT_REGION_ATTRIBUTES_ID =
+      RegionShortcut.REPLICATE.toString();
+
+  private static final Boolean DEFAULT_ENABLE_LOCAL_CACHE = false;
+
+  /**
+   * Constructor
+   *
+   * @param cache
+   * @param properties
+   */
+  public PeerToPeerSessionCache(Cache cache,
+      Map<CacheProperty, Object> properties) {
+    super();
+    this.cache = cache;
+
+    /**
+     * Set some default properties for this cache if they haven't already
+     * been set
+     */
+    this.properties.put(CacheProperty.REGION_ATTRIBUTES_ID,
+        DEFAULT_REGION_ATTRIBUTES_ID);
+    this.properties.put(CacheProperty.ENABLE_LOCAL_CACHE,
+        DEFAULT_ENABLE_LOCAL_CACHE);
+    this.properties.putAll(properties);
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  public void initialize() {
+    // Register Functions
+    registerFunctions();
+
+    // Create or retrieve the region
+    createOrRetrieveRegion();
+
+    /**
+     * If local cache is enabled, create the local region fronting the
+     * session region and set it as the operating region; otherwise, use
+     * the session region directly as the operating region.
+     */
+    boolean enableLocalCache =
+        (Boolean) properties.get(CacheProperty.ENABLE_LOCAL_CACHE);
+    operatingRegion = enableLocalCache
+        ? createOrRetrieveLocalRegion()
+        : this.sessionRegion;
+
+    // Create or retrieve the statistics
+    createStatistics();
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  public GemFireCache getCache() {
+    return cache;
+  }
+
+  @Override
+  public boolean isClientServer() {
+    return false;
+  }
+
+  private void registerFunctions() {
+    // Register the touch partitioned region entries function if it is not already registered
+    if (!FunctionService.isRegistered(
+        TouchPartitionedRegionEntriesFunction.ID)) {
+      FunctionService.registerFunction(
+          new TouchPartitionedRegionEntriesFunction());
+    }
+
+    // Register the touch replicated region entries function if it is not already registered
+    if (!FunctionService.isRegistered(
+        TouchReplicatedRegionEntriesFunction.ID)) {
+      FunctionService.registerFunction(
+          new TouchReplicatedRegionEntriesFunction());
+    }
+  }
+
+  private void createOrRetrieveRegion() {
+    // Create the RegionConfiguration
+    RegionConfiguration configuration = createRegionConfiguration();
+
+    // Attempt to retrieve the region
+    // If it already exists, validate it
+    // If it doesn't already exist, create it
+    Region region = this.cache.getRegion(
+        (String) properties.get(CacheProperty.REGION_NAME));
+    if (region == null) {
+      // Create the region
+      region = RegionHelper.createRegion(cache, configuration);
+      LOG.info("Created new session region: " + region);
+    } else {
+      // Validate the existing region
+      LOG.info("Retrieved existing session region: " + region);
+      RegionHelper.validateRegion(cache, configuration, region);
+    }
+
+    // Set the session region
+    this.sessionRegion = region;
+  }
+
+  /**
+   * Create a local region fronting the main region.
+   *
+   * @return
+   */
+  private Region<String, HttpSession> createOrRetrieveLocalRegion() {
+    // Attempt to retrieve the fronting region
+    String frontingRegionName = this.sessionRegion.getName() + "_local";
+    Region<String, HttpSession> frontingRegion =
+        this.cache.getRegion(frontingRegionName);
+
+    if (frontingRegion == null) {
+      // Create the region factory
+      RegionFactory<String, HttpSession> factory =
+          this.cache.createRegionFactory(RegionShortcut.LOCAL_HEAP_LRU);
+
+      // Add the cache loader and writer
+      factory.setCacheLoader(new LocalSessionCacheLoader(this.sessionRegion));
+      factory.setCacheWriter(new LocalSessionCacheWriter(this.sessionRegion));
+
+      // Create the region
+      frontingRegion = factory.create(frontingRegionName);
+      LOG.info("Created new local session region: {}", frontingRegion);
+    } else {
+      LOG.info("Retrieved existing local session region: {}",
+          frontingRegion);
+    }
+
+    return frontingRegion;
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/common/SessionCache.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/common/SessionCache.java b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/common/SessionCache.java
new file mode 100644
index 0000000..e0aa6bf
--- /dev/null
+++ b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/common/SessionCache.java
@@ -0,0 +1,59 @@
+/*=========================================================================
+ * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+
+package com.gemstone.gemfire.modules.session.internal.common;
+
+import com.gemstone.gemfire.cache.GemFireCache;
+import com.gemstone.gemfire.cache.Region;
+
+import javax.servlet.http.HttpSession;
+
+/**
+ * Interface to basic cache operations.
+ */
+public interface SessionCache {
+
+  /**
+   * Initialize the cache and create the appropriate region.
+   */
+  public void initialize();
+
+  /**
+   * Stop the cache.
+   */
+  public void stop();
+
+  /**
+   * Retrieve the cache reference.
+   *
+   * @return a {@code GemFireCache} reference
+   */
+  public GemFireCache getCache();
+
+  /**
+   * Get the {@code Region} being used by client code to put attributes.
+   *
+   * @return a {@code Region<String, HttpSession>} reference
+   */
+  public Region<String, HttpSession> getOperatingRegion();
+
+  /**
+   * Get the backing {@code Region} being used. This may not be the same as the
+   * region being used by client code to put attributes.
+   *
+   * @return a {@code Region<String, HttpSession>} reference
+   */
+  public Region<String, HttpSession> getSessionRegion();
+
+  /**
+   * Is this cache client-server? The only other alternative is peer-to-peer.
+   *
+   * @return true if this cache is client-server.
+   */
+  public boolean isClientServer();
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/common/SessionExpirationCacheListener.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/common/SessionExpirationCacheListener.java b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/common/SessionExpirationCacheListener.java
new file mode 100644
index 0000000..836f4af
--- /dev/null
+++ b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/common/SessionExpirationCacheListener.java
@@ -0,0 +1,43 @@
+/*=========================================================================
+ * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+package com.gemstone.gemfire.modules.session.internal.common;
+
+import com.gemstone.gemfire.cache.Declarable;
+import com.gemstone.gemfire.cache.EntryEvent;
+import com.gemstone.gemfire.cache.Operation;
+import com.gemstone.gemfire.cache.util.CacheListenerAdapter;
+
+import java.util.Properties;
+import javax.servlet.http.HttpSession;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class SessionExpirationCacheListener extends
+    CacheListenerAdapter<String, HttpSession> implements Declarable {
+
+  private static final Logger LOG =
+      LoggerFactory.getLogger(SessionExpirationCacheListener.class.getName());
+
+  @Override
+  public void afterDestroy(EntryEvent<String, HttpSession> event) {
+    /**
+     * A Session expired. If it was destroyed by GemFire expiration,
+     * process it. If it was destroyed via Session.invalidate, ignore it
+     * since it has already been processed.
+     */
+    if (event.getOperation() == Operation.EXPIRE_DESTROY) {
+      HttpSession session = (HttpSession) event.getOldValue();
+      session.invalidate();
+    }
+  }
+
+  @Override
+  public void init(Properties p) {
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/Constants.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/Constants.java b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/Constants.java
new file mode 100644
index 0000000..f62f9db
--- /dev/null
+++ b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/Constants.java
@@ -0,0 +1,14 @@
+
+package com.gemstone.gemfire.modules.session.internal.filter;
+
+/**
+ * Various constant values used through the app
+ */
+public class Constants {
+
+  public static String GEMFIRE_SESSION_REQUEST = "_gemfire_session_request_";
+
+  public static String SESSION_STATISTICS_MBEAN_NAME =
+      "com.gemstone:type=SessionStatistics,name=sessionStatistics";
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/ContextManager.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/ContextManager.java b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/ContextManager.java
new file mode 100644
index 0000000..4954376
--- /dev/null
+++ b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/ContextManager.java
@@ -0,0 +1,95 @@
+/*=========================================================================
+ * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package com.gemstone.gemfire.modules.session.internal.filter;
+
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
+import javax.servlet.ServletContext;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * This class is a singleton and manages the mapping of context paths to
+ * original ServletContext objects as well as a mapping of paths to Cache
+ * reference handles.
+ */
+public class ContextManager {
+
+  /**
+   * Logger object
+   */
+  private static final Logger LOG =
+      LoggerFactory.getLogger(ContextManager.class.getName());
+
+  /**
+   * Mapping of context path to ServletContext object
+   */
+  private final ConcurrentMap<String, ServletContext> contextMap =
+      new ConcurrentHashMap<String, ServletContext>(16);
+
+  /**
+   * Our singleton reference
+   */
+  private static final ContextManager manager = new ContextManager();
+
+  private ContextManager() {
+    // This is a singleton
+    LOG.info("Initializing ContextManager");
+  }
+
+  /**
+   * Return our singleton instance
+   *
+   * @return
+   */
+  public static ContextManager getInstance() {
+    return manager;
+  }
+
+  /**
+   * Add a context to our collection
+   *
+   * @param context the {@code ServletContext} to add
+   */
+  public void putContext(ServletContext context) {
+    String path = context.getContextPath();
+    contextMap.put(path, context);
+    LOG.info("Adding context '{}' {}", path, context);
+  }
+
+  /**
+   * Remove a context from our collection
+   *
+   * @param context the context to remove
+   */
+  public void removeContext(ServletContext context) {
+    String path = context.getContextPath();
+    contextMap.remove(path);
+    LOG.info("Removing context '{}'", path);
+  }
+
+  /**
+   * Retrieve the context for a given path
+   *
+   * @param path
+   * @return the GemfireServletContext object or null if the path is not found
+   */
+  public ServletContext getContext(String path) {
+    ServletContext ctx = contextMap.get(path);
+    if (ctx == null) {
+      LOG.warn("No context for requested contextPath '{}'", path);
+    }
+    return ctx;
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/DummySessionManager.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/DummySessionManager.java b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/DummySessionManager.java
new file mode 100644
index 0000000..bfa5e57
--- /dev/null
+++ b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/DummySessionManager.java
@@ -0,0 +1,127 @@
+/*=========================================================================
+ * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package com.gemstone.gemfire.modules.session.internal.filter;
+
+import com.gemstone.gemfire.modules.session.internal.filter.attributes.AbstractSessionAttributes;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.UUID;
+import javax.servlet.http.HttpSession;
+
+/**
+ * Class which fakes an in-memory basic session manager for testing purposes.
+ */
+public class DummySessionManager implements SessionManager {
+
+  /**
+   * Map of sessions
+   */
+  private final Map<String, HttpSession> sessions =
+      new HashMap<String, HttpSession>();
+
+  private class Attributes extends AbstractSessionAttributes {
+
+    @Override
+    public Object putAttribute(String attr, Object value) {
+      return attributes.put(attr, value);
+    }
+
+    @Override
+    public Object removeAttribute(String attr) {
+      return attributes.remove(attr);
+    }
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  public void start(Object config, ClassLoader loader) {
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  public void stop() {
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  public HttpSession getSession(String id) {
+    return sessions.get(id);
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  public HttpSession wrapSession(HttpSession nativeSession) {
+    String id = generateId();
+    AbstractSessionAttributes attributes = new Attributes();
+    GemfireHttpSession session = new GemfireHttpSession(id, nativeSession);
+    session.setManager(this);
+    session.setAttributes(attributes);
+    sessions.put(id, session);
+
+    return session;
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  public HttpSession getWrappingSession(String nativeId) {
+    return sessions.get(nativeId);
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  public void putSession(HttpSession session) {
+    // shouldn't ever get called
+    throw new UnsupportedOperationException("Not supported yet.");
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  public void destroySession(String id) {
+    sessions.remove(id);
+  }
+
+  @Override
+  public String destroyNativeSession(String id) {
+    return null;
+  }
+
+  public String getSessionCookieName() {
+    return "JSESSIONID";
+  }
+
+  public String getJvmId() {
+    return "jvm-id";
+  }
+
+  /**
+   * Generate an ID string
+   */
+  private String generateId() {
+    return UUID.randomUUID().toString().toUpperCase() + "-GF";
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/GemfireHttpSession.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/GemfireHttpSession.java b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/GemfireHttpSession.java
new file mode 100644
index 0000000..1f114bc
--- /dev/null
+++ b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/GemfireHttpSession.java
@@ -0,0 +1,517 @@
+/*=========================================================================
+ * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+
+package com.gemstone.gemfire.modules.session.internal.filter;
+
+import com.gemstone.gemfire.DataSerializable;
+import com.gemstone.gemfire.DataSerializer;
+import com.gemstone.gemfire.Delta;
+import com.gemstone.gemfire.Instantiator;
+import com.gemstone.gemfire.InvalidDeltaException;
+import com.gemstone.gemfire.modules.session.internal.filter.attributes.AbstractSessionAttributes;
+import com.gemstone.gemfire.modules.session.internal.filter.attributes.SessionAttributes;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.concurrent.atomic.AtomicBoolean;
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpSession;
+import javax.servlet.http.HttpSessionContext;
+
+import com.gemstone.gemfire.modules.util.ClassLoaderObjectInputStream;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Class which implements a Gemfire persisted {@code HttpSession}
+ */
+public class GemfireHttpSession implements
+    HttpSession, DataSerializable, Delta {
+
+  private static transient final Logger LOG =
+      LoggerFactory.getLogger(GemfireHttpSession.class.getName());
+
+  /**
+   * Serial id
+   */
+  private static final long serialVersionUID = 238915238964017823L;
+
+  /**
+   * Id for the session
+   */
+  private String id;
+
+  /**
+   * Attributes really hold the essence of persistence.
+   */
+  private SessionAttributes attributes;
+
+  private transient SessionManager manager;
+
+  private HttpSession nativeSession = null;
+
+  /**
+   * A session becomes invalid if it is explicitly invalidated or if it
+   * expires.
+   */
+  private boolean isValid = true;
+
+  private boolean isNew = true;
+
+  private boolean isDirty = false;
+
+  /**
+   * This is set during serialization and then reset by the SessionManager when
+   * it is retrieved from the attributes.
+   */
+  private AtomicBoolean serialized = new AtomicBoolean(false);
+
+  /**
+   * Register ourselves for de-serialization
+   */
+  static {
+    Instantiator.register(new Instantiator(GemfireHttpSession.class, 27315) {
+      @Override
+      public DataSerializable newInstance() {
+        return new GemfireHttpSession();
+      }
+    });
+  }
+
+  /**
+   * Constructor used for de-serialization
+   */
+  private GemfireHttpSession() {
+  }
+
+  /**
+   * Constructor
+   */
+  public GemfireHttpSession(String id, HttpSession nativeSession) {
+    this();
+    this.id = id;
+    this.nativeSession = nativeSession;
+    if (nativeSession != null) {
+      attributes.setMaxInactiveInterval(nativeSession.getMaxInactiveInterval());
+    }
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  public Object getAttribute(String name) {
+    if (!isValid) {
+      throw new IllegalStateException("Session is already invalidated");
+    }
+    Object obj = attributes.getAttribute(name);
+
+    if (obj != null) {
+      Object tmpObj = null;
+      ClassLoader loader = ((GemfireSessionManager) manager).getReferenceClassLoader();
+
+      if (obj.getClass().getClassLoader() != loader) {
+        LOG.debug(
+            "Attribute '{}' needs to be reconstructed with a new classloader",
+            name);
+
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        try {
+          ObjectOutputStream oos = new ObjectOutputStream(baos);
+          oos.writeObject(obj);
+          oos.close();
+
+          ObjectInputStream ois = new ClassLoaderObjectInputStream(
+              new ByteArrayInputStream(baos.toByteArray()),
+              loader);
+          tmpObj = ois.readObject();
+        } catch (IOException e) {
+          LOG.error("Exception while recreating attribute '" + name +
+              "'", e);
+        } catch (ClassNotFoundException e) {
+          LOG.error("Exception while recreating attribute '" + name +
+              "'", e);
+        }
+        if (tmpObj != null) {
+          setAttribute(name, tmpObj);
+          obj = tmpObj;
+        }
+      }
+    }
+
+    return obj;
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  public Enumeration getAttributeNames() {
+    if (!isValid) {
+      throw new IllegalStateException("Session is already invalidated");
+    }
+    return Collections.enumeration(attributes.getAttributeNames());
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  public long getCreationTime() {
+    if (nativeSession != null) {
+      return nativeSession.getCreationTime();
+    } else {
+      return 0;
+    }
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  public String getId() {
+    return id;
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  public long getLastAccessedTime() {
+    if (!isValid) {
+      throw new IllegalStateException("Session is already invalidated");
+    }
+    return attributes.getLastAccessedTime();
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  public ServletContext getServletContext() {
+    if (nativeSession != null) {
+      return nativeSession.getServletContext();
+    } else {
+      return null;
+    }
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  public HttpSessionContext getSessionContext() {
+    return null;
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  public Object getValue(String name) {
+    return getAttribute(name);
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  public String[] getValueNames() {
+    return attributes.getAttributeNames().toArray(new String[0]);
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  public void invalidate() {
+    nativeSession.invalidate();
+    manager.destroySession(id);
+    isValid = false;
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  public boolean isNew() {
+    if (!isValid) {
+      throw new IllegalStateException("Session is already invalidated");
+    }
+    return isNew;
+  }
+
+  public void setIsNew(boolean isNew) {
+    this.isNew = isNew;
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  public void setMaxInactiveInterval(int interval) {
+    if (nativeSession != null) {
+      nativeSession.setMaxInactiveInterval(interval);
+    }
+    attributes.setMaxInactiveInterval(interval);
+    isDirty = true;
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  public int getMaxInactiveInterval() {
+    if (nativeSession != null) {
+      return nativeSession.getMaxInactiveInterval();
+    } else {
+      return attributes.getMaxIntactiveInterval();
+    }
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  public void putValue(String name, Object value) {
+    setAttribute(name, value);
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  public void removeAttribute(final String name) {
+    LOG.debug("Session {} removing attribute {}", getId(), name);
+    nativeSession.removeAttribute(name);
+    attributes.removeAttribute(name);
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  public void removeValue(String name) {
+    removeAttribute(name);
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  public void setAttribute(final String name, final Object value) {
+
+    if (LOG.isDebugEnabled()) {
+      LOG.debug("Session {} setting attribute {} = '{}'",
+          new Object[]{id, name, value});
+    }
+
+    isDirty = true;
+    nativeSession.setAttribute(name, value);
+    if (value == null) {
+      removeAttribute(name);
+    } else {
+      attributes.putAttribute(name, value);
+    }
+  }
+
+  /**
+   * Gemfire serialization {@inheritDoc}
+   */
+  @Override
+  public void toData(DataOutput out) throws IOException {
+    DataSerializer.writeString(id, out);
+    DataSerializer.writeObject(attributes, out);
+  }
+
+  /**
+   * Gemfire de-serialization {@inheritDoc}
+   */
+  @Override
+  public void fromData(DataInput in) throws IOException,
+      ClassNotFoundException {
+    id = DataSerializer.readString(in);
+    attributes = DataSerializer.readObject(in);
+    if (getNativeSession() != null) {
+      for (String s : attributes.getAttributeNames()) {
+        getNativeSession().setAttribute(s, attributes.getAttribute(s));
+      }
+    }
+
+    // Explicit sets
+    serialized.set(true);
+    attributes.setSession(this);
+  }
+
+  /**
+   * These three methods handle delta propagation and are deferred to the
+   * attribute object.
+   */
+  @Override
+  public boolean hasDelta() {
+    return isDirty;
+  }
+
+  @Override
+  public void toDelta(DataOutput out) throws IOException {
+    if (attributes instanceof Delta) {
+      ((Delta) attributes).toDelta(out);
+    } else {
+      toData(out);
+    }
+  }
+
+  @Override
+  public void fromDelta(DataInput in) throws IOException,
+      InvalidDeltaException {
+    if (attributes instanceof Delta) {
+      ((Delta) attributes).fromDelta(in);
+    } else {
+      try {
+        fromData(in);
+      } catch (ClassNotFoundException cex) {
+        throw new IOException("Unable to forward fromDelta() call "
+            + "to fromData()", cex);
+      }
+    }
+  }
+
+  @Override
+  public String toString() {
+    StringBuilder builder = new StringBuilder();
+    builder.append("[id=").append(id)
+        .append(", isNew=").append(isNew)
+        .append(", isValid=").append(isValid)
+        .append(", hasDelta=").append(hasDelta())
+        .append(", lastAccessedTime=").append(attributes.getLastAccessedTime())
+        .append(", jvmOwnerId=").append(attributes.getJvmOwnerId());
+    builder.append("]");
+    return builder.toString();
+  }
+
+  /**
+   * Flush the session object to the region
+   */
+  public void putInRegion() {
+
+    manager.putSession(this);
+    isDirty = false;
+  }
+
+  /**
+   * Determine whether the session is still valid or whether it has expired.
+   *
+   * @return true or false
+   */
+  public boolean isValid() {
+    if (!isValid) {
+      return false;
+    }
+    if (getMaxInactiveInterval() >= 0) {
+      long now = System.currentTimeMillis();
+      if (now - attributes.getLastAccessedTime() >= getMaxInactiveInterval() * 1000) {
+        return false;
+      }
+    }
+    return true;
+  }
+
+  /**
+   * Is this session dirty and should it be written to cache
+   */
+  public boolean isDirty() {
+    return isDirty;
+  }
+
+  public void setManager(SessionManager manager) {
+    this.manager = manager;
+  }
+
+  /**
+   * For testing allow retrieval of the wrapped, native session.
+   */
+  public HttpSession getNativeSession() {
+    return nativeSession;
+  }
+
+
+  public void setNativeSession(HttpSession session) {
+    this.nativeSession = session;
+  }
+
+  /**
+   * Handle the process of failing over the session to a new native session
+   * object.
+   *
+   * @param session
+   */
+  public void failoverSession(HttpSession session) {
+    LOG.debug("Failing over session {} to {}", getId(), session.getId());
+    setNativeSession(session);
+    for (String name : attributes.getAttributeNames()) {
+      LOG.debug("Copying '{}' => {}", name, attributes.getAttribute(name));
+      session.setAttribute(name, attributes.getAttribute(name));
+    }
+    session.setMaxInactiveInterval(attributes.getMaxIntactiveInterval());
+    manager.putSession(this);
+  }
+
+
+  /**
+   * Update the last accessed time
+   */
+  public void updateAccessTime() {
+    attributes.setLastAccessedTime(System.currentTimeMillis());
+  }
+
+  /**
+   * The {@code SessionManager} injects this when creating a new session.
+   *
+   * @param attributes
+   */
+  public void setAttributes(AbstractSessionAttributes attributes) {
+    this.attributes = attributes;
+  }
+
+  /**
+   * This is called on deserialization. You can only call it once to get a
+   * meaningful value as it resets the serialized state. In other words, this
+   * call is not idempotent.
+   *
+   * @return whether this object has just been serialized
+   */
+  public boolean justSerialized() {
+    return serialized.getAndSet(false);
+  }
+
+  /**
+   * Called when the session is about to go out of scope. If the session has
+   * been defined to use async queued attributes then they will be written out
+   * at this point.
+   */
+  public void commit() {
+    attributes.setJvmOwnerId(manager.getJvmId());
+    attributes.flush();
+  }
+
+  public String getJvmOwnerId() {
+    if (attributes != null) {
+      return attributes.getJvmOwnerId();
+    }
+
+    return null;
+  }
+}
+

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/GemfireSessionException.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/GemfireSessionException.java b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/GemfireSessionException.java
new file mode 100644
index 0000000..2a34b5e
--- /dev/null
+++ b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/GemfireSessionException.java
@@ -0,0 +1,36 @@
+/*=========================================================================
+ * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package com.gemstone.gemfire.modules.session.internal.filter;
+
+/**
+ * Exception class for Gemfire Session Cache specific exceptions.
+ */
+public class GemfireSessionException extends Exception {
+
+  public GemfireSessionException() {
+    super();
+  }
+
+  public GemfireSessionException(String message) {
+    super(message);
+  }
+
+  public GemfireSessionException(String message, Throwable cause) {
+    super(message, cause);
+  }
+
+  public GemfireSessionException(Throwable cause) {
+    super(cause);
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/GemfireSessionManager.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/GemfireSessionManager.java b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/GemfireSessionManager.java
new file mode 100644
index 0000000..dd148d2
--- /dev/null
+++ b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/GemfireSessionManager.java
@@ -0,0 +1,502 @@
+/*=========================================================================
+ * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+
+package com.gemstone.gemfire.modules.session.internal.filter;
+
+import com.gemstone.gemfire.cache.CacheClosedException;
+import com.gemstone.gemfire.cache.CacheFactory;
+import com.gemstone.gemfire.cache.EntryNotFoundException;
+import com.gemstone.gemfire.cache.control.ResourceManager;
+import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
+import com.gemstone.gemfire.modules.session.bootstrap.AbstractCache;
+import com.gemstone.gemfire.modules.session.bootstrap.ClientServerCache;
+import com.gemstone.gemfire.modules.session.bootstrap.LifecycleTypeAdapter;
+import com.gemstone.gemfire.modules.session.bootstrap.PeerToPeerCache;
+import com.gemstone.gemfire.modules.session.internal.common.CacheProperty;
+import com.gemstone.gemfire.modules.session.internal.common.ClientServerSessionCache;
+import com.gemstone.gemfire.modules.session.internal.common.PeerToPeerSessionCache;
+import com.gemstone.gemfire.modules.session.internal.common.SessionCache;
+import com.gemstone.gemfire.modules.session.internal.filter.attributes.AbstractSessionAttributes;
+import com.gemstone.gemfire.modules.session.internal.filter.attributes.DeltaQueuedSessionAttributes;
+import com.gemstone.gemfire.modules.session.internal.filter.attributes.DeltaSessionAttributes;
+import com.gemstone.gemfire.modules.session.internal.filter.attributes.ImmediateSessionAttributes;
+import com.gemstone.gemfire.modules.session.internal.filter.util.TypeAwareMap;
+import com.gemstone.gemfire.modules.session.internal.jmx.SessionStatistics;
+import com.gemstone.gemfire.modules.util.RegionHelper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+import javax.naming.InitialContext;
+import javax.servlet.FilterConfig;
+import javax.servlet.http.HttpSession;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.UUID;
+
+/**
+ * This class implements the session management using a Gemfire distributedCache
+ * as a persistent store for the session objects
+ */
+public class GemfireSessionManager implements SessionManager {
+
+  private final Logger LOG;
+
+  /**
+   * Prefix of init param string used to set gemfire properties
+   */
+  private static final String GEMFIRE_PROPERTY = "gemfire.property.";
+
+  /**
+   * Prefix of init param string used to set gemfire distributedCache setting
+   */
+  private static final String GEMFIRE_CACHE = "gemfire.cache.";
+
+  private static final String INIT_PARAM_CACHE_TYPE = "cache-type";
+  private static final String CACHE_TYPE_CLIENT_SERVER = "client-server";
+  private static final String CACHE_TYPE_PEER_TO_PEER = "peer-to-peer";
+  private static final String INIT_PARAM_SESSION_COOKIE_NAME = "session-cookie-name";
+  private static final String INIT_PARAM_JVM_ID = "jvm-id";
+  private static final String DEFAULT_JVM_ID = "default";
+
+  private SessionCache sessionCache = null;
+
+  /**
+   * Reference to the distributed system
+   */
+  private AbstractCache distributedCache = null;
+
+  /**
+   * Boolean indicating whether the manager is shutting down
+   */
+  private boolean isStopping = false;
+
+  /**
+   * Boolean indicating whether this manager is defined in the same context (war
+   * / classloader) as the filter.
+   */
+  private boolean isolated = false;
+
+  /**
+   * Map of wrapping GemFire session id to native session id
+   */
+  private Map<String, String> nativeSessionMap =
+      new HashMap<String, String>();
+
+  /**
+   * MBean for statistics
+   */
+  private SessionStatistics mbean;
+
+  /**
+   * This CL is used to compare against the class loader of attributes getting
+   * pulled out of the cache. This variable should be set to the CL of the
+   * filter running everything.
+   */
+  private ClassLoader referenceClassLoader;
+
+  private String sessionCookieName = "JSESSIONID";
+
+  /**
+   * Give this JVM a unique identifier.
+   */
+  private String jvmId = "default";
+
+  /**
+   * Set up properties with default values
+   */
+  private TypeAwareMap<CacheProperty, Object> properties =
+      new TypeAwareMap<CacheProperty, Object>(CacheProperty.class) {{
+        put(CacheProperty.REGION_NAME, RegionHelper.NAME + "_sessions");
+        put(CacheProperty.ENABLE_GATEWAY_DELTA_REPLICATION, Boolean.FALSE);
+        put(CacheProperty.ENABLE_GATEWAY_REPLICATION, Boolean.FALSE);
+        put(CacheProperty.ENABLE_DEBUG_LISTENER, Boolean.FALSE);
+        put(CacheProperty.STATISTICS_NAME, "gemfire_statistics");
+        put(CacheProperty.SESSION_DELTA_POLICY, "delta_queued");
+        put(CacheProperty.REPLICATION_TRIGGER, "set");
+        /**
+         * For REGION_ATTRIBUTES_ID and ENABLE_LOCAL_CACHE the default
+         * is different for ClientServerCache and PeerToPeerCache
+         * so those values are set in the relevant constructors when
+         * these properties are passed in to them.
+         */
+      }};
+
+  public GemfireSessionManager() {
+    LOG = LoggerFactory.getLogger(GemfireSessionManager.class.getName());
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  public void start(Object conf, ClassLoader loader) {
+    this.referenceClassLoader = loader;
+    FilterConfig config = (FilterConfig) conf;
+
+    startDistributedSystem(config);
+    initializeSessionCache(config);
+
+    // Register MBean
+    registerMBean();
+
+    if (distributedCache.getClass().getClassLoader() == loader) {
+      isolated = true;
+    }
+
+    String sessionCookieName = config.getInitParameter(
+        INIT_PARAM_SESSION_COOKIE_NAME);
+    if (sessionCookieName != null && !sessionCookieName.isEmpty()) {
+      this.sessionCookieName = sessionCookieName;
+      LOG.info("Session cookie name set to: {}", this.sessionCookieName);
+    }
+
+    jvmId = config.getInitParameter(INIT_PARAM_JVM_ID);
+    if (jvmId == null || jvmId.isEmpty()) {
+      jvmId = DEFAULT_JVM_ID;
+    }
+
+    LOG.info("Started GemfireSessionManager (isolated={}, jvmId={})",
+        isolated, jvmId);
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  public void stop() {
+    isStopping = true;
+
+    if (isolated) {
+      if (distributedCache != null) {
+        LOG.info("Closing distributed cache - assuming isolated cache");
+        distributedCache.close();
+      }
+    } else {
+      LOG.info("Not closing distributed cache - assuming common cache");
+    }
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  public HttpSession getSession(String id) {
+    GemfireHttpSession session = (GemfireHttpSession) sessionCache.getOperatingRegion().get(
+        id);
+
+    if (session != null) {
+      if (session.justSerialized()) {
+        session.setManager(this);
+        LOG.debug("Recovered serialized session {} (jvmId={})", id,
+            session.getJvmOwnerId());
+      }
+      LOG.debug("Retrieved session id {}", id);
+    } else {
+      LOG.debug("Session id {} not found", id);
+    }
+    return session;
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  public HttpSession wrapSession(HttpSession nativeSession) {
+    String id = generateId();
+    GemfireHttpSession session =
+        new GemfireHttpSession(id, nativeSession);
+
+    /**
+     * Set up the attribute container depending on how things are configured
+     */
+    AbstractSessionAttributes attributes;
+    if ("delta_queued".equals(
+        properties.get(CacheProperty.SESSION_DELTA_POLICY))) {
+      attributes = new DeltaQueuedSessionAttributes();
+      ((DeltaQueuedSessionAttributes) attributes).setReplicationTrigger(
+          (String) properties.get(CacheProperty.REPLICATION_TRIGGER));
+    } else if ("delta_immediate".equals(
+        properties.get(CacheProperty.SESSION_DELTA_POLICY))) {
+      attributes = new DeltaSessionAttributes();
+    } else if ("immediate".equals(
+        properties.get(CacheProperty.SESSION_DELTA_POLICY))) {
+      attributes = new ImmediateSessionAttributes();
+    } else {
+      attributes = new DeltaSessionAttributes();
+      LOG.warn(
+          "No session delta policy specified - using default of 'delta_immediate'");
+    }
+
+    attributes.setSession(session);
+    attributes.setJvmOwnerId(jvmId);
+
+    session.setManager(this);
+    session.setAttributes(attributes);
+
+    LOG.debug("Creating new session {}", id);
+    sessionCache.getOperatingRegion().put(id, session);
+
+    mbean.incActiveSessions();
+
+    return session;
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  public HttpSession getWrappingSession(String nativeId) {
+    HttpSession session = null;
+    String gemfireId = getGemfireSessionIdFromNativeId(nativeId);
+
+    if (gemfireId != null) {
+      session = getSession(gemfireId);
+    }
+    return session;
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  public void destroySession(String id) {
+    if (!isStopping) {
+      try {
+        GemfireHttpSession session = (GemfireHttpSession) sessionCache.getOperatingRegion().get(
+            id);
+        if (session != null && session.getJvmOwnerId().equals(jvmId)) {
+          LOG.debug("Destroying session {}", id);
+          sessionCache.getOperatingRegion().destroy(id);
+          mbean.decActiveSessions();
+        }
+      } catch (EntryNotFoundException nex) {
+      }
+    } else {
+      if (sessionCache.isClientServer()) {
+        LOG.debug("Destroying session {}", id);
+        try {
+          sessionCache.getOperatingRegion().localDestroy(id);
+        } catch (EntryNotFoundException nex) {
+          // Ignored
+        } catch (CacheClosedException ccex) {
+          // Ignored
+        }
+      } else {
+        GemfireHttpSession session = (GemfireHttpSession) sessionCache.getOperatingRegion().get(
+            id);
+        if (session != null) {
+          session.setNativeSession(null);
+        }
+      }
+    }
+
+    synchronized (nativeSessionMap) {
+      String nativeId = nativeSessionMap.remove(id);
+      LOG.debug("destroySession called for {} wrapping {}", id, nativeId);
+    }
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  public void putSession(HttpSession session) {
+    sessionCache.getOperatingRegion().put(session.getId(), session);
+    mbean.incRegionUpdates();
+    nativeSessionMap.put(session.getId(),
+        ((GemfireHttpSession) session).getNativeSession().getId());
+  }
+
+  @Override
+  public String destroyNativeSession(String nativeId) {
+    String gemfireSessionId = getGemfireSessionIdFromNativeId(nativeId);
+    if (gemfireSessionId != null) {
+      destroySession(gemfireSessionId);
+    }
+    return gemfireSessionId;
+  }
+
+  public ClassLoader getReferenceClassLoader() {
+    return referenceClassLoader;
+  }
+
+  /**
+   * This method is called when a native session gets destroyed. It will check
+   * if the GemFire session is actually still valid/not expired and will then
+   * attach a new, native session.
+   *
+   * @param nativeId the id of the native session
+   * @return the id of the newly attached native session or null if the GemFire
+   * session was already invalid
+   */
+  public String refreshSession(String nativeId) {
+    String gemfireId = getGemfireSessionIdFromNativeId(nativeId);
+    if (gemfireId == null) {
+      return null;
+    }
+
+    GemfireHttpSession session = (GemfireHttpSession) sessionCache.getOperatingRegion().get(
+        gemfireId);
+    if (session.isValid()) {
+
+    }
+
+    return null;
+  }
+
+  public String getSessionCookieName() {
+    return sessionCookieName;
+  }
+
+  public String getJvmId() {
+    return jvmId;
+  }
+
+
+  ///////////////////////////////////////////////////////////////////////
+  // Private methods
+
+  private String getGemfireSessionIdFromNativeId(String nativeId) {
+    if (nativeId == null) {
+      return null;
+    }
+
+    for (Map.Entry<String, String> e : nativeSessionMap.entrySet()) {
+      if (nativeId.equals(e.getValue())) {
+        return e.getKey();
+      }
+    }
+    return null;
+  }
+
+  /**
+   * Start the underlying distributed system
+   *
+   * @param config
+   */
+  private void startDistributedSystem(FilterConfig config) {
+    // Get the distributedCache type
+    final String cacheType = config.getInitParameter(INIT_PARAM_CACHE_TYPE);
+    if (CACHE_TYPE_CLIENT_SERVER.equals(cacheType)) {
+      distributedCache = ClientServerCache.getInstance();
+    } else if (CACHE_TYPE_PEER_TO_PEER.equals(cacheType)) {
+      distributedCache = PeerToPeerCache.getInstance();
+    } else {
+      LOG.error("No 'cache-type' initialization param set. "
+          + "Cache will not be started");
+      return;
+    }
+
+    if (!distributedCache.isStarted()) {
+      /**
+       * Process all the init params and see if any apply to the
+       * distributed system.
+       */
+      for (Enumeration<String> e = config.getInitParameterNames(); e.hasMoreElements(); ) {
+        String param = e.nextElement();
+        if (!param.startsWith(GEMFIRE_PROPERTY)) {
+          continue;
+        }
+
+        String gemfireProperty = param.substring(GEMFIRE_PROPERTY.length());
+        LOG.info("Setting gemfire property: {} = {}",
+            gemfireProperty, config.getInitParameter(param));
+        distributedCache.setProperty(gemfireProperty,
+            config.getInitParameter(param));
+      }
+
+      distributedCache.lifecycleEvent(LifecycleTypeAdapter.START);
+    }
+  }
+
+  /**
+   * Initialize the distributedCache
+   */
+  private void initializeSessionCache(FilterConfig config) {
+    // Retrieve the distributedCache
+    GemFireCacheImpl cache = (GemFireCacheImpl) CacheFactory.getAnyInstance();
+    if (cache == null) {
+      throw new IllegalStateException("No cache exists. Please configure "
+          + "either a PeerToPeerCacheLifecycleListener or "
+          + "ClientServerCacheLifecycleListener in the "
+          + "server.xml file.");
+    }
+
+    /**
+     * Process all the init params and see if any apply to the distributedCache
+     */
+    ResourceManager rm = cache.getResourceManager();
+    for (Enumeration<String> e = config.getInitParameterNames(); e.hasMoreElements(); ) {
+      String param = e.nextElement();
+
+      // Uggh - don't like this non-generic stuff
+      if (param.equalsIgnoreCase("criticalHeapPercentage")) {
+        float val = Float.parseFloat(config.getInitParameter(param));
+        rm.setCriticalHeapPercentage(val);
+      }
+
+      if (param.equalsIgnoreCase("evictionHeapPercentage")) {
+        float val = Float.parseFloat(config.getInitParameter(param));
+        rm.setEvictionHeapPercentage(val);
+      }
+
+
+      if (!param.startsWith(GEMFIRE_CACHE)) {
+        continue;
+      }
+
+      String gemfireWebParam = param.substring(GEMFIRE_CACHE.length());
+      LOG.info("Setting cache parameter: {} = {}",
+          gemfireWebParam, config.getInitParameter(param));
+      properties.put(CacheProperty.valueOf(gemfireWebParam.toUpperCase()),
+          config.getInitParameter(param));
+    }
+
+    // Create the appropriate session distributedCache
+    sessionCache = cache.isClient()
+        ? new ClientServerSessionCache(cache, properties)
+        : new PeerToPeerSessionCache(cache, properties);
+
+    // Initialize the session distributedCache
+    sessionCache.initialize();
+  }
+
+  /**
+   * Register a bean for statistic gathering purposes
+   */
+  private void registerMBean() {
+    mbean = new SessionStatistics();
+
+    try {
+      InitialContext ctx = new InitialContext();
+      MBeanServer mbs = MBeanServer.class.cast(
+          ctx.lookup("java:comp/env/jmx/runtime"));
+      ObjectName oname = new ObjectName(
+          Constants.SESSION_STATISTICS_MBEAN_NAME);
+
+      mbs.registerMBean(mbean, oname);
+    } catch (Exception ex) {
+      LOG.warn("Unable to register statistics MBean. Error: {}",
+          ex.getMessage());
+    }
+  }
+
+
+  /**
+   * Generate an ID string
+   */
+  private String generateId() {
+    return UUID.randomUUID().toString().toUpperCase() + "-GF";
+  }
+
+  AbstractCache getCache() {
+    return distributedCache;
+  }
+}
\ No newline at end of file



[05/24] incubator-geode git commit: GEODE-14: Move GemFire Sessions module and relocate all packages to 'internal'

Posted by je...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/CommonTests.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/CommonTests.java b/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/CommonTests.java
new file mode 100644
index 0000000..b9a9a01
--- /dev/null
+++ b/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/CommonTests.java
@@ -0,0 +1,582 @@
+/*=========================================================================
+ * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package com.gemstone.gemfire.modules.session.internal.filter;
+
+import com.mockrunner.mock.web.MockHttpServletRequest;
+import com.mockrunner.mock.web.MockHttpServletResponse;
+import com.mockrunner.mock.web.MockHttpSession;
+import com.mockrunner.servlet.BasicServletTestCaseAdapter;
+import org.junit.After;
+import org.junit.Ignore;
+import org.junit.Test;
+
+import java.util.concurrent.TimeUnit;
+import javax.servlet.http.Cookie;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+import javax.servlet.http.HttpSessionAttributeListener;
+
+import static junit.framework.Assert.assertEquals;
+import static org.junit.Assert.*;
+
+/**
+ * This servlet tests the effects of the downstream SessionCachingFilter filter.
+ * When these tests are performed, the filter would already have taken effect.
+ */
+public abstract class CommonTests extends BasicServletTestCaseAdapter {
+
+  protected static final String CONTEXT_PATH = "/test";
+
+  @After
+  public void tearDown() throws Exception {
+    super.tearDown();
+  }
+
+  @Test
+  public void testGetSession1() throws Exception {
+    doFilter();
+    HttpSession session1 =
+        ((HttpServletRequest) getFilteredRequest()).getSession();
+    HttpSession session2 =
+        ((HttpServletRequest) getFilteredRequest()).getSession();
+
+    assertSame("Session should be the same", session1, session2);
+  }
+
+  @Test
+  public void testGetSession2() throws Exception {
+    doFilter();
+
+    HttpSession session1 = ((HttpServletRequest) getFilteredRequest()).getSession();
+
+    MockHttpServletResponse response = getWebMockObjectFactory().getMockResponse();
+    Cookie cookie = (Cookie) response.getCookies().get(0);
+    getWebMockObjectFactory().getMockRequest().addCookie(cookie);
+
+    doFilter();
+
+    HttpSession session2 = ((HttpServletRequest) getFilteredRequest()).getSession();
+
+    assertEquals("Session objects across requests should be the same", session1, session2);
+  }
+
+  @Test
+  public void testGetAttributeRequest1() throws Exception {
+    doFilter();
+
+    getFilteredRequest().setAttribute("foo", "bar");
+
+    assertEquals("bar", getFilteredRequest().getAttribute("foo"));
+    assertNull("Unknown attribute should be null",
+        getFilteredRequest().getAttribute("baz"));
+  }
+
+  @Test
+  public void testGetAttributeRequest2() throws Exception {
+    // Setup
+    CallbackServlet s = (CallbackServlet) getServlet();
+    s.setCallback(new Callback() {
+      @Override
+      public void call(HttpServletRequest request, HttpServletResponse response) {
+        request.setAttribute("foo", "bar");
+      }
+    });
+    doFilter();
+
+    assertEquals("bar", getFilteredRequest().getAttribute("foo"));
+    assertNull("Unknown attribute should be null",
+        getFilteredRequest().getAttribute("baz"));
+  }
+
+  @Test
+  public void testGetAttributeSession1() throws Exception {
+    doFilter();
+
+    ((HttpServletRequest) getFilteredRequest()).getSession().setAttribute("foo", "bar");
+
+    HttpServletRequest request = (HttpServletRequest) getFilteredRequest();
+    assertEquals("bar", request.getSession().getAttribute("foo"));
+  }
+
+  /**
+   * Are attributes preserved across client requests?
+   */
+  @Test
+  public void testGetAttributeSession2() throws Exception {
+    doFilter();
+
+    ((HttpServletRequest) getFilteredRequest()).getSession().setAttribute("foo", "bar");
+
+    MockHttpServletResponse response = getWebMockObjectFactory().getMockResponse();
+    Cookie cookie = (Cookie) response.getCookies().get(0);
+    getWebMockObjectFactory().getMockRequest().addCookie(cookie);
+
+    doFilter();
+    HttpServletRequest request = (HttpServletRequest) getFilteredRequest();
+
+    assertEquals("bar", request.getSession().getAttribute("foo"));
+  }
+
+  /**
+   * Setting a session attribute to null should remove it
+   */
+  @Test
+  public void testSetAttributeNullSession1() throws Exception {
+    // Setup
+    CallbackServlet s = (CallbackServlet) getServlet();
+    s.setCallback(new Callback() {
+      private boolean called = false;
+
+      @Override
+      public void call(HttpServletRequest request, HttpServletResponse response) {
+        if (called) {
+          request.getSession().setAttribute("foo", null);
+        } else {
+          request.getSession().setAttribute("foo", "bar");
+          called = true;
+        }
+      }
+    });
+
+    doFilter();
+    doFilter();
+
+    HttpSession session = ((HttpServletRequest) getFilteredRequest()).getSession();
+
+    String attr = (String) session.getAttribute("foo");
+    assertNull("Attribute should be null but is " + attr, attr);
+  }
+
+
+  /**
+   * Test that various methods throw the appropriate exception when the session is
+   * invalid.
+   */
+  @Test
+  public void testInvalidate1() throws Exception {
+    doFilter();
+
+    HttpSession session = ((HttpServletRequest) getFilteredRequest()).getSession();
+    session.invalidate();
+
+    try {
+      session.getAttribute("foo");
+      fail("Session should be invalid and an exception should be thrown");
+    } catch (IllegalStateException iex) {
+      // Pass
+    }
+  }
+
+  @Test
+  public void testInvalidate2() throws Exception {
+    doFilter();
+
+    HttpSession session = ((HttpServletRequest) getFilteredRequest()).getSession();
+    session.invalidate();
+
+    try {
+      session.getAttributeNames();
+      fail("Session should be invalid and an exception should be thrown");
+    } catch (IllegalStateException iex) {
+      // Pass
+    }
+  }
+
+  @Ignore(value = "until mockrunner 1.0.9 - see pull request #23")
+  public void testInvalidate3() throws Exception {
+    doFilter();
+
+    HttpSession session = ((HttpServletRequest) getFilteredRequest()).getSession();
+    session.invalidate();
+
+    try {
+      session.getCreationTime();
+      fail("Session should be invalid and an exception should be thrown");
+    } catch (IllegalStateException iex) {
+      // Pass
+    }
+  }
+
+  @Test
+  public void testInvalidate4() throws Exception {
+    doFilter();
+
+    HttpSession session = ((HttpServletRequest) getFilteredRequest()).getSession();
+    session.invalidate();
+
+    try {
+      session.getId();
+    } catch (Exception iex) {
+      fail("Exception should not be thrown");
+    }
+  }
+
+  @Test
+  public void testInvalidate5() throws Exception {
+    doFilter();
+
+    HttpSession session = ((HttpServletRequest) getFilteredRequest()).getSession();
+    session.invalidate();
+
+    try {
+      session.getLastAccessedTime();
+      fail("Session should be invalid and an exception should be thrown");
+    } catch (IllegalStateException iex) {
+      // Pass
+    }
+  }
+
+  @Test
+  public void testInvalidate6() throws Exception {
+    doFilter();
+
+    HttpSession session = ((HttpServletRequest) getFilteredRequest()).getSession();
+    session.invalidate();
+
+    try {
+      session.getMaxInactiveInterval();
+    } catch (Exception ex) {
+      fail("Exception should not be thrown");
+    }
+  }
+
+  @Test
+  public void testInvalidate7() throws Exception {
+    doFilter();
+
+    HttpSession session = ((HttpServletRequest) getFilteredRequest()).getSession();
+    session.invalidate();
+
+    try {
+      session.getServletContext();
+    } catch (Exception ex) {
+      fail("Exception should not be thrown");
+    }
+  }
+
+  @Test
+  public void testInvalidate8() throws Exception {
+    doFilter();
+
+    HttpSession session = ((HttpServletRequest) getFilteredRequest()).getSession();
+    session.invalidate();
+
+    try {
+      session.isNew();
+      fail("Session should be invalid and an exception should be thrown");
+    } catch (IllegalStateException iex) {
+      // Pass
+    }
+  }
+
+  @Test
+  public void testInvalidate9() throws Exception {
+    doFilter();
+
+    HttpSession session = ((HttpServletRequest) getFilteredRequest()).getSession();
+    session.invalidate();
+
+    try {
+      session.removeAttribute("foo");
+      fail("Session should be invalid and an exception should be thrown");
+    } catch (IllegalStateException iex) {
+      // Pass
+    }
+  }
+
+  @Test
+  public void testInvalidate10() throws Exception {
+    doFilter();
+
+    HttpSession session = ((HttpServletRequest) getFilteredRequest()).getSession();
+    session.invalidate();
+
+    try {
+      session.setAttribute("foo", "bar");
+      fail("Session should be invalid and an exception should be thrown");
+    } catch (IllegalStateException iex) {
+      // Pass
+    }
+  }
+
+  @Test
+  public void testInvalidate11() throws Exception {
+    doFilter();
+
+    HttpSession session = ((HttpServletRequest) getFilteredRequest()).getSession();
+    session.invalidate();
+
+    try {
+      session.setMaxInactiveInterval(1);
+    } catch (Exception ex) {
+      fail("Exception should not be thrown");
+    }
+  }
+
+  /**
+   * Test that Session Attribute events get triggered
+   */
+  @Test
+  public void testSessionAttributeListener1() throws Exception {
+    AbstractListener listener = new HttpSessionAttributeListenerImpl();
+    RendezvousManager.registerListener(listener);
+    listener.setLatch(3);
+
+    doFilter();
+
+    // Ugh
+    MockHttpSession session = (MockHttpSession) ((GemfireHttpSession) ((HttpServletRequest) getFilteredRequest()).getSession()).getNativeSession();
+    session.addAttributeListener((HttpSessionAttributeListener) listener);
+    session.setAttribute("foo", "bar");
+    session.setAttribute("foo", "baz");
+    session.setAttribute("foo", null);
+
+    assertTrue("Event timeout", listener.await(1, TimeUnit.SECONDS));
+    assertEquals(ListenerEventType.SESSION_ATTRIBUTE_ADDED, listener.getEvents().get(0));
+    assertEquals(ListenerEventType.SESSION_ATTRIBUTE_REPLACED,
+        listener.getEvents().get(1));
+    assertEquals(ListenerEventType.SESSION_ATTRIBUTE_REMOVED,
+        listener.getEvents().get(2));
+  }
+
+  /**
+   * Test that both replace and remove events get triggered
+   */
+  @Test
+  public void testHttpSessionBindingListener1() throws Exception {
+    doFilter();
+
+    HttpSession session =
+        ((HttpServletRequest) getFilteredRequest()).getSession();
+
+    HttpSessionBindingListenerImpl listener1 =
+        new HttpSessionBindingListenerImpl(2);
+    HttpSessionBindingListenerImpl listener2 =
+        new HttpSessionBindingListenerImpl(2);
+
+    session.setAttribute("foo", listener1);
+    session.setAttribute("foo", listener2);
+    session.setAttribute("foo", null);
+
+    assertTrue("Event timeout", listener1.await(1, TimeUnit.SECONDS));
+    assertTrue("Event timeout", listener2.await(1, TimeUnit.SECONDS));
+
+    assertEquals("Event list size incorrect", 2, listener1.getEvents().size());
+    assertEquals("Event list size incorrect", 2, listener2.getEvents().size());
+    assertEquals(ListenerEventType.SESSION_VALUE_BOUND, listener1.getEvents().get(0));
+    assertEquals(ListenerEventType.SESSION_VALUE_UNBOUND,
+        listener1.getEvents().get(1));
+    assertEquals(ListenerEventType.SESSION_VALUE_BOUND, listener2.getEvents().get(0));
+    assertEquals(ListenerEventType.SESSION_VALUE_UNBOUND,
+        listener2.getEvents().get(1));
+  }
+
+  @Test
+  public void testGetId1() throws Exception {
+    doFilter();
+
+    assertNotNull("Session Id should not be null",
+        ((HttpServletRequest) getFilteredRequest()).getSession().getId());
+  }
+
+  /**
+   * Test that multiple calls from the same client return the same session id
+   */
+  @Test
+  public void testGetId2() throws Exception {
+    doFilter();
+
+    String sessionId = ((HttpServletRequest) getFilteredRequest()).getSession().getId();
+
+    MockHttpServletResponse response = getWebMockObjectFactory().getMockResponse();
+    Cookie cookie = (Cookie) response.getCookies().get(0);
+    getWebMockObjectFactory().getMockRequest().addCookie(cookie);
+
+    doFilter();
+
+    assertEquals("Session Ids should be the same", sessionId,
+        ((HttpServletRequest) getFilteredRequest()).getSession().getId());
+  }
+
+  @Test
+  public void testGetCreationTime1() throws Exception {
+    doFilter();
+
+    HttpServletRequest request = (HttpServletRequest) getFilteredRequest();
+    assertTrue("Session should have a non-zero creation time",
+        request.getSession().getCreationTime() > 0);
+  }
+
+
+  /**
+   * Test that multiple calls from the same client don't change the creation time.
+   */
+  @Test
+  public void testGetCreationTime2() throws Exception {
+    doFilter();
+
+    long creationTime = ((HttpServletRequest) getFilteredRequest()).getSession().getCreationTime();
+
+    MockHttpServletResponse response = getWebMockObjectFactory().getMockResponse();
+    Cookie cookie = (Cookie) response.getCookies().get(0);
+    getWebMockObjectFactory().getMockRequest().addCookie(cookie);
+
+    doFilter();
+
+    assertEquals("Session creation time should be the same", creationTime,
+        ((HttpServletRequest) getFilteredRequest()).getSession().getCreationTime());
+  }
+
+  @Test
+  public void testResponseContainsRequestedSessionId1() throws Exception {
+    Cookie cookie = new Cookie("JSESSIONID", "999-GF");
+    getWebMockObjectFactory().getMockRequest().addCookie(cookie);
+
+    doFilter();
+
+    HttpServletRequest request = (HttpServletRequest) getFilteredRequest();
+
+    assertEquals("Request does not contain requested session ID", "999-GF",
+        request.getRequestedSessionId());
+  }
+
+  @Test
+  public void testGetLastAccessedTime1() throws Exception {
+    doFilter();
+
+    HttpServletRequest request = (HttpServletRequest) getFilteredRequest();
+    assertTrue("Session should have a non-zero last access time",
+        request.getSession().getLastAccessedTime() > 0);
+  }
+
+
+  /**
+   * Test that repeated accesses update the last accessed time
+   */
+  @Test
+  public void testGetLastAccessedTime2() throws Exception {
+    // Setup
+    CallbackServlet s = (CallbackServlet) getServlet();
+    s.setCallback(new Callback() {
+
+      @Override
+      public void call(HttpServletRequest request, HttpServletResponse response) {
+        request.getSession();
+      }
+    });
+
+    doFilter();
+
+    HttpServletRequest request = (HttpServletRequest) getFilteredRequest();
+    long lastAccess = request.getSession().getLastAccessedTime();
+    assertTrue("Session should have a non-zero last access time", lastAccess > 0);
+
+    MockHttpServletResponse response = getWebMockObjectFactory().getMockResponse();
+    Cookie cookie = (Cookie) response.getCookies().get(0);
+
+    MockHttpServletRequest mRequest = getWebMockObjectFactory().createMockRequest();
+    mRequest.setRequestURL("/test/foo/bar");
+    mRequest.setContextPath(CONTEXT_PATH);
+    mRequest.addCookie(cookie);
+    getWebMockObjectFactory().addRequestWrapper(mRequest);
+
+    Thread.sleep(50);
+    doFilter();
+
+    assertTrue("Last access time should be changing",
+        request.getSession().getLastAccessedTime() > lastAccess);
+  }
+
+  @Test
+  public void testGetSetMaxInactiveInterval() throws Exception {
+    doFilter();
+
+    HttpServletRequest request = (HttpServletRequest) getFilteredRequest();
+    request.getSession().setMaxInactiveInterval(50);
+
+    assertEquals(50, request.getSession().getMaxInactiveInterval());
+  }
+
+  @Test
+  public void testIsNew1() throws Exception {
+    doFilter();
+
+    HttpServletRequest request = (HttpServletRequest) getFilteredRequest();
+    assertTrue("Session should be new", request.getSession().isNew());
+  }
+
+  /**
+   * Subsequent calls should not return true
+   */
+  @Test
+  public void testIsNew2() throws Exception {
+    // Setup
+    CallbackServlet s = (CallbackServlet) getServlet();
+    s.setCallback(new Callback() {
+
+      @Override
+      public void call(HttpServletRequest request, HttpServletResponse response) {
+        request.getSession();
+      }
+    });
+
+    doFilter();
+
+    HttpServletRequest request = (HttpServletRequest) getFilteredRequest();
+    request.getSession();
+
+    MockHttpServletResponse response = getWebMockObjectFactory().getMockResponse();
+    Cookie cookie = (Cookie) response.getCookies().get(0);
+
+    MockHttpServletRequest mRequest = getWebMockObjectFactory().createMockRequest();
+    mRequest.setRequestURL("/test/foo/bar");
+    mRequest.setContextPath(CONTEXT_PATH);
+    mRequest.addCookie(cookie);
+    getWebMockObjectFactory().addRequestWrapper(mRequest);
+
+    doFilter();
+
+    request = (HttpServletRequest) getFilteredRequest();
+    HttpSession s1 = request.getSession();
+
+    assertFalse("Subsequent isNew() calls should be false", request.getSession().isNew());
+  }
+
+  @Test
+  public void testIsRequestedSessionIdFromCookie() {
+    MockHttpServletRequest mRequest = getWebMockObjectFactory().getMockRequest();
+    Cookie c = new Cookie("JSESSIONID", "1-GF");
+    mRequest.addCookie(c);
+
+    doFilter();
+    HttpServletRequest request = (HttpServletRequest) getFilteredRequest();
+    request.getSession();
+
+    assertTrue(request.isRequestedSessionIdFromCookie());
+  }
+
+  @Test
+  public void testIsRequestedSessionIdFromURL() {
+    MockHttpServletRequest mRequest = getWebMockObjectFactory().getMockRequest();
+    mRequest.setRequestURL("/foo/bar;jsessionid=1");
+
+    doFilter();
+    HttpServletRequest request = (HttpServletRequest) getFilteredRequest();
+    request.getSession();
+
+    assertFalse("Session ID should not be from cookie",
+        request.isRequestedSessionIdFromCookie());
+    assertTrue("Session ID should be from URL", request.isRequestedSessionIdFromURL());
+  }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/GemfireCacheTest.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/GemfireCacheTest.java b/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/GemfireCacheTest.java
new file mode 100644
index 0000000..1836177
--- /dev/null
+++ b/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/GemfireCacheTest.java
@@ -0,0 +1,46 @@
+/*=========================================================================
+ * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package com.gemstone.gemfire.modules.session.internal.filter;
+
+import com.mockrunner.mock.web.MockFilterConfig;
+import com.mockrunner.mock.web.MockServletConfig;
+import org.junit.Before;
+
+/**
+ * This servlet tests the effects of the downstream SessionCachingFilter filter.
+ * When these tests are performed, the filter would already have taken effect.
+ */
+public class GemfireCacheTest extends CommonTests {
+
+  @Before
+  public void setUp() throws Exception {
+    super.setUp();
+    getWebMockObjectFactory().getMockRequest().setRequestURL("/test/foo/bar");
+    getWebMockObjectFactory().getMockRequest().setContextPath(CONTEXT_PATH);
+    MockFilterConfig config = getWebMockObjectFactory().getMockFilterConfig();
+
+    config.setInitParameter("gemfire.property.mcast-port", "19991");
+    config.setInitParameter("cache-type", "peer-to-peer");
+    System.setProperty("gemfire.logdir", "/tmp");
+
+    getWebMockObjectFactory().getMockServletContext().setContextPath(
+        CONTEXT_PATH);
+
+    setDoChain(true);
+
+    createFilter(SessionCachingFilter.class);
+    createServlet(CallbackServlet.class);
+
+    MockServletConfig servletConfig = getWebMockObjectFactory().getMockServletConfig();
+    ContextManager.getInstance().putContext(servletConfig.getServletContext());
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/GemfireLocalCacheTest.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/GemfireLocalCacheTest.java b/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/GemfireLocalCacheTest.java
new file mode 100644
index 0000000..830e2cb
--- /dev/null
+++ b/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/GemfireLocalCacheTest.java
@@ -0,0 +1,62 @@
+/*=========================================================================
+ * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package com.gemstone.gemfire.modules.session.internal.filter;
+
+import com.mockrunner.mock.web.MockFilterConfig;
+import com.mockrunner.mock.web.MockServletConfig;
+import com.mockrunner.servlet.BasicServletTestCaseAdapter;
+import org.junit.After;
+import org.junit.Before;
+
+import javax.servlet.Filter;
+
+/**
+ * This servlet tests the effects of the downstream SessionCachingFilter filter.
+ * When these tests are performed, the filter would already have taken effect.
+ */
+public class GemfireLocalCacheTest extends BasicServletTestCaseAdapter {
+
+  Filter filter;
+
+  protected static final String CONTEXT_PATH = "/test";
+
+  @Before
+  public void setUp() throws Exception {
+    super.setUp();
+    getWebMockObjectFactory().getMockRequest().setRequestURL("/test/foo/bar");
+    getWebMockObjectFactory().getMockRequest().setContextPath(CONTEXT_PATH);
+    MockFilterConfig config = getWebMockObjectFactory().getMockFilterConfig();
+
+    config.setInitParameter("gemfire.property.mcast-port", "19991");
+    config.setInitParameter("cache-type", "peer-to-peer");
+    config.setInitParameter("gemfire.cache.enable_local_cache", "true");
+    System.setProperty("gemfire.logdir", "/tmp");
+
+    getWebMockObjectFactory().getMockServletContext().setContextPath(
+        CONTEXT_PATH);
+
+    setDoChain(true);
+
+    filter = createFilter(SessionCachingFilter.class);
+    createServlet(CallbackServlet.class);
+
+    MockServletConfig servletConfig = getWebMockObjectFactory().getMockServletConfig();
+    ContextManager.getInstance().putContext(servletConfig.getServletContext());
+  }
+
+  @After
+  public void tearDown() throws Exception {
+    super.tearDown();
+    filter.destroy();
+  }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionAttributeListenerImpl.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionAttributeListenerImpl.java b/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionAttributeListenerImpl.java
new file mode 100644
index 0000000..a374e4d
--- /dev/null
+++ b/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionAttributeListenerImpl.java
@@ -0,0 +1,37 @@
+/*=========================================================================
+ * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+
+package com.gemstone.gemfire.modules.session.internal.filter;
+
+import javax.servlet.http.HttpSessionAttributeListener;
+import javax.servlet.http.HttpSessionBindingEvent;
+
+/**
+ *
+ */
+public class HttpSessionAttributeListenerImpl extends AbstractListener
+    implements HttpSessionAttributeListener {
+
+  @Override
+  public synchronized void attributeAdded(HttpSessionBindingEvent se) {
+    events.add(ListenerEventType.SESSION_ATTRIBUTE_ADDED);
+    latch.countDown();
+  }
+
+  @Override
+  public synchronized void attributeRemoved(HttpSessionBindingEvent se) {
+    events.add(ListenerEventType.SESSION_ATTRIBUTE_REMOVED);
+    latch.countDown();
+  }
+
+  @Override
+  public synchronized void attributeReplaced(HttpSessionBindingEvent se) {
+    events.add(ListenerEventType.SESSION_ATTRIBUTE_REPLACED);
+    latch.countDown();
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionBindingListenerImpl.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionBindingListenerImpl.java b/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionBindingListenerImpl.java
new file mode 100644
index 0000000..2e6ae0c
--- /dev/null
+++ b/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionBindingListenerImpl.java
@@ -0,0 +1,40 @@
+/*=========================================================================
+ * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package com.gemstone.gemfire.modules.session.internal.filter;
+
+import java.io.Serializable;
+import javax.servlet.http.HttpSessionBindingEvent;
+import javax.servlet.http.HttpSessionBindingListener;
+
+/**
+ * @author jdeppe
+ */
+public class HttpSessionBindingListenerImpl extends AbstractListener implements
+    HttpSessionBindingListener, Serializable {
+
+  public HttpSessionBindingListenerImpl(int i) {
+    super(i);
+  }
+
+  @Override
+  public synchronized void valueBound(HttpSessionBindingEvent event) {
+    events.add(ListenerEventType.SESSION_VALUE_BOUND);
+    latch.countDown();
+  }
+
+  @Override
+  public synchronized void valueUnbound(HttpSessionBindingEvent event) {
+    events.add(ListenerEventType.SESSION_VALUE_UNBOUND);
+    latch.countDown();
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionListenerImpl.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionListenerImpl.java b/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionListenerImpl.java
new file mode 100644
index 0000000..0e18e1e
--- /dev/null
+++ b/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionListenerImpl.java
@@ -0,0 +1,33 @@
+/*=========================================================================
+ * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package com.gemstone.gemfire.modules.session.internal.filter;
+
+import javax.servlet.http.HttpSessionEvent;
+import javax.servlet.http.HttpSessionListener;
+
+/**
+ * @author jdeppe
+ */
+public class HttpSessionListenerImpl extends AbstractListener
+    implements HttpSessionListener {
+
+  public synchronized void sessionCreated(HttpSessionEvent se) {
+    events.add(ListenerEventType.SESSION_CREATED);
+    latch.countDown();
+  }
+
+  public synchronized void sessionDestroyed(HttpSessionEvent se) {
+    events.add(ListenerEventType.SESSION_DESTROYED);
+    latch.countDown();
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/RendezvousManager.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/RendezvousManager.java b/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/RendezvousManager.java
new file mode 100644
index 0000000..b2cacf8
--- /dev/null
+++ b/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/RendezvousManager.java
@@ -0,0 +1,37 @@
+/*=========================================================================
+ * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+
+package com.gemstone.gemfire.modules.session.internal.filter;
+
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+
+/**
+ *
+ */
+public class RendezvousManager {
+
+  private static AbstractListener listener = null;
+
+  private static CountDownLatch latch = new CountDownLatch(1);
+
+  public static void registerListener(AbstractListener listener) {
+    RendezvousManager.listener = listener;
+    latch.countDown();
+  }
+
+  public static AbstractListener getListener() {
+    try {
+      latch.await(2, TimeUnit.SECONDS);
+    } catch (InterruptedException ex) {
+    }
+
+    return listener;
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/ServletRequestAttributeListenerImpl.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/ServletRequestAttributeListenerImpl.java b/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/ServletRequestAttributeListenerImpl.java
new file mode 100644
index 0000000..1eea4c0
--- /dev/null
+++ b/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/ServletRequestAttributeListenerImpl.java
@@ -0,0 +1,40 @@
+/*=========================================================================
+ * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package com.gemstone.gemfire.modules.session.internal.filter;
+
+import javax.servlet.ServletRequestAttributeEvent;
+import javax.servlet.ServletRequestAttributeListener;
+
+/**
+ * @author jdeppe
+ */
+public class ServletRequestAttributeListenerImpl extends AbstractListener
+    implements ServletRequestAttributeListener {
+
+  public synchronized void attributeAdded(ServletRequestAttributeEvent srae) {
+    events.add(ListenerEventType.SERVLET_REQUEST_ATTRIBUTE_ADDED);
+    latch.countDown();
+  }
+
+  public synchronized void attributeRemoved(ServletRequestAttributeEvent srae) {
+    events.add(ListenerEventType.SERVLET_REQUEST_ATTRIBUTE_REMOVED);
+    latch.countDown();
+  }
+
+  public synchronized void attributeReplaced(
+      ServletRequestAttributeEvent srae) {
+    events.add(ListenerEventType.SERVLET_REQUEST_ATTRIBUTE_REPLACED);
+    latch.countDown();
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/ServletRequestListenerImpl.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/ServletRequestListenerImpl.java b/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/ServletRequestListenerImpl.java
new file mode 100644
index 0000000..0c1dda2
--- /dev/null
+++ b/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/ServletRequestListenerImpl.java
@@ -0,0 +1,34 @@
+/*=========================================================================
+ * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package com.gemstone.gemfire.modules.session.internal.filter;
+
+import javax.servlet.ServletRequestEvent;
+import javax.servlet.ServletRequestListener;
+
+/**
+ * @author jdeppe
+ */
+public class ServletRequestListenerImpl extends AbstractListener
+    implements ServletRequestListener {
+
+  public synchronized void requestDestroyed(ServletRequestEvent sre) {
+    events.add(ListenerEventType.SERVLET_REQUEST_DESTROYED);
+    latch.countDown();
+  }
+
+  public synchronized void requestInitialized(ServletRequestEvent sre) {
+    events.add(ListenerEventType.SERVLET_REQUEST_INITIALIZED);
+    latch.countDown();
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/SessionTestSuite1.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/SessionTestSuite1.java b/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/SessionTestSuite1.java
new file mode 100644
index 0000000..de80969
--- /dev/null
+++ b/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/SessionTestSuite1.java
@@ -0,0 +1,69 @@
+/*=========================================================================
+ * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+package com.gemstone.gemfire.modules.session.internal.filter;
+
+import com.gemstone.gemfire.modules.session.junit.SeparateClassloaderTestRunner;
+import com.mockrunner.mock.web.MockFilterConfig;
+import com.mockrunner.mock.web.WebMockObjectFactory;
+import com.mockrunner.servlet.ServletTestModule;
+
+import java.io.File;
+import javax.servlet.Filter;
+
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.runner.RunWith;
+
+/**
+ *
+ */
+@RunWith(SeparateClassloaderTestRunner.class)
+public class SessionTestSuite1 extends GemfireCacheTest {
+
+  private static Filter filter;
+
+  private static final File tmpdir;
+
+  private static final String gemfire_log;
+
+  static {
+    // Create a per-user scratch directory
+    tmpdir = new File(System.getProperty("java.io.tmpdir"),
+        "gemfire_modules-" + System.getProperty("user.name"));
+    tmpdir.mkdirs();
+    tmpdir.deleteOnExit();
+
+    gemfire_log = tmpdir.getPath() +
+        System.getProperty("file.separator") + "gemfire_modules.log";
+  }
+
+
+  @BeforeClass
+  public static void setupClass() throws Exception {
+    System.out.println("Executing " + SessionTestSuite1.class.getName());
+    WebMockObjectFactory factory = new WebMockObjectFactory();
+    MockFilterConfig config = factory.getMockFilterConfig();
+
+    config.setInitParameter("gemfire.property.mcast-port", "19991");
+    config.setInitParameter("gemfire.property.log-file", gemfire_log);
+    config.setInitParameter("gemfire.property.writable-working-dir",
+        tmpdir.getPath());
+    config.setInitParameter("cache-type", "peer-to-peer");
+    config.setInitParameter("close-cache-on-stop", "true");
+
+    factory.getMockServletContext().setContextPath("");
+
+    ServletTestModule module = new ServletTestModule(factory);
+    filter = module.createFilter(SessionCachingFilter.class);
+  }
+
+  @AfterClass
+  public static void teardownClass() throws Exception {
+    filter.destroy();
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/SessionTestSuite2.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/SessionTestSuite2.java b/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/SessionTestSuite2.java
new file mode 100644
index 0000000..d0c0ea0
--- /dev/null
+++ b/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/SessionTestSuite2.java
@@ -0,0 +1,68 @@
+/*=========================================================================
+ * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+package com.gemstone.gemfire.modules.session.internal.filter;
+
+import com.gemstone.gemfire.modules.session.junit.SeparateClassloaderTestRunner;
+import com.mockrunner.mock.web.MockFilterConfig;
+import com.mockrunner.mock.web.WebMockObjectFactory;
+import com.mockrunner.servlet.ServletTestModule;
+
+import java.io.File;
+import javax.servlet.Filter;
+
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.runner.RunWith;
+
+/**
+ *
+ */
+@RunWith(SeparateClassloaderTestRunner.class)
+public class SessionTestSuite2 extends GemfireCacheTest {
+
+  private static Filter filter;
+
+  private static final File tmpdir;
+
+  private static final String gemfire_log;
+
+  static {
+    // Create a per-user scratch directory
+    tmpdir = new File(System.getProperty("java.io.tmpdir"),
+        "gemfire_modules-" + System.getProperty("user.name"));
+    tmpdir.mkdirs();
+    tmpdir.deleteOnExit();
+
+    gemfire_log = tmpdir.getPath() +
+        System.getProperty("file.separator") + "gemfire_modules.log";
+  }
+
+  @BeforeClass
+  public static void setupClass() throws Exception {
+    System.out.println("Executing " + SessionTestSuite2.class.getName());
+    WebMockObjectFactory factory = new WebMockObjectFactory();
+    MockFilterConfig config = factory.getMockFilterConfig();
+
+    config.setInitParameter("mcast-port", "19991");
+    config.setInitParameter("gemfire.property.log-file", gemfire_log);
+    config.setInitParameter("gemfire.property.writable-working-dir",
+        tmpdir.getPath());
+    config.setInitParameter("cache-type", "peer-to-peer");
+    config.setInitParameter("gemfire.cache.enable_local_cache", "true");
+
+    factory.getMockServletContext().setContextPath("");
+
+    ServletTestModule module = new ServletTestModule(factory);
+    filter = module.createFilter(SessionCachingFilter.class);
+  }
+
+  @AfterClass
+  public static void teardownClass() throws Exception {
+    filter.destroy();
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/SessionUberSuite.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/SessionUberSuite.java b/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/SessionUberSuite.java
new file mode 100644
index 0000000..be9ffa0
--- /dev/null
+++ b/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/SessionUberSuite.java
@@ -0,0 +1,30 @@
+/*=========================================================================
+ * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+package com.gemstone.gemfire.modules.session.internal.filter;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+
+/**
+ * The goal of having a suite of suites is for each suite to be able to start up
+ * and shut down a unique cache with a different config. Currently a restart
+ * doesn't work... This is dependent on gemfire 6.5.1.4 which provides a unified
+ * classloading framework. Once that can be introduced here we can simply switch
+ * the URLClassLoader for a ChildFirstClassLoader and have the ability to run
+ * multiple caches in a single JVM. This should also allow us the ability to
+ * cleanly shut down a cache at the end of a test.
+ * <p/>
+ * To be continued...
+ */
+@RunWith(Suite.class)
+@Suite.SuiteClasses({
+  SessionTestSuite1.class,
+  SessionTestSuite2.class
+})
+public class SessionUberSuite {
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/filter/AbstractListener.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/filter/AbstractListener.java b/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/filter/AbstractListener.java
deleted file mode 100644
index 729786b..0000000
--- a/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/filter/AbstractListener.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-
-package com.gemstone.gemfire.modules.session.filter;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-
-/**
- * @author jdeppe
- */
-public abstract class AbstractListener {
-
-  protected final List<ListenerEventType> events =
-      new ArrayList<ListenerEventType>();
-
-  protected CountDownLatch latch;
-
-  public AbstractListener() {
-    this(1);
-  }
-
-  public AbstractListener(int numCalls) {
-    latch = new CountDownLatch(numCalls);
-  }
-
-  public void setLatch(int numCalls) {
-    latch = new CountDownLatch(numCalls);
-  }
-
-  public boolean await(long timeout,
-      TimeUnit unit) throws InterruptedException {
-    return latch.await(timeout, unit);
-  }
-
-  public List<ListenerEventType> getEvents() {
-    return events;
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/filter/BasicServlet.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/filter/BasicServlet.java b/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/filter/BasicServlet.java
deleted file mode 100644
index 00e3a5b..0000000
--- a/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/filter/BasicServlet.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-package com.gemstone.gemfire.modules.session.filter;
-
-import java.io.IOException;
-import javax.servlet.ServletConfig;
-import javax.servlet.ServletContext;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.eclipse.jetty.servlet.DefaultServlet;
-/**
- *
- */
-public class BasicServlet extends DefaultServlet {
-
-  Callback callback = null;
-
-  @Override
-  public void doGet(HttpServletRequest request, HttpServletResponse response)
-      throws IOException, ServletException {
-
-    if (callback != null) {
-      callback.call(request, response);
-    }
-  }
-
-  @Override
-  public void init(ServletConfig config) throws ServletException {
-    super.init(config);
-    ServletContext context = config.getServletContext();
-
-    String cbInitParam = config.getInitParameter("test.callback");
-    callback = (Callback) context.getAttribute(cbInitParam);
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/filter/Callback.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/filter/Callback.java b/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/filter/Callback.java
deleted file mode 100644
index d4bbd33..0000000
--- a/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/filter/Callback.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-
-package com.gemstone.gemfire.modules.session.filter;
-
-import java.io.IOException;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-/**
- * @author jdeppe
- */
-public interface Callback {
-  public void call(HttpServletRequest request,
-      HttpServletResponse response) throws IOException, ServletException;
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/filter/HttpSessionListenerImpl.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/filter/HttpSessionListenerImpl.java b/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/filter/HttpSessionListenerImpl.java
deleted file mode 100644
index 612546e..0000000
--- a/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/filter/HttpSessionListenerImpl.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-
-package com.gemstone.gemfire.modules.session.filter;
-
-import javax.servlet.http.HttpSession;
-import javax.servlet.http.HttpSessionEvent;
-import javax.servlet.http.HttpSessionListener;
-
-/**
- * @author jdeppe
- */
-public class HttpSessionListenerImpl extends AbstractListener
-    implements HttpSessionListener {
-
-  @Override
-  public void sessionCreated(HttpSessionEvent se) {
-    HttpSession gfeSession = SessionCachingFilter.getWrappingSession(
-        se.getSession());
-    gfeSession.setAttribute("gemfire-session-id", gfeSession.getId());
-    events.add(ListenerEventType.SESSION_CREATED);
-    latch.countDown();
-  }
-
-  @Override
-  public void sessionDestroyed(HttpSessionEvent se) {
-    events.add(ListenerEventType.SESSION_DESTROYED);
-    latch.countDown();
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/filter/HttpSessionListenerImpl2.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/filter/HttpSessionListenerImpl2.java b/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/filter/HttpSessionListenerImpl2.java
deleted file mode 100644
index f9f8819..0000000
--- a/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/filter/HttpSessionListenerImpl2.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-
-package com.gemstone.gemfire.modules.session.filter;
-
-import javax.servlet.http.HttpSession;
-import javax.servlet.http.HttpSessionEvent;
-import javax.servlet.http.HttpSessionListener;
-
-/**
- * @author jdeppe
- */
-public class HttpSessionListenerImpl2 extends AbstractListener
-    implements HttpSessionListener {
-
-  @Override
-  public void sessionCreated(HttpSessionEvent se) {
-    events.add(ListenerEventType.SESSION_CREATED);
-    latch.countDown();
-  }
-
-  @Override
-  public void sessionDestroyed(HttpSessionEvent se) {
-    HttpSession gfeSession = SessionCachingFilter.getWrappingSession(
-        se.getSession());
-    assert (gfeSession != null);
-    events.add(ListenerEventType.SESSION_DESTROYED);
-    latch.countDown();
-  }
-}


[09/24] incubator-geode git commit: GEODE-14: Adding integration tests from '-external'

Posted by je...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/db02660d/modules/gemfire-modules-session-external/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/SessionCachingFilter.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-external/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/SessionCachingFilter.java b/modules/gemfire-modules-session-external/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/SessionCachingFilter.java
deleted file mode 100644
index b3dada5..0000000
--- a/modules/gemfire-modules-session-external/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/SessionCachingFilter.java
+++ /dev/null
@@ -1,639 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-package com.gemstone.gemfire.modules.session.internal.filter;
-
-import com.gemstone.gemfire.modules.session.internal.filter.util.ThreadLocalSession;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.servlet.Filter;
-import javax.servlet.FilterChain;
-import javax.servlet.FilterConfig;
-import javax.servlet.ServletException;
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
-import javax.servlet.http.Cookie;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletRequestWrapper;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpServletResponseWrapper;
-import javax.servlet.http.HttpSession;
-import java.io.IOException;
-import java.io.PrintStream;
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.security.Principal;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.atomic.AtomicInteger;
-
-/**
- * Primary class which orchestrates everything. This is the class which gets
- * configured in the web.xml.
- */
-public class SessionCachingFilter implements Filter {
-
-  /**
-   * Logger instance
-   */
-  private static final Logger LOG =
-      LoggerFactory.getLogger(SessionCachingFilter.class.getName());
-
-  /**
-   * The filter configuration object we are associated with.  If this value is
-   * null, this filter instance is not currently configured.
-   */
-  private FilterConfig filterConfig = null;
-
-  /**
-   * Some containers will want to instantiate multiple instances of this filter,
-   * but we only need one SessionManager
-   */
-  private static SessionManager manager = null;
-
-  /**
-   * Can be overridden during testing.
-   */
-  private static AtomicInteger started =
-      new AtomicInteger(
-          Integer.getInteger("gemfire.override.session.manager.count", 1));
-
-  private static int percentInactiveTimeTriggerRebuild =
-      Integer.getInteger("gemfire.session.inactive.trigger.rebuild", 80);
-
-  /**
-   * This latch ensures that at least one thread/instance has fired up the
-   * session manager before any other threads complete the init method.
-   */
-  private static CountDownLatch startingLatch = new CountDownLatch(1);
-
-  /**
-   * This request wrapper class extends the support class
-   * HttpServletRequestWrapper, which implements all the methods in the
-   * HttpServletRequest interface, as delegations to the wrapped request. You
-   * only need to override the methods that you need to change. You can get
-   * access to the wrapped request using the method getRequest()
-   */
-  public static class RequestWrapper extends HttpServletRequestWrapper {
-
-    private static final String URL_SESSION_IDENTIFIER = ";jsessionid=";
-
-    private ResponseWrapper response;
-
-    private boolean sessionFromCookie = false;
-
-    private boolean sessionFromURL = false;
-
-    private String requestedSessionId = null;
-
-    private GemfireHttpSession session = null;
-
-    private SessionManager manager;
-
-    private HttpServletRequest outerRequest = null;
-
-    /**
-     * Need to save this in case we need the original {@code RequestDispatcher}
-     */
-    private HttpServletRequest originalRequest;
-
-    public RequestWrapper(SessionManager manager,
-        HttpServletRequest request,
-        ResponseWrapper response) {
-
-      super(request);
-      this.response = response;
-      this.manager = manager;
-      this.originalRequest = request;
-
-      final Cookie[] cookies = request.getCookies();
-      if (cookies != null) {
-        for (final Cookie cookie : cookies) {
-          if (cookie.getName().equalsIgnoreCase(
-              manager.getSessionCookieName()) &&
-              cookie.getValue().endsWith("-GF")) {
-            requestedSessionId = cookie.getValue();
-            sessionFromCookie = true;
-
-            LOG.debug("Cookie contains sessionId: {}",
-                requestedSessionId);
-          }
-        }
-      }
-
-      if (requestedSessionId == null) {
-        requestedSessionId = extractSessionId();
-        LOG.debug("Extracted sessionId from URL {}", requestedSessionId);
-        if (requestedSessionId != null) {
-          sessionFromURL = true;
-        }
-      }
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public HttpSession getSession() {
-      return getSession(true);
-    }
-
-    /**
-     * Create our own sessions. TODO: Handle invalidated sessions
-     *
-     * @return a HttpSession
-     */
-    @Override
-    public HttpSession getSession(boolean create) {
-      if (session != null && session.isValid()) {
-        session.setIsNew(false);
-        session.updateAccessTime();
-                /*
-                 * This is a massively gross hack. Currently, there is no way
-                 * to actually update the last accessed time for a session, so
-                 * what we do here is once we're into X% of the session's TTL
-                 * we grab a new session from the container.
-                 *
-                 * (inactive * 1000) * (pct / 100) ==> (inactive * 10 * pct)
-                 */
-        if (session.getLastAccessedTime() - session.getCreationTime() >
-            (session.getMaxInactiveInterval() * 10 * percentInactiveTimeTriggerRebuild)) {
-          HttpSession nativeSession = super.getSession();
-          session.failoverSession(nativeSession);
-        }
-        return session;
-      }
-
-      if (requestedSessionId != null) {
-        session = (GemfireHttpSession) manager.getSession(
-            requestedSessionId);
-        if (session != null) {
-          session.setIsNew(false);
-          // This means we've failed over to another node
-          if (session.getNativeSession() == null) {
-            try {
-              ThreadLocalSession.set(session);
-              HttpSession nativeSession = super.getSession();
-              session.failoverSession(nativeSession);
-              session.putInRegion();
-            } finally {
-              ThreadLocalSession.remove();
-            }
-          }
-        }
-      }
-
-      if (session == null || !session.isValid()) {
-        if (create) {
-          try {
-            session = (GemfireHttpSession) manager.wrapSession(null);
-            ThreadLocalSession.set(session);
-            HttpSession nativeSession = super.getSession();
-            if (session.getNativeSession() == null) {
-              session.setNativeSession(nativeSession);
-            } else {
-              assert (session.getNativeSession() == nativeSession);
-            }
-            session.setIsNew(true);
-            manager.putSession(session);
-          } finally {
-            ThreadLocalSession.remove();
-          }
-        } else {
-          // create is false, and session is either null or not valid.
-          // The spec says return a null:
-          return null;
-        }
-      }
-
-      if (session != null) {
-        addSessionCookie(response);
-        session.updateAccessTime();
-      }
-
-      return session;
-    }
-
-    private void addSessionCookie(HttpServletResponse response) {
-      // Don't bother if the response is already committed
-      if (response.isCommitted()) {
-        return;
-      }
-
-      // Get the existing cookies
-      Cookie[] cookies = getCookies();
-
-      Cookie cookie = new Cookie(manager.getSessionCookieName(),
-          session.getId());
-      cookie.setPath("".equals(getContextPath()) ? "/" : getContextPath());
-      // Clear out all old cookies and just set ours
-      response.addCookie(cookie);
-
-      // Replace all other cookies which aren't JSESSIONIDs
-      if (cookies != null) {
-        for (Cookie c : cookies) {
-          if (manager.getSessionCookieName().equals(c.getName())) {
-            continue;
-          }
-          response.addCookie(c);
-        }
-      }
-
-    }
-
-    private String getCookieString(Cookie c) {
-      StringBuilder cookie = new StringBuilder();
-      cookie.append(c.getName()).append("=").append(c.getValue());
-
-      if (c.getPath() != null) {
-        cookie.append("; ").append("Path=").append(c.getPath());
-      }
-      if (c.getDomain() != null) {
-        cookie.append("; ").append("Domain=").append(c.getDomain());
-      }
-      if (c.getSecure()) {
-        cookie.append("; ").append("Secure");
-      }
-
-      cookie.append("; HttpOnly");
-
-      return cookie.toString();
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public boolean isRequestedSessionIdFromCookie() {
-      return sessionFromCookie;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public boolean isRequestedSessionIdFromURL() {
-      return sessionFromURL;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public String getRequestedSessionId() {
-      if (requestedSessionId != null) {
-        return requestedSessionId;
-      } else {
-        return super.getRequestedSessionId();
-      }
-    }
-
-        /*
-         * Hmmm... not sure if this is right or even good to do. So, in some
-         * cases - for ex. using a Spring security filter, we have 3 possible
-         * wrappers to deal with - the original, this one and one created by
-         * Spring. When a servlet or JSP is forwarded to the original request
-         * is passed in, but then this (the wrapped) request is used by the JSP.
-         * In some cases, the outer wrapper also contains information relevant
-         * to the request - in this case security info. So here we allow access
-         * to that. There's probably a better way....
-         */
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public Principal getUserPrincipal() {
-      if (outerRequest != null) {
-        return outerRequest.getUserPrincipal();
-      } else {
-        return super.getUserPrincipal();
-      }
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public String getRemoteUser() {
-      if (outerRequest != null) {
-        return outerRequest.getRemoteUser();
-      } else {
-        return super.getRemoteUser();
-      }
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    public boolean isUserInRole(String role) {
-      if (outerRequest != null) {
-        return outerRequest.isUserInRole(role);
-      } else {
-        return super.isUserInRole(role);
-      }
-    }
-
-    //////////////////////////////////////////////////////////////
-    // Non-API methods
-
-    void setOuterWrapper(HttpServletRequest outer) {
-      this.outerRequest = outer;
-    }
-
-    //////////////////////////////////////////////////////////////
-    // Private methods
-    private String extractSessionId() {
-      final int prefix = getRequestURL().indexOf(URL_SESSION_IDENTIFIER);
-      if (prefix != -1) {
-        final int start = prefix + URL_SESSION_IDENTIFIER.length();
-        int suffix = getRequestURL().indexOf("?", start);
-        if (suffix < 0) {
-          suffix = getRequestURL().indexOf("#", start);
-        }
-        if (suffix <= prefix) {
-          return getRequestURL().substring(start);
-        }
-        return getRequestURL().substring(start, suffix);
-      }
-      return null;
-    }
-  }
-
-  /**
-   * This response wrapper class extends the support class
-   * HttpServletResponseWrapper, which implements all the methods in the
-   * HttpServletResponse interface, as delegations to the wrapped response. You
-   * only need to override the methods that you need to change. You can get
-   * access to the wrapped response using the method getResponse()
-   */
-  class ResponseWrapper extends HttpServletResponseWrapper {
-
-    HttpServletResponse originalResponse;
-
-    public ResponseWrapper(HttpServletResponse response) throws IOException {
-      super(response);
-      originalResponse = response;
-    }
-
-    public HttpServletResponse getOriginalResponse() {
-      return originalResponse;
-    }
-
-    @Override
-    public void setHeader(String name, String value) {
-      super.setHeader(name, value);
-    }
-
-    @Override
-    public void setIntHeader(String name, int value) {
-      super.setIntHeader(name, value);
-    }
-  }
-
-
-  public SessionCachingFilter() {
-  }
-
-  /**
-   * @param request  The servlet request we are processing
-   * @param response The servlet response we are creating
-   * @param chain    The filter chain we are processing
-   * @throws IOException      if an input/output error occurs
-   * @throws ServletException if a servlet error occurs
-   */
-  @Override
-  public void doFilter(ServletRequest request, ServletResponse response,
-      FilterChain chain)
-      throws IOException, ServletException {
-
-    HttpServletRequest httpReq = (HttpServletRequest) request;
-    HttpServletResponse httpResp = (HttpServletResponse) response;
-
-    /**
-     * Early out if this isn't the right kind of request. We might see a
-     * RequestWrapper instance during a forward or include request.
-     */
-    if (request instanceof RequestWrapper ||
-        !(request instanceof HttpServletRequest)) {
-      LOG.debug("Handling already-wrapped request");
-      chain.doFilter(request, response);
-      return;
-    }
-
-    // Create wrappers for the request and response objects.
-    // Using these, you can extend the capabilities of the
-    // request and response, for example, allow setting parameters
-    // on the request before sending the request to the rest of the filter chain,
-    // or keep track of the cookies that are set on the response.
-    //
-    // Caveat: some servers do not handle wrappers very well for forward or
-    // include requests.
-
-    ResponseWrapper wrappedResponse = new ResponseWrapper(httpResp);
-    final RequestWrapper wrappedRequest =
-        new RequestWrapper(manager, httpReq, wrappedResponse);
-
-    Throwable problem = null;
-
-    try {
-      chain.doFilter(wrappedRequest, wrappedResponse);
-    } catch (Throwable t) {
-      // If an exception is thrown somewhere down the filter chain,
-      // we still want to execute our after processing, and then
-      // rethrow the problem after that.
-      problem = t;
-      LOG.error("Exception processing filter chain", t);
-    }
-
-    GemfireHttpSession session =
-        (GemfireHttpSession) wrappedRequest.getSession(false);
-
-    // If there was a problem, we want to rethrow it if it is
-    // a known type, otherwise log it.
-    if (problem != null) {
-      if (problem instanceof ServletException) {
-        throw (ServletException) problem;
-      }
-      if (problem instanceof IOException) {
-        throw (IOException) problem;
-      }
-      sendProcessingError(problem, response);
-    }
-
-    /**
-     * Commit any updates. What actually happens at that point is
-     * dependent on the type of attributes defined for use by the sessions.
-     */
-    if (session != null) {
-      session.commit();
-    }
-  }
-
-  /**
-   * Return the filter configuration object for this filter.
-   */
-  public FilterConfig getFilterConfig() {
-    return (this.filterConfig);
-  }
-
-  /**
-   * Set the filter configuration object for this filter.
-   *
-   * @param filterConfig The filter configuration object
-   */
-  public void setFilterConfig(FilterConfig filterConfig) {
-    this.filterConfig = filterConfig;
-  }
-
-  /**
-   * Destroy method for this filter
-   */
-  @Override
-  public void destroy() {
-    if (manager != null) {
-      manager.stop();
-    }
-  }
-
-  /**
-   * This is where all the initialization happens.
-   *
-   * @param config
-   * @throws ServletException
-   */
-  @Override
-  public void init(final FilterConfig config) {
-    LOG.info("Starting Session Filter initialization");
-    this.filterConfig = config;
-
-    if (started.getAndDecrement() > 0) {
-      /**
-       * Allow override for testing purposes
-       */
-      String managerClassStr =
-          config.getInitParameter("session-manager-class");
-
-      // Otherwise default
-      if (managerClassStr == null) {
-        managerClassStr = GemfireSessionManager.class.getName();
-      }
-
-      try {
-        manager = (SessionManager) Class.forName(
-            managerClassStr).newInstance();
-        manager.start(config, this.getClass().getClassLoader());
-      } catch (Exception ex) {
-        LOG.error("Exception creating Session Manager", ex);
-      }
-
-      startingLatch.countDown();
-    } else {
-      try {
-        startingLatch.await();
-      } catch (InterruptedException iex) {
-      }
-
-      LOG.debug("SessionManager and listener initialization skipped - "
-          + "already done.");
-    }
-
-    LOG.info("Session Filter initialization complete");
-    LOG.debug("Filter class loader {}", this.getClass().getClassLoader());
-  }
-
-  /**
-   * Return a String representation of this object.
-   */
-  @Override
-  public String toString() {
-    if (filterConfig == null) {
-      return ("SessionCachingFilter()");
-    }
-    StringBuilder sb = new StringBuilder("SessionCachingFilter(");
-    sb.append(filterConfig);
-    sb.append(")");
-    return (sb.toString());
-
-  }
-
-
-  private void sendProcessingError(Throwable t, ServletResponse response) {
-    String stackTrace = getStackTrace(t);
-
-    if (stackTrace != null && !stackTrace.equals("")) {
-      try {
-        response.setContentType("text/html");
-        PrintStream ps = new PrintStream(response.getOutputStream());
-        PrintWriter pw = new PrintWriter(ps);
-        pw.print(
-            "<html>\n<head>\n<title>Error</title>\n</head>\n<body>\n"); //NOI18N
-
-        // PENDING! Localize this for next official release
-        pw.print("<h1>The resource did not process correctly</h1>\n<pre>\n");
-        pw.print(stackTrace);
-        pw.print("</pre></body>\n</html>"); //NOI18N
-        pw.close();
-        ps.close();
-        response.getOutputStream().close();
-      } catch (Exception ex) {
-      }
-    } else {
-      try {
-        PrintStream ps = new PrintStream(response.getOutputStream());
-        t.printStackTrace(ps);
-        ps.close();
-        response.getOutputStream().close();
-      } catch (Exception ex) {
-      }
-    }
-  }
-
-  public static String getStackTrace(Throwable t) {
-    String stackTrace = null;
-    try {
-      StringWriter sw = new StringWriter();
-      PrintWriter pw = new PrintWriter(sw);
-      t.printStackTrace(pw);
-      pw.close();
-      sw.close();
-      stackTrace = sw.getBuffer().toString();
-    } catch (Exception ex) {
-    }
-    return stackTrace;
-  }
-
-  /**
-   * Retrieve the SessionManager. This is only here so that tests can get access
-   * to the cache.
-   */
-  static SessionManager getSessionManager() {
-    return manager;
-  }
-
-  /**
-   * Return the GemFire session which wraps a native session
-   *
-   * @param nativeSession the native session for which the corresponding GemFire
-   *                      session should be returned.
-   * @return the GemFire session or null if no session maps to the native
-   * session
-   */
-  public static HttpSession getWrappingSession(HttpSession nativeSession) {
-        /*
-         * This is a special case where the GemFire session has been set as a
-         * ThreadLocal during session creation.
-         */
-    GemfireHttpSession gemfireSession = (GemfireHttpSession) ThreadLocalSession.get();
-    if (gemfireSession != null) {
-      gemfireSession.setNativeSession(nativeSession);
-      return gemfireSession;
-    }
-    return getSessionManager().getWrappingSession(nativeSession.getId());
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/db02660d/modules/gemfire-modules-session-external/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/SessionListener.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-external/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/SessionListener.java b/modules/gemfire-modules-session-external/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/SessionListener.java
deleted file mode 100644
index 254fafe..0000000
--- a/modules/gemfire-modules-session-external/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/SessionListener.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-package com.gemstone.gemfire.modules.session.internal.filter;
-
-import com.gemstone.gemfire.distributed.DistributedSystemDisconnectedException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.servlet.http.HttpSessionEvent;
-import javax.servlet.http.HttpSessionListener;
-
-public class SessionListener implements HttpSessionListener {
-
-  private static final Logger LOG =
-      LoggerFactory.getLogger(SessionListener.class.getName());
-
-  public void sessionCreated(HttpSessionEvent httpSessionEvent) {
-  }
-
-  /**
-   * This will receive events from the container using the native sessions.
-   */
-  public void sessionDestroyed(HttpSessionEvent event) {
-    String nativeId = event.getSession().getId();
-    try {
-      String sessionId = SessionCachingFilter.getSessionManager().destroyNativeSession(
-          nativeId);
-      LOG.debug(
-          "Received sessionDestroyed event for native session {} (wrapped by {})",
-          nativeId, sessionId);
-    } catch (DistributedSystemDisconnectedException dex) {
-      LOG.debug("Cache disconnected - unable to destroy native session {0}",
-          nativeId);
-    }
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/db02660d/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/AbstractListener.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/AbstractListener.java b/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/AbstractListener.java
deleted file mode 100644
index 94dc07f..0000000
--- a/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/AbstractListener.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-
-package com.gemstone.gemfire.modules.session.internal.filter;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-
-/**
- * @author jdeppe
- */
-public abstract class AbstractListener {
-
-  protected final List<ListenerEventType> events =
-      new ArrayList<ListenerEventType>();
-
-  protected CountDownLatch latch;
-
-  public AbstractListener() {
-    this(1);
-  }
-
-  public AbstractListener(int numCalls) {
-    latch = new CountDownLatch(numCalls);
-    RendezvousManager.registerListener(this);
-  }
-
-  public synchronized void setLatch(int numCalls) {
-    latch = new CountDownLatch(numCalls);
-    events.clear();
-  }
-
-  public boolean await(long timeout,
-      TimeUnit unit) throws InterruptedException {
-    return latch.await(timeout, unit);
-  }
-
-  public List<ListenerEventType> getEvents() {
-    return events;
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/db02660d/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/Callback.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/Callback.java b/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/Callback.java
deleted file mode 100644
index ab74084..0000000
--- a/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/Callback.java
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-
-package com.gemstone.gemfire.modules.session.internal.filter;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-/**
- * @author jdeppe
- */
-public interface Callback {
-  public void call(HttpServletRequest request,
-      HttpServletResponse response);
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/db02660d/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/CallbackServlet.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/CallbackServlet.java b/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/CallbackServlet.java
deleted file mode 100644
index f9d2971..0000000
--- a/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/CallbackServlet.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-package com.gemstone.gemfire.modules.session.internal.filter;
-
-import java.io.IOException;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-/**
- * @author jdeppe
- */
-public class CallbackServlet extends HttpServlet {
-
-  private Callback callback;
-
-  /**
-   * Processes requests for both HTTP <code>GET</code> and <code>POST</code>
-   * methods.
-   *
-   * @param request  servlet request
-   * @param response servlet response
-   * @throws ServletException if a servlet-specific error occurs
-   * @throws IOException      if an I/O error occurs
-   */
-  protected void processRequest(HttpServletRequest request,
-      HttpServletResponse response)
-      throws ServletException, IOException {
-
-    if (callback != null) {
-      callback.call(request, response);
-    }
-  }
-
-  public void setCallback(Callback callback) {
-    this.callback = callback;
-  }
-
-  /**
-   * Handles the HTTP <code>GET</code> method.
-   *
-   * @param request  servlet request
-   * @param response servlet response
-   * @throws ServletException if a servlet-specific error occurs
-   * @throws IOException      if an I/O error occurs
-   */
-  @Override
-  protected void doGet(HttpServletRequest request, HttpServletResponse response)
-      throws ServletException, IOException {
-    processRequest(request, response);
-  }
-
-  /**
-   * Handles the HTTP <code>POST</code> method.
-   *
-   * @param request  servlet request
-   * @param response servlet response
-   * @throws ServletException if a servlet-specific error occurs
-   * @throws IOException      if an I/O error occurs
-   */
-  @Override
-  protected void doPost(HttpServletRequest request,
-      HttpServletResponse response)
-      throws ServletException, IOException {
-    processRequest(request, response);
-  }
-
-  /**
-   * Returns a short description of the servlet.
-   *
-   * @return a String containing servlet description
-   */
-  @Override
-  public String getServletInfo() {
-    return "Short description";
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/db02660d/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/CommonTests.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/CommonTests.java b/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/CommonTests.java
deleted file mode 100644
index b9a9a01..0000000
--- a/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/CommonTests.java
+++ /dev/null
@@ -1,582 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-package com.gemstone.gemfire.modules.session.internal.filter;
-
-import com.mockrunner.mock.web.MockHttpServletRequest;
-import com.mockrunner.mock.web.MockHttpServletResponse;
-import com.mockrunner.mock.web.MockHttpSession;
-import com.mockrunner.servlet.BasicServletTestCaseAdapter;
-import org.junit.After;
-import org.junit.Ignore;
-import org.junit.Test;
-
-import java.util.concurrent.TimeUnit;
-import javax.servlet.http.Cookie;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpSession;
-import javax.servlet.http.HttpSessionAttributeListener;
-
-import static junit.framework.Assert.assertEquals;
-import static org.junit.Assert.*;
-
-/**
- * This servlet tests the effects of the downstream SessionCachingFilter filter.
- * When these tests are performed, the filter would already have taken effect.
- */
-public abstract class CommonTests extends BasicServletTestCaseAdapter {
-
-  protected static final String CONTEXT_PATH = "/test";
-
-  @After
-  public void tearDown() throws Exception {
-    super.tearDown();
-  }
-
-  @Test
-  public void testGetSession1() throws Exception {
-    doFilter();
-    HttpSession session1 =
-        ((HttpServletRequest) getFilteredRequest()).getSession();
-    HttpSession session2 =
-        ((HttpServletRequest) getFilteredRequest()).getSession();
-
-    assertSame("Session should be the same", session1, session2);
-  }
-
-  @Test
-  public void testGetSession2() throws Exception {
-    doFilter();
-
-    HttpSession session1 = ((HttpServletRequest) getFilteredRequest()).getSession();
-
-    MockHttpServletResponse response = getWebMockObjectFactory().getMockResponse();
-    Cookie cookie = (Cookie) response.getCookies().get(0);
-    getWebMockObjectFactory().getMockRequest().addCookie(cookie);
-
-    doFilter();
-
-    HttpSession session2 = ((HttpServletRequest) getFilteredRequest()).getSession();
-
-    assertEquals("Session objects across requests should be the same", session1, session2);
-  }
-
-  @Test
-  public void testGetAttributeRequest1() throws Exception {
-    doFilter();
-
-    getFilteredRequest().setAttribute("foo", "bar");
-
-    assertEquals("bar", getFilteredRequest().getAttribute("foo"));
-    assertNull("Unknown attribute should be null",
-        getFilteredRequest().getAttribute("baz"));
-  }
-
-  @Test
-  public void testGetAttributeRequest2() throws Exception {
-    // Setup
-    CallbackServlet s = (CallbackServlet) getServlet();
-    s.setCallback(new Callback() {
-      @Override
-      public void call(HttpServletRequest request, HttpServletResponse response) {
-        request.setAttribute("foo", "bar");
-      }
-    });
-    doFilter();
-
-    assertEquals("bar", getFilteredRequest().getAttribute("foo"));
-    assertNull("Unknown attribute should be null",
-        getFilteredRequest().getAttribute("baz"));
-  }
-
-  @Test
-  public void testGetAttributeSession1() throws Exception {
-    doFilter();
-
-    ((HttpServletRequest) getFilteredRequest()).getSession().setAttribute("foo", "bar");
-
-    HttpServletRequest request = (HttpServletRequest) getFilteredRequest();
-    assertEquals("bar", request.getSession().getAttribute("foo"));
-  }
-
-  /**
-   * Are attributes preserved across client requests?
-   */
-  @Test
-  public void testGetAttributeSession2() throws Exception {
-    doFilter();
-
-    ((HttpServletRequest) getFilteredRequest()).getSession().setAttribute("foo", "bar");
-
-    MockHttpServletResponse response = getWebMockObjectFactory().getMockResponse();
-    Cookie cookie = (Cookie) response.getCookies().get(0);
-    getWebMockObjectFactory().getMockRequest().addCookie(cookie);
-
-    doFilter();
-    HttpServletRequest request = (HttpServletRequest) getFilteredRequest();
-
-    assertEquals("bar", request.getSession().getAttribute("foo"));
-  }
-
-  /**
-   * Setting a session attribute to null should remove it
-   */
-  @Test
-  public void testSetAttributeNullSession1() throws Exception {
-    // Setup
-    CallbackServlet s = (CallbackServlet) getServlet();
-    s.setCallback(new Callback() {
-      private boolean called = false;
-
-      @Override
-      public void call(HttpServletRequest request, HttpServletResponse response) {
-        if (called) {
-          request.getSession().setAttribute("foo", null);
-        } else {
-          request.getSession().setAttribute("foo", "bar");
-          called = true;
-        }
-      }
-    });
-
-    doFilter();
-    doFilter();
-
-    HttpSession session = ((HttpServletRequest) getFilteredRequest()).getSession();
-
-    String attr = (String) session.getAttribute("foo");
-    assertNull("Attribute should be null but is " + attr, attr);
-  }
-
-
-  /**
-   * Test that various methods throw the appropriate exception when the session is
-   * invalid.
-   */
-  @Test
-  public void testInvalidate1() throws Exception {
-    doFilter();
-
-    HttpSession session = ((HttpServletRequest) getFilteredRequest()).getSession();
-    session.invalidate();
-
-    try {
-      session.getAttribute("foo");
-      fail("Session should be invalid and an exception should be thrown");
-    } catch (IllegalStateException iex) {
-      // Pass
-    }
-  }
-
-  @Test
-  public void testInvalidate2() throws Exception {
-    doFilter();
-
-    HttpSession session = ((HttpServletRequest) getFilteredRequest()).getSession();
-    session.invalidate();
-
-    try {
-      session.getAttributeNames();
-      fail("Session should be invalid and an exception should be thrown");
-    } catch (IllegalStateException iex) {
-      // Pass
-    }
-  }
-
-  @Ignore(value = "until mockrunner 1.0.9 - see pull request #23")
-  public void testInvalidate3() throws Exception {
-    doFilter();
-
-    HttpSession session = ((HttpServletRequest) getFilteredRequest()).getSession();
-    session.invalidate();
-
-    try {
-      session.getCreationTime();
-      fail("Session should be invalid and an exception should be thrown");
-    } catch (IllegalStateException iex) {
-      // Pass
-    }
-  }
-
-  @Test
-  public void testInvalidate4() throws Exception {
-    doFilter();
-
-    HttpSession session = ((HttpServletRequest) getFilteredRequest()).getSession();
-    session.invalidate();
-
-    try {
-      session.getId();
-    } catch (Exception iex) {
-      fail("Exception should not be thrown");
-    }
-  }
-
-  @Test
-  public void testInvalidate5() throws Exception {
-    doFilter();
-
-    HttpSession session = ((HttpServletRequest) getFilteredRequest()).getSession();
-    session.invalidate();
-
-    try {
-      session.getLastAccessedTime();
-      fail("Session should be invalid and an exception should be thrown");
-    } catch (IllegalStateException iex) {
-      // Pass
-    }
-  }
-
-  @Test
-  public void testInvalidate6() throws Exception {
-    doFilter();
-
-    HttpSession session = ((HttpServletRequest) getFilteredRequest()).getSession();
-    session.invalidate();
-
-    try {
-      session.getMaxInactiveInterval();
-    } catch (Exception ex) {
-      fail("Exception should not be thrown");
-    }
-  }
-
-  @Test
-  public void testInvalidate7() throws Exception {
-    doFilter();
-
-    HttpSession session = ((HttpServletRequest) getFilteredRequest()).getSession();
-    session.invalidate();
-
-    try {
-      session.getServletContext();
-    } catch (Exception ex) {
-      fail("Exception should not be thrown");
-    }
-  }
-
-  @Test
-  public void testInvalidate8() throws Exception {
-    doFilter();
-
-    HttpSession session = ((HttpServletRequest) getFilteredRequest()).getSession();
-    session.invalidate();
-
-    try {
-      session.isNew();
-      fail("Session should be invalid and an exception should be thrown");
-    } catch (IllegalStateException iex) {
-      // Pass
-    }
-  }
-
-  @Test
-  public void testInvalidate9() throws Exception {
-    doFilter();
-
-    HttpSession session = ((HttpServletRequest) getFilteredRequest()).getSession();
-    session.invalidate();
-
-    try {
-      session.removeAttribute("foo");
-      fail("Session should be invalid and an exception should be thrown");
-    } catch (IllegalStateException iex) {
-      // Pass
-    }
-  }
-
-  @Test
-  public void testInvalidate10() throws Exception {
-    doFilter();
-
-    HttpSession session = ((HttpServletRequest) getFilteredRequest()).getSession();
-    session.invalidate();
-
-    try {
-      session.setAttribute("foo", "bar");
-      fail("Session should be invalid and an exception should be thrown");
-    } catch (IllegalStateException iex) {
-      // Pass
-    }
-  }
-
-  @Test
-  public void testInvalidate11() throws Exception {
-    doFilter();
-
-    HttpSession session = ((HttpServletRequest) getFilteredRequest()).getSession();
-    session.invalidate();
-
-    try {
-      session.setMaxInactiveInterval(1);
-    } catch (Exception ex) {
-      fail("Exception should not be thrown");
-    }
-  }
-
-  /**
-   * Test that Session Attribute events get triggered
-   */
-  @Test
-  public void testSessionAttributeListener1() throws Exception {
-    AbstractListener listener = new HttpSessionAttributeListenerImpl();
-    RendezvousManager.registerListener(listener);
-    listener.setLatch(3);
-
-    doFilter();
-
-    // Ugh
-    MockHttpSession session = (MockHttpSession) ((GemfireHttpSession) ((HttpServletRequest) getFilteredRequest()).getSession()).getNativeSession();
-    session.addAttributeListener((HttpSessionAttributeListener) listener);
-    session.setAttribute("foo", "bar");
-    session.setAttribute("foo", "baz");
-    session.setAttribute("foo", null);
-
-    assertTrue("Event timeout", listener.await(1, TimeUnit.SECONDS));
-    assertEquals(ListenerEventType.SESSION_ATTRIBUTE_ADDED, listener.getEvents().get(0));
-    assertEquals(ListenerEventType.SESSION_ATTRIBUTE_REPLACED,
-        listener.getEvents().get(1));
-    assertEquals(ListenerEventType.SESSION_ATTRIBUTE_REMOVED,
-        listener.getEvents().get(2));
-  }
-
-  /**
-   * Test that both replace and remove events get triggered
-   */
-  @Test
-  public void testHttpSessionBindingListener1() throws Exception {
-    doFilter();
-
-    HttpSession session =
-        ((HttpServletRequest) getFilteredRequest()).getSession();
-
-    HttpSessionBindingListenerImpl listener1 =
-        new HttpSessionBindingListenerImpl(2);
-    HttpSessionBindingListenerImpl listener2 =
-        new HttpSessionBindingListenerImpl(2);
-
-    session.setAttribute("foo", listener1);
-    session.setAttribute("foo", listener2);
-    session.setAttribute("foo", null);
-
-    assertTrue("Event timeout", listener1.await(1, TimeUnit.SECONDS));
-    assertTrue("Event timeout", listener2.await(1, TimeUnit.SECONDS));
-
-    assertEquals("Event list size incorrect", 2, listener1.getEvents().size());
-    assertEquals("Event list size incorrect", 2, listener2.getEvents().size());
-    assertEquals(ListenerEventType.SESSION_VALUE_BOUND, listener1.getEvents().get(0));
-    assertEquals(ListenerEventType.SESSION_VALUE_UNBOUND,
-        listener1.getEvents().get(1));
-    assertEquals(ListenerEventType.SESSION_VALUE_BOUND, listener2.getEvents().get(0));
-    assertEquals(ListenerEventType.SESSION_VALUE_UNBOUND,
-        listener2.getEvents().get(1));
-  }
-
-  @Test
-  public void testGetId1() throws Exception {
-    doFilter();
-
-    assertNotNull("Session Id should not be null",
-        ((HttpServletRequest) getFilteredRequest()).getSession().getId());
-  }
-
-  /**
-   * Test that multiple calls from the same client return the same session id
-   */
-  @Test
-  public void testGetId2() throws Exception {
-    doFilter();
-
-    String sessionId = ((HttpServletRequest) getFilteredRequest()).getSession().getId();
-
-    MockHttpServletResponse response = getWebMockObjectFactory().getMockResponse();
-    Cookie cookie = (Cookie) response.getCookies().get(0);
-    getWebMockObjectFactory().getMockRequest().addCookie(cookie);
-
-    doFilter();
-
-    assertEquals("Session Ids should be the same", sessionId,
-        ((HttpServletRequest) getFilteredRequest()).getSession().getId());
-  }
-
-  @Test
-  public void testGetCreationTime1() throws Exception {
-    doFilter();
-
-    HttpServletRequest request = (HttpServletRequest) getFilteredRequest();
-    assertTrue("Session should have a non-zero creation time",
-        request.getSession().getCreationTime() > 0);
-  }
-
-
-  /**
-   * Test that multiple calls from the same client don't change the creation time.
-   */
-  @Test
-  public void testGetCreationTime2() throws Exception {
-    doFilter();
-
-    long creationTime = ((HttpServletRequest) getFilteredRequest()).getSession().getCreationTime();
-
-    MockHttpServletResponse response = getWebMockObjectFactory().getMockResponse();
-    Cookie cookie = (Cookie) response.getCookies().get(0);
-    getWebMockObjectFactory().getMockRequest().addCookie(cookie);
-
-    doFilter();
-
-    assertEquals("Session creation time should be the same", creationTime,
-        ((HttpServletRequest) getFilteredRequest()).getSession().getCreationTime());
-  }
-
-  @Test
-  public void testResponseContainsRequestedSessionId1() throws Exception {
-    Cookie cookie = new Cookie("JSESSIONID", "999-GF");
-    getWebMockObjectFactory().getMockRequest().addCookie(cookie);
-
-    doFilter();
-
-    HttpServletRequest request = (HttpServletRequest) getFilteredRequest();
-
-    assertEquals("Request does not contain requested session ID", "999-GF",
-        request.getRequestedSessionId());
-  }
-
-  @Test
-  public void testGetLastAccessedTime1() throws Exception {
-    doFilter();
-
-    HttpServletRequest request = (HttpServletRequest) getFilteredRequest();
-    assertTrue("Session should have a non-zero last access time",
-        request.getSession().getLastAccessedTime() > 0);
-  }
-
-
-  /**
-   * Test that repeated accesses update the last accessed time
-   */
-  @Test
-  public void testGetLastAccessedTime2() throws Exception {
-    // Setup
-    CallbackServlet s = (CallbackServlet) getServlet();
-    s.setCallback(new Callback() {
-
-      @Override
-      public void call(HttpServletRequest request, HttpServletResponse response) {
-        request.getSession();
-      }
-    });
-
-    doFilter();
-
-    HttpServletRequest request = (HttpServletRequest) getFilteredRequest();
-    long lastAccess = request.getSession().getLastAccessedTime();
-    assertTrue("Session should have a non-zero last access time", lastAccess > 0);
-
-    MockHttpServletResponse response = getWebMockObjectFactory().getMockResponse();
-    Cookie cookie = (Cookie) response.getCookies().get(0);
-
-    MockHttpServletRequest mRequest = getWebMockObjectFactory().createMockRequest();
-    mRequest.setRequestURL("/test/foo/bar");
-    mRequest.setContextPath(CONTEXT_PATH);
-    mRequest.addCookie(cookie);
-    getWebMockObjectFactory().addRequestWrapper(mRequest);
-
-    Thread.sleep(50);
-    doFilter();
-
-    assertTrue("Last access time should be changing",
-        request.getSession().getLastAccessedTime() > lastAccess);
-  }
-
-  @Test
-  public void testGetSetMaxInactiveInterval() throws Exception {
-    doFilter();
-
-    HttpServletRequest request = (HttpServletRequest) getFilteredRequest();
-    request.getSession().setMaxInactiveInterval(50);
-
-    assertEquals(50, request.getSession().getMaxInactiveInterval());
-  }
-
-  @Test
-  public void testIsNew1() throws Exception {
-    doFilter();
-
-    HttpServletRequest request = (HttpServletRequest) getFilteredRequest();
-    assertTrue("Session should be new", request.getSession().isNew());
-  }
-
-  /**
-   * Subsequent calls should not return true
-   */
-  @Test
-  public void testIsNew2() throws Exception {
-    // Setup
-    CallbackServlet s = (CallbackServlet) getServlet();
-    s.setCallback(new Callback() {
-
-      @Override
-      public void call(HttpServletRequest request, HttpServletResponse response) {
-        request.getSession();
-      }
-    });
-
-    doFilter();
-
-    HttpServletRequest request = (HttpServletRequest) getFilteredRequest();
-    request.getSession();
-
-    MockHttpServletResponse response = getWebMockObjectFactory().getMockResponse();
-    Cookie cookie = (Cookie) response.getCookies().get(0);
-
-    MockHttpServletRequest mRequest = getWebMockObjectFactory().createMockRequest();
-    mRequest.setRequestURL("/test/foo/bar");
-    mRequest.setContextPath(CONTEXT_PATH);
-    mRequest.addCookie(cookie);
-    getWebMockObjectFactory().addRequestWrapper(mRequest);
-
-    doFilter();
-
-    request = (HttpServletRequest) getFilteredRequest();
-    HttpSession s1 = request.getSession();
-
-    assertFalse("Subsequent isNew() calls should be false", request.getSession().isNew());
-  }
-
-  @Test
-  public void testIsRequestedSessionIdFromCookie() {
-    MockHttpServletRequest mRequest = getWebMockObjectFactory().getMockRequest();
-    Cookie c = new Cookie("JSESSIONID", "1-GF");
-    mRequest.addCookie(c);
-
-    doFilter();
-    HttpServletRequest request = (HttpServletRequest) getFilteredRequest();
-    request.getSession();
-
-    assertTrue(request.isRequestedSessionIdFromCookie());
-  }
-
-  @Test
-  public void testIsRequestedSessionIdFromURL() {
-    MockHttpServletRequest mRequest = getWebMockObjectFactory().getMockRequest();
-    mRequest.setRequestURL("/foo/bar;jsessionid=1");
-
-    doFilter();
-    HttpServletRequest request = (HttpServletRequest) getFilteredRequest();
-    request.getSession();
-
-    assertFalse("Session ID should not be from cookie",
-        request.isRequestedSessionIdFromCookie());
-    assertTrue("Session ID should be from URL", request.isRequestedSessionIdFromURL());
-  }
-
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/db02660d/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/GemfireCacheTest.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/GemfireCacheTest.java b/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/GemfireCacheTest.java
deleted file mode 100644
index 1836177..0000000
--- a/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/GemfireCacheTest.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-package com.gemstone.gemfire.modules.session.internal.filter;
-
-import com.mockrunner.mock.web.MockFilterConfig;
-import com.mockrunner.mock.web.MockServletConfig;
-import org.junit.Before;
-
-/**
- * This servlet tests the effects of the downstream SessionCachingFilter filter.
- * When these tests are performed, the filter would already have taken effect.
- */
-public class GemfireCacheTest extends CommonTests {
-
-  @Before
-  public void setUp() throws Exception {
-    super.setUp();
-    getWebMockObjectFactory().getMockRequest().setRequestURL("/test/foo/bar");
-    getWebMockObjectFactory().getMockRequest().setContextPath(CONTEXT_PATH);
-    MockFilterConfig config = getWebMockObjectFactory().getMockFilterConfig();
-
-    config.setInitParameter("gemfire.property.mcast-port", "19991");
-    config.setInitParameter("cache-type", "peer-to-peer");
-    System.setProperty("gemfire.logdir", "/tmp");
-
-    getWebMockObjectFactory().getMockServletContext().setContextPath(
-        CONTEXT_PATH);
-
-    setDoChain(true);
-
-    createFilter(SessionCachingFilter.class);
-    createServlet(CallbackServlet.class);
-
-    MockServletConfig servletConfig = getWebMockObjectFactory().getMockServletConfig();
-    ContextManager.getInstance().putContext(servletConfig.getServletContext());
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/db02660d/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/GemfireLocalCacheTest.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/GemfireLocalCacheTest.java b/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/GemfireLocalCacheTest.java
deleted file mode 100644
index 830e2cb..0000000
--- a/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/GemfireLocalCacheTest.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-package com.gemstone.gemfire.modules.session.internal.filter;
-
-import com.mockrunner.mock.web.MockFilterConfig;
-import com.mockrunner.mock.web.MockServletConfig;
-import com.mockrunner.servlet.BasicServletTestCaseAdapter;
-import org.junit.After;
-import org.junit.Before;
-
-import javax.servlet.Filter;
-
-/**
- * This servlet tests the effects of the downstream SessionCachingFilter filter.
- * When these tests are performed, the filter would already have taken effect.
- */
-public class GemfireLocalCacheTest extends BasicServletTestCaseAdapter {
-
-  Filter filter;
-
-  protected static final String CONTEXT_PATH = "/test";
-
-  @Before
-  public void setUp() throws Exception {
-    super.setUp();
-    getWebMockObjectFactory().getMockRequest().setRequestURL("/test/foo/bar");
-    getWebMockObjectFactory().getMockRequest().setContextPath(CONTEXT_PATH);
-    MockFilterConfig config = getWebMockObjectFactory().getMockFilterConfig();
-
-    config.setInitParameter("gemfire.property.mcast-port", "19991");
-    config.setInitParameter("cache-type", "peer-to-peer");
-    config.setInitParameter("gemfire.cache.enable_local_cache", "true");
-    System.setProperty("gemfire.logdir", "/tmp");
-
-    getWebMockObjectFactory().getMockServletContext().setContextPath(
-        CONTEXT_PATH);
-
-    setDoChain(true);
-
-    filter = createFilter(SessionCachingFilter.class);
-    createServlet(CallbackServlet.class);
-
-    MockServletConfig servletConfig = getWebMockObjectFactory().getMockServletConfig();
-    ContextManager.getInstance().putContext(servletConfig.getServletContext());
-  }
-
-  @After
-  public void tearDown() throws Exception {
-    super.tearDown();
-    filter.destroy();
-  }
-
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/db02660d/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionAttributeListenerImpl.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionAttributeListenerImpl.java b/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionAttributeListenerImpl.java
deleted file mode 100644
index a374e4d..0000000
--- a/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionAttributeListenerImpl.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-
-package com.gemstone.gemfire.modules.session.internal.filter;
-
-import javax.servlet.http.HttpSessionAttributeListener;
-import javax.servlet.http.HttpSessionBindingEvent;
-
-/**
- *
- */
-public class HttpSessionAttributeListenerImpl extends AbstractListener
-    implements HttpSessionAttributeListener {
-
-  @Override
-  public synchronized void attributeAdded(HttpSessionBindingEvent se) {
-    events.add(ListenerEventType.SESSION_ATTRIBUTE_ADDED);
-    latch.countDown();
-  }
-
-  @Override
-  public synchronized void attributeRemoved(HttpSessionBindingEvent se) {
-    events.add(ListenerEventType.SESSION_ATTRIBUTE_REMOVED);
-    latch.countDown();
-  }
-
-  @Override
-  public synchronized void attributeReplaced(HttpSessionBindingEvent se) {
-    events.add(ListenerEventType.SESSION_ATTRIBUTE_REPLACED);
-    latch.countDown();
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/db02660d/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionBindingListenerImpl.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionBindingListenerImpl.java b/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionBindingListenerImpl.java
deleted file mode 100644
index 2e6ae0c..0000000
--- a/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionBindingListenerImpl.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-
-package com.gemstone.gemfire.modules.session.internal.filter;
-
-import java.io.Serializable;
-import javax.servlet.http.HttpSessionBindingEvent;
-import javax.servlet.http.HttpSessionBindingListener;
-
-/**
- * @author jdeppe
- */
-public class HttpSessionBindingListenerImpl extends AbstractListener implements
-    HttpSessionBindingListener, Serializable {
-
-  public HttpSessionBindingListenerImpl(int i) {
-    super(i);
-  }
-
-  @Override
-  public synchronized void valueBound(HttpSessionBindingEvent event) {
-    events.add(ListenerEventType.SESSION_VALUE_BOUND);
-    latch.countDown();
-  }
-
-  @Override
-  public synchronized void valueUnbound(HttpSessionBindingEvent event) {
-    events.add(ListenerEventType.SESSION_VALUE_UNBOUND);
-    latch.countDown();
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/db02660d/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionListenerImpl.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionListenerImpl.java b/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionListenerImpl.java
deleted file mode 100644
index 0e18e1e..0000000
--- a/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionListenerImpl.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-
-package com.gemstone.gemfire.modules.session.internal.filter;
-
-import javax.servlet.http.HttpSessionEvent;
-import javax.servlet.http.HttpSessionListener;
-
-/**
- * @author jdeppe
- */
-public class HttpSessionListenerImpl extends AbstractListener
-    implements HttpSessionListener {
-
-  public synchronized void sessionCreated(HttpSessionEvent se) {
-    events.add(ListenerEventType.SESSION_CREATED);
-    latch.countDown();
-  }
-
-  public synchronized void sessionDestroyed(HttpSessionEvent se) {
-    events.add(ListenerEventType.SESSION_DESTROYED);
-    latch.countDown();
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/db02660d/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/RendezvousManager.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/RendezvousManager.java b/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/RendezvousManager.java
deleted file mode 100644
index b2cacf8..0000000
--- a/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/RendezvousManager.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-
-package com.gemstone.gemfire.modules.session.internal.filter;
-
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-
-/**
- *
- */
-public class RendezvousManager {
-
-  private static AbstractListener listener = null;
-
-  private static CountDownLatch latch = new CountDownLatch(1);
-
-  public static void registerListener(AbstractListener listener) {
-    RendezvousManager.listener = listener;
-    latch.countDown();
-  }
-
-  public static AbstractListener getListener() {
-    try {
-      latch.await(2, TimeUnit.SECONDS);
-    } catch (InterruptedException ex) {
-    }
-
-    return listener;
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/db02660d/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/ServletRequestAttributeListenerImpl.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/ServletRequestAttributeListenerImpl.java b/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/ServletRequestAttributeListenerImpl.java
deleted file mode 100644
index 1eea4c0..0000000
--- a/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/ServletRequestAttributeListenerImpl.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-
-package com.gemstone.gemfire.modules.session.internal.filter;
-
-import javax.servlet.ServletRequestAttributeEvent;
-import javax.servlet.ServletRequestAttributeListener;
-
-/**
- * @author jdeppe
- */
-public class ServletRequestAttributeListenerImpl extends AbstractListener
-    implements ServletRequestAttributeListener {
-
-  public synchronized void attributeAdded(ServletRequestAttributeEvent srae) {
-    events.add(ListenerEventType.SERVLET_REQUEST_ATTRIBUTE_ADDED);
-    latch.countDown();
-  }
-
-  public synchronized void attributeRemoved(ServletRequestAttributeEvent srae) {
-    events.add(ListenerEventType.SERVLET_REQUEST_ATTRIBUTE_REMOVED);
-    latch.countDown();
-  }
-
-  public synchronized void attributeReplaced(
-      ServletRequestAttributeEvent srae) {
-    events.add(ListenerEventType.SERVLET_REQUEST_ATTRIBUTE_REPLACED);
-    latch.countDown();
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/db02660d/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/ServletRequestListenerImpl.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/ServletRequestListenerImpl.java b/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/ServletRequestListenerImpl.java
deleted file mode 100644
index 0c1dda2..0000000
--- a/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/ServletRequestListenerImpl.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-
-package com.gemstone.gemfire.modules.session.internal.filter;
-
-import javax.servlet.ServletRequestEvent;
-import javax.servlet.ServletRequestListener;
-
-/**
- * @author jdeppe
- */
-public class ServletRequestListenerImpl extends AbstractListener
-    implements ServletRequestListener {
-
-  public synchronized void requestDestroyed(ServletRequestEvent sre) {
-    events.add(ListenerEventType.SERVLET_REQUEST_DESTROYED);
-    latch.countDown();
-  }
-
-  public synchronized void requestInitialized(ServletRequestEvent sre) {
-    events.add(ListenerEventType.SERVLET_REQUEST_INITIALIZED);
-    latch.countDown();
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/db02660d/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/SessionTestSuite1.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/SessionTestSuite1.java b/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/SessionTestSuite1.java
deleted file mode 100644
index de80969..0000000
--- a/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/SessionTestSuite1.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-package com.gemstone.gemfire.modules.session.internal.filter;
-
-import com.gemstone.gemfire.modules.session.junit.SeparateClassloaderTestRunner;
-import com.mockrunner.mock.web.MockFilterConfig;
-import com.mockrunner.mock.web.WebMockObjectFactory;
-import com.mockrunner.servlet.ServletTestModule;
-
-import java.io.File;
-import javax.servlet.Filter;
-
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.runner.RunWith;
-
-/**
- *
- */
-@RunWith(SeparateClassloaderTestRunner.class)
-public class SessionTestSuite1 extends GemfireCacheTest {
-
-  private static Filter filter;
-
-  private static final File tmpdir;
-
-  private static final String gemfire_log;
-
-  static {
-    // Create a per-user scratch directory
-    tmpdir = new File(System.getProperty("java.io.tmpdir"),
-        "gemfire_modules-" + System.getProperty("user.name"));
-    tmpdir.mkdirs();
-    tmpdir.deleteOnExit();
-
-    gemfire_log = tmpdir.getPath() +
-        System.getProperty("file.separator") + "gemfire_modules.log";
-  }
-
-
-  @BeforeClass
-  public static void setupClass() throws Exception {
-    System.out.println("Executing " + SessionTestSuite1.class.getName());
-    WebMockObjectFactory factory = new WebMockObjectFactory();
-    MockFilterConfig config = factory.getMockFilterConfig();
-
-    config.setInitParameter("gemfire.property.mcast-port", "19991");
-    config.setInitParameter("gemfire.property.log-file", gemfire_log);
-    config.setInitParameter("gemfire.property.writable-working-dir",
-        tmpdir.getPath());
-    config.setInitParameter("cache-type", "peer-to-peer");
-    config.setInitParameter("close-cache-on-stop", "true");
-
-    factory.getMockServletContext().setContextPath("");
-
-    ServletTestModule module = new ServletTestModule(factory);
-    filter = module.createFilter(SessionCachingFilter.class);
-  }
-
-  @AfterClass
-  public static void teardownClass() throws Exception {
-    filter.destroy();
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/db02660d/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/SessionTestSuite2.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/SessionTestSuite2.java b/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/SessionTestSuite2.java
deleted file mode 100644
index d0c0ea0..0000000
--- a/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/SessionTestSuite2.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-package com.gemstone.gemfire.modules.session.internal.filter;
-
-import com.gemstone.gemfire.modules.session.junit.SeparateClassloaderTestRunner;
-import com.mockrunner.mock.web.MockFilterConfig;
-import com.mockrunner.mock.web.WebMockObjectFactory;
-import com.mockrunner.servlet.ServletTestModule;
-
-import java.io.File;
-import javax.servlet.Filter;
-
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.runner.RunWith;
-
-/**
- *
- */
-@RunWith(SeparateClassloaderTestRunner.class)
-public class SessionTestSuite2 extends GemfireCacheTest {
-
-  private static Filter filter;
-
-  private static final File tmpdir;
-
-  private static final String gemfire_log;
-
-  static {
-    // Create a per-user scratch directory
-    tmpdir = new File(System.getProperty("java.io.tmpdir"),
-        "gemfire_modules-" + System.getProperty("user.name"));
-    tmpdir.mkdirs();
-    tmpdir.deleteOnExit();
-
-    gemfire_log = tmpdir.getPath() +
-        System.getProperty("file.separator") + "gemfire_modules.log";
-  }
-
-  @BeforeClass
-  public static void setupClass() throws Exception {
-    System.out.println("Executing " + SessionTestSuite2.class.getName());
-    WebMockObjectFactory factory = new WebMockObjectFactory();
-    MockFilterConfig config = factory.getMockFilterConfig();
-
-    config.setInitParameter("mcast-port", "19991");
-    config.setInitParameter("gemfire.property.log-file", gemfire_log);
-    config.setInitParameter("gemfire.property.writable-working-dir",
-        tmpdir.getPath());
-    config.setInitParameter("cache-type", "peer-to-peer");
-    config.setInitParameter("gemfire.cache.enable_local_cache", "true");
-
-    factory.getMockServletContext().setContextPath("");
-
-    ServletTestModule module = new ServletTestModule(factory);
-    filter = module.createFilter(SessionCachingFilter.class);
-  }
-
-  @AfterClass
-  public static void teardownClass() throws Exception {
-    filter.destroy();
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/db02660d/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/SessionUberSuite.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/SessionUberSuite.java b/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/SessionUberSuite.java
deleted file mode 100644
index be9ffa0..0000000
--- a/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/SessionUberSuite.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-package com.gemstone.gemfire.modules.session.internal.filter;
-
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-/**
- * The goal of having a suite of suites is for each suite to be able to start up
- * and shut down a unique cache with a different config. Currently a restart
- * doesn't work... This is dependent on gemfire 6.5.1.4 which provides a unified
- * classloading framework. Once that can be introduced here we can simply switch
- * the URLClassLoader for a ChildFirstClassLoader and have the ability to run
- * multiple caches in a single JVM. This should also allow us the ability to
- * cleanly shut down a cache at the end of a test.
- * <p/>
- * To be continued...
- */
-@RunWith(Suite.class)
-@Suite.SuiteClasses({
-  SessionTestSuite1.class,
-  SessionTestSuite2.class
-})
-public class SessionUberSuite {
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/db02660d/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/junit/SeparateClassloaderTestRunner.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/junit/SeparateClassloaderTestRunner.java b/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/junit/SeparateClassloaderTestRunner.java
deleted file mode 100644
index 6e47aa9..0000000
--- a/modules/gemfire-modules-session-external/src/test/java/com/gemstone/gemfire/modules/session/junit/SeparateClassloaderTestRunner.java
+++ /dev/null
@@ -1,39 +0,0 @@
-package com.gemstone.gemfire.modules.session.junit;
-
-import org.junit.runners.BlockJUnit4ClassRunner;
-import org.junit.runners.model.InitializationError;
-
-import java.net.URLClassLoader;
-
-/**
- * @author StackOverflow
- */
-public class SeparateClassloaderTestRunner extends BlockJUnit4ClassRunner {
-
-  public SeparateClassloaderTestRunner(Class<?> clazz) throws InitializationError {
-    super(getFromTestClassloader(clazz));
-  }
-
-  private static Class<?> getFromTestClassloader(Class<?> clazz) throws InitializationError {
-    try {
-      ClassLoader testClassLoader = new TestClassLoader();
-      return Class.forName(clazz.getName(), true, testClassLoader);
-    } catch (ClassNotFoundException e) {
-      throw new InitializationError(e);
-    }
-  }
-
-  public static class TestClassLoader extends URLClassLoader {
-    public TestClassLoader() {
-      super(((URLClassLoader)getSystemClassLoader()).getURLs());
-    }
-
-    @Override
-    public Class<?> loadClass(String name) throws ClassNotFoundException {
-      if (name.startsWith("com.gemstone.gemfire.modules.session.")) {
-        return super.findClass(name);
-      }
-      return super.loadClass(name);
-    }
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/db02660d/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionListenerImpl.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionListenerImpl.java b/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionListenerImpl.java
index 6cbd75b..bcdc550 100644
--- a/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionListenerImpl.java
+++ b/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionListenerImpl.java
@@ -12,6 +12,8 @@
 
 package com.gemstone.gemfire.modules.session.internal.filter;
 
+import com.gemstone.gemfire.modules.session.filter.SessionCachingFilter;
+
 import javax.servlet.http.HttpSession;
 import javax.servlet.http.HttpSessionEvent;
 import javax.servlet.http.HttpSessionListener;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/db02660d/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionListenerImpl2.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionListenerImpl2.java b/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionListenerImpl2.java
index 154414a..ea39f65 100644
--- a/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionListenerImpl2.java
+++ b/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionListenerImpl2.java
@@ -12,6 +12,8 @@
 
 package com.gemstone.gemfire.modules.session.internal.filter;
 
+import com.gemstone.gemfire.modules.session.filter.SessionCachingFilter;
+
 import javax.servlet.http.HttpSession;
 import javax.servlet.http.HttpSessionEvent;
 import javax.servlet.http.HttpSessionListener;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/db02660d/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/IntegrationTest.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/IntegrationTest.java b/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/IntegrationTest.java
index ed5ed79..11d1029 100644
--- a/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/IntegrationTest.java
+++ b/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/IntegrationTest.java
@@ -30,6 +30,7 @@ import javax.servlet.http.HttpSession;
 
 import com.gemstone.gemfire.cache.Region;
 import com.gemstone.gemfire.modules.junit.PerTestClassLoaderRunner;
+import com.gemstone.gemfire.modules.session.filter.SessionCachingFilter;
 import org.apache.jasper.servlet.JspServlet;
 import org.junit.After;
 import org.junit.Before;


[19/24] incubator-geode git commit: GEODE-14: Adding session replication assembly module

Posted by je...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/65a03287/extensions/gemfire-modules-assembly/release/3rdparty_license/open_source_licenses-vFabric_GemFire_HTTP_Session_Management_Modules_2.1.1.txt
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-assembly/release/3rdparty_license/open_source_licenses-vFabric_GemFire_HTTP_Session_Management_Modules_2.1.1.txt b/extensions/gemfire-modules-assembly/release/3rdparty_license/open_source_licenses-vFabric_GemFire_HTTP_Session_Management_Modules_2.1.1.txt
new file mode 100644
index 0000000..e60114d
--- /dev/null
+++ b/extensions/gemfire-modules-assembly/release/3rdparty_license/open_source_licenses-vFabric_GemFire_HTTP_Session_Management_Modules_2.1.1.txt
@@ -0,0 +1,1326 @@
+
+VMware vFabric GemFire HTTP Session Management Module 2.1.1
+
+
+===========================================================================
+
+The following copyright statements and licenses apply to various open
+source software components (or portions thereof) that are distributed with
+this VMware software products.
+
+The VMware Product may also include other VMware components, which may contain additional open 
+source software packages. One or more such open_source_licenses.txt files may therefore 
+accompany this VMware Product. 
+
+The VMware product that includes this file does not necessarily use all the
+open source software components referred to below and may also only use
+portions of a given component.
+
+
+=============== TABLE OF CONTENTS =============================
+
+
+The following is a listing of the open source components detailed in this
+document.  This list is provided for your convenience; please read further if
+you wish to review the copyright notice(s) and the full text of the license
+associated with each component.
+
+
+
+SECTION 1: BSD-STYLE, MIT-STYLE, OR SIMILAR STYLE LICENSES
+
+   >>> antlr-2.7.3
+   >>> backport-util-concurrent-java_5.0
+   >>> mx4j-2.0.1
+   >>> slf4j-1.5.8
+
+
+
+SECTION 2: Apache License, V2.0
+
+   >>> commons-modeler-2.0
+
+
+
+SECTION 3: Common Development and Distribution License, V1.0
+
+   >>> servlet-api-2.5
+
+
+
+SECTION 4: GNU Lesser General Public License, V2.1
+
+   >>> jgroups-2.10
+   >>> trove-1.1.b3
+
+
+
+APPENDIX. Standard License Files
+
+   >>> Apache License, V2.0
+
+   >>> GNU Lesser General Public License, V2.1
+
+   >>> Common Development and Distribution License, V1.0
+
+
+
+
+
+--------------- SECTION 1:  BSD-STYLE, MIT-STYLE, OR SIMILAR STYLE LICENSES ----------
+
+BSD-STYLE, MIT-STYLE, OR SIMILAR STYLE LICENSES are applicable to the following component(s).
+
+
+>>> antlr-2.7.3
+
+SOFTWARE RIGHTS
+
+ANTLR 1989-2004 Developed by Terence Parr
+Partially supported by University of San Francisco & jGuru.com
+
+We reserve no legal rights to the ANTLR--it is fully in the
+public domain. An individual or company may do whatever
+they wish with source code distributed with ANTLR or the
+code generated by ANTLR, including the incorporation of
+ANTLR, or its output, into commerical software.
+
+We encourage users to develop software with ANTLR. However,
+we do ask that credit is given to us for developing
+ANTLR. By "credit", we mean that if you use ANTLR or
+incorporate any source code into one of your programs
+(commercial product, research project, or otherwise) that
+you acknowledge this fact somewhere in the documentation,
+research report, etc... If you like ANTLR and have
+developed a nice tool with the output, please mention that
+you developed it using ANTLR. In addition, we ask that the
+headers remain intact in our source code. As long as these
+guidelines are kept, we expect to continue enhancing this
+system and expect to make other tools available as they are
+completed.
+
+The primary ANTLR guy:
+
+Terence Parr
+parrt@cs.usfca.edu
+parrt@antlr.org
+
+
+>>> backport-util-concurrent-java_5.0
+
+License
+This software is released to the public domain, in the spirit of the original code written by Doug Lea. 
+The code can be used for any purpose, modified, and redistributed without acknowledgment. No 
+warranty is provided, either express or implied.
+
+
+>>> mx4j-2.0.1
+
+The MX4J License, Version 1.0
+
+Copyright (c) 2001-2004 by the MX4J contributors.  All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+         1. Redistributions of source code must retain the above copyright
+            notice, this list of conditions and the following disclaimer.
+
+         2. Redistributions in binary form must reproduce the above copyright
+            notice, this list of conditions and the following disclaimer in
+            the documentation and/or other materials provided with the
+            distribution.
+
+         3. The end-user documentation included with the redistribution,
+            if any, must include the following acknowledgment:
+               "This product includes software developed by the
+                MX4J project (http://mx4j.sourceforge.net)."
+            Alternately, this acknowledgment may appear in the software itself,
+            if and wherever such third-party acknowledgments normally appear.
+
+         4. The name "MX4J" must not be used to endorse or promote
+            products derived from this software without prior written
+            permission.
+            For written permission, please contact
+            biorn_steedom [at] users [dot] sourceforge [dot] net
+
+         5. Products derived from this software may not be called "MX4J",
+            nor may "MX4J" appear in their name, without prior written
+            permission of Simone Bordet.
+
+THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED.  IN NO EVENT SHALL THE MX4J CONTRIBUTORS
+BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
+
+This software consists of voluntary contributions made by many
+individuals on behalf of the MX4J project.  For more information on
+MX4J, please see
+the MX4J website.
+
+
+>>> slf4j-1.5.8
+
+Copyright (c) 2004-2008 QOS.ch
+All rights reserved.
+
+Permission is hereby granted, free  of charge, to any person obtaining
+a  copy  of this  software  and  associated  documentation files  (the
+"Software"), to  deal in  the Software without  restriction, including
+without limitation  the rights to  use, copy, modify,  merge, publish,
+distribute,  sublicense, and/or sell  copies of  the Software,  and to
+permit persons to whom the Software  is furnished to do so, subject to
+the following conditions:
+
+The  above  copyright  notice  and  this permission  notice  shall  be
+included in all copies or substantial portions of the Software.
+
+THE  SOFTWARE IS  PROVIDED  "AS  IS", WITHOUT  WARRANTY  OF ANY  KIND,
+EXPRESS OR  IMPLIED, INCLUDING  BUT NOT LIMITED  TO THE  WARRANTIES OF
+MERCHANTABILITY,    FITNESS    FOR    A   PARTICULAR    PURPOSE    AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE,  ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+
+--------------- SECTION 2: Apache License, V2.0 ----------
+
+Apache License, V2.0 is applicable to the following component(s).
+
+
+>>> commons-modeler-2.0
+
+This product includes software developed by
+The Apache Software Foundation (http://www.apache.org/).
+
+
+--------------- SECTION 3: Common Development and Distribution License, V1.0 ----------
+
+Common Development and Distribution License, V1.0 is applicable to the following component(s).
+
+
+>>> servlet-api-2.5
+
+The contents of this file are subject to the terms 
+of the Common Development and Distribution License 
+(the "License"). You may not use this file except 
+in compliance with the License. 
+ 
+You can obtain a copy of the license at 
+glassfish/bootstrap/legal/CDDLv1.0.txt or 
+https://glassfish.dev.java.net/public/CDDLv1.0.html. 
+See the License for the specific language governing 
+permissions and limitations under the License. 
+ 
+When distributing Covered Code, include this CDDL 
+HEADER in each file and include the License file at 
+glassfish/bootstrap/legal/CDDLv1.0.txt. If applicable, 
+add the following below this CDDL HEADER, with the 
+fields enclosed by brackets "[]" replaced with your 
+own identifying information: Portions Copyright [yyyy] 
+[name of copyright owner] 
+ 
+Copyright 2005 Sun Microsystems, Inc. All rights reserved. 
+ 
+Portions Copyright Apache Software Foundation.
+
+
+--------------- SECTION 4: GNU Lesser General Public License, V2.1 ----------
+
+GNU Lesser General Public License, V2.1 is applicable to the following component(s).
+
+
+>>> jgroups-2.10
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+
+>>> trove-1.1.b3
+
+The Trove library is licensed under the Lesser GNU Public License,
+which is included with the distribution in a file called LICENSE.txt.
+
+The PrimeFinder and HashFunctions classes in Trove are subject to the
+following license restrictions:
+
+Copyright (c) 1999 CERN - European Organization for Nuclear Research.
+
+Permission to use, copy, modify, distribute and sell this software and
+its documentation for any purpose is hereby granted without fee,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation. CERN makes no representations about the
+suitability of this software for any purpose. It is provided "as is"
+without expressed or implied warranty.
+
+
+
+
+
+=============== APPENDIX. Standard License Files ============== 
+
+
+
+--------------- SECTION 1: Apache License, V2.0 -----------
+
+Apache License 
+
+Version 2.0, January 2004 
+http://www.apache.org/licenses/ 
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 
+
+1. Definitions.
+
+"License" shall mean the terms and conditions for use, reproduction,
+and distribution as defined by Sections 1 through 9 of this document.
+
+"Licensor" shall mean the copyright owner or entity authorized by the
+copyright owner that is granting the License.  
+
+"Legal Entity" shall mean the union of the acting entity and all other
+entities that control, are controlled by, or are under common control
+with that entity. For the purposes of this definition, "control" means
+(i) the power, direct or indirect, to cause the direction or management
+of such entity, whether by contract or otherwise, or (ii) ownership
+of fifty percent (50%) or more of the outstanding shares, or (iii)
+beneficial ownership of such entity.
+
+"You" (or "Your") shall mean an individual or Legal Entity exercising
+permissions granted by this License.  
+
+"Source" form shall mean the preferred form for making modifications,
+including but not limited to software source code, documentation source,
+and configuration files.
+
+"Object" form shall mean any form resulting from mechanical transformation
+or translation of a Source form, including but not limited to compiled
+object code, generated documentation, and conversions to other media
+types.  
+
+"Work" shall mean the work of authorship, whether in Source or
+Object form, made available under the License, as indicated by a copyright
+notice that is included in or attached to the work (an example is provided
+in the Appendix below).  
+
+"Derivative Works" shall mean any work, whether in Source or Object form,
+that is based on (or derived from) the Work and for which the editorial
+revisions, annotations, elaborations, or other modifications represent,
+as a whole, an original work of authorship. For the purposes of this
+License, Derivative Works shall not include works that remain separable
+from, or merely link (or bind by name) to the interfaces of, the Work
+and Derivative Works thereof.
+
+"Contribution" shall mean any work of authorship, including the
+original version of the Work and any modifications or additions to
+that Work or Derivative Works thereof, that is intentionally submitted
+to Licensor for inclusion in the Work by the copyright owner or by an
+individual or Legal Entity authorized to submit on behalf of the copyright
+owner. For the purposes of this definition, "submitted" means any form of
+electronic, verbal, or written communication sent to the Licensor or its
+representatives, including but not limited to communication on electronic
+mailing lists, source code control systems, and issue tracking systems
+that are managed by, or on behalf of, the Licensor for the purpose of
+discussing and improving the Work, but excluding communication that is
+conspicuously marked or otherwise designated in writing by the copyright
+owner as "Not a Contribution."
+
+"Contributor" shall mean Licensor and any individual or Legal Entity
+on behalf of whom a Contribution has been received by Licensor and
+subsequently incorporated within the Work.
+
+2. Grant of Copyright License.
+Subject to the terms and conditions of this License, each Contributor
+hereby grants to You a perpetual, worldwide, non-exclusive, no-charge,
+royalty-free, irrevocable copyright license to reproduce, prepare
+Derivative Works of, publicly display, publicly perform, sublicense, and
+distribute the Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License.
+Subject to the terms and conditions of this License, each Contributor
+hereby grants to You a perpetual, worldwide, non-exclusive, no-charge,
+royalty- free, irrevocable (except as stated in this section) patent
+license to make, have made, use, offer to sell, sell, import, and
+otherwise transfer the Work, where such license applies only to those
+patent claims licensable by such Contributor that are necessarily
+infringed by their Contribution(s) alone or by combination of
+their Contribution(s) with the Work to which such Contribution(s)
+was submitted. If You institute patent litigation against any entity
+(including a cross-claim or counterclaim in a lawsuit) alleging that the
+Work or a Contribution incorporated within the Work constitutes direct
+or contributory patent infringement, then any patent licenses granted
+to You under this License for that Work shall terminate as of the date
+such litigation is filed.
+
+4. Redistribution.
+You may reproduce and distribute copies of the Work or Derivative Works
+thereof in any medium, with or without modifications, and in Source or
+Object form, provided that You meet the following conditions:
+
+  a. You must give any other recipients of the Work or Derivative Works
+     a copy of this License; and
+
+  b. You must cause any modified files to carry prominent notices stating
+     that You changed the files; and
+
+  c. You must retain, in the Source form of any Derivative Works that
+     You distribute, all copyright, patent, trademark, and attribution
+     notices from the Source form of the Work, excluding those notices
+     that do not pertain to any part of the Derivative Works; and
+
+  d. If the Work includes a "NOTICE" text file as part of its
+     distribution, then any Derivative Works that You distribute must
+     include a readable copy of the attribution notices contained
+     within such NOTICE file, excluding those notices that do not
+     pertain to any part of the Derivative Works, in at least one of
+     the following places: within a NOTICE text file distributed as part
+     of the Derivative Works; within the Source form or documentation,
+     if provided along with the Derivative Works; or, within a display
+     generated by the Derivative Works, if and wherever such third-party
+     notices normally appear. The contents of the NOTICE file are for
+     informational purposes only and do not modify the License. You
+     may add Your own attribution notices within Derivative Works that
+     You distribute, alongside or as an addendum to the NOTICE text
+     from the Work, provided that such additional attribution notices
+     cannot be construed as modifying the License.  You may add Your own
+     copyright statement to Your modifications and may provide additional
+     or different license terms and conditions for use, reproduction, or
+     distribution of Your modifications, or for any such Derivative Works
+     as a whole, provided Your use, reproduction, and distribution of the
+     Work otherwise complies with the conditions stated in this License.
+
+5. Submission of Contributions.
+Unless You explicitly state otherwise, any Contribution intentionally
+submitted for inclusion in the Work by You to the Licensor shall be
+under the terms and conditions of this License, without any additional
+terms or conditions.  Notwithstanding the above, nothing herein shall
+supersede or modify the terms of any separate license agreement you may
+have executed with Licensor regarding such Contributions.
+
+6. Trademarks.
+This License does not grant permission to use the trade names, trademarks,
+service marks, or product names of the Licensor, except as required for
+reasonable and customary use in describing the origin of the Work and
+reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty.
+Unless required by applicable law or agreed to in writing, Licensor
+provides the Work (and each Contributor provides its Contributions) on
+an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+express or implied, including, without limitation, any warranties or
+conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR
+A PARTICULAR PURPOSE. You are solely responsible for determining the
+appropriateness of using or redistributing the Work and assume any risks
+associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability.
+In no event and under no legal theory, whether in tort (including
+negligence), contract, or otherwise, unless required by applicable law
+(such as deliberate and grossly negligent acts) or agreed to in writing,
+shall any Contributor be liable to You for damages, including any direct,
+indirect, special, incidental, or consequential damages of any character
+arising as a result of this License or out of the use or inability to
+use the Work (including but not limited to damages for loss of goodwill,
+work stoppage, computer failure or malfunction, or any and all other
+commercial damages or losses), even if such Contributor has been advised
+of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability.
+While redistributing the Work or Derivative Works thereof, You may
+choose to offer, and charge a fee for, acceptance of support, warranty,
+indemnity, or other liability obligations and/or rights consistent with
+this License. However, in accepting such obligations, You may act only
+on Your own behalf and on Your sole responsibility, not on behalf of
+any other Contributor, and only if You agree to indemnify, defend, and
+hold each Contributor harmless for any liability incurred by, or claims
+asserted against, such Contributor by reason of your accepting any such
+warranty or additional liability.
+
+END OF TERMS AND CONDITIONS 
+
+
+
+--------------- SECTION 2: GNU Lesser General Public License, V2.1 -----------
+
+		  GNU LESSER GENERAL PUBLIC LICENSE
+		       Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+ 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL.  It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+  This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it.  You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+  When we speak of free software, we are referring to freedom of use,
+not price.  Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+  To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights.  These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+  For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you.  You must make sure that they, too, receive or can get the source
+code.  If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it.  And you must show them these terms so they know their rights.
+
+  We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+  To protect each distributor, we want to make it very clear that
+there is no warranty for the free library.  Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+
+  Finally, software patents pose a constant threat to the existence of
+any free program.  We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder.  Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+  Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License.  This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License.  We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+  When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library.  The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom.  The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+  We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License.  It also provides other free software developers Less
+of an advantage over competing non-free programs.  These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries.  However, the Lesser license provides advantages in certain
+special circumstances.
+
+  For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard.  To achieve this, non-free programs must be
+allowed to use the library.  A more frequent case is that a free
+library does the same job as widely used non-free libraries.  In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+  In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software.  For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+  Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.  Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library".  The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+
+		  GNU LESSER GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+  A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+  The "Library", below, refers to any such software library or work
+which has been distributed under these terms.  A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language.  (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+  "Source code" for a work means the preferred form of the work for
+making modifications to it.  For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+  Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it).  Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+  1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+  You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+  2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) The modified work must itself be a software library.
+
+    b) You must cause the files modified to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    c) You must cause the whole of the work to be licensed at no
+    charge to all third parties under the terms of this License.
+
+    d) If a facility in the modified Library refers to a function or a
+    table of data to be supplied by an application program that uses
+    the facility, other than as an argument passed when the facility
+    is invoked, then you must make a good faith effort to ensure that,
+    in the event an application does not supply such function or
+    table, the facility still operates, and performs whatever part of
+    its purpose remains meaningful.
+
+    (For example, a function in a library to compute square roots has
+    a purpose that is entirely well-defined independent of the
+    application.  Therefore, Subsection 2d requires that any
+    application-supplied function or table used by this function must
+    be optional: if the application does not supply it, the square
+    root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library.  To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License.  (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.)  Do not make any other change in
+these notices.
+
+  Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+  This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+  4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+  If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library".  Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+  However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library".  The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+  When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library.  The
+threshold for this to be true is not precisely defined by law.
+
+  If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work.  (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+  Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+  6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+  You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License.  You must supply a copy of this License.  If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License.  Also, you must do one
+of these things:
+
+    a) Accompany the work with the complete corresponding
+    machine-readable source code for the Library including whatever
+    changes were used in the work (which must be distributed under
+    Sections 1 and 2 above); and, if the work is an executable linked
+    with the Library, with the complete machine-readable "work that
+    uses the Library", as object code and/or source code, so that the
+    user can modify the Library and then relink to produce a modified
+    executable containing the modified Library.  (It is understood
+    that the user who changes the contents of definitions files in the
+    Library will not necessarily be able to recompile the application
+    to use the modified definitions.)
+
+    b) Use a suitable shared library mechanism for linking with the
+    Library.  A suitable mechanism is one that (1) uses at run time a
+    copy of the library already present on the user's computer system,
+    rather than copying library functions into the executable, and (2)
+    will operate properly with a modified version of the library, if
+    the user installs one, as long as the modified version is
+    interface-compatible with the version that the work was made with.
+
+    c) Accompany the work with a written offer, valid for at
+    least three years, to give the same user the materials
+    specified in Subsection 6a, above, for a charge no more
+    than the cost of performing this distribution.
+
+    d) If distribution of the work is made by offering access to copy
+    from a designated place, offer equivalent access to copy the above
+    specified materials from the same place.
+
+    e) Verify that the user has already received a copy of these
+    materials or that you have already sent this user a copy.
+
+  For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it.  However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+  It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system.  Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+  7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+    a) Accompany the combined library with a copy of the same work
+    based on the Library, uncombined with any other library
+    facilities.  This must be distributed under the terms of the
+    Sections above.
+
+    b) Give prominent notice with the combined library of the fact
+    that part of it is a work based on the Library, and explaining
+    where to find the accompanying uncombined form of the same work.
+
+  8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License.  Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License.  However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+  9. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Library or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+  10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+
+  11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded.  In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+  13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation.  If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+  14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission.  For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this.  Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+			    NO WARRANTY
+
+  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
+
+           How to Apply These Terms to Your New Libraries
+
+  If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change.  You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+  To apply these terms, attach the following notices to the library.  It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the library's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the
+  library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+  <signature of Ty Coon>, 1 April 1990
+  Ty Coon, President of Vice
+
+That's all there is to it!
+
+
+
+
+--------------- SECTION 3: Common Development and Distribution License, V1.0 -----------
+
+COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
+
+1. Definitions.
+
+1.1. "Contributor" means each individual or entity that creates or
+contributes to the creation of Modifications.
+
+1.2. "Contributor Version" means the combination of the Original Software,
+prior Modifications used by a Contributor (if any), and the Modifications
+made by that particular Contributor.
+
+1.3. "Covered Software" means (a) the Original Software, or (b)
+Modifications, or (c) the combination of files containing Original
+Software with files containing Modifications, in each case including
+portions thereof.
+
+1.4. "Executable" means the Covered Software in any form other than
+Source Code.
+
+1.5. "Initial Developer" means the individual or entity that first makes
+Original Software available under this License.
+
+1.6. "Larger Work" means a work which combines Covered Software or
+portions thereof with code not governed by the terms of this License.
+
+1.7. "License" means this document.
+
+1.8. "Licensable" means having the right to grant, to the maximum extent
+possible, whether at the time of the initial grant or subsequently
+acquired, any and all of the rights conveyed herein.
+
+1.9. "Modifications" means the Source Code and Executable form of any
+of the following:
+
+    A. Any file that results from an addition to, deletion from or
+    modification of the contents of a file containing Original Software
+    or previous Modifications;
+
+    B. Any new file that contains any part of the Original Software or
+    previous Modification; or
+
+    C. Any new file that is contributed or otherwise made available
+    under the terms of this License.
+
+1.10. "Original Software" means the Source Code and Executable form of
+computer software code that is originally released under this License.
+
+1.11. "Patent Claims" means any patent claim(s), now owned or hereafter
+acquired, including without limitation, method, process, and apparatus
+claims, in any patent Licensable by grantor.
+
+1.12. "Source Code" means (a) the common form of computer software code
+in which modifications are made and (b) associated documentation included
+in or with such code.
+
+1.13. "You" (or "Your") means an individual or a legal entity exercising
+rights under, and complying with all of the terms of, this License. For
+legal entities, "You" includes any entity which controls, is controlled
+by, or is under common control with You. For purposes of this definition,
+"control" means (a) the power, direct or indirect, to cause the direction
+or management of such entity, whether by contract or otherwise, or (b)
+ownership of more than fifty percent (50%) of the outstanding shares or
+beneficial ownership of such entity.
+
+2. License Grants. 
+
+2.1. The Initial Developer Grant.
+
+Conditioned upon Your compliance with Section 3.1 below and subject to
+third party intellectual property claims, the Initial Developer hereby
+grants You a world-wide, royalty-free, non-exclusive license:
+
+    (a) under intellectual property rights (other than patent or
+    trademark) Licensable by Initial Developer, to use, reproduce, modify,
+    display, perform, sublicense and distribute the Original Software
+    (or portions thereof), with or without Modifications, and/or as part
+    of a Larger Work; and
+
+    (b) under Patent Claims infringed by the making, using or selling
+    of Original Software, to make, have made, use, practice, sell, and
+    offer for sale, and/or otherwise dispose of the Original Software
+    (or portions thereof).
+
+    (c) The licenses granted in Sections 2.1(a) and (b) are effective
+    on the date Initial Developer first distributes or otherwise makes
+    the Original Software available to a third party under the terms of
+    this License.
+
+    (d) Notwithstanding Section 2.1(b) above, no patent license is
+    granted: (1) for code that You delete from the Original Software,
+    or (2) for infringements caused by: (i) the modification of the
+    Original Software, or (ii) the combination of the Original Software
+    with other software or devices.
+
+2.2. Contributor Grant.
+
+Conditioned upon Your compliance with Section 3.1 below and subject to
+third party intellectual property claims, each Contributor hereby grants
+You a world-wide, royalty-free, non-exclusive license:
+
+    (a) under intellectual property rights (other than patent or
+    trademark) Licensable by Contributor to use, reproduce, modify,
+    display, perform, sublicense and distribute the Modifications created
+    by such Contributor (or portions thereof), either on an unmodified
+    basis, with other Modifications, as Covered Software and/or as part
+    of a Larger Work; and
+
+    (b) under Patent Claims infringed by the making, using, or selling
+    of Modifications made by that Contributor either alone and/or
+    in combination with its Contributor Version (or portions of such
+    combination), to make, use, sell, offer for sale, have made, and/or
+    otherwise dispose of: (1) Modifications made by that Contributor
+    (or portions thereof); and (2) the combination of Modifications
+    made by that Contributor with its Contributor Version (or portions
+    of such combination).
+
+    (c) The licenses granted in Sections 2.2(a) and 2.2(b) are effective
+    on the date Contributor first distributes or otherwise makes the
+    Modifications available to a third party.
+
+    (d) Notwithstanding Section 2.2(b) above, no patent license is
+    granted: (1) for any code that Contributor has deleted from the
+    Contributor Version; (2) for infringements caused by: (i) third
+    party modifications of Contributor Version, or (ii) the combination
+    of Modifications made by that Contributor with other software
+    (except as part of the Contributor Version) or other devices; or (3)
+    under Patent Claims infringed by Covered Software in the absence of
+    Modifications made by that Contributor.
+
+3. Distribution Obligations.
+
+3.1. Availability of Source Code.
+
+Any Covered Software that You distribute or otherwise make available
+in Executable form must also be made available in Source Code form and
+that Source Code form must be distributed only under the terms of this
+License. You must include a copy of this License with every copy of the
+Source Code form of the Covered Software You distribute or otherwise make
+available. You must inform recipients of any such Covered Software in
+Executable form as to how they can obtain such Covered Software in Source
+Code form in a reasonable manner on or through a medium customarily used
+for software exchange.
+
+3.2. Modifications.
+
+The Modifications that You create or to which You contribute are governed
+by the terms of this License. You represent that You believe Your
+Modifications are Your original creation(s) and/or You have sufficient
+rights to grant the rights conveyed by this License.
+
+3.3. Required Notices.
+
+You must include a notice in each of Your Modifications that identifies
+You as the Contributor of the Modification.  You may not remove or alter
+any copyright, patent or trademark notices contained within the Covered
+Software, or any notices of licensing or any descriptive text giving
+attribution to any Contributor or the Initial Developer.
+
+3.4. Application of Additional Terms.
+
+You may not offer or impose any terms on any Covered Software in Source
+Code form that alters or restricts the applicable version of this License
+or the recipients' rights hereunder. You may choose to offer, and to
+charge a fee for, warranty, support, indemnity or liability obligations to
+one or more recipients of Covered Software.  However, you may do so only
+on Your own behalf, and not on behalf of the Initial Developer or any
+Contributor. You must make it absolutely clear that any such warranty,
+support, indemnity or liability obligation is offered by You alone, and
+You hereby agree to indemnify the Initial Developer and every Contributor
+for any liability incurred by the Initial Developer or such Contributor
+as a result of warranty, support, indemnity or liability terms You offer.
+
+3.5. Distribution of Executable Versions.
+
+You may distribute the Executable form of the Covered Software under the
+terms of this License or under the terms of a license of Your choice,
+which may contain terms different from this License, provided that You are
+in compliance with the terms of this License and that the license for the
+Executable form does not attempt to limit or alter the recipient's rights
+in the Source Code form from the rights set forth in this License. If
+You distribute the Covered Software in Executable form under a different
+license, You must make it absolutely clear that any terms which differ
+from this License are offered by You alone, not by the Initial Developer
+or Contributor. You hereby agree to indemnify the Initial Developer and
+every Contributor for any liability incurred by the Initial Developer
+or such Contributor as a result of any such terms You offer.
+
+3.6. Larger Works.
+
+You may create a Larger Work by combining Covered Software with other code
+not governed by the terms of this License and distribute the Larger Work
+as a single product. In such a case, You must make sure the requirements
+of this License are fulfilled for the Covered Software.
+
+4. Versions of the License. 
+
+4.1. New Versions.
+
+Sun Microsystems, Inc. is the initial license steward and may publish
+revised and/or new versions of this License from time to time. Each
+version will be given a distinguishing version number. Except as provided
+in Section 4.3, no one other than the license steward has the right to
+modify this License.
+
+4.2. Effect of New Versions.
+
+You may always continue to use, distribute or otherwise make the Covered
+Software available under the terms of the version of the License under
+which You originally received the Covered Software. If the Initial
+Developer includes a notice in the Original Software prohibiting it
+from being distributed or otherwise made available under any subsequent
+version of the License, You must distribute and make the Covered Software
+available under the terms of the version of the License under which You
+originally received the Covered Software. Otherwise, You may also choose
+to use, distribute or otherwise make the Covered Software available
+under the terms of any subsequent version of the License published by
+the license steward.
+
+4.3. Modified Versions.
+
+When You are an Initial Developer and You want to create a new license
+for Your Original Software, You may create and use a modified version of
+this License if You: (a) rename the license and remove any references
+to the name of the license steward (except to note that the license
+differs from this License); and (b) otherwise make it clear that the
+license contains terms which differ from this License.
+
+5. DISCLAIMER OF WARRANTY.
+
+COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+WITHOUT LIMITATION, WARRANTIES THAT THE COVERED SOFTWARE IS FREE OF
+DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE
+ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED SOFTWARE
+IS WITH YOU. SHOULD ANY COVERED SOFTWARE PROVE DEFECTIVE IN ANY RESPECT,
+YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST
+OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF
+WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY
+COVERED SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
+
+6. TERMINATION. 
+
+6.1. This License and the rights granted hereunder will terminate
+automatically if You fail to comply with terms herein and fail to cure
+such breach within 30 days of becoming aware of the breach. Provisions
+which, by their nature, must remain in effect beyond the termination of
+this License shall survive.
+
+6.2. If You assert a patent infringement claim (excluding declaratory
+judgment actions) against Initial Developer or a Contributor (the
+Initial Developer or Contributor against whom You assert such claim is
+referred to as "Participant") alleging that the Participant Software
+(meaning the Contributor Version where the Participant is a Contributor
+or the Original Software where the Participant is the Initial Developer)
+directly or indirectly infringes any patent, then any and all rights
+granted directly or indirectly to You by such Participant, the Initial
+Developer (if the Initial Developer is not the Participant) and all
+Contributors under Sections 2.1 and/or 2.2 of this License shall, upon 60
+days notice from Participant terminate prospectively and automatically
+at the expiration of such 60 day notice period, unless if within such
+60 day period You withdraw Your claim with respect to the Participant
+Software against such Participant either unilaterally or pursuant to a
+written agreement with Participant.
+
+6.3. In the event of termination under Sections 6.1 or 6.2 above, all end
+user licenses that have been validly granted by You or any distributor
+hereunder prior to termination (excluding licenses granted to You by
+any distributor) shall survive termination.
+
+7. LIMITATION OF LIABILITY.
+
+UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING
+NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL DEVELOPER, ANY
+OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED SOFTWARE, OR ANY SUPPLIER
+OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL,
+INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT
+LIMITATION, DAMAGES FOR LOST PROFITS, LOSS OF GOODWILL, WORK STOPPAGE,
+COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES
+OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY
+OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY
+FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH PARTY'S NEGLIGENCE TO
+THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS
+DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL
+DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
+
+8. U.S. GOVERNMENT END USERS.
+
+The Covered Software is a "commercial item," as that term is defined
+in 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer
+software" (as that term is defined at 48 C.F.R.  252.227-7014(a)(1)) and
+"commercial computer software documentation" as such terms are used in
+48 C.F.R. 12.212 (Sept.  1995). Consistent with 48 C.F.R. 12.212 and 48
+C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End
+Users acquire Covered Software with only those rights set forth herein.
+This U.S. Government Rights clause is in lieu of, and supersedes, any
+other FAR, DFAR, or other clause or provision that addresses Government
+rights in computer software under this License.
+
+9. MISCELLANEOUS.
+
+This License represents the complete agreement concerning subject matter
+hereof. If any provision of this License is held to be unenforceable,
+such provision shall be reformed only to the extent necessary to make it
+enforceable. This License shall be governed by the law of the jurisdiction
+specified in a notice contained within the Original Software (except to
+the extent applicable law, if any, provides otherwise), excluding such
+jurisdiction's conflict-of-law provisions. Any litigation relating to
+this License shall be subject to the jurisdiction of the courts located
+in the jurisdiction and venue specified in a notice contained within
+the Original Software, with the losing party responsible for costs,
+including, without limitation, court costs and reasonable attorneys'
+fees and expenses. The application of the United Nations Convention on
+Contracts for the International Sale of Goods is expressly excluded. Any
+law or regulation which provides that the language of a contract shall
+be construed against the drafter shall not apply to this License.
+You agree that You alone are responsible for compliance with the United
+States export administration regulations (and the export control laws and
+regulation of any other countries) when You use, distribute or otherwise
+make available any Covered Software.
+
+10. RESPONSIBILITY FOR CLAIMS.
+
+As between Initial Developer and the Contributors, each party is
+responsible for claims and damages arising, directly or indirectly, out
+of its utilization of rights under this License and You agree to work
+with Initial Developer and Contributors to distribute such responsibility
+on an equitable basis. Nothing herein is intended or shall be deemed to
+constitute any admission of liability.
+
+
+
+===========================================================================
+
+To the extent any open source components are licensed under the
+GPL and/or LGPL, or other similar licenses that require the
+source code and/or modifications to source code to be made
+available (as would be noted above), you may obtain a copy of
+the source code corresponding to the binaries for such open
+source components and modifications thereto, if any, (the
+"Source Files"), by downloading the Source Files from VMware's website at
+http://www.vmware.com/download/open_source.html, or by sending a request, with
+your name and address to: VMware, Inc., 3401 Hillview Avenue,
+Palo Alto, CA 94304,United States of America. All such
+requests should clearly specify: OPEN SOURCE FILES REQUEST,
+Attention General Counsel. VMware shall mail a copy of the
+Source Files to you on a CD or equivalent physical medium. This
+offer to obtain a copy of the Source Files is valid for three
+years from the date you acquired this Software product. Alternatively,
+the Source Files may accompany the VMware product.
+
+
+[VFABRICGEMFIREHTTPSESSIONMANAGEMENTMODULE211GAKL051812]


[03/24] incubator-geode git commit: GEODE-14: Move GemFire Sessions module and relocate all packages to 'internal'

Posted by je...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/IntegrationTest.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/IntegrationTest.java b/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/IntegrationTest.java
new file mode 100644
index 0000000..ed5ed79
--- /dev/null
+++ b/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/IntegrationTest.java
@@ -0,0 +1,1552 @@
+/*=========================================================================
+ * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package com.gemstone.gemfire.modules.session.internal.filter;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.ArrayList;
+import java.util.EnumSet;
+import java.util.Enumeration;
+import java.util.List;
+import java.util.StringTokenizer;
+import java.util.concurrent.TimeUnit;
+import javax.servlet.DispatcherType;
+import javax.servlet.RequestDispatcher;
+import javax.servlet.ServletException;
+import javax.servlet.http.Cookie;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.modules.junit.PerTestClassLoaderRunner;
+import org.apache.jasper.servlet.JspServlet;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.eclipse.jetty.servlet.FilterHolder;
+import org.eclipse.jetty.servlet.ServletHolder;
+import org.eclipse.jetty.http.HttpTester;
+
+import static org.junit.Assert.*;
+
+/**
+ * In-container testing using Jetty. This allows us to test context listener
+ * events as well as dispatching actions.
+ */
+@RunWith(PerTestClassLoaderRunner.class)
+public class IntegrationTest {
+
+  private MyServletTester tester;
+
+  private HttpTester.Request request;
+
+  private HttpTester.Response response;
+
+  private ServletHolder servletHolder;
+
+  private FilterHolder filterHolder;
+
+  private static final File tmpdir;
+
+  private static final String gemfire_log;
+
+  static {
+    // Create a per-user scratch directory
+    tmpdir = new File(System.getProperty("java.io.tmpdir"),
+        "gemfire_modules-" + System.getProperty("user.name"));
+    tmpdir.mkdirs();
+    tmpdir.deleteOnExit();
+
+    gemfire_log = tmpdir.getPath() +
+        System.getProperty("file.separator") + "gemfire_modules.log";
+  }
+
+  @Before
+  public void setUp() throws Exception {
+    request = HttpTester.newRequest();
+
+    tester = new MyServletTester();
+    tester.setContextPath("/test");
+
+    filterHolder = tester.addFilter(SessionCachingFilter.class, "/*",
+        EnumSet.of(DispatcherType.REQUEST));
+    filterHolder.setInitParameter("gemfire.property.mcast-port", "0");
+    filterHolder.setInitParameter("gemfire.property.writable-working-dir",
+        tmpdir.getPath());
+    filterHolder.setInitParameter("cache-type", "peer-to-peer");
+    filterHolder.setInitParameter("gemfire.property.log-file",
+        gemfire_log);
+
+    servletHolder = tester.addServlet(BasicServlet.class, "/hello");
+    servletHolder.setInitParameter("test.callback", "callback_1");
+
+    /**
+     * This starts the servlet. Our wrapped servlets *must* start
+     * immediately otherwise the ServletContext is not captured correctly.
+     */
+    servletHolder.setInitOrder(0);
+  }
+
+  @After
+  public void tearDown() throws Exception {
+    if (tester.isStarted()) {
+      ContextManager.getInstance().removeContext(
+          servletHolder.getServlet().getServletConfig().getServletContext());
+    }
+    tester.stop();
+  }
+
+  @Test
+  public void testSanity() throws Exception {
+    Callback c = new Callback() {
+      @Override
+      public void call(HttpServletRequest request, HttpServletResponse response)
+          throws IOException {
+        PrintWriter out = response.getWriter();
+        out.write("Hello World");
+      }
+    };
+
+    tester.setAttribute("callback_1", c);
+    tester.start();
+    ContextManager.getInstance().putContext(
+        servletHolder.getServlet().getServletConfig().getServletContext());
+
+    request.setMethod("GET");
+    request.setURI("/test/hello");
+    request.setHeader("Host", "tester");
+    request.setVersion("HTTP/1.0");
+
+    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
+
+    assertEquals(200, response.getStatus());
+    assertEquals("Hello World", response.getContent());
+  }
+
+  @Test
+  public void testSessionGenerated() throws Exception {
+    Callback c = new Callback() {
+      @Override
+      public void call(HttpServletRequest request, HttpServletResponse response)
+          throws IOException {
+        PrintWriter out = response.getWriter();
+        out.write(request.getSession().getId());
+      }
+    };
+
+    tester.setAttribute("callback_1", c);
+    tester.start();
+    ContextManager.getInstance().putContext(
+        servletHolder.getServlet().getServletConfig().getServletContext());
+
+    request.setMethod("GET");
+    request.setURI("/test/hello");
+    request.setHeader("Host", "tester");
+    request.setVersion("HTTP/1.0");
+
+    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
+
+    assertTrue("Not a correctly generated session id",
+        response.getContent().endsWith("-GF"));
+
+    List<Cookie> cookies = getCookies(response);
+    assertEquals("Session id != JSESSIONID from cookie",
+        response.getContent(), cookies.get(0).getValue());
+
+    Region r = getRegion();
+    assertNotNull("Session not found in region",
+        r.get(cookies.get(0).getValue()));
+  }
+
+
+  /**
+   * Test that getSession(false) does not create a new session
+   */
+  @Test
+  public void testSessionNotGenerated() throws Exception {
+    Callback c = new Callback() {
+      @Override
+      public void call(HttpServletRequest request, HttpServletResponse response)
+          throws IOException {
+        String output = "OK";
+        HttpSession s = request.getSession(false);
+        if (s != null) {
+          output = s.getId();
+        }
+        PrintWriter out = response.getWriter();
+        out.write(output);
+      }
+    };
+
+    tester.setAttribute("callback_1", c);
+    tester.start();
+    ContextManager.getInstance().putContext(
+        servletHolder.getServlet().getServletConfig().getServletContext());
+
+    request.setMethod("GET");
+    request.setURI("/test/hello");
+    request.setHeader("Host", "tester");
+    request.setVersion("HTTP/1.0");
+
+    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
+
+    assertEquals("Session should not have been created", "OK",
+        response.getContent());
+  }
+
+
+  @Test
+  public void testUnknownAttributeIsNull() throws Exception {
+    Callback c = new Callback() {
+      @Override
+      public void call(HttpServletRequest request, HttpServletResponse response)
+          throws IOException {
+        Object o = request.getSession().getAttribute("unknown");
+        PrintWriter out = response.getWriter();
+        if (o == null) {
+          out.write("null");
+        } else {
+          out.write(o.toString());
+        }
+      }
+    };
+
+    tester.setAttribute("callback_1", c);
+    tester.start();
+    ContextManager.getInstance().putContext(
+        servletHolder.getServlet().getServletConfig().getServletContext());
+
+    request.setMethod("GET");
+    request.setURI("/test/hello");
+    request.setHeader("Host", "tester");
+    request.setVersion("HTTP/1.0");
+
+    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
+
+    assertEquals("Unknown attribute should be null", "null",
+        response.getContent());
+  }
+
+
+  @Test
+  public void testSessionRemains1() throws Exception {
+    Callback c = new Callback() {
+      @Override
+      public void call(HttpServletRequest request, HttpServletResponse response)
+          throws IOException {
+        String output = "null";
+        HttpSession session = request.getSession();
+        if (session.isNew()) {
+          output = "new";
+          session.setAttribute("foo", output);
+        } else {
+          output = (String) session.getAttribute("foo");
+          if (output != null) {
+            output = "old";
+          }
+        }
+        PrintWriter out = response.getWriter();
+        out.write(output);
+      }
+    };
+
+    tester.setAttribute("callback_1", c);
+    tester.start();
+    ContextManager.getInstance().putContext(
+        servletHolder.getServlet().getServletConfig().getServletContext());
+
+    request.setMethod("GET");
+    request.setURI("/test/hello");
+    request.setHeader("Host", "tester");
+    request.setVersion("HTTP/1.0");
+
+    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
+
+    assertEquals("Session should be new", "new", response.getContent());
+
+    List<Cookie> cookies = getCookies(response);
+    request.setHeader("Cookie", "JSESSIONID=" + cookies.get(0).getValue());
+
+    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
+
+    assertEquals("Session should be old", "old", response.getContent());
+
+    List<Cookie> cookies2 = getCookies(response);
+    assertEquals("Session IDs should be the same", cookies.get(0).getValue(),
+        cookies2.get(0).getValue());
+
+    Region r = getRegion();
+    assertNotNull("Session object should exist in region",
+        r.get(cookies.get(0).getValue()));
+  }
+
+  /**
+   * Test that attributes are updated on the backend
+   */
+  @Test
+  public void testAttributesUpdatedInRegion() throws Exception {
+    Callback c_1 = new Callback() {
+      @Override
+      public void call(HttpServletRequest request, HttpServletResponse response)
+          throws IOException, ServletException {
+        request.getSession().setAttribute("foo", "bar");
+      }
+    };
+
+    // This is the callback used to invalidate the session
+    Callback c_2 = new Callback() {
+      @Override
+      public void call(HttpServletRequest request, HttpServletResponse response)
+          throws IOException, ServletException {
+        request.getSession().setAttribute("foo", "baz");
+      }
+    };
+
+    tester.setAttribute("callback_1", c_1);
+    tester.setAttribute("callback_2", c_2);
+
+    servletHolder.setInitParameter("test.callback", "callback_1");
+
+    ServletHolder sh2 = tester.addServlet(BasicServlet.class, "/request2");
+    sh2.setInitParameter("test.callback", "callback_2");
+
+    tester.start();
+    ContextManager.getInstance().putContext(
+        servletHolder.getServlet().getServletConfig().getServletContext());
+
+    request.setMethod("GET");
+    request.setURI("/test/hello");
+    request.setHeader("Host", "tester");
+    request.setVersion("HTTP/1.0");
+    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
+
+    List<Cookie> cookies = getCookies(response);
+
+    Region r = getRegion();
+    assertEquals("bar",
+        ((HttpSession) r.get(cookies.get(0).getValue())).getAttribute("foo"));
+
+    request.setHeader("Cookie", "JSESSIONID=" + cookies.get(0).getValue());
+    request.setURI("/test/request2");
+    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
+
+    assertEquals("baz",
+        ((HttpSession) r.get(cookies.get(0).getValue())).getAttribute(
+            "foo"));
+  }
+
+  /**
+   * Test setting an attribute to null deletes it
+   */
+  @Test
+  public void testSetAttributeNullDeletesIt() throws Exception {
+    Callback c_1 = new Callback() {
+      @Override
+      public void call(HttpServletRequest request, HttpServletResponse response)
+          throws IOException, ServletException {
+        request.getSession().setAttribute("foo", "bar");
+      }
+    };
+
+    // This is the callback used to invalidate the session
+    Callback c_2 = new Callback() {
+      @Override
+      public void call(HttpServletRequest request, HttpServletResponse response)
+          throws IOException, ServletException {
+        request.getSession().setAttribute("foo", null);
+      }
+    };
+
+    tester.setAttribute("callback_1", c_1);
+    tester.setAttribute("callback_2", c_2);
+
+    servletHolder.setInitParameter("test.callback", "callback_1");
+
+    ServletHolder sh2 = tester.addServlet(BasicServlet.class, "/request2");
+    sh2.setInitParameter("test.callback", "callback_2");
+
+    tester.start();
+    ContextManager.getInstance().putContext(
+        servletHolder.getServlet().getServletConfig().getServletContext());
+
+    request.setMethod("GET");
+    request.setURI("/test/hello");
+    request.setHeader("Host", "tester");
+    request.setVersion("HTTP/1.0");
+    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
+
+    List<Cookie> cookies = getCookies(response);
+
+    Region r = getRegion();
+    assertEquals("bar",
+        ((HttpSession) r.get(cookies.get(0).getValue())).getAttribute(
+            "foo"));
+
+    request.setHeader("Cookie", "JSESSIONID=" + cookies.get(0).getValue());
+    request.setURI("/test/request2");
+    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
+
+    assertNull(
+        ((HttpSession) r.get(cookies.get(0).getValue())).getAttribute(
+            "foo"));
+  }
+
+// Don't see how to do this currently as the SessionListener needs a full
+// web context to work in.
+
+//    /**
+//     * Test that sessions expire correctly
+//     */
+//    public void testSessionExpiration() throws Exception {
+//        Callback c_1 = new Callback() {
+//            @Override
+//            public void call(HttpServletRequest request, HttpServletResponse response)
+//                    throws IOException, ServletException {
+//                HttpSession s = request.getSession();
+//                s.setAttribute("foo", "bar");
+//                s.setMaxInactiveInterval(1);
+//
+//                PrintWriter out = response.getWriter();
+//                out.write(s.getId());
+//            }
+//        };
+//
+//        // This is the callback used to check if the session is still there
+//        Callback c_2 = new Callback() {
+//            @Override
+//            public void call(HttpServletRequest request, HttpServletResponse response)
+//                    throws IOException, ServletException {
+//                HttpSession s = request.getSession(false);
+//                String output;
+//                if (s == null) {
+//                    output = "null";
+//                } else {
+//                    output = s.getId();
+//                }
+//
+//                PrintWriter out = response.getWriter();
+//                out.write(output);
+//            }
+//        };
+//
+//        tester.addEventListener(new SessionListener());
+//        tester.setAttribute("callback_1", c_1);
+//        tester.setAttribute("callback_2", c_2);
+//
+//        servletHolder.setInitParameter("test.callback", "callback_1");
+//
+//        ServletHolder sh2 = tester.addServlet(BasicServlet.class, "/request2");
+//        sh2.setInitParameter("test.callback", "callback_2");
+//
+//        tester.start();
+//        ContextManager.getInstance().putContext(
+//                servletHolder.getServlet().getServletConfig().getServletContext());
+//
+//        request.setMethod("GET");
+//        request.setURI("/test/hello");
+//        request.setHeader("Host", "tester");
+//        request.setVersion("HTTP/1.0");
+//        response.parse(tester.getResponses(request.generate()));
+//
+//        String id = response.getContent();
+//
+//        // Wait for the session to expire
+//        Thread.sleep(2000);
+//
+//        request.setHeader("Cookie", "JSESSIONID=" + id);
+//        request.setURI("/test/request2");
+//        response.parse(tester.getResponses(request.generate()));
+//
+//        assertEquals("null", response.getContent());
+//
+//        Region r = getRegion();
+//        assertNull("Region should not contain session", r.get(id));
+//    }
+
+  /**
+   * Test that invalidating a session destroys it as well as the backend
+   * object.
+   */
+  @Test
+  public void testInvalidateSession1() throws Exception {
+    Callback c_1 = new Callback() {
+      @Override
+      public void call(HttpServletRequest request, HttpServletResponse response)
+          throws IOException, ServletException {
+        request.getSession().setAttribute("foo", "bar");
+      }
+    };
+
+    // This is the callback used to invalidate the session
+    Callback c_2 = new Callback() {
+      @Override
+      public void call(HttpServletRequest request, HttpServletResponse response)
+          throws IOException, ServletException {
+        request.getSession(false).invalidate();
+      }
+    };
+
+    tester.setAttribute("callback_1", c_1);
+    tester.setAttribute("callback_2", c_2);
+
+    servletHolder.setInitParameter("test.callback", "callback_1");
+
+    ServletHolder sh2 = tester.addServlet(BasicServlet.class, "/request2");
+    sh2.setInitParameter("test.callback", "callback_2");
+
+    tester.start();
+    ContextManager.getInstance().putContext(
+        servletHolder.getServlet().getServletConfig().getServletContext());
+
+    request.setMethod("GET");
+    request.setURI("/test/hello");
+    request.setHeader("Host", "tester");
+    request.setVersion("HTTP/1.0");
+    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
+
+    List<Cookie> cookies = getCookies(response);
+    Region r = getRegion();
+    assertEquals("bar",
+        ((HttpSession) r.get(cookies.get(0).getValue())).getAttribute("foo"));
+
+    request.setHeader("Cookie", "JSESSIONID=" + cookies.get(0).getValue());
+    request.setURI("/test/request2");
+    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
+
+    assertNull("Region should not contain session",
+        r.get(cookies.get(0).getValue()));
+  }
+
+  /**
+   * Test that invalidating a session throws an exception on subsequent access.
+   */
+  @Test
+  public void testInvalidateSession2() throws Exception {
+    Callback c_1 = new Callback() {
+      @Override
+      public void call(HttpServletRequest request, HttpServletResponse response)
+          throws IOException, ServletException {
+        HttpSession s = request.getSession();
+        s.invalidate();
+        PrintWriter out = response.getWriter();
+        try {
+          s.getAttribute("foo");
+        } catch (IllegalStateException iex) {
+          out.write("OK");
+        }
+      }
+    };
+
+    tester.setAttribute("callback_1", c_1);
+
+    servletHolder.setInitParameter("test.callback", "callback_1");
+
+    tester.start();
+    ContextManager.getInstance().putContext(
+        servletHolder.getServlet().getServletConfig().getServletContext());
+
+    request.setMethod("GET");
+    request.setURI("/test/hello");
+    request.setHeader("Host", "tester");
+    request.setVersion("HTTP/1.0");
+    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
+
+    assertEquals("OK", response.getContent());
+  }
+
+  /**
+   * Test that invalidating a session throws an exception on subsequent access.
+   */
+  @Test
+  public void testInvalidateSession3() throws Exception {
+    Callback c_1 = new Callback() {
+      @Override
+      public void call(HttpServletRequest request, HttpServletResponse response)
+          throws IOException, ServletException {
+        HttpSession s = request.getSession();
+        s.invalidate();
+        PrintWriter out = response.getWriter();
+        try {
+          s.getAttributeNames();
+        } catch (IllegalStateException iex) {
+          out.write("OK");
+        }
+      }
+    };
+
+    tester.setAttribute("callback_1", c_1);
+
+    servletHolder.setInitParameter("test.callback", "callback_1");
+
+    tester.start();
+    ContextManager.getInstance().putContext(
+        servletHolder.getServlet().getServletConfig().getServletContext());
+
+    request.setMethod("GET");
+    request.setURI("/test/hello");
+    request.setHeader("Host", "tester");
+    request.setVersion("HTTP/1.0");
+    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
+
+    assertEquals("OK", response.getContent());
+  }
+
+  /**
+   * Test that invalidating a session throws an exception on subsequent access.
+   */
+  @Test
+  public void testInvalidateSession4() throws Exception {
+    Callback c_1 = new Callback() {
+      @Override
+      public void call(HttpServletRequest request, HttpServletResponse response)
+          throws IOException, ServletException {
+        HttpSession s = request.getSession();
+        s.invalidate();
+        PrintWriter out = response.getWriter();
+        try {
+          s.getCreationTime();
+        } catch (IllegalStateException iex) {
+          out.write("OK");
+        }
+      }
+    };
+
+    tester.setAttribute("callback_1", c_1);
+
+    servletHolder.setInitParameter("test.callback", "callback_1");
+
+    tester.start();
+    ContextManager.getInstance().putContext(
+        servletHolder.getServlet().getServletConfig().getServletContext());
+
+    request.setMethod("GET");
+    request.setURI("/test/hello");
+    request.setHeader("Host", "tester");
+    request.setVersion("HTTP/1.0");
+    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
+
+    assertEquals("OK", response.getContent());
+  }
+
+  /**
+   * Test that invalidating a session does not throw an exception for subsequent
+   * getId calls.
+   */
+  @Test
+  public void testInvalidateSession5() throws Exception {
+    Callback c_1 = new Callback() {
+      @Override
+      public void call(HttpServletRequest request, HttpServletResponse response)
+          throws IOException, ServletException {
+        HttpSession s = request.getSession();
+        s.invalidate();
+        s.getId();
+        PrintWriter out = response.getWriter();
+        out.write("OK");
+      }
+    };
+
+    tester.setAttribute("callback_1", c_1);
+
+    servletHolder.setInitParameter("test.callback", "callback_1");
+
+    tester.start();
+    ContextManager.getInstance().putContext(
+        servletHolder.getServlet().getServletConfig().getServletContext());
+
+    request.setMethod("GET");
+    request.setURI("/test/hello");
+    request.setHeader("Host", "tester");
+    request.setVersion("HTTP/1.0");
+    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
+
+    assertEquals("OK", response.getContent());
+  }
+
+  /**
+   * Test that invalidating a session throws an exception on subsequent access.
+   */
+  @Test
+  public void testInvalidateSession6() throws Exception {
+    Callback c_1 = new Callback() {
+      @Override
+      public void call(HttpServletRequest request, HttpServletResponse response)
+          throws IOException, ServletException {
+        HttpSession s = request.getSession();
+        s.invalidate();
+        PrintWriter out = response.getWriter();
+        try {
+          s.getLastAccessedTime();
+        } catch (IllegalStateException iex) {
+          out.write("OK");
+        }
+      }
+    };
+
+    tester.setAttribute("callback_1", c_1);
+
+    servletHolder.setInitParameter("test.callback", "callback_1");
+
+    tester.start();
+    ContextManager.getInstance().putContext(
+        servletHolder.getServlet().getServletConfig().getServletContext());
+
+    request.setMethod("GET");
+    request.setURI("/test/hello");
+    request.setHeader("Host", "tester");
+    request.setVersion("HTTP/1.0");
+    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
+
+    assertEquals("OK", response.getContent());
+  }
+
+  /**
+   * Test that invalidating a session does not throw an exception for
+   * subsequent getMaxInactiveInterval calls.
+   */
+
+// I've commented this out for now as Jetty seems to want to throw an
+// Exception here where the HttpServlet api doesn't specify that.
+  @Test
+  public void testInvalidateSession7() throws Exception {
+    Callback c_1 = new Callback() {
+      @Override
+      public void call(HttpServletRequest request,
+          HttpServletResponse response) throws IOException, ServletException {
+        HttpSession s = request.getSession();
+        s.invalidate();
+        s.getMaxInactiveInterval();
+        PrintWriter out = response.getWriter();
+        out.write("OK");
+      }
+    };
+
+    tester.setAttribute("callback_1", c_1);
+
+    servletHolder.setInitParameter("test.callback", "callback_1");
+
+    tester.start();
+    ContextManager.getInstance().putContext(
+        servletHolder.getServlet().getServletConfig().getServletContext());
+
+    request.setMethod("GET");
+    request.setURI("/test/hello");
+    request.setHeader("Host", "tester");
+    request.setVersion("HTTP/1.0");
+    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
+
+    assertEquals("OK", response.getContent());
+  }
+
+  /**
+   * Test that invalidating a session does not throw an exception for subsequent
+   * getServletContext calls.
+   */
+  @Test
+  public void testInvalidateSession8() throws Exception {
+    Callback c_1 = new Callback() {
+      @Override
+      public void call(HttpServletRequest request, HttpServletResponse response)
+          throws IOException, ServletException {
+        HttpSession s = request.getSession();
+        s.invalidate();
+        s.getServletContext();
+        PrintWriter out = response.getWriter();
+        out.write("OK");
+      }
+    };
+
+    tester.setAttribute("callback_1", c_1);
+
+    servletHolder.setInitParameter("test.callback", "callback_1");
+
+    tester.start();
+    ContextManager.getInstance().putContext(
+        servletHolder.getServlet().getServletConfig().getServletContext());
+
+    request.setMethod("GET");
+    request.setURI("/test/hello");
+    request.setHeader("Host", "tester");
+    request.setVersion("HTTP/1.0");
+    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
+
+    assertEquals("OK", response.getContent());
+  }
+
+  /**
+   * Test that invalidating a session throws an exception on subsequent access.
+   */
+  @Test
+  public void testInvalidateSession9() throws Exception {
+    Callback c_1 = new Callback() {
+      @Override
+      public void call(HttpServletRequest request, HttpServletResponse response)
+          throws IOException, ServletException {
+        HttpSession s = request.getSession();
+        s.invalidate();
+        PrintWriter out = response.getWriter();
+        try {
+          s.isNew();
+        } catch (IllegalStateException iex) {
+          out.write("OK");
+        }
+      }
+    };
+
+    tester.setAttribute("callback_1", c_1);
+
+    servletHolder.setInitParameter("test.callback", "callback_1");
+
+    tester.start();
+    ContextManager.getInstance().putContext(
+        servletHolder.getServlet().getServletConfig().getServletContext());
+
+    request.setMethod("GET");
+    request.setURI("/test/hello");
+    request.setHeader("Host", "tester");
+    request.setVersion("HTTP/1.0");
+    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
+
+    assertEquals("OK", response.getContent());
+  }
+
+  /**
+   * Test that invalidating a session throws an exception on subsequent access.
+   */
+  @Test
+  public void testInvalidateSession10() throws Exception {
+    Callback c_1 = new Callback() {
+      @Override
+      public void call(HttpServletRequest request, HttpServletResponse response)
+          throws IOException, ServletException {
+        HttpSession s = request.getSession();
+        s.invalidate();
+        PrintWriter out = response.getWriter();
+        try {
+          s.removeAttribute("foo");
+        } catch (IllegalStateException iex) {
+          out.write("OK");
+        }
+      }
+    };
+
+    tester.setAttribute("callback_1", c_1);
+
+    servletHolder.setInitParameter("test.callback", "callback_1");
+
+    tester.start();
+    ContextManager.getInstance().putContext(
+        servletHolder.getServlet().getServletConfig().getServletContext());
+
+    request.setMethod("GET");
+    request.setURI("/test/hello");
+    request.setHeader("Host", "tester");
+    request.setVersion("HTTP/1.0");
+    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
+
+    assertEquals("OK", response.getContent());
+  }
+
+  /**
+   * Test that invalidating a session throws an exception on subsequent access.
+   */
+  @Test
+  public void testInvalidateSession11() throws Exception {
+    Callback c_1 = new Callback() {
+      @Override
+      public void call(HttpServletRequest request, HttpServletResponse response)
+          throws IOException, ServletException {
+        HttpSession s = request.getSession();
+        s.invalidate();
+        PrintWriter out = response.getWriter();
+        try {
+          s.setAttribute("foo", "bar");
+        } catch (IllegalStateException iex) {
+          out.write("OK");
+        }
+      }
+    };
+
+    tester.setAttribute("callback_1", c_1);
+
+    servletHolder.setInitParameter("test.callback", "callback_1");
+
+    tester.start();
+    ContextManager.getInstance().putContext(
+        servletHolder.getServlet().getServletConfig().getServletContext());
+
+    request.setMethod("GET");
+    request.setURI("/test/hello");
+    request.setHeader("Host", "tester");
+    request.setVersion("HTTP/1.0");
+    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
+
+    assertEquals("OK", response.getContent());
+  }
+
+  /**
+   * Test that invalidating a session does not throw an exception for subsequent
+   * setMaxInactiveInterval calls.
+   */
+  @Test
+  public void testInvalidateSession12() throws Exception {
+    Callback c_1 = new Callback() {
+      @Override
+      public void call(HttpServletRequest request, HttpServletResponse response)
+          throws IOException, ServletException {
+        HttpSession s = request.getSession();
+        s.invalidate();
+        s.setMaxInactiveInterval(1);
+        PrintWriter out = response.getWriter();
+        out.write("OK");
+      }
+    };
+
+    tester.setAttribute("callback_1", c_1);
+
+    servletHolder.setInitParameter("test.callback", "callback_1");
+
+    tester.start();
+    ContextManager.getInstance().putContext(
+        servletHolder.getServlet().getServletConfig().getServletContext());
+
+    request.setMethod("GET");
+    request.setURI("/test/hello");
+    request.setHeader("Host", "tester");
+    request.setVersion("HTTP/1.0");
+    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
+
+    assertEquals("OK", response.getContent());
+  }
+
+  /**
+   * Test that invalidating a session results in null being returned on
+   * subsequent getSession(false) calls.
+   */
+  @Test
+  public void testInvalidateSession13() throws Exception {
+    Callback c_1 = new Callback() {
+      @Override
+      public void call(HttpServletRequest request, HttpServletResponse response)
+          throws IOException, ServletException {
+        HttpSession s = request.getSession();
+        s.invalidate();
+        s = request.getSession(false);
+        PrintWriter out = response.getWriter();
+        if (s == null) {
+          out.write("OK");
+        } else {
+          out.write(s.toString());
+        }
+      }
+    };
+
+    tester.setAttribute("callback_1", c_1);
+
+    servletHolder.setInitParameter("test.callback", "callback_1");
+
+    tester.start();
+    ContextManager.getInstance().putContext(
+        servletHolder.getServlet().getServletConfig().getServletContext());
+
+    request.setMethod("GET");
+    request.setURI("/test/hello");
+    request.setHeader("Host", "tester");
+    request.setVersion("HTTP/1.0");
+    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
+
+    assertEquals("OK", response.getContent());
+  }
+
+
+  /**
+   * Test that we can invalidate and then recreate a new session
+   */
+  @Test
+  public void testInvalidateAndRecreateSession() throws Exception {
+    Callback c_1 = new Callback() {
+      @Override
+      public void call(HttpServletRequest request, HttpServletResponse response)
+          throws IOException, ServletException {
+
+        PrintWriter out = response.getWriter();
+        out.write(request.getSession().getId());
+      }
+    };
+
+    Callback c_2 = new Callback() {
+      @Override
+      public void call(HttpServletRequest request, HttpServletResponse response)
+          throws IOException, ServletException {
+        HttpSession s = request.getSession();
+        s.invalidate();
+
+        PrintWriter out = response.getWriter();
+        out.write(request.getSession().getId());
+      }
+    };
+
+    tester.setAttribute("callback_1", c_1);
+    tester.setAttribute("callback_2", c_2);
+
+    ServletHolder sh = tester.addServlet(BasicServlet.class, "/dispatch");
+    sh.setInitParameter("test.callback", "callback_2");
+
+    tester.start();
+    ContextManager.getInstance().putContext(
+        sh.getServlet().getServletConfig().getServletContext());
+
+    request.setMethod("GET");
+    request.setURI("/test/hello");
+    request.setHeader("Host", "tester");
+    request.setVersion("HTTP/1.0");
+
+    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
+    String session1 = response.getContent();
+
+    request.setHeader("Cookie", "JSESSIONID=" + session1);
+    request.setURI("/test/request2");
+    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
+
+    String session12 = response.getContent();
+    assertFalse("First and subsequent session ids must not be the same",
+        session1.equals(session12));
+  }
+
+
+  /**
+   * Test that creation time does not change on subsequent access
+   */
+  @Test
+  public void testGetCreationTime() throws Exception {
+    Callback c = new Callback() {
+      @Override
+      public void call(HttpServletRequest request, HttpServletResponse response)
+          throws IOException {
+        HttpSession session = request.getSession();
+        PrintWriter out = response.getWriter();
+        out.write(Long.toString(session.getCreationTime()));
+      }
+    };
+
+    tester.setAttribute("callback_1", c);
+    tester.start();
+    ContextManager.getInstance().putContext(
+        servletHolder.getServlet().getServletConfig().getServletContext());
+
+    request.setMethod("GET");
+    request.setURI("/test/hello");
+    request.setHeader("Host", "tester");
+    request.setVersion("HTTP/1.0");
+
+    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
+
+    long time1 = Long.parseLong(response.getContent());
+    assertTrue("Creation time should be positive", time1 > 0);
+
+    List<Cookie> cookies = getCookies(response);
+    request.setHeader("Cookie", "JSESSIONID=" + cookies.get(0).getValue());
+
+    try {
+      Thread.sleep(1000);
+    } catch (Exception ex) {
+    }
+
+    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
+    long time2 = Long.parseLong(response.getContent());
+    assertTrue("Creation time should be the same across requests",
+        time1 == time2);
+  }
+
+  /**
+   * Test that the last accessed time is updated on subsequent access
+   */
+  @Test
+  public void testGetLastAccessedTime() throws Exception {
+    Callback c = new Callback() {
+      @Override
+      public void call(HttpServletRequest request, HttpServletResponse response)
+          throws IOException {
+        HttpSession session = request.getSession();
+        PrintWriter out = response.getWriter();
+        out.write(Long.toString(session.getLastAccessedTime()));
+      }
+    };
+
+    tester.setAttribute("callback_1", c);
+    tester.start();
+    ContextManager.getInstance().putContext(
+        servletHolder.getServlet().getServletConfig().getServletContext());
+
+    request.setMethod("GET");
+    request.setURI("/test/hello");
+    request.setHeader("Host", "tester");
+    request.setVersion("HTTP/1.0");
+
+    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
+
+    long time1 = Long.parseLong(response.getContent());
+//        assertTrue("Last accessed time should be positive", time1 > 0);
+
+    List<Cookie> cookies = getCookies(response);
+    request.setHeader("Cookie", "JSESSIONID=" + cookies.get(0).getValue());
+
+    Thread.sleep(1000);
+
+    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
+    long time2 = Long.parseLong(response.getContent());
+    assertTrue("Last accessed time should be increasing across requests",
+        time2 > time1);
+  }
+
+  /**
+   * Test that the underlying native session remains the same across requests
+   */
+  @Test
+  public void testNativeSessionRemainsUnchanged() throws Exception {
+    Callback c = new Callback() {
+      @Override
+      public void call(HttpServletRequest request, HttpServletResponse response)
+          throws IOException {
+        GemfireHttpSession session = (GemfireHttpSession) request.getSession();
+        PrintWriter out = response.getWriter();
+        out.write(session.getNativeSession().getId());
+      }
+    };
+
+    tester.setAttribute("callback_1", c);
+    tester.start();
+    ContextManager.getInstance().putContext(
+        servletHolder.getServlet().getServletConfig().getServletContext());
+
+    request.setMethod("GET");
+    request.setURI("/test/hello");
+    request.setHeader("Host", "tester");
+    request.setVersion("HTTP/1.0");
+
+    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
+    String nativeSessionId = response.getContent();
+
+    List<Cookie> cookies = getCookies(response);
+    String sessionId = cookies.get(0).getValue();
+    Region r = getRegion();
+
+    assertEquals(
+        "Cached native session id does not match servlet returned native session id",
+        nativeSessionId,
+        ((GemfireHttpSession) r.get(sessionId)).getNativeSession().getId());
+
+    request.setHeader("Cookie", "JSESSIONID=" + cookies.get(0).getValue());
+    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
+
+    assertEquals(
+        "Underlying native sessions must remain the same across requests",
+        nativeSessionId,
+        ((GemfireHttpSession) r.get(sessionId)).getNativeSession().getId());
+  }
+
+  /**
+   * Test session id embedded in the URL
+   */
+  @Test
+  public void testSessionIdEmbeddedInUrl() throws Exception {
+    Callback c = new Callback() {
+      @Override
+      public void call(HttpServletRequest request, HttpServletResponse response)
+          throws IOException {
+        GemfireHttpSession session = (GemfireHttpSession) request.getSession();
+        PrintWriter out = response.getWriter();
+        out.write(session.getId());
+      }
+    };
+
+    tester.setAttribute("callback_1", c);
+    tester.start();
+    ContextManager.getInstance().putContext(
+        servletHolder.getServlet().getServletConfig().getServletContext());
+
+    request.setMethod("GET");
+    request.setURI("/test/hello");
+    request.setHeader("Host", "tester");
+    request.setVersion("HTTP/1.0");
+
+    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
+    List<Cookie> cookies = getCookies(response);
+    String sessionId = response.getContent();
+    assertEquals("Session ids should be the same", sessionId,
+        cookies.get(0).getValue());
+
+    request.setURI("/test/hello;jsessionid=" + sessionId);
+    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
+    cookies = getCookies(response);
+
+    assertEquals("Session ids should be the same", sessionId,
+        cookies.get(0).getValue());
+  }
+
+
+  /**
+   * Test that request forward dispatching works
+   */
+  @Test
+  public void testDispatchingForward1() throws Exception {
+    Callback c_1 = new Callback() {
+      @Override
+      public void call(HttpServletRequest request, HttpServletResponse response)
+          throws IOException, ServletException {
+        RequestDispatcher dispatcher = request.getRequestDispatcher("dispatch");
+        dispatcher.forward(request, response);
+
+        // This should not appear in the output
+        PrintWriter out = response.getWriter();
+        out.write("bang");
+      }
+    };
+
+    // This is the callback used by the forward servlet
+    Callback c_2 = new Callback() {
+      @Override
+      public void call(HttpServletRequest request, HttpServletResponse response)
+          throws IOException, ServletException {
+        PrintWriter out = response.getWriter();
+        out.write("dispatched");
+      }
+    };
+
+    tester.setAttribute("callback_1", c_1);
+    tester.setAttribute("callback_2", c_2);
+
+    ServletHolder sh = tester.addServlet(BasicServlet.class, "/dispatch");
+    sh.setInitParameter("test.callback", "callback_2");
+
+    tester.start();
+    ContextManager.getInstance().putContext(
+        sh.getServlet().getServletConfig().getServletContext());
+
+    request.setMethod("GET");
+    request.setURI("/test/hello");
+    request.setHeader("Host", "tester");
+    request.setVersion("HTTP/1.0");
+
+    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
+    assertEquals("dispatched", response.getContent());
+
+    ContextManager.getInstance().removeContext(
+        sh.getServlet().getServletConfig().getServletContext());
+  }
+
+
+  /**
+   * Test that request include dispatching works
+   */
+  @Test
+  public void testDispatchingInclude() throws Exception {
+    Callback c_1 = new Callback() {
+      @Override
+      public void call(HttpServletRequest request, HttpServletResponse response)
+          throws IOException, ServletException {
+        RequestDispatcher dispatcher = request.getRequestDispatcher("dispatch");
+        dispatcher.include(request, response);
+
+        // This *should* appear in the output
+        PrintWriter out = response.getWriter();
+        out.write("_bang");
+      }
+    };
+
+    // This is the callback used by the include servlet
+    Callback c_2 = new Callback() {
+      @Override
+      public void call(HttpServletRequest request, HttpServletResponse response)
+          throws IOException, ServletException {
+        PrintWriter out = response.getWriter();
+        out.write("dispatched");
+      }
+    };
+
+    tester.setAttribute("callback_1", c_1);
+    tester.setAttribute("callback_2", c_2);
+
+    ServletHolder sh = tester.addServlet(BasicServlet.class, "/dispatch");
+    sh.setInitParameter("test.callback", "callback_2");
+
+    tester.start();
+    ContextManager.getInstance().putContext(
+        sh.getServlet().getServletConfig().getServletContext());
+
+    request.setMethod("GET");
+    request.setURI("/test/hello");
+    request.setHeader("Host", "tester");
+    request.setVersion("HTTP/1.0");
+
+    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
+    assertEquals("dispatched_bang", response.getContent());
+
+    ContextManager.getInstance().removeContext(
+        sh.getServlet().getServletConfig().getServletContext());
+  }
+
+
+  /**
+   * Test to try and simulate a failover scenario
+   */
+  @Test
+  public void testFailover1() throws Exception {
+    Callback c_1 = new Callback() {
+      @Override
+      public void call(HttpServletRequest request, HttpServletResponse response)
+          throws IOException, ServletException {
+        HttpSession s = request.getSession();
+        s.setAttribute("foo", "bar");
+
+        PrintWriter out = response.getWriter();
+        out.write(request.getSession().getId());
+      }
+    };
+
+    Callback c_2 = new Callback() {
+      @Override
+      public void call(HttpServletRequest request, HttpServletResponse response)
+          throws IOException, ServletException {
+        HttpSession s = request.getSession();
+
+        PrintWriter out = response.getWriter();
+        out.write((String) s.getAttribute("foo"));
+      }
+    };
+
+    tester.setAttribute("callback_1", c_1);
+    tester.setAttribute("callback_2", c_2);
+
+    ServletHolder sh = tester.addServlet(BasicServlet.class, "/request2");
+    sh.setInitParameter("test.callback", "callback_2");
+
+    tester.start();
+    ContextManager.getInstance().putContext(
+        sh.getServlet().getServletConfig().getServletContext());
+
+    request.setMethod("GET");
+    request.setURI("/test/hello");
+    request.setHeader("Host", "tester");
+    request.setVersion("HTTP/1.0");
+
+    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
+    String id = response.getContent();
+
+    // Now we simulate the failover by removing the native session from
+    // the stored session
+    Region r = getRegion();
+    GemfireHttpSession sessObj = (GemfireHttpSession) r.get(id);
+    sessObj.setNativeSession(null);
+
+    r.put(id, sessObj);
+
+    request.setHeader("Cookie", "JSESSIONID=" + id);
+    request.setURI("/test/request2");
+    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
+
+    assertEquals("bar", response.getContent());
+  }
+
+  @Test
+  public void testHttpSessionListener1() throws Exception {
+    HttpSessionListenerImpl listener = new HttpSessionListenerImpl();
+    tester.getContext().getSessionHandler().addEventListener(listener);
+
+    Callback c = new Callback() {
+      @Override
+      public void call(HttpServletRequest request, HttpServletResponse response)
+          throws IOException {
+        HttpSession s = request.getSession();
+        // This is set in HttpSessionListenerImpl
+        String result = (String) s.getAttribute("gemfire-session-id");
+        response.getWriter().write(result);
+      }
+    };
+
+    tester.setAttribute("callback_1", c);
+    tester.start();
+    ContextManager.getInstance().putContext(
+        servletHolder.getServlet().getServletConfig().getServletContext());
+
+    request.setMethod("GET");
+    request.setURI("/test/hello");
+    request.setHeader("Host", "tester");
+    request.setVersion("HTTP/1.0");
+
+    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
+
+    assertEquals(200, response.getStatus());
+
+    List<Cookie> cookies = getCookies(response);
+
+//        AbstractListener listener = RendezvousManager.getListener();
+    tester.stop();
+
+    assertTrue("Timeout waiting for events",
+        listener.await(1, TimeUnit.SECONDS));
+    assertEquals(ListenerEventType.SESSION_CREATED,
+        listener.events.get(0));
+    assertEquals(ListenerEventType.SESSION_DESTROYED,
+        listener.events.get(1));
+    assertEquals(cookies.get(0).getValue(), response.getContent());
+  }
+
+  @Test
+  public void testHttpSessionListener2() throws Exception {
+    HttpSessionListenerImpl2 listener = new HttpSessionListenerImpl2();
+    tester.getContext().getSessionHandler().addEventListener(listener);
+
+    Callback c = new Callback() {
+      @Override
+      public void call(HttpServletRequest request, HttpServletResponse response)
+          throws IOException {
+        HttpSession s = request.getSession();
+        s.setAttribute("test01", "test01");
+        s = request.getSession(false);
+        s.invalidate();
+        response.getWriter().write(s.getId());
+      }
+    };
+
+    tester.setAttribute("callback_1", c);
+    tester.start();
+    ContextManager.getInstance().putContext(
+        servletHolder.getServlet().getServletConfig().getServletContext());
+
+    request.setMethod("GET");
+    request.setURI("/test/hello");
+    request.setHeader("Host", "tester");
+    request.setVersion("HTTP/1.0");
+
+    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
+
+    assertEquals(200, response.getStatus());
+
+    List<Cookie> cookies = getCookies(response);
+
+    tester.stop();
+
+    assertTrue("Timeout waiting for events",
+        listener.await(1, TimeUnit.SECONDS));
+    assertEquals(ListenerEventType.SESSION_CREATED,
+        listener.events.get(0));
+    assertEquals(ListenerEventType.SESSION_DESTROYED,
+        listener.events.get(1));
+    assertEquals(cookies.get(0).getValue(), response.getContent());
+  }
+
+
+
+
+//  @Test
+  public void testJsp() throws Exception {
+    tester.setResourceBase("target/test-classes");
+    ServletHolder jspHolder = tester.addServlet(JspServlet.class, "/test/*");
+    jspHolder.setInitOrder(1);
+
+    jspHolder.setInitParameter("scratchdir", tmpdir.getPath());
+
+    Callback c_1 = new Callback() {
+      @Override
+      public void call(HttpServletRequest request, HttpServletResponse response)
+          throws IOException, ServletException {
+        request.getSession().setAttribute("foo", "bar");
+        request.setAttribute("foo", "baz");
+        RequestDispatcher dispatcher = request.getRequestDispatcher(
+            "pagecontext.jsp");
+        dispatcher.forward(request, response);
+      }
+    };
+
+    tester.getContext().setClassLoader(Thread.currentThread().getContextClassLoader());
+    tester.setAttribute("callback_1", c_1);
+
+    tester.start();
+
+    request.setMethod("GET");
+    request.setURI("/test/hello");
+    request.setHeader("Host", "tester");
+    request.setVersion("HTTP/1.0");
+
+    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
+
+    assertEquals(200, response.getStatus());
+    assertEquals("baz", response.getContent().trim());
+  }
+
+
+  ////////////////////////////////////////////////////////////////////
+  // Private methods
+
+  /**
+   * Why doesn't HttpTester do this already??
+   */
+  private List<Cookie> getCookies(HttpTester.Response response) {
+    List<Cookie> cookies = new ArrayList<Cookie>();
+
+    Enumeration e = response.getValues("Set-Cookie");
+
+    while (e != null && e.hasMoreElements()) {
+      String header = (String) e.nextElement();
+      Cookie c = null;
+
+      StringTokenizer st = new StringTokenizer(header, ";");
+      while (st.hasMoreTokens()) {
+        String[] split = st.nextToken().split("=");
+        String param = split[0].trim();
+        String value = null;
+        if (split.length > 1) {
+          value = split[1].trim();
+        }
+        if ("version".equalsIgnoreCase(param)) {
+          c.setVersion(Integer.parseInt(value));
+        } else if ("comment".equalsIgnoreCase(param)) {
+          c.setComment(value);
+        } else if ("domain".equalsIgnoreCase(param)) {
+          c.setDomain(value);
+        } else if ("max-age".equalsIgnoreCase(param)) {
+          c.setMaxAge(Integer.parseInt(value));
+        } else if ("discard".equalsIgnoreCase(param)) {
+          c.setMaxAge(-1);
+        } else if ("path".equalsIgnoreCase(param)) {
+          c.setPath(value);
+        } else if ("secure".equalsIgnoreCase(param)) {
+          c.setSecure(true);
+        } else if ("httponly".equalsIgnoreCase(param)) {
+          // Ignored??
+        } else {
+          if (c == null) {
+            c = new Cookie(param, value);
+          } else {
+            throw new IllegalStateException("Unknown cookie param: " + param);
+          }
+        }
+      }
+
+      if (c != null) {
+        cookies.add(c);
+      }
+    }
+
+    return cookies;
+  }
+
+  private Region getRegion() {
+    // Yuck...
+    return ((GemfireSessionManager) ((SessionCachingFilter) filterHolder.getFilter()).getSessionManager()).getCache().getCache().getRegion(
+        "gemfire_modules_sessions");
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/MyServletTester.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/MyServletTester.java b/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/MyServletTester.java
new file mode 100644
index 0000000..1ff6e70
--- /dev/null
+++ b/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/MyServletTester.java
@@ -0,0 +1,33 @@
+/*=========================================================================
+ * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package com.gemstone.gemfire.modules.session.internal.filter;
+
+import org.eclipse.jetty.servlet.ServletTester;
+
+/**
+ * Extend the base ServletTester class with a couple of helper methods. This
+ * depends on a patched ServletTester class which exposes the _server variable
+ * as package-private.
+ */
+public class MyServletTester extends ServletTester {
+
+  public boolean isStarted() {
+//    return _server.isStarted();
+    return false;
+  }
+
+  public boolean isStopped() {
+//    return _server.isStopped();
+    return false;
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/ServletContextListenerImpl.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/ServletContextListenerImpl.java b/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/ServletContextListenerImpl.java
new file mode 100644
index 0000000..39e4489
--- /dev/null
+++ b/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/ServletContextListenerImpl.java
@@ -0,0 +1,46 @@
+/*=========================================================================
+ * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package com.gemstone.gemfire.modules.session.internal.filter;
+
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletContextListener;
+
+/**
+ * @author jdeppe
+ */
+public class ServletContextListenerImpl extends AbstractListener
+    implements ServletContextListener {
+
+  /**
+   * This is a 'custom' constructor which sets our latch count to 2. This is
+   * done because the earliest point, within our test code, where we can get a
+   * reference to the listener (in order to reset the latch count) an event
+   * *may* (more than likely) already have been fired.
+   */
+  public ServletContextListenerImpl() {
+    super(2);
+  }
+
+  @Override
+  public void contextInitialized(ServletContextEvent sce) {
+    events.add(ListenerEventType.SERVLET_CONTEXT_INITIALIZED);
+    latch.countDown();
+  }
+
+  @Override
+  public void contextDestroyed(ServletContextEvent sce) {
+    events.add(ListenerEventType.SERVLET_CONTEXT_DESTROYED);
+    latch.countDown();
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session/build.gradle
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session/build.gradle b/modules/gemfire-modules-session/build.gradle
deleted file mode 100644
index f6b074b..0000000
--- a/modules/gemfire-modules-session/build.gradle
+++ /dev/null
@@ -1,3 +0,0 @@
-dependencies {
-  compile project(':gemfire-modules')
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session/pom.xml
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session/pom.xml b/modules/gemfire-modules-session/pom.xml
deleted file mode 100644
index b274ab3..0000000
--- a/modules/gemfire-modules-session/pom.xml
+++ /dev/null
@@ -1,46 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-  <modelVersion>4.0.0</modelVersion>
-  <groupId>com.gemstone</groupId>
-  <artifactId>gemfire-modules-session</artifactId>
-  <packaging>jar</packaging>
-  <version>${gemfire.modules.version}</version>
-  <url>http://maven.apache.org</url>
-  <name>gemfire-modules-session</name>
-
-  <parent>
-    <groupId>com.gemstone</groupId>
-    <artifactId>gemfire-modules-parent</artifactId>
-    <version>1.0-SNAPSHOT</version>
-  </parent>
-
-  <dependencies>
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-    </dependency>
-
-    <dependency>
-      <groupId>javax.servlet</groupId>
-      <artifactId>servlet-api</artifactId>
-    </dependency>
-
-    <dependency>
-      <groupId>com.gemstone</groupId>
-      <artifactId>gemfire-modules</artifactId>
-    </dependency>
-
-    <dependency>
-      <groupId>com.gemstone.gemfire</groupId>
-      <artifactId>gemfire</artifactId>
-    </dependency>
-
-    <!--<dependency>-->
-      <!--<groupId>org.slf4j</groupId>-->
-      <!--<artifactId>slf4j-log4j12</artifactId>-->
-      <!--<scope>compile</scope>-->
-    <!--</dependency>-->
-
-  </dependencies>
-</project>

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session/profiles.xml
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session/profiles.xml b/modules/gemfire-modules-session/profiles.xml
deleted file mode 100644
index 3bad1da..0000000
--- a/modules/gemfire-modules-session/profiles.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<profilesXml xmlns="http://maven.apache.org/PROFILES/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://maven.apache.org/PROFILES/1.0.0 http://maven.apache.org/xsd/profiles-1.0.0.xsd">
-    <profiles>
-        <profile>
-            <id>netbeans-private</id>
-            <activation>
-                <property>
-                    <name>netbeans.execution</name>
-                    <value>true</value>
-                </property>
-            </activation>
-            <properties>
-                <netbeans.deployment.server.id>[/Users/jdeppe/apps/glassfishv3/glassfish]deployer:gfv3ee6:localhost:4848</netbeans.deployment.server.id>
-            </properties>
-        </profile>
-    </profiles>
-</profilesXml>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session/release/bin/cacheserver.bat
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session/release/bin/cacheserver.bat b/modules/gemfire-modules-session/release/bin/cacheserver.bat
deleted file mode 100755
index 2632dc7..0000000
--- a/modules/gemfire-modules-session/release/bin/cacheserver.bat
+++ /dev/null
@@ -1,33 +0,0 @@
-@setlocal enableextensions
-@set scriptdir=%~dp0
-@set gf=%scriptdir:\bin\=%
-@if exist "%gf%\lib\gemfire.jar" @goto gfok
-@echo Could not determine GEMFIRE location
-@verify other 2>nul
-@goto done
-:gfok
-
-@REM Initialize classpath
-
-@REM Add GemFire classes
-@set GEMFIRE_JARS=%gf%/lib/gemfire.jar;%gf%/lib/antlr.jar;%gf%/lib/mail.jar
-
-@REM Add Tomcat classes
-@set GEMFIRE_JARS=%GEMFIRE_JARS%;%gf%/lib/servlet-api.jar;%gf%/lib/catalina.jar;%gf%/lib/${artifact.artifactId}-${artifact.version}.jar;%gf%/bin/tomcat-juli.jar
-
-@REM Add conf directory
-@set GEMFIRE_JARS=%GEMFIRE_JARS%;%gf%/conf
-
-@if defined CLASSPATH set GEMFIRE_JARS=%GEMFIRE_JARS%;%CLASSPATH%
-
-@if not defined GF_JAVA (
-@REM %GF_JAVA% is not defined, assume it is on the PATH
-@set GF_JAVA=java
-)
-
-@"%GF_JAVA%" %JAVA_ARGS% -classpath "%GEMFIRE_JARS%" com.gemstone.gemfire.internal.cache.CacheServerLauncher %*
-:done
-@set scriptdir=
-@set gf=
-@set GEMFIRE_JARS=
-

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session/release/bin/cacheserver.sh
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session/release/bin/cacheserver.sh b/modules/gemfire-modules-session/release/bin/cacheserver.sh
deleted file mode 100755
index e395001..0000000
--- a/modules/gemfire-modules-session/release/bin/cacheserver.sh
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/bin/bash
-# Set GEMFIRE to the product toplevel directory
-GEMFIRE=`dirname $0`
-OLDPWD=$PWD
-cd $GEMFIRE
-GEMFIRE=`dirname $PWD`
-cd $OLDPWD
-
-if [ "x$WINDIR" != "x" ]; then
-  echo "ERROR: The variable WINDIR is set indicating this script is running in a Windows OS, please use the .bat file version instead."
-  exit 1
-fi
-
-GEMFIRE_JARS=$GEMFIRE/lib/gemfire-[0-9]*.jar
-if [ ! -f ${GEMFIRE_JARS} ]; then
-  echo "ERROR: Could not determine GEMFIRE location."
-  exit 1
-fi
-
-# Initialize classpath
-GEMFIRE_JARS=$GEMFIRE_JARS:$GEMFIRE/lib/gemfire-modules-[0-9]*
-GEMFIRE_JARS=$GEMFIRE_JARS:$GEMFIRE/lib/servlet-api-[0-9]*
-GEMFIRE_JARS=$GEMFIRE_JARS:$GEMFIRE/lib/slf4j-api-[0-9]*
-GEMFIRE_JARS=$GEMFIRE_JARS:$GEMFIRE/lib/slf4j-jdk14-[0-9]*
-
-# Add configuration
-GEMFIRE_JARS=$GEMFIRE_JARS:$GEMFIRE/conf
-
-if [ "x$CLASSPATH" != "x" ]; then
-  GEMFIRE_JARS=$GEMFIRE_JARS:$CLASSPATH
-fi
-
-${GF_JAVA:-java} ${JAVA_ARGS} -classpath ${GEMFIRE_JARS} com.gemstone.gemfire.internal.cache.CacheServerLauncher "$@"

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session/release/bin/gemfire.bat
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session/release/bin/gemfire.bat b/modules/gemfire-modules-session/release/bin/gemfire.bat
deleted file mode 100755
index 96d2564..0000000
--- a/modules/gemfire-modules-session/release/bin/gemfire.bat
+++ /dev/null
@@ -1,23 +0,0 @@
-@setlocal enableextensions
-@set scriptdir=%~dp0
-@set gf=%scriptdir:\bin\=%
-@if exist "%gf%\lib\gemfire.jar" @goto gfok
-@echo Could not determine GEMFIRE location
-@verify other 2>nul
-@goto done
-:gfok
-
-@set GEMFIRE_JARS=%gf%/lib/gemfire.jar;%gf%/lib/antlr.jar;%gf%/lib/mail.jar
-@if defined CLASSPATH set GEMFIRE_JARS=%GEMFIRE_JARS%;%CLASSPATH%
-
-@if not defined GF_JAVA (
-@REM %GF_JAVA% is not defined, assume it is on the PATH
-@set GF_JAVA=java
-)
-
-@"%GF_JAVA%" %JAVA_ARGS% -classpath "%GEMFIRE_JARS%" com.gemstone.gemfire.internal.SystemAdmin %*
-:done
-@set scriptdir=
-@set gf=
-@set GEMFIRE_JARS=
-

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session/release/bin/gemfire.sh
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session/release/bin/gemfire.sh b/modules/gemfire-modules-session/release/bin/gemfire.sh
deleted file mode 100755
index fa5f4cd..0000000
--- a/modules/gemfire-modules-session/release/bin/gemfire.sh
+++ /dev/null
@@ -1,41 +0,0 @@
-#!/bin/bash
-# Set GEMFIRE to the product toplevel directory
-GEMFIRE=`dirname $0`
-OLDPWD=$PWD
-cd $GEMFIRE
-GEMFIRE=`dirname $PWD`
-cd $OLDPWD
-
-if [ "x$WINDIR" != "x" ]; then
-  echo "ERROR: The variable WINDIR is set indicating this script is running in a Windows OS, please use the .bat file version instead."
-  exit 1
-fi
-
-if [ ! -f $GEMFIRE/lib/gemfire.jar ]; then
-  echo "ERROR: Could not determine GEMFIRE location."
-  exit 1
-fi
-
-GEMFIRE_JARS=$GEMFIRE/lib/gemfire.jar:$GEMFIRE/lib/antlr.jar
-
-if [ "x$CLASSPATH" != "x" ]; then
-  GEMFIRE_JARS=$GEMFIRE_JARS:$CLASSPATH
-fi
-
-# Command line args that start with -J will be passed to the java vm in JARGS.
-# See java --help for a listing of valid vm args.
-# Example: -J-Xmx1g sets the max heap size to 1 gigabyte.
-
-JARGS=
-GEMFIRE_ARGS=
-for i in "$@"
-do
-  if [ "-J" == "${i:0:2}" ]
-  then
-    JARGS="${JARGS} \"${i#-J}\""
-  else
-    GEMFIRE_ARGS="${GEMFIRE_ARGS} \"${i}\""
-  fi
-done
-
-eval ${GF_JAVA:-java} ${JAVA_ARGS} ${JARGS} -classpath ${GEMFIRE_JARS} com.gemstone.gemfire.internal.SystemAdmin ${GEMFIRE_ARGS}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session/release/bin/setenv.properties
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session/release/bin/setenv.properties b/modules/gemfire-modules-session/release/bin/setenv.properties
deleted file mode 100644
index fc8918b..0000000
--- a/modules/gemfire-modules-session/release/bin/setenv.properties
+++ /dev/null
@@ -1,6 +0,0 @@
-java.opt.1=-Xms${initial.vm.heap.size.mb:512}M
-java.opt.2=-Xmx${maximum.vm.heap.size.mb:512}M
-java.opt.hotspot.1=-XX:+UseParNewGC
-java.opt.hotspot.2=-XX:+UseConcMarkSweepGC
-java.opt.hotspot.3=-XX:CMSInitiatingOccupancyFraction=${cms.initiating.heap.percentage:50}
-java.opt.j9.1=-Xgcpolicy:gencon
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session/release/conf/cache-client.xml
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session/release/conf/cache-client.xml b/modules/gemfire-modules-session/release/conf/cache-client.xml
deleted file mode 100755
index c8444b2..0000000
--- a/modules/gemfire-modules-session/release/conf/cache-client.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!DOCTYPE client-cache PUBLIC
-  "-//GemStone Systems, Inc.//GemFire Declarative Caching 6.5//EN"
-  "http://www.gemstone.com/dtd/cache6_6.dtd">
-  
-<client-cache>
-
-  <!-- The default pool connects to a cache server running on  localhost at
-       port 40404. To connect to a different server host and port, modify
-       the following pool server host and port. -->
-  <pool name="sessions" subscription-enabled="true">
-    <server host="localhost" port="40404"/>
-  </pool>
-
-  <!-- To configure the client to use a locator instead of a server, replace
-       the server pool above with the locator pool below and modify the locator
-       host and port as necessary. -->
-  <!--
-  <pool name="sessions" subscription-enabled="true">
-    <locator host="localhost" port="10334"/>
-  </pool>
-  -->
-  
-</client-cache>

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session/release/conf/cache-peer.xml
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session/release/conf/cache-peer.xml b/modules/gemfire-modules-session/release/conf/cache-peer.xml
deleted file mode 100755
index 1a49637..0000000
--- a/modules/gemfire-modules-session/release/conf/cache-peer.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!DOCTYPE cache PUBLIC
-  "-//GemStone Systems, Inc.//GemFire Declarative Caching 6.5//EN"
-  "http://www.gemstone.com/dtd/cache6_6.dtd">
-  
-<cache>
-
-  <!-- Uncomment the following disk-store element to modify the default disk store directory -->
-  <!--
-  <disk-store name="DEFAULT">
-    <disk-dirs>
-      <disk-dir>/path/to/persistent/data</disk-dir>
-    </disk-dirs>
-  </disk-store>
-  -->
-
-  <!-- This is the definition of the default session region -->
-  <!--
-  <region name="gemfire_modules_sessions">
-    <region-attributes scope="distributed-ack" enable-gateway="false" data-policy="replicate" statistics-enabled="true">
-      <entry-idle-time>
-        <expiration-attributes timeout="0" action="invalidate">
-          <custom-expiry>
-            <class-name>com.gemstone.gemfire.modules.util.SessionCustomExpiry</class-name>
-          </custom-expiry>
-        </expiration-attributes>
-      </entry-idle-time>
-    </region-attributes>
-  </region>
-  -->
-  
-</cache>

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session/release/conf/cache-server.xml
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session/release/conf/cache-server.xml b/modules/gemfire-modules-session/release/conf/cache-server.xml
deleted file mode 100755
index 6ee2223..0000000
--- a/modules/gemfire-modules-session/release/conf/cache-server.xml
+++ /dev/null
@@ -1,59 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!DOCTYPE cache PUBLIC
-  "-//GemStone Systems, Inc.//GemFire Declarative Caching 6.5//EN"
-  "http://www.gemstone.com/dtd/cache6_6.dtd">
-  
-<cache>
-
-  <!-- Uncomment the following gateway-hub element to create a gateway hub -->
-  <!--
-  <gateway-hub id="NY" port="11110">
-    <gateway id="LN">
-      <gateway-endpoint id="LN-1" host="localhost" port="22220"/>
-      <gateway-queue disk-store-name="NY_GATEWAY"/>
-    </gateway>
-  </gateway-hub>
-  -->
-
-  <!-- Uncomment the following cache-server element to modify the listen port -->
-  <!--
-  <cache-server port="44444"/>
-  -->
-
-  <!-- Uncomment the following disk-store element to modify the default disk store directory -->
-  <!--
-  <disk-store name="DEFAULT">
-    <disk-dirs>
-      <disk-dir>/path/to/persistent/data</disk-dir>
-    </disk-dirs>
-  </disk-store>
-  -->
-  
-  <!-- Uncomment the following disk-store element to create the NY_GATEWAY disk store
-       (for the gateway-hub element defined above) -->
-  <!--
-  <disk-store name="NY_GATEWAY">
-    <disk-dirs>
-      <disk-dir>/path/to/persistent/data</disk-dir>
-    </disk-dirs>
-  </disk-store>
-  -->
-  
-  <!-- This is the definition of the default session region -->
-  <!--
-  <region name="gemfire_modules_sessions">
-    <region-attributes enable-gateway="false" data-policy="partition" statistics-enabled="true">
-      <entry-idle-time>
-        <expiration-attributes timeout="0" action="invalidate">
-          <custom-expiry>
-            <class-name>com.gemstone.gemfire.modules.util.SessionCustomExpiry</class-name>
-          </custom-expiry>
-        </expiration-attributes>
-      </entry-idle-time>
-      <partition-attributes redundant-copies="1" total-num-buckets="113"/>
-    </region-attributes>
-  </region>
-  -->
-
-</cache>

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/common/AbstractSessionCache.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/common/AbstractSessionCache.java b/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/common/AbstractSessionCache.java
deleted file mode 100644
index a60b154..0000000
--- a/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/common/AbstractSessionCache.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-package com.gemstone.gemfire.modules.session.common;
-
-import com.gemstone.gemfire.cache.Region;
-import com.gemstone.gemfire.modules.session.catalina.internal.DeltaSessionStatistics;
-import com.gemstone.gemfire.modules.session.filter.util.TypeAwareMap;
-import com.gemstone.gemfire.modules.util.RegionConfiguration;
-
-import java.util.Map;
-import javax.servlet.http.HttpSession;
-
-public abstract class AbstractSessionCache implements SessionCache {
-
-  /**
-   * The sessionRegion is the <code>Region</code> that actually stores and
-   * replicates the <code>Session</code>s.
-   */
-  protected Region<String, HttpSession> sessionRegion;
-
-  /**
-   * The operatingRegion is the <code>Region</code> used to do HTTP operations.
-   * if local cache is enabled, then this will be the local <code>Region</code>;
-   * otherwise, it will be the session <code>Region</code>.
-   */
-  protected Region<String, HttpSession> operatingRegion;
-
-  protected Map<CacheProperty, Object> properties =
-      new TypeAwareMap<CacheProperty, Object>(CacheProperty.class);
-
-  protected DeltaSessionStatistics statistics;
-
-  /**
-   * {@inheritDoc}
-   */
-  @Override
-  public void stop() {
-    sessionRegion.close();
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  @Override
-  public Region<String, HttpSession> getOperatingRegion() {
-    return this.operatingRegion;
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  @Override
-  public Region<String, HttpSession> getSessionRegion() {
-    return this.sessionRegion;
-  }
-
-  protected void createStatistics() {
-    this.statistics =
-        new DeltaSessionStatistics(getCache().getDistributedSystem(),
-            (String) properties.get(CacheProperty.STATISTICS_NAME));
-  }
-
-  /**
-   * Build up a {@code RegionConfiguraton} object from parameters originally
-   * passed in as filter initialization parameters.
-   *
-   * @return a {@code RegionConfiguration} object
-   */
-  protected RegionConfiguration createRegionConfiguration() {
-    RegionConfiguration configuration = new RegionConfiguration();
-
-    configuration.setRegionName(
-        (String) properties.get(CacheProperty.REGION_NAME));
-    configuration.setRegionAttributesId(
-        (String) properties.get(CacheProperty.REGION_ATTRIBUTES_ID));
-
-    configuration.setEnableGatewayDeltaReplication(
-        (Boolean) properties.get(
-            CacheProperty.ENABLE_GATEWAY_DELTA_REPLICATION));
-    configuration.setEnableGatewayReplication(
-        (Boolean) properties.get(CacheProperty.ENABLE_GATEWAY_REPLICATION));
-    configuration.setEnableDebugListener(
-        (Boolean) properties.get(CacheProperty.ENABLE_DEBUG_LISTENER));
-
-    return configuration;
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/common/CacheProperty.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/common/CacheProperty.java b/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/common/CacheProperty.java
deleted file mode 100644
index d8b7c64..0000000
--- a/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/common/CacheProperty.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-
-package com.gemstone.gemfire.modules.session.common;
-
-/**
- * Used to define cache properties
- */
-public enum CacheProperty {
-
-  ENABLE_DEBUG_LISTENER(Boolean.class),
-
-  ENABLE_GATEWAY_REPLICATION(Boolean.class),
-
-  ENABLE_GATEWAY_DELTA_REPLICATION(Boolean.class),
-
-  ENABLE_LOCAL_CACHE(Boolean.class),
-
-  REGION_NAME(String.class),
-
-  REGION_ATTRIBUTES_ID(String.class),
-
-  STATISTICS_NAME(String.class),
-
-  /**
-   * This parameter can take the following values which match the respective
-   * attribute container classes
-   * <p/>
-   * delta_queued     : QueuedDeltaSessionAttributes delta_immediate  :
-   * DeltaSessionAttributes immediate        : ImmediateSessionAttributes queued
-   * : QueuedSessionAttributes
-   */
-  SESSION_DELTA_POLICY(String.class),
-
-  /**
-   * This parameter can take the following values:
-   * <p/>
-   * set (default) set_and_get
-   */
-  REPLICATION_TRIGGER(String.class);
-
-  Class clazz;
-
-  CacheProperty(Class clazz) {
-    this.clazz = clazz;
-  }
-
-  public Class getClazz() {
-    return clazz;
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/common/ClientServerSessionCache.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/common/ClientServerSessionCache.java b/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/common/ClientServerSessionCache.java
deleted file mode 100644
index a53bfbc..0000000
--- a/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/common/ClientServerSessionCache.java
+++ /dev/null
@@ -1,176 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-package com.gemstone.gemfire.modules.session.common;
-
-import com.gemstone.gemfire.cache.GemFireCache;
-import com.gemstone.gemfire.cache.Region;
-import com.gemstone.gemfire.cache.RegionShortcut;
-import com.gemstone.gemfire.cache.client.ClientCache;
-import com.gemstone.gemfire.cache.client.ClientRegionFactory;
-import com.gemstone.gemfire.cache.client.ClientRegionShortcut;
-import com.gemstone.gemfire.cache.execute.Execution;
-import com.gemstone.gemfire.cache.execute.FunctionService;
-import com.gemstone.gemfire.cache.execute.ResultCollector;
-import com.gemstone.gemfire.modules.util.BootstrappingFunction;
-import com.gemstone.gemfire.modules.util.CreateRegionFunction;
-import com.gemstone.gemfire.modules.util.RegionConfiguration;
-import com.gemstone.gemfire.modules.util.RegionStatus;
-
-import java.util.List;
-import java.util.Map;
-import javax.servlet.http.HttpSession;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Class which defines a client/server cache.
- */
-public class ClientServerSessionCache extends AbstractSessionCache {
-
-  private static final Logger LOG =
-      LoggerFactory.getLogger(PeerToPeerSessionCache.class.getName());
-
-  private ClientCache cache;
-
-  protected static final String DEFAULT_REGION_ATTRIBUTES_ID =
-      RegionShortcut.PARTITION_REDUNDANT.toString();
-
-  protected static final Boolean DEFAULT_ENABLE_LOCAL_CACHE = true;
-
-  /**
-   * Constructor
-   *
-   * @param cache
-   * @param properties
-   */
-  public ClientServerSessionCache(ClientCache cache,
-      Map<CacheProperty, Object> properties) {
-    super();
-    this.cache = cache;
-
-    /**
-     * Set some default properties for this cache if they haven't already
-     * been set
-     */
-    this.properties.put(CacheProperty.REGION_ATTRIBUTES_ID,
-        DEFAULT_REGION_ATTRIBUTES_ID);
-    this.properties.put(CacheProperty.ENABLE_LOCAL_CACHE,
-        DEFAULT_ENABLE_LOCAL_CACHE);
-    this.properties.putAll(properties);
-  }
-
-  @Override
-  public void initialize() {
-    // Bootstrap the servers
-    bootstrapServers();
-
-    // Create or retrieve the region
-    createOrRetrieveRegion();
-
-    // Set the session region directly as the operating region since there is no difference
-    // between the local cache region and the session region.
-    operatingRegion = sessionRegion;
-
-    // Create or retrieve the statistics
-    createStatistics();
-  }
-
-  @Override
-  public GemFireCache getCache() {
-    return cache;
-  }
-
-  @Override
-  public boolean isClientServer() {
-    return true;
-  }
-
-
-  ////////////////////////////////////////////////////////////////////////
-  // Private methods
-
-  private void bootstrapServers() {
-    Execution execution = FunctionService.onServers(this.cache);
-    ResultCollector collector = execution.execute(new BootstrappingFunction());
-    // Get the result. Nothing is being done with it.
-    try {
-      collector.getResult();
-    } catch (Exception e) {
-      // If an exception occurs in the function, log it.
-      LOG.warn("Caught unexpected exception:", e);
-    }
-  }
-
-  private void createOrRetrieveRegion() {
-    // Retrieve the local session region
-    this.sessionRegion =
-        this.cache.getRegion(
-            (String) properties.get(CacheProperty.REGION_NAME));
-
-    // If necessary, create the regions on the server and client
-    if (this.sessionRegion == null) {
-      // Create the PR on the servers
-      createSessionRegionOnServers();
-
-      // Create the region on the client
-      this.sessionRegion = createLocalSessionRegion();
-      LOG.debug("Created session region: " + this.sessionRegion);
-    } else {
-      LOG.debug("Retrieved session region: " + this.sessionRegion);
-    }
-  }
-
-  private void createSessionRegionOnServers() {
-    // Create the RegionConfiguration
-    RegionConfiguration configuration = createRegionConfiguration();
-
-    // Send it to the server tier
-    Execution execution = FunctionService.onServer(this.cache).withArgs(
-        configuration);
-    ResultCollector collector = execution.execute(CreateRegionFunction.ID);
-
-    // Verify the region was successfully created on the servers
-    List<RegionStatus> results = (List<RegionStatus>) collector.getResult();
-    for (RegionStatus status : results) {
-      if (status == RegionStatus.INVALID) {
-        StringBuilder builder = new StringBuilder();
-        builder.append(
-            "An exception occurred on the server while attempting to create or validate region named ");
-        builder.append(properties.get(CacheProperty.REGION_NAME));
-        builder.append(". See the server log for additional details.");
-        throw new IllegalStateException(builder.toString());
-      }
-    }
-  }
-
-  private Region<String, HttpSession> createLocalSessionRegion() {
-    ClientRegionFactory<String, HttpSession> factory = null;
-    boolean enableLocalCache =
-        (Boolean) properties.get(CacheProperty.ENABLE_LOCAL_CACHE);
-
-    String regionName = (String) properties.get(CacheProperty.REGION_NAME);
-    if (enableLocalCache) {
-      // Create the region factory with caching and heap LRU enabled
-      factory = ((ClientCache) this.cache).
-          createClientRegionFactory(
-              ClientRegionShortcut.CACHING_PROXY_HEAP_LRU);
-      LOG.info("Created new local client session region: {}", regionName);
-    } else {
-      // Create the region factory without caching enabled
-      factory = ((ClientCache) this.cache).createClientRegionFactory(
-          ClientRegionShortcut.PROXY);
-      LOG.info(
-          "Created new local client (uncached) session region: {} without any session expiry",
-          regionName);
-    }
-
-    // Create the region
-    return factory.create(regionName);
-  }
-}


[02/24] incubator-geode git commit: GEODE-14: Move GemFire Sessions module and relocate all packages to 'internal'

Posted by je...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/common/PeerToPeerSessionCache.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/common/PeerToPeerSessionCache.java b/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/common/PeerToPeerSessionCache.java
deleted file mode 100644
index d727f83..0000000
--- a/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/common/PeerToPeerSessionCache.java
+++ /dev/null
@@ -1,174 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-package com.gemstone.gemfire.modules.session.common;
-
-import com.gemstone.gemfire.cache.Cache;
-import com.gemstone.gemfire.cache.GemFireCache;
-import com.gemstone.gemfire.cache.Region;
-import com.gemstone.gemfire.cache.RegionFactory;
-import com.gemstone.gemfire.cache.RegionShortcut;
-import com.gemstone.gemfire.cache.execute.FunctionService;
-import com.gemstone.gemfire.modules.session.catalina.callback.LocalSessionCacheLoader;
-import com.gemstone.gemfire.modules.session.catalina.callback.LocalSessionCacheWriter;
-import com.gemstone.gemfire.modules.util.RegionConfiguration;
-import com.gemstone.gemfire.modules.util.RegionHelper;
-import com.gemstone.gemfire.modules.util.TouchPartitionedRegionEntriesFunction;
-import com.gemstone.gemfire.modules.util.TouchReplicatedRegionEntriesFunction;
-
-import java.util.Map;
-import javax.servlet.http.HttpSession;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Class which defines a peer-to-peer cache
- */
-public class PeerToPeerSessionCache extends AbstractSessionCache {
-
-  private static final Logger LOG =
-      LoggerFactory.getLogger(PeerToPeerSessionCache.class.getName());
-
-  private Cache cache;
-
-  private static final String DEFAULT_REGION_ATTRIBUTES_ID =
-      RegionShortcut.REPLICATE.toString();
-
-  private static final Boolean DEFAULT_ENABLE_LOCAL_CACHE = false;
-
-  /**
-   * Constructor
-   *
-   * @param cache
-   * @param properties
-   */
-  public PeerToPeerSessionCache(Cache cache,
-      Map<CacheProperty, Object> properties) {
-    super();
-    this.cache = cache;
-
-    /**
-     * Set some default properties for this cache if they haven't already
-     * been set
-     */
-    this.properties.put(CacheProperty.REGION_ATTRIBUTES_ID,
-        DEFAULT_REGION_ATTRIBUTES_ID);
-    this.properties.put(CacheProperty.ENABLE_LOCAL_CACHE,
-        DEFAULT_ENABLE_LOCAL_CACHE);
-    this.properties.putAll(properties);
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  @Override
-  public void initialize() {
-    // Register Functions
-    registerFunctions();
-
-    // Create or retrieve the region
-    createOrRetrieveRegion();
-
-    /**
-     * If local cache is enabled, create the local region fronting the
-     * session region and set it as the operating region; otherwise, use
-     * the session region directly as the operating region.
-     */
-    boolean enableLocalCache =
-        (Boolean) properties.get(CacheProperty.ENABLE_LOCAL_CACHE);
-    operatingRegion = enableLocalCache
-        ? createOrRetrieveLocalRegion()
-        : this.sessionRegion;
-
-    // Create or retrieve the statistics
-    createStatistics();
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  @Override
-  public GemFireCache getCache() {
-    return cache;
-  }
-
-  @Override
-  public boolean isClientServer() {
-    return false;
-  }
-
-  private void registerFunctions() {
-    // Register the touch partitioned region entries function if it is not already registered
-    if (!FunctionService.isRegistered(
-        TouchPartitionedRegionEntriesFunction.ID)) {
-      FunctionService.registerFunction(
-          new TouchPartitionedRegionEntriesFunction());
-    }
-
-    // Register the touch replicated region entries function if it is not already registered
-    if (!FunctionService.isRegistered(
-        TouchReplicatedRegionEntriesFunction.ID)) {
-      FunctionService.registerFunction(
-          new TouchReplicatedRegionEntriesFunction());
-    }
-  }
-
-  private void createOrRetrieveRegion() {
-    // Create the RegionConfiguration
-    RegionConfiguration configuration = createRegionConfiguration();
-
-    // Attempt to retrieve the region
-    // If it already exists, validate it
-    // If it doesn't already exist, create it
-    Region region = this.cache.getRegion(
-        (String) properties.get(CacheProperty.REGION_NAME));
-    if (region == null) {
-      // Create the region
-      region = RegionHelper.createRegion(cache, configuration);
-      LOG.info("Created new session region: " + region);
-    } else {
-      // Validate the existing region
-      LOG.info("Retrieved existing session region: " + region);
-      RegionHelper.validateRegion(cache, configuration, region);
-    }
-
-    // Set the session region
-    this.sessionRegion = region;
-  }
-
-  /**
-   * Create a local region fronting the main region.
-   *
-   * @return
-   */
-  private Region<String, HttpSession> createOrRetrieveLocalRegion() {
-    // Attempt to retrieve the fronting region
-    String frontingRegionName = this.sessionRegion.getName() + "_local";
-    Region<String, HttpSession> frontingRegion =
-        this.cache.getRegion(frontingRegionName);
-
-    if (frontingRegion == null) {
-      // Create the region factory
-      RegionFactory<String, HttpSession> factory =
-          this.cache.createRegionFactory(RegionShortcut.LOCAL_HEAP_LRU);
-
-      // Add the cache loader and writer
-      factory.setCacheLoader(new LocalSessionCacheLoader(this.sessionRegion));
-      factory.setCacheWriter(new LocalSessionCacheWriter(this.sessionRegion));
-
-      // Create the region
-      frontingRegion = factory.create(frontingRegionName);
-      LOG.info("Created new local session region: {}", frontingRegion);
-    } else {
-      LOG.info("Retrieved existing local session region: {}",
-          frontingRegion);
-    }
-
-    return frontingRegion;
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/common/SessionCache.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/common/SessionCache.java b/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/common/SessionCache.java
deleted file mode 100644
index 7a5f034..0000000
--- a/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/common/SessionCache.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-
-package com.gemstone.gemfire.modules.session.common;
-
-import com.gemstone.gemfire.cache.GemFireCache;
-import com.gemstone.gemfire.cache.Region;
-
-import javax.servlet.http.HttpSession;
-
-/**
- * Interface to basic cache operations.
- */
-public interface SessionCache {
-
-  /**
-   * Initialize the cache and create the appropriate region.
-   */
-  public void initialize();
-
-  /**
-   * Stop the cache.
-   */
-  public void stop();
-
-  /**
-   * Retrieve the cache reference.
-   *
-   * @return a {@code GemFireCache} reference
-   */
-  public GemFireCache getCache();
-
-  /**
-   * Get the {@code Region} being used by client code to put attributes.
-   *
-   * @return a {@code Region<String, HttpSession>} reference
-   */
-  public Region<String, HttpSession> getOperatingRegion();
-
-  /**
-   * Get the backing {@code Region} being used. This may not be the same as the
-   * region being used by client code to put attributes.
-   *
-   * @return a {@code Region<String, HttpSession>} reference
-   */
-  public Region<String, HttpSession> getSessionRegion();
-
-  /**
-   * Is this cache client-server? The only other alternative is peer-to-peer.
-   *
-   * @return true if this cache is client-server.
-   */
-  public boolean isClientServer();
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/common/SessionExpirationCacheListener.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/common/SessionExpirationCacheListener.java b/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/common/SessionExpirationCacheListener.java
deleted file mode 100644
index 164102d..0000000
--- a/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/common/SessionExpirationCacheListener.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-package com.gemstone.gemfire.modules.session.common;
-
-import com.gemstone.gemfire.cache.Declarable;
-import com.gemstone.gemfire.cache.EntryEvent;
-import com.gemstone.gemfire.cache.Operation;
-import com.gemstone.gemfire.cache.util.CacheListenerAdapter;
-
-import java.util.Properties;
-import javax.servlet.http.HttpSession;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class SessionExpirationCacheListener extends
-    CacheListenerAdapter<String, HttpSession> implements Declarable {
-
-  private static final Logger LOG =
-      LoggerFactory.getLogger(SessionExpirationCacheListener.class.getName());
-
-  @Override
-  public void afterDestroy(EntryEvent<String, HttpSession> event) {
-    /**
-     * A Session expired. If it was destroyed by GemFire expiration,
-     * process it. If it was destroyed via Session.invalidate, ignore it
-     * since it has already been processed.
-     */
-    if (event.getOperation() == Operation.EXPIRE_DESTROY) {
-      HttpSession session = (HttpSession) event.getOldValue();
-      session.invalidate();
-    }
-  }
-
-  @Override
-  public void init(Properties p) {
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/Constants.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/Constants.java b/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/Constants.java
deleted file mode 100644
index a8bb852..0000000
--- a/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/Constants.java
+++ /dev/null
@@ -1,14 +0,0 @@
-
-package com.gemstone.gemfire.modules.session.filter;
-
-/**
- * Various constant values used through the app
- */
-public class Constants {
-
-  public static String GEMFIRE_SESSION_REQUEST = "_gemfire_session_request_";
-
-  public static String SESSION_STATISTICS_MBEAN_NAME =
-      "com.gemstone:type=SessionStatistics,name=sessionStatistics";
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/ContextManager.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/ContextManager.java b/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/ContextManager.java
deleted file mode 100644
index 2837659..0000000
--- a/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/ContextManager.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-
-package com.gemstone.gemfire.modules.session.filter;
-
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-import javax.servlet.ServletContext;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * This class is a singleton and manages the mapping of context paths to
- * original ServletContext objects as well as a mapping of paths to Cache
- * reference handles.
- */
-public class ContextManager {
-
-  /**
-   * Logger object
-   */
-  private static final Logger LOG =
-      LoggerFactory.getLogger(ContextManager.class.getName());
-
-  /**
-   * Mapping of context path to ServletContext object
-   */
-  private final ConcurrentMap<String, ServletContext> contextMap =
-      new ConcurrentHashMap<String, ServletContext>(16);
-
-  /**
-   * Our singleton reference
-   */
-  private static final ContextManager manager = new ContextManager();
-
-  private ContextManager() {
-    // This is a singleton
-    LOG.info("Initializing ContextManager");
-  }
-
-  /**
-   * Return our singleton instance
-   *
-   * @return
-   */
-  public static ContextManager getInstance() {
-    return manager;
-  }
-
-  /**
-   * Add a context to our collection
-   *
-   * @param context the {@code ServletContext} to add
-   */
-  public void putContext(ServletContext context) {
-    String path = context.getContextPath();
-    contextMap.put(path, context);
-    LOG.info("Adding context '{}' {}", path, context);
-  }
-
-  /**
-   * Remove a context from our collection
-   *
-   * @param context the context to remove
-   */
-  public void removeContext(ServletContext context) {
-    String path = context.getContextPath();
-    contextMap.remove(path);
-    LOG.info("Removing context '{}'", path);
-  }
-
-  /**
-   * Retrieve the context for a given path
-   *
-   * @param path
-   * @return the GemfireServletContext object or null if the path is not found
-   */
-  public ServletContext getContext(String path) {
-    ServletContext ctx = contextMap.get(path);
-    if (ctx == null) {
-      LOG.warn("No context for requested contextPath '{}'", path);
-    }
-    return ctx;
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/DummySessionManager.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/DummySessionManager.java b/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/DummySessionManager.java
deleted file mode 100644
index 34d0978..0000000
--- a/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/DummySessionManager.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-
-package com.gemstone.gemfire.modules.session.filter;
-
-import com.gemstone.gemfire.modules.session.filter.attributes.AbstractSessionAttributes;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-import java.util.UUID;
-import javax.servlet.http.HttpSession;
-
-/**
- * Class which fakes an in-memory basic session manager for testing purposes.
- */
-public class DummySessionManager implements SessionManager {
-
-  /**
-   * Map of sessions
-   */
-  private final Map<String, HttpSession> sessions =
-      new HashMap<String, HttpSession>();
-
-  private class Attributes extends AbstractSessionAttributes {
-
-    @Override
-    public Object putAttribute(String attr, Object value) {
-      return attributes.put(attr, value);
-    }
-
-    @Override
-    public Object removeAttribute(String attr) {
-      return attributes.remove(attr);
-    }
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  @Override
-  public void start(Object config, ClassLoader loader) {
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  @Override
-  public void stop() {
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  @Override
-  public HttpSession getSession(String id) {
-    return sessions.get(id);
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  @Override
-  public HttpSession wrapSession(HttpSession nativeSession) {
-    String id = generateId();
-    AbstractSessionAttributes attributes = new Attributes();
-    GemfireHttpSession session = new GemfireHttpSession(id, nativeSession);
-    session.setManager(this);
-    session.setAttributes(attributes);
-    sessions.put(id, session);
-
-    return session;
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  @Override
-  public HttpSession getWrappingSession(String nativeId) {
-    return sessions.get(nativeId);
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  @Override
-  public void putSession(HttpSession session) {
-    // shouldn't ever get called
-    throw new UnsupportedOperationException("Not supported yet.");
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  @Override
-  public void destroySession(String id) {
-    sessions.remove(id);
-  }
-
-  @Override
-  public String destroyNativeSession(String id) {
-    return null;
-  }
-
-  public String getSessionCookieName() {
-    return "JSESSIONID";
-  }
-
-  public String getJvmId() {
-    return "jvm-id";
-  }
-
-  /**
-   * Generate an ID string
-   */
-  private String generateId() {
-    return UUID.randomUUID().toString().toUpperCase() + "-GF";
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/GemfireHttpSession.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/GemfireHttpSession.java b/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/GemfireHttpSession.java
deleted file mode 100644
index 2406ce7..0000000
--- a/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/GemfireHttpSession.java
+++ /dev/null
@@ -1,517 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-
-package com.gemstone.gemfire.modules.session.filter;
-
-import com.gemstone.gemfire.DataSerializable;
-import com.gemstone.gemfire.DataSerializer;
-import com.gemstone.gemfire.Delta;
-import com.gemstone.gemfire.Instantiator;
-import com.gemstone.gemfire.InvalidDeltaException;
-import com.gemstone.gemfire.modules.session.filter.attributes.AbstractSessionAttributes;
-import com.gemstone.gemfire.modules.session.filter.attributes.SessionAttributes;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.DataInput;
-import java.io.DataOutput;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.concurrent.atomic.AtomicBoolean;
-import javax.servlet.ServletContext;
-import javax.servlet.http.HttpSession;
-import javax.servlet.http.HttpSessionContext;
-
-import com.gemstone.gemfire.modules.util.ClassLoaderObjectInputStream;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Class which implements a Gemfire persisted {@code HttpSession}
- */
-public class GemfireHttpSession implements
-    HttpSession, DataSerializable, Delta {
-
-  private static transient final Logger LOG =
-      LoggerFactory.getLogger(GemfireHttpSession.class.getName());
-
-  /**
-   * Serial id
-   */
-  private static final long serialVersionUID = 238915238964017823L;
-
-  /**
-   * Id for the session
-   */
-  private String id;
-
-  /**
-   * Attributes really hold the essence of persistence.
-   */
-  private SessionAttributes attributes;
-
-  private transient SessionManager manager;
-
-  private HttpSession nativeSession = null;
-
-  /**
-   * A session becomes invalid if it is explicitly invalidated or if it
-   * expires.
-   */
-  private boolean isValid = true;
-
-  private boolean isNew = true;
-
-  private boolean isDirty = false;
-
-  /**
-   * This is set during serialization and then reset by the SessionManager when
-   * it is retrieved from the attributes.
-   */
-  private AtomicBoolean serialized = new AtomicBoolean(false);
-
-  /**
-   * Register ourselves for de-serialization
-   */
-  static {
-    Instantiator.register(new Instantiator(GemfireHttpSession.class, 27315) {
-      @Override
-      public DataSerializable newInstance() {
-        return new GemfireHttpSession();
-      }
-    });
-  }
-
-  /**
-   * Constructor used for de-serialization
-   */
-  private GemfireHttpSession() {
-  }
-
-  /**
-   * Constructor
-   */
-  public GemfireHttpSession(String id, HttpSession nativeSession) {
-    this();
-    this.id = id;
-    this.nativeSession = nativeSession;
-    if (nativeSession != null) {
-      attributes.setMaxInactiveInterval(nativeSession.getMaxInactiveInterval());
-    }
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  @Override
-  public Object getAttribute(String name) {
-    if (!isValid) {
-      throw new IllegalStateException("Session is already invalidated");
-    }
-    Object obj = attributes.getAttribute(name);
-
-    if (obj != null) {
-      Object tmpObj = null;
-      ClassLoader loader = ((GemfireSessionManager) manager).getReferenceClassLoader();
-
-      if (obj.getClass().getClassLoader() != loader) {
-        LOG.debug(
-            "Attribute '{}' needs to be reconstructed with a new classloader",
-            name);
-
-        ByteArrayOutputStream baos = new ByteArrayOutputStream();
-        try {
-          ObjectOutputStream oos = new ObjectOutputStream(baos);
-          oos.writeObject(obj);
-          oos.close();
-
-          ObjectInputStream ois = new ClassLoaderObjectInputStream(
-              new ByteArrayInputStream(baos.toByteArray()),
-              loader);
-          tmpObj = ois.readObject();
-        } catch (IOException e) {
-          LOG.error("Exception while recreating attribute '" + name +
-              "'", e);
-        } catch (ClassNotFoundException e) {
-          LOG.error("Exception while recreating attribute '" + name +
-              "'", e);
-        }
-        if (tmpObj != null) {
-          setAttribute(name, tmpObj);
-          obj = tmpObj;
-        }
-      }
-    }
-
-    return obj;
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  @Override
-  public Enumeration getAttributeNames() {
-    if (!isValid) {
-      throw new IllegalStateException("Session is already invalidated");
-    }
-    return Collections.enumeration(attributes.getAttributeNames());
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  @Override
-  public long getCreationTime() {
-    if (nativeSession != null) {
-      return nativeSession.getCreationTime();
-    } else {
-      return 0;
-    }
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  @Override
-  public String getId() {
-    return id;
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  @Override
-  public long getLastAccessedTime() {
-    if (!isValid) {
-      throw new IllegalStateException("Session is already invalidated");
-    }
-    return attributes.getLastAccessedTime();
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  @Override
-  public ServletContext getServletContext() {
-    if (nativeSession != null) {
-      return nativeSession.getServletContext();
-    } else {
-      return null;
-    }
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  @Override
-  public HttpSessionContext getSessionContext() {
-    return null;
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  @Override
-  public Object getValue(String name) {
-    return getAttribute(name);
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  @Override
-  public String[] getValueNames() {
-    return attributes.getAttributeNames().toArray(new String[0]);
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  @Override
-  public void invalidate() {
-    nativeSession.invalidate();
-    manager.destroySession(id);
-    isValid = false;
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  @Override
-  public boolean isNew() {
-    if (!isValid) {
-      throw new IllegalStateException("Session is already invalidated");
-    }
-    return isNew;
-  }
-
-  public void setIsNew(boolean isNew) {
-    this.isNew = isNew;
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  @Override
-  public void setMaxInactiveInterval(int interval) {
-    if (nativeSession != null) {
-      nativeSession.setMaxInactiveInterval(interval);
-    }
-    attributes.setMaxInactiveInterval(interval);
-    isDirty = true;
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  @Override
-  public int getMaxInactiveInterval() {
-    if (nativeSession != null) {
-      return nativeSession.getMaxInactiveInterval();
-    } else {
-      return attributes.getMaxIntactiveInterval();
-    }
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  @Override
-  public void putValue(String name, Object value) {
-    setAttribute(name, value);
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  @Override
-  public void removeAttribute(final String name) {
-    LOG.debug("Session {} removing attribute {}", getId(), name);
-    nativeSession.removeAttribute(name);
-    attributes.removeAttribute(name);
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  @Override
-  public void removeValue(String name) {
-    removeAttribute(name);
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  @Override
-  public void setAttribute(final String name, final Object value) {
-
-    if (LOG.isDebugEnabled()) {
-      LOG.debug("Session {} setting attribute {} = '{}'",
-          new Object[]{id, name, value});
-    }
-
-    isDirty = true;
-    nativeSession.setAttribute(name, value);
-    if (value == null) {
-      removeAttribute(name);
-    } else {
-      attributes.putAttribute(name, value);
-    }
-  }
-
-  /**
-   * Gemfire serialization {@inheritDoc}
-   */
-  @Override
-  public void toData(DataOutput out) throws IOException {
-    DataSerializer.writeString(id, out);
-    DataSerializer.writeObject(attributes, out);
-  }
-
-  /**
-   * Gemfire de-serialization {@inheritDoc}
-   */
-  @Override
-  public void fromData(DataInput in) throws IOException,
-      ClassNotFoundException {
-    id = DataSerializer.readString(in);
-    attributes = DataSerializer.readObject(in);
-    if (getNativeSession() != null) {
-      for (String s : attributes.getAttributeNames()) {
-        getNativeSession().setAttribute(s, attributes.getAttribute(s));
-      }
-    }
-
-    // Explicit sets
-    serialized.set(true);
-    attributes.setSession(this);
-  }
-
-  /**
-   * These three methods handle delta propagation and are deferred to the
-   * attribute object.
-   */
-  @Override
-  public boolean hasDelta() {
-    return isDirty;
-  }
-
-  @Override
-  public void toDelta(DataOutput out) throws IOException {
-    if (attributes instanceof Delta) {
-      ((Delta) attributes).toDelta(out);
-    } else {
-      toData(out);
-    }
-  }
-
-  @Override
-  public void fromDelta(DataInput in) throws IOException,
-      InvalidDeltaException {
-    if (attributes instanceof Delta) {
-      ((Delta) attributes).fromDelta(in);
-    } else {
-      try {
-        fromData(in);
-      } catch (ClassNotFoundException cex) {
-        throw new IOException("Unable to forward fromDelta() call "
-            + "to fromData()", cex);
-      }
-    }
-  }
-
-  @Override
-  public String toString() {
-    StringBuilder builder = new StringBuilder();
-    builder.append("[id=").append(id)
-        .append(", isNew=").append(isNew)
-        .append(", isValid=").append(isValid)
-        .append(", hasDelta=").append(hasDelta())
-        .append(", lastAccessedTime=").append(attributes.getLastAccessedTime())
-        .append(", jvmOwnerId=").append(attributes.getJvmOwnerId());
-    builder.append("]");
-    return builder.toString();
-  }
-
-  /**
-   * Flush the session object to the region
-   */
-  public void putInRegion() {
-
-    manager.putSession(this);
-    isDirty = false;
-  }
-
-  /**
-   * Determine whether the session is still valid or whether it has expired.
-   *
-   * @return true or false
-   */
-  public boolean isValid() {
-    if (!isValid) {
-      return false;
-    }
-    if (getMaxInactiveInterval() >= 0) {
-      long now = System.currentTimeMillis();
-      if (now - attributes.getLastAccessedTime() >= getMaxInactiveInterval() * 1000) {
-        return false;
-      }
-    }
-    return true;
-  }
-
-  /**
-   * Is this session dirty and should it be written to cache
-   */
-  public boolean isDirty() {
-    return isDirty;
-  }
-
-  public void setManager(SessionManager manager) {
-    this.manager = manager;
-  }
-
-  /**
-   * For testing allow retrieval of the wrapped, native session.
-   */
-  public HttpSession getNativeSession() {
-    return nativeSession;
-  }
-
-
-  public void setNativeSession(HttpSession session) {
-    this.nativeSession = session;
-  }
-
-  /**
-   * Handle the process of failing over the session to a new native session
-   * object.
-   *
-   * @param session
-   */
-  public void failoverSession(HttpSession session) {
-    LOG.debug("Failing over session {} to {}", getId(), session.getId());
-    setNativeSession(session);
-    for (String name : attributes.getAttributeNames()) {
-      LOG.debug("Copying '{}' => {}", name, attributes.getAttribute(name));
-      session.setAttribute(name, attributes.getAttribute(name));
-    }
-    session.setMaxInactiveInterval(attributes.getMaxIntactiveInterval());
-    manager.putSession(this);
-  }
-
-
-  /**
-   * Update the last accessed time
-   */
-  public void updateAccessTime() {
-    attributes.setLastAccessedTime(System.currentTimeMillis());
-  }
-
-  /**
-   * The {@code SessionManager} injects this when creating a new session.
-   *
-   * @param attributes
-   */
-  public void setAttributes(AbstractSessionAttributes attributes) {
-    this.attributes = attributes;
-  }
-
-  /**
-   * This is called on deserialization. You can only call it once to get a
-   * meaningful value as it resets the serialized state. In other words, this
-   * call is not idempotent.
-   *
-   * @return whether this object has just been serialized
-   */
-  public boolean justSerialized() {
-    return serialized.getAndSet(false);
-  }
-
-  /**
-   * Called when the session is about to go out of scope. If the session has
-   * been defined to use async queued attributes then they will be written out
-   * at this point.
-   */
-  public void commit() {
-    attributes.setJvmOwnerId(manager.getJvmId());
-    attributes.flush();
-  }
-
-  public String getJvmOwnerId() {
-    if (attributes != null) {
-      return attributes.getJvmOwnerId();
-    }
-
-    return null;
-  }
-}
-

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/GemfireSessionException.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/GemfireSessionException.java b/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/GemfireSessionException.java
deleted file mode 100644
index 1f58779..0000000
--- a/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/GemfireSessionException.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-
-package com.gemstone.gemfire.modules.session.filter;
-
-/**
- * Exception class for Gemfire Session Cache specific exceptions.
- */
-public class GemfireSessionException extends Exception {
-
-  public GemfireSessionException() {
-    super();
-  }
-
-  public GemfireSessionException(String message) {
-    super(message);
-  }
-
-  public GemfireSessionException(String message, Throwable cause) {
-    super(message, cause);
-  }
-
-  public GemfireSessionException(Throwable cause) {
-    super(cause);
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/GemfireSessionManager.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/GemfireSessionManager.java b/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/GemfireSessionManager.java
deleted file mode 100644
index 0d44385..0000000
--- a/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/GemfireSessionManager.java
+++ /dev/null
@@ -1,503 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-
-package com.gemstone.gemfire.modules.session.filter;
-
-import com.gemstone.gemfire.cache.CacheClosedException;
-import com.gemstone.gemfire.cache.CacheFactory;
-import com.gemstone.gemfire.cache.EntryNotFoundException;
-import com.gemstone.gemfire.cache.control.ResourceManager;
-import com.gemstone.gemfire.internal.cache.GemFireCacheImpl;
-import com.gemstone.gemfire.modules.session.bootstrap.AbstractCache;
-import com.gemstone.gemfire.modules.session.bootstrap.ClientServerCache;
-import com.gemstone.gemfire.modules.session.bootstrap.LifecycleTypeAdapter;
-import com.gemstone.gemfire.modules.session.bootstrap.PeerToPeerCache;
-import com.gemstone.gemfire.modules.session.common.CacheProperty;
-import com.gemstone.gemfire.modules.session.common.ClientServerSessionCache;
-import com.gemstone.gemfire.modules.session.common.PeerToPeerSessionCache;
-import com.gemstone.gemfire.modules.session.common.SessionCache;
-import com.gemstone.gemfire.modules.session.filter.attributes.AbstractSessionAttributes;
-import com.gemstone.gemfire.modules.session.filter.attributes.DeltaQueuedSessionAttributes;
-import com.gemstone.gemfire.modules.session.filter.attributes.DeltaSessionAttributes;
-import com.gemstone.gemfire.modules.session.filter.attributes.ImmediateSessionAttributes;
-import com.gemstone.gemfire.modules.session.filter.util.TypeAwareMap;
-import com.gemstone.gemfire.modules.session.jmx.SessionStatistics;
-import com.gemstone.gemfire.modules.util.RegionHelper;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-import javax.naming.InitialContext;
-import javax.servlet.FilterConfig;
-import javax.servlet.http.HttpSession;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.UUID;
-
-/**
- * This class implements the session management using a Gemfire distributedCache
- * as a persistent store for the session objects
- */
-public class GemfireSessionManager implements SessionManager {
-
-  private final Logger LOG;
-
-  /**
-   * Prefix of init param string used to set gemfire properties
-   */
-  private static final String GEMFIRE_PROPERTY = "gemfire.property.";
-
-  /**
-   * Prefix of init param string used to set gemfire distributedCache setting
-   */
-  private static final String GEMFIRE_CACHE = "gemfire.cache.";
-
-  private static final String INIT_PARAM_CACHE_TYPE = "cache-type";
-  private static final String CACHE_TYPE_CLIENT_SERVER = "client-server";
-  private static final String CACHE_TYPE_PEER_TO_PEER = "peer-to-peer";
-  private static final String INIT_PARAM_SESSION_COOKIE_NAME = "session-cookie-name";
-  private static final String INIT_PARAM_JVM_ID = "jvm-id";
-  private static final String DEFAULT_JVM_ID = "default";
-
-  private SessionCache sessionCache = null;
-
-  /**
-   * Reference to the distributed system
-   */
-  private AbstractCache distributedCache = null;
-
-  /**
-   * Boolean indicating whether the manager is shutting down
-   */
-  private boolean isStopping = false;
-
-  /**
-   * Boolean indicating whether this manager is defined in the same context (war
-   * / classloader) as the filter.
-   */
-  private boolean isolated = false;
-
-  /**
-   * Map of wrapping GemFire session id to native session id
-   */
-  private Map<String, String> nativeSessionMap =
-      new HashMap<String, String>();
-
-  /**
-   * MBean for statistics
-   */
-  private SessionStatistics mbean;
-
-  /**
-   * This CL is used to compare against the class loader of attributes getting
-   * pulled out of the cache. This variable should be set to the CL of the
-   * filter running everything.
-   */
-  private ClassLoader referenceClassLoader;
-
-  private String sessionCookieName = "JSESSIONID";
-
-  /**
-   * Give this JVM a unique identifier.
-   */
-  private String jvmId = "default";
-
-  /**
-   * Set up properties with default values
-   */
-  private TypeAwareMap<CacheProperty, Object> properties =
-      new TypeAwareMap<CacheProperty, Object>(CacheProperty.class) {{
-        put(CacheProperty.REGION_NAME, RegionHelper.NAME + "_sessions");
-        put(CacheProperty.ENABLE_GATEWAY_DELTA_REPLICATION, Boolean.FALSE);
-        put(CacheProperty.ENABLE_GATEWAY_REPLICATION, Boolean.FALSE);
-        put(CacheProperty.ENABLE_DEBUG_LISTENER, Boolean.FALSE);
-        put(CacheProperty.STATISTICS_NAME, "gemfire_statistics");
-        put(CacheProperty.SESSION_DELTA_POLICY, "delta_queued");
-        put(CacheProperty.REPLICATION_TRIGGER, "set");
-        /**
-         * For REGION_ATTRIBUTES_ID and ENABLE_LOCAL_CACHE the default
-         * is different for ClientServerCache and PeerToPeerCache
-         * so those values are set in the relevant constructors when
-         * these properties are passed in to them.
-         */
-      }};
-
-  public GemfireSessionManager() {
-    LOG = LoggerFactory.getLogger(GemfireSessionManager.class.getName());
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  @Override
-  public void start(Object conf, ClassLoader loader) {
-    this.referenceClassLoader = loader;
-    FilterConfig config = (FilterConfig) conf;
-
-    startDistributedSystem(config);
-    initializeSessionCache(config);
-
-    // Register MBean
-    registerMBean();
-
-    if (distributedCache.getClass().getClassLoader() == loader) {
-      isolated = true;
-    }
-
-    String sessionCookieName = config.getInitParameter(
-        INIT_PARAM_SESSION_COOKIE_NAME);
-    if (sessionCookieName != null && !sessionCookieName.isEmpty()) {
-      this.sessionCookieName = sessionCookieName;
-      LOG.info("Session cookie name set to: {}", this.sessionCookieName);
-    }
-
-    jvmId = config.getInitParameter(INIT_PARAM_JVM_ID);
-    if (jvmId == null || jvmId.isEmpty()) {
-      jvmId = DEFAULT_JVM_ID;
-    }
-
-    LOG.info("Started GemfireSessionManager (isolated={}, jvmId={})",
-        isolated, jvmId);
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  @Override
-  public void stop() {
-    isStopping = true;
-
-    if (isolated) {
-      if (distributedCache != null) {
-        LOG.info("Closing distributed cache - assuming isolated cache");
-        distributedCache.close();
-      }
-    } else {
-      LOG.info("Not closing distributed cache - assuming common cache");
-    }
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  @Override
-  public HttpSession getSession(String id) {
-    GemfireHttpSession session = (GemfireHttpSession) sessionCache.getOperatingRegion().get(
-        id);
-
-    if (session != null) {
-      if (session.justSerialized()) {
-        session.setManager(this);
-        LOG.debug("Recovered serialized session {} (jvmId={})", id,
-            session.getJvmOwnerId());
-      }
-      LOG.debug("Retrieved session id {}", id);
-    } else {
-      LOG.debug("Session id {} not found", id);
-    }
-    return session;
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  @Override
-  public HttpSession wrapSession(HttpSession nativeSession) {
-    String id = generateId();
-    GemfireHttpSession session =
-        new GemfireHttpSession(id, nativeSession);
-
-    /**
-     * Set up the attribute container depending on how things are configured
-     */
-    AbstractSessionAttributes attributes;
-    if ("delta_queued".equals(
-        properties.get(CacheProperty.SESSION_DELTA_POLICY))) {
-      attributes = new DeltaQueuedSessionAttributes();
-      ((DeltaQueuedSessionAttributes) attributes).setReplicationTrigger(
-          (String) properties.get(CacheProperty.REPLICATION_TRIGGER));
-    } else if ("delta_immediate".equals(
-        properties.get(CacheProperty.SESSION_DELTA_POLICY))) {
-      attributes = new DeltaSessionAttributes();
-    } else if ("immediate".equals(
-        properties.get(CacheProperty.SESSION_DELTA_POLICY))) {
-      attributes = new ImmediateSessionAttributes();
-    } else {
-      attributes = new DeltaSessionAttributes();
-      LOG.warn(
-          "No session delta policy specified - using default of 'delta_immediate'");
-    }
-
-    attributes.setSession(session);
-    attributes.setJvmOwnerId(jvmId);
-
-    session.setManager(this);
-    session.setAttributes(attributes);
-
-    LOG.debug("Creating new session {}", id);
-    sessionCache.getOperatingRegion().put(id, session);
-
-    mbean.incActiveSessions();
-
-    return session;
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  public HttpSession getWrappingSession(String nativeId) {
-    HttpSession session = null;
-    String gemfireId = getGemfireSessionIdFromNativeId(nativeId);
-
-    if (gemfireId != null) {
-      session = getSession(gemfireId);
-    }
-    return session;
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  @Override
-  public void destroySession(String id) {
-    if (!isStopping) {
-      try {
-        GemfireHttpSession session = (GemfireHttpSession) sessionCache.getOperatingRegion().get(
-            id);
-        if (session != null && session.getJvmOwnerId().equals(jvmId)) {
-          LOG.debug("Destroying session {}", id);
-          sessionCache.getOperatingRegion().destroy(id);
-          mbean.decActiveSessions();
-        }
-      } catch (EntryNotFoundException nex) {
-      }
-    } else {
-      if (sessionCache.isClientServer()) {
-        LOG.debug("Destroying session {}", id);
-        try {
-          sessionCache.getOperatingRegion().localDestroy(id);
-        } catch (EntryNotFoundException nex) {
-          // Ignored
-        } catch (CacheClosedException ccex) {
-          // Ignored
-        }
-      } else {
-        GemfireHttpSession session = (GemfireHttpSession) sessionCache.getOperatingRegion().get(
-            id);
-        if (session != null) {
-          session.setNativeSession(null);
-        }
-      }
-    }
-
-    synchronized (nativeSessionMap) {
-      String nativeId = nativeSessionMap.remove(id);
-      LOG.debug("destroySession called for {} wrapping {}", id, nativeId);
-    }
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  @Override
-  public void putSession(HttpSession session) {
-    sessionCache.getOperatingRegion().put(session.getId(), session);
-    mbean.incRegionUpdates();
-    nativeSessionMap.put(session.getId(),
-        ((GemfireHttpSession) session).getNativeSession().getId());
-  }
-
-  @Override
-  public String destroyNativeSession(String nativeId) {
-    String gemfireSessionId = getGemfireSessionIdFromNativeId(nativeId);
-    if (gemfireSessionId != null) {
-      destroySession(gemfireSessionId);
-    }
-    return gemfireSessionId;
-  }
-
-  public ClassLoader getReferenceClassLoader() {
-    return referenceClassLoader;
-  }
-
-  /**
-   * This method is called when a native session gets destroyed. It will check
-   * if the GemFire session is actually still valid/not expired and will then
-   * attach a new, native session.
-   *
-   * @param nativeId the id of the native session
-   * @return the id of the newly attached native session or null if the GemFire
-   * session was already invalid
-   */
-  public String refreshSession(String nativeId) {
-    String gemfireId = getGemfireSessionIdFromNativeId(nativeId);
-    if (gemfireId == null) {
-      return null;
-    }
-
-    GemfireHttpSession session = (GemfireHttpSession) sessionCache.getOperatingRegion().get(
-        gemfireId);
-    if (session.isValid()) {
-
-    }
-
-    return null;
-  }
-
-  public String getSessionCookieName() {
-    return sessionCookieName;
-  }
-
-  public String getJvmId() {
-    return jvmId;
-  }
-
-
-  ///////////////////////////////////////////////////////////////////////
-  // Private methods
-
-  private String getGemfireSessionIdFromNativeId(String nativeId) {
-    if (nativeId == null) {
-      return null;
-    }
-
-    for (Map.Entry<String, String> e : nativeSessionMap.entrySet()) {
-      if (nativeId.equals(e.getValue())) {
-        return e.getKey();
-      }
-    }
-    return null;
-  }
-
-  /**
-   * Start the underlying distributed system
-   *
-   * @param config
-   */
-  private void startDistributedSystem(FilterConfig config) {
-    // Get the distributedCache type
-    final String cacheType = config.getInitParameter(INIT_PARAM_CACHE_TYPE);
-    if (CACHE_TYPE_CLIENT_SERVER.equals(cacheType)) {
-      distributedCache = ClientServerCache.getInstance();
-    } else if (CACHE_TYPE_PEER_TO_PEER.equals(cacheType)) {
-      distributedCache = PeerToPeerCache.getInstance();
-    } else {
-      LOG.error("No 'cache-type' initialization param set. "
-          + "Cache will not be started");
-      return;
-    }
-
-    if (!distributedCache.isStarted()) {
-      /**
-       * Process all the init params and see if any apply to the
-       * distributed system.
-       */
-      for (Enumeration<String> e = config.getInitParameterNames(); e.hasMoreElements(); ) {
-        String param = e.nextElement();
-        if (!param.startsWith(GEMFIRE_PROPERTY)) {
-          continue;
-        }
-
-        String gemfireProperty = param.substring(GEMFIRE_PROPERTY.length());
-        LOG.info("Setting gemfire property: {} = {}",
-            gemfireProperty, config.getInitParameter(param));
-        distributedCache.setProperty(gemfireProperty,
-            config.getInitParameter(param));
-      }
-
-      distributedCache.lifecycleEvent(LifecycleTypeAdapter.START);
-    }
-  }
-
-  /**
-   * Initialize the distributedCache
-   */
-  private void initializeSessionCache(FilterConfig config) {
-    // Retrieve the distributedCache
-    GemFireCacheImpl cache = (GemFireCacheImpl) CacheFactory.getAnyInstance();
-    if (cache == null) {
-      throw new IllegalStateException("No cache exists. Please configure "
-          + "either a PeerToPeerCacheLifecycleListener or "
-          + "ClientServerCacheLifecycleListener in the "
-          + "server.xml file.");
-    }
-
-    /**
-     * Process all the init params and see if any apply to the distributedCache
-     */
-    ResourceManager rm = cache.getResourceManager();
-    for (Enumeration<String> e = config.getInitParameterNames(); e.hasMoreElements(); ) {
-      String param = e.nextElement();
-
-      // Uggh - don't like this non-generic stuff
-      if (param.equalsIgnoreCase("criticalHeapPercentage")) {
-        float val = Float.parseFloat(config.getInitParameter(param));
-        rm.setCriticalHeapPercentage(val);
-      }
-
-      if (param.equalsIgnoreCase("evictionHeapPercentage")) {
-        float val = Float.parseFloat(config.getInitParameter(param));
-        rm.setEvictionHeapPercentage(val);
-      }
-
-
-      if (!param.startsWith(GEMFIRE_CACHE)) {
-        continue;
-      }
-
-      String gemfireWebParam = param.substring(GEMFIRE_CACHE.length());
-      LOG.info("Setting cache parameter: {} = {}",
-          gemfireWebParam, config.getInitParameter(param));
-      properties.put(CacheProperty.valueOf(gemfireWebParam.toUpperCase()),
-          config.getInitParameter(param));
-    }
-
-    // Create the appropriate session distributedCache
-    sessionCache = cache.isClient()
-        ? new ClientServerSessionCache(cache, properties)
-        : new PeerToPeerSessionCache(cache, properties);
-
-    // Initialize the session distributedCache
-    sessionCache.initialize();
-  }
-
-  /**
-   * Register a bean for statistic gathering purposes
-   */
-  private void registerMBean() {
-    mbean = new SessionStatistics();
-
-    try {
-      InitialContext ctx = new InitialContext();
-      MBeanServer mbs = MBeanServer.class.cast(
-          ctx.lookup("java:comp/env/jmx/runtime"));
-      ObjectName oname = new ObjectName(
-          Constants.SESSION_STATISTICS_MBEAN_NAME);
-
-      mbs.registerMBean(mbean, oname);
-    } catch (Exception ex) {
-      LOG.warn("Unable to register statistics MBean. Error: {}",
-          ex.getMessage());
-    }
-  }
-
-
-  /**
-   * Generate an ID string
-   */
-  private String generateId() {
-    return UUID.randomUUID().toString().toUpperCase() + "-GF";
-  }
-
-  AbstractCache getCache() {
-    return distributedCache;
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/ListenerEventType.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/ListenerEventType.java b/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/ListenerEventType.java
deleted file mode 100644
index 3b5f468..0000000
--- a/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/ListenerEventType.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-
-package com.gemstone.gemfire.modules.session.filter;
-
-/**
- * Enumeration of all possible event types which can be listened for.
- */
-public enum ListenerEventType {
-
-  /**
-   * HttpSessionAttributeListener
-   */
-  SESSION_ATTRIBUTE_ADDED,
-  SESSION_ATTRIBUTE_REMOVED,
-  SESSION_ATTRIBUTE_REPLACED,
-
-  /**
-   * HttpSessionBindingListener
-   */
-  SESSION_VALUE_BOUND,
-  SESSION_VALUE_UNBOUND,
-
-  /**
-   * HttpSessionListener
-   */
-  SESSION_CREATED,
-  SESSION_DESTROYED,
-
-  /**
-   * HttpSessionActivationListener
-   */
-  SESSION_WILL_ACTIVATE,
-  SESSION_DID_PASSIVATE,
-
-  /**
-   * ServletContextListener
-   */
-  SERVLET_CONTEXT_INITIALIZED,
-  SERVLET_CONTEXT_DESTROYED,
-
-  /**
-   * ServletContextAttributeListener
-   */
-  SERVLET_CONTEXT_ATTRIBUTE_ADDED,
-  SERVLET_CONTEXT_ATTRIBUTE_REMOVED,
-  SERVLET_CONTEXT_ATTRIBUTE_REPLACED,
-
-  /**
-   * ServletRequestListener
-   */
-  SERVLET_REQUEST_DESTROYED,
-  SERVLET_REQUEST_INITIALIZED,
-
-  /**
-   * ServletRequestAttributeListener
-   */
-  SERVLET_REQUEST_ATTRIBUTE_ADDED,
-  SERVLET_REQUEST_ATTRIBUTE_REMOVED,
-  SERVLET_REQUEST_ATTRIBUTE_REPLACED;
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/SessionManager.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/SessionManager.java b/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/SessionManager.java
deleted file mode 100644
index bd39a75..0000000
--- a/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/SessionManager.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-
-package com.gemstone.gemfire.modules.session.filter;
-
-import javax.servlet.http.HttpSession;
-
-/**
- * Interface to session management. This class would be responsible for creating
- * new sessions.
- */
-public interface SessionManager {
-
-  /**
-   * Start the manager possibly using the config passed in.
-   *
-   * @param config Config object specific to individual implementations.
-   * @param loader This is a hack. When the manager is started it wants to be
-   *               able to determine if the cache, which it would create, and
-   *               the filter which starts everything, are defined by the same
-   *               classloader. This is so that during shutdown, the manager can
-   *               decide whether or not to also stop the cache. This option
-   *               allows the filter's classloader to be passed in.
-   */
-  public void start(Object config, ClassLoader loader);
-
-  /**
-   * Stop the session manager and free up any resources.
-   */
-  public void stop();
-
-  /**
-   * Write the session to the region
-   *
-   * @param session the session to write
-   */
-  public void putSession(HttpSession session);
-
-  /**
-   * Return a session if it exists or null otherwise
-   *
-   * @param id The session id to attempt to retrieve
-   * @return a HttpSession object if a session was found otherwise null.
-   */
-  public HttpSession getSession(String id);
-
-  /**
-   * Create a new session, wrapping a container session.
-   *
-   * @param nativeSession
-   * @return the HttpSession object
-   */
-  public HttpSession wrapSession(HttpSession nativeSession);
-
-  /**
-   * Get the wrapped (GemFire) session from a native session id. This method
-   * would typically be used from within session/http event listeners which
-   * receive the original session id.
-   *
-   * @param nativeId
-   * @return the wrapped GemFire session which maps the native session
-   */
-  public HttpSession getWrappingSession(String nativeId);
-
-  /**
-   * Destroy the session associated with the given id.
-   *
-   * @param id The id of the session to destroy.
-   */
-  public void destroySession(String id);
-
-  /**
-   * Destroy the session associated with a given native session
-   *
-   * @param id the id of the native session
-   * @return the corresponding Gemfire session which wrapped the native session
-   * and was destroyed.
-   */
-  public String destroyNativeSession(String id);
-
-  /**
-   * Returns the cookie name used to hold the session id. By default this is
-   * JSESSIONID.
-   *
-   * @return the name of the cookie which contains the session id
-   */
-  public String getSessionCookieName();
-
-  /**
-   * Get the JVM Id - this is a unique string used internally to identify who
-   * last touched a session.
-   *
-   * @return the jvm id
-   */
-  public String getJvmId();
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/attributes/AbstractDeltaSessionAttributes.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/attributes/AbstractDeltaSessionAttributes.java b/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/attributes/AbstractDeltaSessionAttributes.java
deleted file mode 100644
index 68341a5..0000000
--- a/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/attributes/AbstractDeltaSessionAttributes.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-package com.gemstone.gemfire.modules.session.filter.attributes;
-
-import com.gemstone.gemfire.DataSerializer;
-import com.gemstone.gemfire.Delta;
-import com.gemstone.gemfire.InvalidDeltaException;
-
-import java.io.DataInput;
-import java.io.DataOutput;
-import java.io.IOException;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * This abstract class contains the structures and methods to handle delta
- * updates to attributes.
- */
-public abstract class AbstractDeltaSessionAttributes
-    extends AbstractSessionAttributes implements Delta {
-
-  private static final Logger LOG =
-      LoggerFactory.getLogger(AbstractDeltaSessionAttributes.class.getName());
-
-  /**
-   * This map holds the updates to attributes
-   */
-  protected transient Map<String, DeltaEvent> deltas =
-      Collections.synchronizedMap(new HashMap<String, DeltaEvent>());
-
-  @Override
-  public boolean hasDelta() {
-    return true;
-  }
-
-  @Override
-  public void toDelta(DataOutput out) throws IOException {
-    out.writeInt(maxInactiveInterval);
-    out.writeLong(lastAccessedTime);
-
-    synchronized (deltas) {
-      DataSerializer.writeInteger(deltas.size(), out);
-      for (Map.Entry<String, DeltaEvent> e : deltas.entrySet()) {
-        DataSerializer.writeString(e.getKey(), out);
-        DataSerializer.writeObject(e.getValue(), out);
-      }
-      deltas.clear();
-    }
-
-    out.writeUTF(jvmOwnerId);
-  }
-
-  @Override
-  public void fromDelta(DataInput in)
-      throws IOException, InvalidDeltaException {
-    maxInactiveInterval = in.readInt();
-    lastAccessedTime = in.readLong();
-    Map<String, DeltaEvent> localDeltas = new HashMap<String, DeltaEvent>();
-    try {
-      int size = DataSerializer.readInteger(in);
-      for (int i = 0; i < size; i++) {
-        String key = DataSerializer.readString(in);
-        DeltaEvent evt = DataSerializer.readObject(in);
-        localDeltas.put(key, evt);
-      }
-    } catch (ClassNotFoundException ex) {
-      LOG.error("Unable to de-serialize delta events", ex);
-      return;
-    }
-
-    LOG.debug("Processing {} delta events for {}",
-        localDeltas.size(), session);
-    for (DeltaEvent e : localDeltas.values()) {
-      if (e.isUpdate()) {
-        attributes.put(e.getName(), e.getValue());
-        if (session.getNativeSession() != null) {
-          session.getNativeSession().setAttribute(e.getName(), e.getValue());
-        }
-      } else {
-        attributes.remove(e.getName());
-        if (session.getNativeSession() != null) {
-          session.getNativeSession().setAttribute(e.getName(), null);
-        }
-      }
-    }
-    jvmOwnerId = in.readUTF();
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/attributes/AbstractSessionAttributes.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/attributes/AbstractSessionAttributes.java b/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/attributes/AbstractSessionAttributes.java
deleted file mode 100644
index d76fb93..0000000
--- a/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/attributes/AbstractSessionAttributes.java
+++ /dev/null
@@ -1,179 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-
-package com.gemstone.gemfire.modules.session.filter.attributes;
-
-import com.gemstone.gemfire.DataSerializer;
-import com.gemstone.gemfire.internal.util.BlobHelper;
-import com.gemstone.gemfire.modules.session.filter.GemfireHttpSession;
-
-import java.io.DataInput;
-import java.io.DataOutput;
-import java.io.IOException;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Abstract implementation for attributes. Should be sub-classed to provide
- * differing implementations for synchronous or delta propagation. The backing
- * store used is defined by the session manager.
- */
-public abstract class AbstractSessionAttributes implements SessionAttributes {
-
-  private static final Logger LOG =
-      LoggerFactory.getLogger(AbstractSessionAttributes.class.getName());
-
-  /**
-   * Internal attribute store.
-   */
-  protected Map<String, Object> attributes =
-      Collections.synchronizedMap(new HashMap<String, Object>());
-
-  /**
-   * The session to which these attributes belong
-   */
-  protected transient GemfireHttpSession session;
-
-  /**
-   * The last accessed time
-   */
-  protected long lastAccessedTime;
-
-  /**
-   * The maximum inactive interval. Default is 1800 seconds.
-   */
-  protected int maxInactiveInterval = 60 * 30;
-
-  /**
-   * The JVM Id who last committed these attributes
-   */
-  protected String jvmOwnerId;
-
-  /**
-   * {@inheritDoc}
-   */
-  @Override
-  public void setSession(GemfireHttpSession session) {
-    this.session = session;
-  }
-
-  /**
-   * {@inheritDoc} The actual de-serialization of any domain objects is deferred
-   * until the point at which they are actually retrieved by the application
-   * layer.
-   */
-  @Override
-  public Object getAttribute(String name) {
-    Object value = attributes.get(name);
-
-    // If the value is a byte[] (meaning it came from the server),
-    // deserialize it and re-add it to attributes map before returning it.
-    if (value instanceof byte[]) {
-      try {
-        value = BlobHelper.deserializeBlob((byte[]) value);
-        attributes.put(name, value);
-      } catch (Exception iox) {
-        LOG.error("Attribute '" + name +
-            " contains a byte[] that cannot be deserialized due "
-            + "to the following exception", iox);
-      }
-    }
-
-    return value;
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  @Override
-  public Set<String> getAttributeNames() {
-    return attributes.keySet();
-  }
-
-  /**
-   * {@inheritDoc} +
-   */
-  @Override
-  public void setMaxInactiveInterval(int interval) {
-    maxInactiveInterval = interval;
-  }
-
-  @Override
-  public int getMaxIntactiveInterval() {
-    return maxInactiveInterval;
-  }
-
-  @Override
-  public void setLastAccessedTime(long time) {
-    lastAccessedTime = time;
-  }
-
-  @Override
-  public long getLastAccessedTime() {
-    return lastAccessedTime;
-  }
-
-  /**
-   * {@inheritDoc} This method calls back into the session to flush the whole
-   * session including its attributes.
-   */
-  @Override
-  public void flush() {
-    session.putInRegion();
-  }
-
-  /**
-   * Use DeltaEvents to propagate the actual attribute data - DeltaEvents turn
-   * the values into byte arrays which means that the actual domain classes are
-   * not required on the server.
-   */
-  @Override
-  public void toData(DataOutput out) throws IOException {
-    out.writeInt(maxInactiveInterval);
-    out.writeLong(lastAccessedTime);
-
-    synchronized (attributes) {
-      out.writeInt(attributes.size());
-      for (Map.Entry<String, Object> entry : attributes.entrySet()) {
-        DeltaEvent delta = new DeltaEvent(true, entry.getKey(),
-            entry.getValue());
-        DataSerializer.writeObject(delta, out);
-      }
-    }
-
-    out.writeUTF(jvmOwnerId);
-  }
-
-  @Override
-  public void fromData(
-      DataInput in) throws IOException, ClassNotFoundException {
-    maxInactiveInterval = in.readInt();
-    lastAccessedTime = in.readLong();
-    int size = in.readInt();
-    while (size-- > 0) {
-      DeltaEvent event = DataSerializer.readObject(in);
-      attributes.put(event.getName(), event.getValue());
-    }
-    jvmOwnerId = in.readUTF();
-  }
-
-  @Override
-  public void setJvmOwnerId(String jvmId) {
-    this.jvmOwnerId = jvmId;
-  }
-
-  @Override
-  public String getJvmOwnerId() {
-    return jvmOwnerId;
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/attributes/DeltaEvent.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/attributes/DeltaEvent.java b/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/attributes/DeltaEvent.java
deleted file mode 100644
index 61258ea..0000000
--- a/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/attributes/DeltaEvent.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-package com.gemstone.gemfire.modules.session.filter.attributes;
-
-import com.gemstone.gemfire.DataSerializable;
-import com.gemstone.gemfire.DataSerializer;
-import com.gemstone.gemfire.internal.util.BlobHelper;
-import com.gemstone.gemfire.modules.session.filter.GemfireHttpSession;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.DataInput;
-import java.io.DataOutput;
-import java.io.IOException;
-
-/**
- * Capture the update to a particular name
- */
-public class DeltaEvent implements DataSerializable {
-
-  private static final Logger LOG =
-      LoggerFactory.getLogger(DeltaEvent.class.getName());
-  /**
-   * The event is either an update (true) or a remove (false)
-   */
-  private boolean update;
-
-  private String name;
-
-  private Object value = null;
-
-  private GemfireHttpSession session = null;
-
-  /**
-   * Constructor for de-serialization only
-   */
-  public DeltaEvent() {
-  }
-
-  /**
-   * Constructor which creates a 'deferred' event. This is used when the value
-   * should only be applied when the object is serialized.
-   *
-   * @param session   the session from which the value ultimately will be
-   *                  retrieved
-   * @param attribute the name of the attribute
-   */
-  public DeltaEvent(GemfireHttpSession session, String attribute) {
-    this.session = session;
-    this.name = attribute;
-    this.update = true;
-  }
-
-  public DeltaEvent(boolean update, String attribute, Object value) {
-    this.update = update;
-    this.name = attribute;
-    this.value = value;
-    blobifyValue();
-  }
-
-  private void blobifyValue() {
-    if (value instanceof byte[]) {
-      LOG.warn("Session attribute is already a byte[] - problems may "
-          + "occur transmitting this delta.");
-    }
-    try {
-      value = BlobHelper.serializeToBlob(value);
-    } catch (IOException iox) {
-      LOG.error("Attribute '" + name + "' value: " + value
-          + " cannot be serialized due to the following exception", iox);
-    }
-  }
-
-  public boolean isUpdate() {
-    return update;
-  }
-
-  public String getName() {
-    return name;
-  }
-
-  public Object getValue() {
-    return value;
-  }
-
-  @Override
-  public void toData(DataOutput out) throws IOException {
-    if (session != null) {
-      value = session.getNativeSession().getAttribute(name);
-      blobifyValue();
-    }
-    out.writeBoolean(update);
-    DataSerializer.writeString(name, out);
-    DataSerializer.writeObject(value, out);
-  }
-
-  @Override
-  public void fromData(
-      DataInput in) throws IOException, ClassNotFoundException {
-    update = in.readBoolean();
-    name = DataSerializer.readString(in);
-    value = DataSerializer.readObject(in);
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/attributes/DeltaQueuedSessionAttributes.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/attributes/DeltaQueuedSessionAttributes.java b/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/attributes/DeltaQueuedSessionAttributes.java
deleted file mode 100644
index 678141f..0000000
--- a/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/attributes/DeltaQueuedSessionAttributes.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-package com.gemstone.gemfire.modules.session.filter.attributes;
-
-import com.gemstone.gemfire.DataSerializable;
-import com.gemstone.gemfire.Instantiator;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * This class implements delayed attribute delta propagation. Updates to
- * attributes are only propagated once the session goes out of scope - i.e. as
- * the request is done being processed.
- */
-public class DeltaQueuedSessionAttributes extends AbstractDeltaSessionAttributes {
-
-  private static final Logger LOG =
-      LoggerFactory.getLogger(DeltaQueuedSessionAttributes.class.getName());
-
-  private Trigger trigger = Trigger.SET;
-
-  private enum Trigger {
-    SET,
-    SET_AND_GET;
-  }
-
-  /**
-   * Register ourselves for de-serialization
-   */
-  static {
-    Instantiator.register(
-        new Instantiator(DeltaQueuedSessionAttributes.class, 3479) {
-          @Override
-          public DataSerializable newInstance() {
-            return new DeltaQueuedSessionAttributes();
-          }
-        });
-  }
-
-  /**
-   * Default constructor
-   */
-  public DeltaQueuedSessionAttributes() {
-  }
-
-  public void setReplicationTrigger(String trigger) {
-    this.trigger = Trigger.valueOf(trigger.toUpperCase());
-  }
-
-  @Override
-  public Object getAttribute(String attr) {
-    if (trigger == Trigger.SET_AND_GET) {
-      deltas.put(attr, new DeltaEvent(session, attr));
-    }
-    return super.getAttribute(attr);
-  }
-
-  /**
-   * {@inheritDoc} Put an attribute, setting the dirty flag. The changes are
-   * flushed at the end of filter processing.
-   */
-  @Override
-  public Object putAttribute(String attr, Object value) {
-    Object obj = attributes.put(attr, value);
-    deltas.put(attr, new DeltaEvent(true, attr, value));
-    return obj;
-  }
-
-  /**
-   * {@inheritDoc} Remove an attribute, setting the dirty flag. The changes are
-   * flushed at the end of filter processing.
-   */
-  @Override
-  public Object removeAttribute(String attr) {
-    Object obj = attributes.remove(attr);
-    deltas.put(attr, new DeltaEvent(false, attr, null));
-    return obj;
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/attributes/DeltaSessionAttributes.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/attributes/DeltaSessionAttributes.java b/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/attributes/DeltaSessionAttributes.java
deleted file mode 100644
index 349cfc2..0000000
--- a/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/attributes/DeltaSessionAttributes.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-package com.gemstone.gemfire.modules.session.filter.attributes;
-
-import com.gemstone.gemfire.DataSerializable;
-import com.gemstone.gemfire.Instantiator;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * This class implements synchronous attribute delta propagation. Updates to
- * attributes are immediately propagated.
- */
-public class DeltaSessionAttributes extends AbstractDeltaSessionAttributes {
-
-  private static final Logger LOG =
-      LoggerFactory.getLogger(DeltaSessionAttributes.class.getName());
-
-  /**
-   * Register ourselves for de-serialization
-   */
-  static {
-    Instantiator.register(new Instantiator(DeltaSessionAttributes.class, 347) {
-      @Override
-      public DataSerializable newInstance() {
-        return new DeltaSessionAttributes();
-      }
-    });
-  }
-
-  /**
-   * Default constructor
-   */
-  public DeltaSessionAttributes() {
-  }
-
-  /**
-   * {@inheritDoc} Put an attribute, setting the dirty flag and immediately
-   * flushing the delta queue.
-   */
-  @Override
-  public Object putAttribute(String attr, Object value) {
-    Object obj = attributes.put(attr, value);
-    deltas.put(attr, new DeltaEvent(true, attr, value));
-    flush();
-    return obj;
-  }
-
-  /**
-   * {@inheritDoc} Remove an attribute, setting the dirty flag and immediately
-   * flushing the delta queue.
-   */
-  @Override
-  public Object removeAttribute(String attr) {
-    Object obj = attributes.remove(attr);
-    deltas.put(attr, new DeltaEvent(false, attr, null));
-    flush();
-    return obj;
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/attributes/ImmediateSessionAttributes.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/attributes/ImmediateSessionAttributes.java b/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/attributes/ImmediateSessionAttributes.java
deleted file mode 100644
index 4cfbe19..0000000
--- a/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/attributes/ImmediateSessionAttributes.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-package com.gemstone.gemfire.modules.session.filter.attributes;
-
-import com.gemstone.gemfire.DataSerializable;
-import com.gemstone.gemfire.DataSerializer;
-import com.gemstone.gemfire.Instantiator;
-
-import java.io.DataInput;
-import java.io.DataOutput;
-import java.io.IOException;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * This class implements immediately transmitted attributes. All attributes are
- * transmitted for every attribute update. This is bound to be a performance hit
- * in some cases but ensures much higher data availability.
- */
-public class ImmediateSessionAttributes extends AbstractSessionAttributes {
-
-  private static final Logger LOG =
-      LoggerFactory.getLogger(ImmediateSessionAttributes.class.getName());
-
-  /**
-   * Register ourselves for de-serialization
-   */
-  static {
-    Instantiator.register(
-        new Instantiator(ImmediateSessionAttributes.class, 347) {
-          @Override
-          public DataSerializable newInstance() {
-            return new ImmediateSessionAttributes();
-          }
-        });
-  }
-
-  /**
-   * Default constructor
-   */
-  public ImmediateSessionAttributes() {
-  }
-
-  @Override
-  public Object putAttribute(String attr, Object value) {
-    Object obj = attributes.put(attr, value);
-    flush();
-    return obj;
-  }
-
-  @Override
-  public Object removeAttribute(String attr) {
-    Object obj = attributes.remove(attr);
-    flush();
-    return obj;
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/attributes/QueuedSessionAttributes.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/attributes/QueuedSessionAttributes.java b/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/attributes/QueuedSessionAttributes.java
deleted file mode 100644
index 769bd59..0000000
--- a/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/attributes/QueuedSessionAttributes.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-package com.gemstone.gemfire.modules.session.filter.attributes;
-
-import com.gemstone.gemfire.DataSerializable;
-import com.gemstone.gemfire.DataSerializer;
-import com.gemstone.gemfire.Instantiator;
-
-import java.io.DataInput;
-import java.io.DataOutput;
-import java.io.IOException;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * This class implements an attribute container which delays sending updates
- * until the session goes out of scope. All attributes are transmitted during
- * the update.
- */
-public class QueuedSessionAttributes extends AbstractSessionAttributes {
-
-  private static final Logger LOG =
-      LoggerFactory.getLogger(QueuedSessionAttributes.class.getName());
-
-  /**
-   * Register ourselves for de-serialization
-   */
-  static {
-    Instantiator.register(new Instantiator(QueuedSessionAttributes.class, 347) {
-      @Override
-      public DataSerializable newInstance() {
-        return new QueuedSessionAttributes();
-      }
-    });
-  }
-
-  /**
-   * Default constructor
-   */
-  public QueuedSessionAttributes() {
-  }
-
-  @Override
-  public Object putAttribute(String attr, Object value) {
-    Object obj = attributes.put(attr, value);
-    return obj;
-  }
-
-  @Override
-  public Object removeAttribute(String attr) {
-    Object obj = attributes.remove(attr);
-    return obj;
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/attributes/SessionAttributes.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/attributes/SessionAttributes.java b/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/attributes/SessionAttributes.java
deleted file mode 100644
index 552477f..0000000
--- a/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/attributes/SessionAttributes.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-
-package com.gemstone.gemfire.modules.session.filter.attributes;
-
-import com.gemstone.gemfire.DataSerializable;
-import com.gemstone.gemfire.modules.session.filter.GemfireHttpSession;
-
-import java.util.Set;
-
-/**
- * Interface for session attribute storage. In reality, this interface is
- * responsible for anything, in the session which needs to be propagated for
- * caching - as such it also includes other 'attributes' such as
- * maxInactiveInterval and lastAccessedTime
- */
-public interface SessionAttributes extends DataSerializable {
-
-  /**
-   * Set the session to which these attributes belong.
-   *
-   * @param session the session to set
-   */
-  public void setSession(GemfireHttpSession session);
-
-  /**
-   * Set an attribute value.
-   *
-   * @param attr  the name of the attribute to set
-   * @param value the value for the attribute
-   * @return the value object
-   */
-  public Object putAttribute(String attr, Object value);
-
-  /**
-   * Retrieve an attribute's value.
-   *
-   * @param attr the name of the attribute
-   * @return the object associated with the attribute or null if none exists.
-   */
-  public Object getAttribute(String attr);
-
-  /**
-   * Remove the named attribute.
-   *
-   * @param attr the name of the attribute to remove
-   * @return the value of the attribute removed or null if the named attribute
-   * did not exist.
-   */
-  public Object removeAttribute(String attr);
-
-  /**
-   * Return a set of all attribute names.
-   *
-   * @return a set of all attribute names
-   */
-  public Set<String> getAttributeNames();
-
-  /**
-   * Set the max inactive interval for replication to other systems
-   *
-   * @param interval the time interval in seconds
-   */
-  public void setMaxInactiveInterval(int interval);
-
-  /**
-   * Retrieve the max inactive interval
-   *
-   * @return the max inactive interval in seconds
-   */
-  public int getMaxIntactiveInterval();
-
-  /**
-   * Set the last accessed time for replication to other systems
-   *
-   * @param time the last accessed time in milliseconds
-   */
-  public void setLastAccessedTime(long time);
-
-  /**
-   * Return the last accessed time in milliseconds
-   *
-   * @return the last accessed time
-   */
-  public long getLastAccessedTime();
-
-  /**
-   * Explicitly flush the attributes to backing store.
-   */
-  public void flush();
-
-  /**
-   * Return the last jvm which 'owned' these attributes
-   *
-   * @return the jvmId
-   */
-  public String getJvmOwnerId();
-
-  /**
-   * Set the jvmId. This is set every time the attributes are flushed to the
-   * cache.
-   *
-   * @param jvmId
-   */
-  public void setJvmOwnerId(String jvmId);
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/92ee6a79/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/util/NamedThreadFactory.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/util/NamedThreadFactory.java b/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/util/NamedThreadFactory.java
deleted file mode 100644
index edf1e60..0000000
--- a/modules/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/util/NamedThreadFactory.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-
-package com.gemstone.gemfire.modules.session.filter.util;
-
-import java.lang.Thread.UncaughtExceptionHandler;
-import java.util.concurrent.ThreadFactory;
-import java.util.concurrent.atomic.AtomicLong;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/**
- * Factory to create named threads for easy identification at runtime.
- */
-public class NamedThreadFactory implements ThreadFactory {
-
-  private static final Logger LOG = Logger.getLogger(
-      NamedThreadFactory.class.getName());
-
-  private final String id;
-
-  private final AtomicLong serial = new AtomicLong();
-
-  /**
-   * Create a new thread factory, using the specified pool ID as a basis for
-   * naming each thread.
-   *
-   * @param poolID pool name/ID
-   */
-  public NamedThreadFactory(final String poolID) {
-    id = poolID;
-  }
-
-  /**
-   * {@inheritDoc}
-   * <p/>
-   * This implementation sets the name of the thread, sets the thread to be a
-   * daemon thread, and adds an uncaught exception handler.
-   */
-  @Override
-  public Thread newThread(Runnable r) {
-    Thread thr = new Thread(r);
-    thr.setDaemon(true);
-    thr.setName(id + " - " + serial.incrementAndGet());
-    thr.setUncaughtExceptionHandler(new UncaughtExceptionHandler() {
-      @Override
-      public void uncaughtException(Thread t, Throwable e) {
-        LOG.log(Level.WARNING,
-            "Uncaught Exception in thread: " + t.getName(), e);
-      }
-    });
-    return thr;
-  }
-}



[13/24] incubator-geode git commit: GEODE-14: Added session replication integration tests

Posted by je...@apache.org.
GEODE-14: Added session replication integration tests


Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/890d62e3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/890d62e3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/890d62e3

Branch: refs/heads/feature/GEODE-14
Commit: 890d62e3cee384b89b9bc0348dada3529f483c03
Parents: db02660
Author: Jens Deppe <jd...@pivotal.io>
Authored: Mon Dec 28 20:45:34 2015 -0800
Committer: Jens Deppe <jd...@pivotal.io>
Committed: Mon Dec 28 20:45:34 2015 -0800

----------------------------------------------------------------------
 extensions/gemfire-modules-session/build.gradle |   12 +-
 .../session/filter/SessionCachingFilter.java    |    2 +-
 .../session/internal/filter/BasicServlet.java   |   46 +
 .../session/internal/filter/Callback.java       |    5 +-
 .../filter/HttpSessionListenerImpl.java         |    6 +
 .../filter/HttpSessionListenerImpl2.java        |   41 +
 .../internal/filter/MyServletTester.java        |   33 +
 .../SessionReplicationIntegrationJUnitTest.java | 1552 +++++++++++++++++
 .../filter/SessionReplicationJUnitTest.java     |    4 +-
 .../SessionReplicationLocalCacheJUnitTest.java  |    4 +-
 .../session/junit/ChildFirstClassLoader.java    |   76 +
 .../modules/session/junit/NamedRunner.java      |  127 ++
 .../session/junit/PerTestClassLoaderRunner.java |  273 +++
 .../modules/junit/ChildFirstClassLoader.java    |   76 -
 .../gemfire/modules/junit/NamedRunner.java      |  127 --
 .../modules/junit/PerTestClassLoaderRunner.java |  273 ---
 .../session/internal/filter/BasicServlet.java   |   46 -
 .../filter/HttpSessionListenerImpl2.java        |   41 -
 .../internal/filter/IntegrationTest.java        | 1553 ------------------
 .../internal/filter/MyServletTester.java        |   33 -
 20 files changed, 2173 insertions(+), 2157 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/890d62e3/extensions/gemfire-modules-session/build.gradle
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/build.gradle b/extensions/gemfire-modules-session/build.gradle
index 29ecd30..942d3f4 100644
--- a/extensions/gemfire-modules-session/build.gradle
+++ b/extensions/gemfire-modules-session/build.gradle
@@ -1,11 +1,21 @@
+integrationTest {
+  testLogging {
+    events 'passed', 'skipped', 'failed'
+    exceptionFormat = 'full'
+  }
+}
+
 dependencies {
   compile project(':extensions/gemfire-modules')
   compile project(':gemfire-core')
 
-  testCompile 'javax.servlet:servlet-api:2.5'
+  testCompile 'javax.servlet:javax.servlet-api:3.1.0'
   testCompile 'org.slf4j:slf4j-jdk14:1.7.7'
   testCompile('com.mockrunner:mockrunner-servlet:1.0.8') {
     exclude group: 'jboss'
   }
+  testCompile(group: 'org.eclipse.jetty', name: 'jetty-http', version: project.'jetty.version', classifier: 'tests')
+  testCompile(group: 'org.eclipse.jetty', name: 'jetty-servlet', version: project.'jetty.version', classifier: 'tests')
+
   provided project(path: ':gemfire-junit', configuration: 'testOutput')
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/890d62e3/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/SessionCachingFilter.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/SessionCachingFilter.java b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/SessionCachingFilter.java
index a241f20..bf08d05 100644
--- a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/SessionCachingFilter.java
+++ b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/SessionCachingFilter.java
@@ -615,7 +615,7 @@ public class SessionCachingFilter implements Filter {
    * Retrieve the SessionManager. This is only here so that tests can get access
    * to the cache.
    */
-  static SessionManager getSessionManager() {
+  public static SessionManager getSessionManager() {
     return manager;
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/890d62e3/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/BasicServlet.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/BasicServlet.java b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/BasicServlet.java
new file mode 100644
index 0000000..2c1d7e4
--- /dev/null
+++ b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/BasicServlet.java
@@ -0,0 +1,46 @@
+/*=========================================================================
+ * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package com.gemstone.gemfire.modules.session.internal.filter;
+
+import java.io.IOException;
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.eclipse.jetty.servlet.DefaultServlet;
+/**
+ *
+ */
+public class BasicServlet extends DefaultServlet {
+
+  Callback callback = null;
+
+  @Override
+  public void doGet(HttpServletRequest request, HttpServletResponse response)
+      throws IOException, ServletException {
+
+    if (callback != null) {
+      callback.call(request, response);
+    }
+  }
+
+  @Override
+  public void init(ServletConfig config) throws ServletException {
+    super.init(config);
+    ServletContext context = config.getServletContext();
+
+    String cbInitParam = config.getInitParameter("test.callback");
+    callback = (Callback) context.getAttribute(cbInitParam);
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/890d62e3/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/Callback.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/Callback.java b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/Callback.java
index ab74084..3fc6600 100644
--- a/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/Callback.java
+++ b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/Callback.java
@@ -5,13 +5,14 @@
 
 package com.gemstone.gemfire.modules.session.internal.filter;
 
+import javax.servlet.ServletException;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
 
 /**
  * @author jdeppe
  */
 public interface Callback {
-  public void call(HttpServletRequest request,
-      HttpServletResponse response);
+  void call(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException;
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/890d62e3/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionListenerImpl.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionListenerImpl.java b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionListenerImpl.java
index 0e18e1e..a76f463 100644
--- a/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionListenerImpl.java
+++ b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionListenerImpl.java
@@ -12,6 +12,9 @@
 
 package com.gemstone.gemfire.modules.session.internal.filter;
 
+import com.gemstone.gemfire.modules.session.filter.SessionCachingFilter;
+
+import javax.servlet.http.HttpSession;
 import javax.servlet.http.HttpSessionEvent;
 import javax.servlet.http.HttpSessionListener;
 
@@ -22,6 +25,9 @@ public class HttpSessionListenerImpl extends AbstractListener
     implements HttpSessionListener {
 
   public synchronized void sessionCreated(HttpSessionEvent se) {
+    HttpSession gfeSession = SessionCachingFilter.getWrappingSession(
+        se.getSession());
+    gfeSession.setAttribute("gemfire-session-id", gfeSession.getId());
     events.add(ListenerEventType.SESSION_CREATED);
     latch.countDown();
   }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/890d62e3/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionListenerImpl2.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionListenerImpl2.java b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionListenerImpl2.java
new file mode 100644
index 0000000..ea39f65
--- /dev/null
+++ b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionListenerImpl2.java
@@ -0,0 +1,41 @@
+/*=========================================================================
+ * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package com.gemstone.gemfire.modules.session.internal.filter;
+
+import com.gemstone.gemfire.modules.session.filter.SessionCachingFilter;
+
+import javax.servlet.http.HttpSession;
+import javax.servlet.http.HttpSessionEvent;
+import javax.servlet.http.HttpSessionListener;
+
+/**
+ * @author jdeppe
+ */
+public class HttpSessionListenerImpl2 extends AbstractListener
+    implements HttpSessionListener {
+
+  @Override
+  public void sessionCreated(HttpSessionEvent se) {
+    events.add(ListenerEventType.SESSION_CREATED);
+    latch.countDown();
+  }
+
+  @Override
+  public void sessionDestroyed(HttpSessionEvent se) {
+    HttpSession gfeSession = SessionCachingFilter.getWrappingSession(
+        se.getSession());
+    assert (gfeSession != null);
+    events.add(ListenerEventType.SESSION_DESTROYED);
+    latch.countDown();
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/890d62e3/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/MyServletTester.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/MyServletTester.java b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/MyServletTester.java
new file mode 100644
index 0000000..1ff6e70
--- /dev/null
+++ b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/MyServletTester.java
@@ -0,0 +1,33 @@
+/*=========================================================================
+ * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package com.gemstone.gemfire.modules.session.internal.filter;
+
+import org.eclipse.jetty.servlet.ServletTester;
+
+/**
+ * Extend the base ServletTester class with a couple of helper methods. This
+ * depends on a patched ServletTester class which exposes the _server variable
+ * as package-private.
+ */
+public class MyServletTester extends ServletTester {
+
+  public boolean isStarted() {
+//    return _server.isStarted();
+    return false;
+  }
+
+  public boolean isStopped() {
+//    return _server.isStopped();
+    return false;
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/890d62e3/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/SessionReplicationIntegrationJUnitTest.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/SessionReplicationIntegrationJUnitTest.java b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/SessionReplicationIntegrationJUnitTest.java
new file mode 100644
index 0000000..5a4e650
--- /dev/null
+++ b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/SessionReplicationIntegrationJUnitTest.java
@@ -0,0 +1,1552 @@
+/*=========================================================================
+ * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package com.gemstone.gemfire.modules.session.internal.filter;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.ArrayList;
+import java.util.EnumSet;
+import java.util.Enumeration;
+import java.util.List;
+import java.util.StringTokenizer;
+import java.util.concurrent.TimeUnit;
+import javax.servlet.DispatcherType;
+import javax.servlet.RequestDispatcher;
+import javax.servlet.ServletException;
+import javax.servlet.http.Cookie;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+
+import com.gemstone.gemfire.cache.Region;
+import com.gemstone.gemfire.modules.session.junit.PerTestClassLoaderRunner;
+import com.gemstone.gemfire.modules.session.filter.SessionCachingFilter;
+import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
+import org.apache.jasper.servlet.JspServlet;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.junit.runner.RunWith;
+import org.eclipse.jetty.servlet.FilterHolder;
+import org.eclipse.jetty.servlet.ServletHolder;
+import org.eclipse.jetty.http.HttpTester;
+
+import static org.junit.Assert.*;
+
+/**
+ * In-container testing using Jetty. This allows us to test context listener
+ * events as well as dispatching actions.
+ */
+@Category(IntegrationTest.class)
+@RunWith(PerTestClassLoaderRunner.class)
+public class SessionReplicationIntegrationJUnitTest {
+
+  private MyServletTester tester;
+
+  private HttpTester.Request request;
+
+  private HttpTester.Response response;
+
+  private ServletHolder servletHolder;
+
+  private FilterHolder filterHolder;
+
+  private static final File tmpdir;
+
+  private static final String gemfire_log;
+
+  static {
+    // Create a per-user scratch directory
+    tmpdir = new File(System.getProperty("java.io.tmpdir"),
+        "gemfire_modules-" + System.getProperty("user.name"));
+    tmpdir.mkdirs();
+    tmpdir.deleteOnExit();
+
+    gemfire_log = tmpdir.getPath() +
+        System.getProperty("file.separator") + "gemfire_modules.log";
+  }
+
+  @Before
+  public void setUp() throws Exception {
+    request = HttpTester.newRequest();
+
+    tester = new MyServletTester();
+    tester.setContextPath("/test");
+
+    filterHolder = tester.addFilter(SessionCachingFilter.class, "/*", EnumSet.of(DispatcherType.REQUEST));
+    filterHolder.setInitParameter("gemfire.property.mcast-port", "0");
+    filterHolder.setInitParameter("gemfire.property.log-file", gemfire_log);
+    filterHolder.setInitParameter("cache-type", "peer-to-peer");
+
+    servletHolder = tester.addServlet(BasicServlet.class, "/hello");
+    servletHolder.setInitParameter("test.callback", "callback_1");
+
+    /**
+     * This starts the servlet. Our wrapped servlets *must* start
+     * immediately otherwise the ServletContext is not captured correctly.
+     */
+    servletHolder.setInitOrder(0);
+  }
+
+  @After
+  public void tearDown() throws Exception {
+//    if (tester.isStarted()) {
+//      ContextManager.getInstance().removeContext(
+//          servletHolder.getServlet().getServletConfig().getServletContext());
+//    }
+    tester.stop();
+  }
+
+  @Test
+  public void testSanity() throws Exception {
+    Callback c = new Callback() {
+      @Override
+      public void call(HttpServletRequest request, HttpServletResponse response)
+          throws IOException {
+        PrintWriter out = response.getWriter();
+        out.write("Hello World");
+      }
+    };
+
+    tester.setAttribute("callback_1", c);
+    tester.start();
+//    ContextManager.getInstance().putContext(
+//        servletHolder.getServlet().getServletConfig().getServletContext());
+
+    request.setMethod("GET");
+    request.setURI("/test/hello");
+    request.setHeader("Host", "tester");
+    request.setVersion("HTTP/1.0");
+
+    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
+
+    assertEquals(200, response.getStatus());
+    assertEquals("Hello World", response.getContent());
+  }
+
+  @Test
+  public void testSessionGenerated() throws Exception {
+    Callback c = new Callback() {
+      @Override
+      public void call(HttpServletRequest request, HttpServletResponse response)
+          throws IOException {
+        PrintWriter out = response.getWriter();
+        out.write(request.getSession().getId());
+      }
+    };
+
+    tester.setAttribute("callback_1", c);
+    tester.start();
+//    ContextManager.getInstance().putContext(
+//        servletHolder.getServlet().getServletConfig().getServletContext());
+
+    request.setMethod("GET");
+    request.setURI("/test/hello");
+    request.setHeader("Host", "tester");
+    request.setVersion("HTTP/1.0");
+
+    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
+
+    assertTrue("Not a correctly generated session id",
+        response.getContent().endsWith("-GF"));
+
+    List<Cookie> cookies = getCookies(response);
+    assertEquals("Session id != JSESSIONID from cookie",
+        response.getContent(), cookies.get(0).getValue());
+
+    Region r = getRegion();
+    assertNotNull("Session not found in region",
+        r.get(cookies.get(0).getValue()));
+  }
+
+
+  /**
+   * Test that getSession(false) does not create a new session
+   */
+  @Test
+  public void testSessionNotGenerated() throws Exception {
+    Callback c = new Callback() {
+      @Override
+      public void call(HttpServletRequest request, HttpServletResponse response)
+          throws IOException {
+        String output = "OK";
+        HttpSession s = request.getSession(false);
+        if (s != null) {
+          output = s.getId();
+        }
+        PrintWriter out = response.getWriter();
+        out.write(output);
+      }
+    };
+
+    tester.setAttribute("callback_1", c);
+    tester.start();
+//    ContextManager.getInstance().putContext(
+//        servletHolder.getServlet().getServletConfig().getServletContext());
+
+    request.setMethod("GET");
+    request.setURI("/test/hello");
+    request.setHeader("Host", "tester");
+    request.setVersion("HTTP/1.0");
+
+    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
+
+    assertEquals("Session should not have been created", "OK",
+        response.getContent());
+  }
+
+
+  @Test
+  public void testUnknownAttributeIsNull() throws Exception {
+    Callback c = new Callback() {
+      @Override
+      public void call(HttpServletRequest request, HttpServletResponse response)
+          throws IOException {
+        Object o = request.getSession().getAttribute("unknown");
+        PrintWriter out = response.getWriter();
+        if (o == null) {
+          out.write("null");
+        } else {
+          out.write(o.toString());
+        }
+      }
+    };
+
+    tester.setAttribute("callback_1", c);
+    tester.start();
+//    ContextManager.getInstance().putContext(
+//        servletHolder.getServlet().getServletConfig().getServletContext());
+
+    request.setMethod("GET");
+    request.setURI("/test/hello");
+    request.setHeader("Host", "tester");
+    request.setVersion("HTTP/1.0");
+
+    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
+
+    assertEquals("Unknown attribute should be null", "null",
+        response.getContent());
+  }
+
+
+  @Test
+  public void testSessionRemains1() throws Exception {
+    Callback c = new Callback() {
+      @Override
+      public void call(HttpServletRequest request, HttpServletResponse response)
+          throws IOException {
+        String output = "null";
+        HttpSession session = request.getSession();
+        if (session.isNew()) {
+          output = "new";
+          session.setAttribute("foo", output);
+        } else {
+          output = (String) session.getAttribute("foo");
+          if (output != null) {
+            output = "old";
+          }
+        }
+        PrintWriter out = response.getWriter();
+        out.write(output);
+      }
+    };
+
+    tester.setAttribute("callback_1", c);
+    tester.start();
+//    ContextManager.getInstance().putContext(
+//        servletHolder.getServlet().getServletConfig().getServletContext());
+
+    request.setMethod("GET");
+    request.setURI("/test/hello");
+    request.setHeader("Host", "tester");
+    request.setVersion("HTTP/1.0");
+
+    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
+
+    assertEquals("Session should be new", "new", response.getContent());
+
+    List<Cookie> cookies = getCookies(response);
+    request.setHeader("Cookie", "JSESSIONID=" + cookies.get(0).getValue());
+
+    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
+
+    assertEquals("Session should be old", "old", response.getContent());
+
+    List<Cookie> cookies2 = getCookies(response);
+    assertEquals("Session IDs should be the same", cookies.get(0).getValue(),
+        cookies2.get(0).getValue());
+
+    Region r = getRegion();
+    assertNotNull("Session object should exist in region",
+        r.get(cookies.get(0).getValue()));
+  }
+
+  /**
+   * Test that attributes are updated on the backend
+   */
+  @Test
+  public void testAttributesUpdatedInRegion() throws Exception {
+    Callback c_1 = new Callback() {
+      @Override
+      public void call(HttpServletRequest request, HttpServletResponse response)
+          throws IOException {
+        request.getSession().setAttribute("foo", "bar");
+      }
+    };
+
+    // This is the callback used to invalidate the session
+    Callback c_2 = new Callback() {
+      @Override
+      public void call(HttpServletRequest request, HttpServletResponse response)
+          throws IOException {
+        request.getSession().setAttribute("foo", "baz");
+      }
+    };
+
+    tester.setAttribute("callback_1", c_1);
+    tester.setAttribute("callback_2", c_2);
+
+    servletHolder.setInitParameter("test.callback", "callback_1");
+
+    ServletHolder sh2 = tester.addServlet(BasicServlet.class, "/request2");
+    sh2.setInitParameter("test.callback", "callback_2");
+
+    tester.start();
+//    ContextManager.getInstance().putContext(
+//        servletHolder.getServlet().getServletConfig().getServletContext());
+
+    request.setMethod("GET");
+    request.setURI("/test/hello");
+    request.setHeader("Host", "tester");
+    request.setVersion("HTTP/1.0");
+    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
+
+    List<Cookie> cookies = getCookies(response);
+
+    Region r = getRegion();
+    assertEquals("bar",
+        ((HttpSession) r.get(cookies.get(0).getValue())).getAttribute("foo"));
+
+    request.setHeader("Cookie", "JSESSIONID=" + cookies.get(0).getValue());
+    request.setURI("/test/request2");
+    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
+
+    assertEquals("baz",
+        ((HttpSession) r.get(cookies.get(0).getValue())).getAttribute(
+            "foo"));
+  }
+
+  /**
+   * Test setting an attribute to null deletes it
+   */
+  @Test
+  public void testSetAttributeNullDeletesIt() throws Exception {
+    Callback c_1 = new Callback() {
+      @Override
+      public void call(HttpServletRequest request, HttpServletResponse response)
+          throws IOException {
+        request.getSession().setAttribute("foo", "bar");
+      }
+    };
+
+    // This is the callback used to invalidate the session
+    Callback c_2 = new Callback() {
+      @Override
+      public void call(HttpServletRequest request, HttpServletResponse response)
+          throws IOException {
+        request.getSession().setAttribute("foo", null);
+      }
+    };
+
+    tester.setAttribute("callback_1", c_1);
+    tester.setAttribute("callback_2", c_2);
+
+    servletHolder.setInitParameter("test.callback", "callback_1");
+
+    ServletHolder sh2 = tester.addServlet(BasicServlet.class, "/request2");
+    sh2.setInitParameter("test.callback", "callback_2");
+
+    tester.start();
+//    ContextManager.getInstance().putContext(
+//        servletHolder.getServlet().getServletConfig().getServletContext());
+
+    request.setMethod("GET");
+    request.setURI("/test/hello");
+    request.setHeader("Host", "tester");
+    request.setVersion("HTTP/1.0");
+    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
+
+    List<Cookie> cookies = getCookies(response);
+
+    Region r = getRegion();
+    assertEquals("bar",
+        ((HttpSession) r.get(cookies.get(0).getValue())).getAttribute(
+            "foo"));
+
+    request.setHeader("Cookie", "JSESSIONID=" + cookies.get(0).getValue());
+    request.setURI("/test/request2");
+    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
+
+    assertNull(
+        ((HttpSession) r.get(cookies.get(0).getValue())).getAttribute(
+            "foo"));
+  }
+
+// Don't see how to do this currently as the SessionListener needs a full
+// web context to work in.
+
+//    /**
+//     * Test that sessions expire correctly
+//     */
+//    public void testSessionExpiration() throws Exception {
+//        Callback c_1 = new Callback() {
+//            @Override
+//            public void call(HttpServletRequest request, HttpServletResponse response)
+//                    throws IOException, ServletException {
+//                HttpSession s = request.getSession();
+//                s.setAttribute("foo", "bar");
+//                s.setMaxInactiveInterval(1);
+//
+//                PrintWriter out = response.getWriter();
+//                out.write(s.getId());
+//            }
+//        };
+//
+//        // This is the callback used to check if the session is still there
+//        Callback c_2 = new Callback() {
+//            @Override
+//            public void call(HttpServletRequest request, HttpServletResponse response)
+//                    throws IOException, ServletException {
+//                HttpSession s = request.getSession(false);
+//                String output;
+//                if (s == null) {
+//                    output = "null";
+//                } else {
+//                    output = s.getId();
+//                }
+//
+//                PrintWriter out = response.getWriter();
+//                out.write(output);
+//            }
+//        };
+//
+//        tester.addEventListener(new SessionListener());
+//        tester.setAttribute("callback_1", c_1);
+//        tester.setAttribute("callback_2", c_2);
+//
+//        servletHolder.setInitParameter("test.callback", "callback_1");
+//
+//        ServletHolder sh2 = tester.addServlet(BasicServlet.class, "/request2");
+//        sh2.setInitParameter("test.callback", "callback_2");
+//
+//        tester.start();
+//        ContextManager.getInstance().putContext(
+//                servletHolder.getServlet().getServletConfig().getServletContext());
+//
+//        request.setMethod("GET");
+//        request.setURI("/test/hello");
+//        request.setHeader("Host", "tester");
+//        request.setVersion("HTTP/1.0");
+//        response.parse(tester.getResponses(request.generate()));
+//
+//        String id = response.getContent();
+//
+//        // Wait for the session to expire
+//        Thread.sleep(2000);
+//
+//        request.setHeader("Cookie", "JSESSIONID=" + id);
+//        request.setURI("/test/request2");
+//        response.parse(tester.getResponses(request.generate()));
+//
+//        assertEquals("null", response.getContent());
+//
+//        Region r = getRegion();
+//        assertNull("Region should not contain session", r.get(id));
+//    }
+
+  /**
+   * Test that invalidating a session destroys it as well as the backend
+   * object.
+   */
+  @Test
+  public void testInvalidateSession1() throws Exception {
+    Callback c_1 = new Callback() {
+      @Override
+      public void call(HttpServletRequest request, HttpServletResponse response)
+          throws IOException {
+        request.getSession().setAttribute("foo", "bar");
+      }
+    };
+
+    // This is the callback used to invalidate the session
+    Callback c_2 = new Callback() {
+      @Override
+      public void call(HttpServletRequest request, HttpServletResponse response)
+          throws IOException {
+        request.getSession(false).invalidate();
+      }
+    };
+
+    tester.setAttribute("callback_1", c_1);
+    tester.setAttribute("callback_2", c_2);
+
+    servletHolder.setInitParameter("test.callback", "callback_1");
+
+    ServletHolder sh2 = tester.addServlet(BasicServlet.class, "/request2");
+    sh2.setInitParameter("test.callback", "callback_2");
+
+    tester.start();
+//    ContextManager.getInstance().putContext(
+//        servletHolder.getServlet().getServletConfig().getServletContext());
+
+    request.setMethod("GET");
+    request.setURI("/test/hello");
+    request.setHeader("Host", "tester");
+    request.setVersion("HTTP/1.0");
+    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
+
+    List<Cookie> cookies = getCookies(response);
+    Region r = getRegion();
+    assertEquals("bar",
+        ((HttpSession) r.get(cookies.get(0).getValue())).getAttribute("foo"));
+
+    request.setHeader("Cookie", "JSESSIONID=" + cookies.get(0).getValue());
+    request.setURI("/test/request2");
+    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
+
+    assertNull("Region should not contain session",
+        r.get(cookies.get(0).getValue()));
+  }
+
+  /**
+   * Test that invalidating a session throws an exception on subsequent access.
+   */
+  @Test
+  public void testInvalidateSession2() throws Exception {
+    Callback c_1 = new Callback() {
+      @Override
+      public void call(HttpServletRequest request, HttpServletResponse response)
+          throws IOException {
+        HttpSession s = request.getSession();
+        s.invalidate();
+        PrintWriter out = response.getWriter();
+        try {
+          s.getAttribute("foo");
+        } catch (IllegalStateException iex) {
+          out.write("OK");
+        }
+      }
+    };
+
+    tester.setAttribute("callback_1", c_1);
+
+    servletHolder.setInitParameter("test.callback", "callback_1");
+
+    tester.start();
+//    ContextManager.getInstance().putContext(
+//        servletHolder.getServlet().getServletConfig().getServletContext());
+
+    request.setMethod("GET");
+    request.setURI("/test/hello");
+    request.setHeader("Host", "tester");
+    request.setVersion("HTTP/1.0");
+    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
+
+    assertEquals("OK", response.getContent());
+  }
+
+  /**
+   * Test that invalidating a session throws an exception on subsequent access.
+   */
+  @Test
+  public void testInvalidateSession3() throws Exception {
+    Callback c_1 = new Callback() {
+      @Override
+      public void call(HttpServletRequest request, HttpServletResponse response)
+          throws IOException {
+        HttpSession s = request.getSession();
+        s.invalidate();
+        PrintWriter out = response.getWriter();
+        try {
+          s.getAttributeNames();
+        } catch (IllegalStateException iex) {
+          out.write("OK");
+        }
+      }
+    };
+
+    tester.setAttribute("callback_1", c_1);
+
+    servletHolder.setInitParameter("test.callback", "callback_1");
+
+    tester.start();
+//    ContextManager.getInstance().putContext(
+//        servletHolder.getServlet().getServletConfig().getServletContext());
+
+    request.setMethod("GET");
+    request.setURI("/test/hello");
+    request.setHeader("Host", "tester");
+    request.setVersion("HTTP/1.0");
+    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
+
+    assertEquals("OK", response.getContent());
+  }
+
+  /**
+   * Test that invalidating a session throws an exception on subsequent access.
+   */
+  @Test
+  public void testInvalidateSession4() throws Exception {
+    Callback c_1 = new Callback() {
+      @Override
+      public void call(HttpServletRequest request, HttpServletResponse response)
+          throws IOException {
+        HttpSession s = request.getSession();
+        s.invalidate();
+        PrintWriter out = response.getWriter();
+        try {
+          s.getCreationTime();
+        } catch (IllegalStateException iex) {
+          out.write("OK");
+        }
+      }
+    };
+
+    tester.setAttribute("callback_1", c_1);
+
+    servletHolder.setInitParameter("test.callback", "callback_1");
+
+    tester.start();
+//    ContextManager.getInstance().putContext(
+//        servletHolder.getServlet().getServletConfig().getServletContext());
+
+    request.setMethod("GET");
+    request.setURI("/test/hello");
+    request.setHeader("Host", "tester");
+    request.setVersion("HTTP/1.0");
+    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
+
+    assertEquals("OK", response.getContent());
+  }
+
+  /**
+   * Test that invalidating a session does not throw an exception for subsequent
+   * getId calls.
+   */
+  @Test
+  public void testInvalidateSession5() throws Exception {
+    Callback c_1 = new Callback() {
+      @Override
+      public void call(HttpServletRequest request, HttpServletResponse response)
+          throws IOException {
+        HttpSession s = request.getSession();
+        s.invalidate();
+        s.getId();
+        PrintWriter out = response.getWriter();
+        out.write("OK");
+      }
+    };
+
+    tester.setAttribute("callback_1", c_1);
+
+    servletHolder.setInitParameter("test.callback", "callback_1");
+
+    tester.start();
+//    ContextManager.getInstance().putContext(
+//        servletHolder.getServlet().getServletConfig().getServletContext());
+
+    request.setMethod("GET");
+    request.setURI("/test/hello");
+    request.setHeader("Host", "tester");
+    request.setVersion("HTTP/1.0");
+    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
+
+    assertEquals("OK", response.getContent());
+  }
+
+  /**
+   * Test that invalidating a session throws an exception on subsequent access.
+   */
+  @Test
+  public void testInvalidateSession6() throws Exception {
+    Callback c_1 = new Callback() {
+      @Override
+      public void call(HttpServletRequest request, HttpServletResponse response)
+          throws IOException {
+        HttpSession s = request.getSession();
+        s.invalidate();
+        PrintWriter out = response.getWriter();
+        try {
+          s.getLastAccessedTime();
+        } catch (IllegalStateException iex) {
+          out.write("OK");
+        }
+      }
+    };
+
+    tester.setAttribute("callback_1", c_1);
+
+    servletHolder.setInitParameter("test.callback", "callback_1");
+
+    tester.start();
+//    ContextManager.getInstance().putContext(
+//        servletHolder.getServlet().getServletConfig().getServletContext());
+
+    request.setMethod("GET");
+    request.setURI("/test/hello");
+    request.setHeader("Host", "tester");
+    request.setVersion("HTTP/1.0");
+    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
+
+    assertEquals("OK", response.getContent());
+  }
+
+  /**
+   * Test that invalidating a session does not throw an exception for
+   * subsequent getMaxInactiveInterval calls.
+   */
+
+// I've commented this out for now as Jetty seems to want to throw an
+// Exception here where the HttpServlet api doesn't specify that.
+  @Test
+  public void testInvalidateSession7() throws Exception {
+    Callback c_1 = new Callback() {
+      @Override
+      public void call(HttpServletRequest request,
+          HttpServletResponse response) throws IOException {
+        HttpSession s = request.getSession();
+        s.invalidate();
+        s.getMaxInactiveInterval();
+        PrintWriter out = response.getWriter();
+        out.write("OK");
+      }
+    };
+
+    tester.setAttribute("callback_1", c_1);
+
+    servletHolder.setInitParameter("test.callback", "callback_1");
+
+    tester.start();
+//    ContextManager.getInstance().putContext(
+//        servletHolder.getServlet().getServletConfig().getServletContext());
+
+    request.setMethod("GET");
+    request.setURI("/test/hello");
+    request.setHeader("Host", "tester");
+    request.setVersion("HTTP/1.0");
+    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
+
+    assertEquals("OK", response.getContent());
+  }
+
+  /**
+   * Test that invalidating a session does not throw an exception for subsequent
+   * getServletContext calls.
+   */
+  @Test
+  public void testInvalidateSession8() throws Exception {
+    Callback c_1 = new Callback() {
+      @Override
+      public void call(HttpServletRequest request, HttpServletResponse response)
+          throws IOException {
+        HttpSession s = request.getSession();
+        s.invalidate();
+        s.getServletContext();
+        PrintWriter out = response.getWriter();
+        out.write("OK");
+      }
+    };
+
+    tester.setAttribute("callback_1", c_1);
+
+    servletHolder.setInitParameter("test.callback", "callback_1");
+
+    tester.start();
+//    ContextManager.getInstance().putContext(
+//        servletHolder.getServlet().getServletConfig().getServletContext());
+
+    request.setMethod("GET");
+    request.setURI("/test/hello");
+    request.setHeader("Host", "tester");
+    request.setVersion("HTTP/1.0");
+    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
+
+    assertEquals("OK", response.getContent());
+  }
+
+  /**
+   * Test that invalidating a session throws an exception on subsequent access.
+   */
+  @Test
+  public void testInvalidateSession9() throws Exception {
+    Callback c_1 = new Callback() {
+      @Override
+      public void call(HttpServletRequest request, HttpServletResponse response)
+          throws IOException {
+        HttpSession s = request.getSession();
+        s.invalidate();
+        PrintWriter out = response.getWriter();
+        try {
+          s.isNew();
+        } catch (IllegalStateException iex) {
+          out.write("OK");
+        }
+      }
+    };
+
+    tester.setAttribute("callback_1", c_1);
+
+    servletHolder.setInitParameter("test.callback", "callback_1");
+
+    tester.start();
+//    ContextManager.getInstance().putContext(
+//        servletHolder.getServlet().getServletConfig().getServletContext());
+
+    request.setMethod("GET");
+    request.setURI("/test/hello");
+    request.setHeader("Host", "tester");
+    request.setVersion("HTTP/1.0");
+    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
+
+    assertEquals("OK", response.getContent());
+  }
+
+  /**
+   * Test that invalidating a session throws an exception on subsequent access.
+   */
+  @Test
+  public void testInvalidateSession10() throws Exception {
+    Callback c_1 = new Callback() {
+      @Override
+      public void call(HttpServletRequest request, HttpServletResponse response)
+          throws IOException {
+        HttpSession s = request.getSession();
+        s.invalidate();
+        PrintWriter out = response.getWriter();
+        try {
+          s.removeAttribute("foo");
+        } catch (IllegalStateException iex) {
+          out.write("OK");
+        }
+      }
+    };
+
+    tester.setAttribute("callback_1", c_1);
+
+    servletHolder.setInitParameter("test.callback", "callback_1");
+
+    tester.start();
+//    ContextManager.getInstance().putContext(
+//        servletHolder.getServlet().getServletConfig().getServletContext());
+
+    request.setMethod("GET");
+    request.setURI("/test/hello");
+    request.setHeader("Host", "tester");
+    request.setVersion("HTTP/1.0");
+    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
+
+    assertEquals("OK", response.getContent());
+  }
+
+  /**
+   * Test that invalidating a session throws an exception on subsequent access.
+   */
+  @Test
+  public void testInvalidateSession11() throws Exception {
+    Callback c_1 = new Callback() {
+      @Override
+      public void call(HttpServletRequest request, HttpServletResponse response)
+          throws IOException {
+        HttpSession s = request.getSession();
+        s.invalidate();
+        PrintWriter out = response.getWriter();
+        try {
+          s.setAttribute("foo", "bar");
+        } catch (IllegalStateException iex) {
+          out.write("OK");
+        }
+      }
+    };
+
+    tester.setAttribute("callback_1", c_1);
+
+    servletHolder.setInitParameter("test.callback", "callback_1");
+
+    tester.start();
+//    ContextManager.getInstance().putContext(
+//        servletHolder.getServlet().getServletConfig().getServletContext());
+
+    request.setMethod("GET");
+    request.setURI("/test/hello");
+    request.setHeader("Host", "tester");
+    request.setVersion("HTTP/1.0");
+    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
+
+    assertEquals("OK", response.getContent());
+  }
+
+  /**
+   * Test that invalidating a session does not throw an exception for subsequent
+   * setMaxInactiveInterval calls.
+   */
+  @Test
+  public void testInvalidateSession12() throws Exception {
+    Callback c_1 = new Callback() {
+      @Override
+      public void call(HttpServletRequest request, HttpServletResponse response)
+          throws IOException {
+        HttpSession s = request.getSession();
+        s.invalidate();
+        s.setMaxInactiveInterval(1);
+        PrintWriter out = response.getWriter();
+        out.write("OK");
+      }
+    };
+
+    tester.setAttribute("callback_1", c_1);
+
+    servletHolder.setInitParameter("test.callback", "callback_1");
+
+    tester.start();
+//    ContextManager.getInstance().putContext(
+//        servletHolder.getServlet().getServletConfig().getServletContext());
+
+    request.setMethod("GET");
+    request.setURI("/test/hello");
+    request.setHeader("Host", "tester");
+    request.setVersion("HTTP/1.0");
+    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
+
+    assertEquals("OK", response.getContent());
+  }
+
+  /**
+   * Test that invalidating a session results in null being returned on
+   * subsequent getSession(false) calls.
+   */
+  @Test
+  public void testInvalidateSession13() throws Exception {
+    Callback c_1 = new Callback() {
+      @Override
+      public void call(HttpServletRequest request, HttpServletResponse response)
+          throws IOException {
+        HttpSession s = request.getSession();
+        s.invalidate();
+        s = request.getSession(false);
+        PrintWriter out = response.getWriter();
+        if (s == null) {
+          out.write("OK");
+        } else {
+          out.write(s.toString());
+        }
+      }
+    };
+
+    tester.setAttribute("callback_1", c_1);
+
+    servletHolder.setInitParameter("test.callback", "callback_1");
+
+    tester.start();
+//    ContextManager.getInstance().putContext(
+//        servletHolder.getServlet().getServletConfig().getServletContext());
+
+    request.setMethod("GET");
+    request.setURI("/test/hello");
+    request.setHeader("Host", "tester");
+    request.setVersion("HTTP/1.0");
+    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
+
+    assertEquals("OK", response.getContent());
+  }
+
+
+  /**
+   * Test that we can invalidate and then recreate a new session
+   */
+  @Test
+  public void testInvalidateAndRecreateSession() throws Exception {
+    Callback c_1 = new Callback() {
+      @Override
+      public void call(HttpServletRequest request, HttpServletResponse response)
+          throws IOException {
+
+        PrintWriter out = response.getWriter();
+        out.write(request.getSession().getId());
+      }
+    };
+
+    Callback c_2 = new Callback() {
+      @Override
+      public void call(HttpServletRequest request, HttpServletResponse response)
+          throws IOException {
+        HttpSession s = request.getSession();
+        s.invalidate();
+
+        PrintWriter out = response.getWriter();
+        out.write(request.getSession().getId());
+      }
+    };
+
+    tester.setAttribute("callback_1", c_1);
+    tester.setAttribute("callback_2", c_2);
+
+    ServletHolder sh = tester.addServlet(BasicServlet.class, "/dispatch");
+    sh.setInitParameter("test.callback", "callback_2");
+
+    tester.start();
+//    ContextManager.getInstance().putContext(
+//        sh.getServlet().getServletConfig().getServletContext());
+
+    request.setMethod("GET");
+    request.setURI("/test/hello");
+    request.setHeader("Host", "tester");
+    request.setVersion("HTTP/1.0");
+
+    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
+    String session1 = response.getContent();
+
+    request.setHeader("Cookie", "JSESSIONID=" + session1);
+    request.setURI("/test/request2");
+    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
+
+    String session12 = response.getContent();
+    assertFalse("First and subsequent session ids must not be the same",
+        session1.equals(session12));
+  }
+
+
+  /**
+   * Test that creation time does not change on subsequent access
+   */
+  @Test
+  public void testGetCreationTime() throws Exception {
+    Callback c = new Callback() {
+      @Override
+      public void call(HttpServletRequest request, HttpServletResponse response)
+          throws IOException {
+        HttpSession session = request.getSession();
+        PrintWriter out = response.getWriter();
+        out.write(Long.toString(session.getCreationTime()));
+      }
+    };
+
+    tester.setAttribute("callback_1", c);
+    tester.start();
+//    ContextManager.getInstance().putContext(
+//        servletHolder.getServlet().getServletConfig().getServletContext());
+
+    request.setMethod("GET");
+    request.setURI("/test/hello");
+    request.setHeader("Host", "tester");
+    request.setVersion("HTTP/1.0");
+
+    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
+
+    long time1 = Long.parseLong(response.getContent());
+    assertTrue("Creation time should be positive", time1 > 0);
+
+    List<Cookie> cookies = getCookies(response);
+    request.setHeader("Cookie", "JSESSIONID=" + cookies.get(0).getValue());
+
+    try {
+      Thread.sleep(1000);
+    } catch (Exception ex) {
+    }
+
+    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
+    long time2 = Long.parseLong(response.getContent());
+    assertTrue("Creation time should be the same across requests",
+        time1 == time2);
+  }
+
+  /**
+   * Test that the last accessed time is updated on subsequent access
+   */
+  @Test
+  public void testGetLastAccessedTime() throws Exception {
+    Callback c = new Callback() {
+      @Override
+      public void call(HttpServletRequest request, HttpServletResponse response)
+          throws IOException {
+        HttpSession session = request.getSession();
+        PrintWriter out = response.getWriter();
+        out.write(Long.toString(session.getLastAccessedTime()));
+      }
+    };
+
+    tester.setAttribute("callback_1", c);
+    tester.start();
+//    ContextManager.getInstance().putContext(
+//        servletHolder.getServlet().getServletConfig().getServletContext());
+
+    request.setMethod("GET");
+    request.setURI("/test/hello");
+    request.setHeader("Host", "tester");
+    request.setVersion("HTTP/1.0");
+
+    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
+
+    long time1 = Long.parseLong(response.getContent());
+//        assertTrue("Last accessed time should be positive", time1 > 0);
+
+    List<Cookie> cookies = getCookies(response);
+    request.setHeader("Cookie", "JSESSIONID=" + cookies.get(0).getValue());
+
+    Thread.sleep(1000);
+
+    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
+    long time2 = Long.parseLong(response.getContent());
+    assertTrue("Last accessed time should be increasing across requests",
+        time2 > time1);
+  }
+
+  /**
+   * Test that the underlying native session remains the same across requests
+   */
+  @Test
+  public void testNativeSessionRemainsUnchanged() throws Exception {
+    Callback c = new Callback() {
+      @Override
+      public void call(HttpServletRequest request, HttpServletResponse response)
+          throws IOException {
+        GemfireHttpSession session = (GemfireHttpSession) request.getSession();
+        PrintWriter out = response.getWriter();
+        out.write(session.getNativeSession().getId());
+      }
+    };
+
+    tester.setAttribute("callback_1", c);
+    tester.start();
+//    ContextManager.getInstance().putContext(
+//        servletHolder.getServlet().getServletConfig().getServletContext());
+
+    request.setMethod("GET");
+    request.setURI("/test/hello");
+    request.setHeader("Host", "tester");
+    request.setVersion("HTTP/1.0");
+
+    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
+    String nativeSessionId = response.getContent();
+
+    List<Cookie> cookies = getCookies(response);
+    String sessionId = cookies.get(0).getValue();
+    Region r = getRegion();
+
+    assertEquals(
+        "Cached native session id does not match servlet returned native session id",
+        nativeSessionId,
+        ((GemfireHttpSession) r.get(sessionId)).getNativeSession().getId());
+
+    request.setHeader("Cookie", "JSESSIONID=" + cookies.get(0).getValue());
+    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
+
+    assertEquals(
+        "Underlying native sessions must remain the same across requests",
+        nativeSessionId,
+        ((GemfireHttpSession) r.get(sessionId)).getNativeSession().getId());
+  }
+
+  /**
+   * Test session id embedded in the URL
+   */
+  @Test
+  public void testSessionIdEmbeddedInUrl() throws Exception {
+    Callback c = new Callback() {
+      @Override
+      public void call(HttpServletRequest request, HttpServletResponse response)
+          throws IOException {
+        GemfireHttpSession session = (GemfireHttpSession) request.getSession();
+        PrintWriter out = response.getWriter();
+        out.write(session.getId());
+      }
+    };
+
+    tester.setAttribute("callback_1", c);
+    tester.start();
+//    ContextManager.getInstance().putContext(
+//        servletHolder.getServlet().getServletConfig().getServletContext());
+
+    request.setMethod("GET");
+    request.setURI("/test/hello");
+    request.setHeader("Host", "tester");
+    request.setVersion("HTTP/1.0");
+
+    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
+    List<Cookie> cookies = getCookies(response);
+    String sessionId = response.getContent();
+    assertEquals("Session ids should be the same", sessionId,
+        cookies.get(0).getValue());
+
+    request.setURI("/test/hello;jsessionid=" + sessionId);
+    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
+    cookies = getCookies(response);
+
+    assertEquals("Session ids should be the same", sessionId,
+        cookies.get(0).getValue());
+  }
+
+
+  /**
+   * Test that request forward dispatching works
+   */
+  @Test
+  public void testDispatchingForward1() throws Exception {
+    Callback c_1 = new Callback() {
+      @Override
+      public void call(HttpServletRequest request, HttpServletResponse response)
+          throws IOException, ServletException {
+        RequestDispatcher dispatcher = request.getRequestDispatcher("dispatch");
+        dispatcher.forward(request, response);
+
+        // This should not appear in the output
+        PrintWriter out = response.getWriter();
+        out.write("bang");
+      }
+    };
+
+    // This is the callback used by the forward servlet
+    Callback c_2 = new Callback() {
+      @Override
+      public void call(HttpServletRequest request, HttpServletResponse response)
+          throws IOException, ServletException {
+        PrintWriter out = response.getWriter();
+        out.write("dispatched");
+      }
+    };
+
+    tester.setAttribute("callback_1", c_1);
+    tester.setAttribute("callback_2", c_2);
+
+    ServletHolder sh = tester.addServlet(BasicServlet.class, "/dispatch");
+    sh.setInitParameter("test.callback", "callback_2");
+
+    tester.start();
+//    ContextManager.getInstance().putContext(
+//        sh.getServlet().getServletConfig().getServletContext());
+
+    request.setMethod("GET");
+    request.setURI("/test/hello");
+    request.setHeader("Host", "tester");
+    request.setVersion("HTTP/1.0");
+
+    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
+    assertEquals("dispatched", response.getContent());
+
+//    ContextManager.getInstance().removeContext(
+//        sh.getServlet().getServletConfig().getServletContext());
+  }
+
+
+  /**
+   * Test that request include dispatching works
+   */
+  @Test
+  public void testDispatchingInclude() throws Exception {
+    Callback c_1 = new Callback() {
+      @Override
+      public void call(HttpServletRequest request, HttpServletResponse response)
+          throws IOException, ServletException {
+        RequestDispatcher dispatcher = request.getRequestDispatcher("dispatch");
+        dispatcher.include(request, response);
+
+        // This *should* appear in the output
+        PrintWriter out = response.getWriter();
+        out.write("_bang");
+      }
+    };
+
+    // This is the callback used by the include servlet
+    Callback c_2 = new Callback() {
+      @Override
+      public void call(HttpServletRequest request, HttpServletResponse response)
+          throws IOException, ServletException {
+        PrintWriter out = response.getWriter();
+        out.write("dispatched");
+      }
+    };
+
+    tester.setAttribute("callback_1", c_1);
+    tester.setAttribute("callback_2", c_2);
+
+    ServletHolder sh = tester.addServlet(BasicServlet.class, "/dispatch");
+    sh.setInitParameter("test.callback", "callback_2");
+
+    tester.start();
+//    ContextManager.getInstance().putContext(
+//        sh.getServlet().getServletConfig().getServletContext());
+
+    request.setMethod("GET");
+    request.setURI("/test/hello");
+    request.setHeader("Host", "tester");
+    request.setVersion("HTTP/1.0");
+
+    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
+    assertEquals("dispatched_bang", response.getContent());
+
+//    ContextManager.getInstance().removeContext(
+//        sh.getServlet().getServletConfig().getServletContext());
+  }
+
+
+  /**
+   * Test to try and simulate a failover scenario
+   */
+  @Test
+  public void testFailover1() throws Exception {
+    Callback c_1 = new Callback() {
+      @Override
+      public void call(HttpServletRequest request, HttpServletResponse response)
+          throws IOException, ServletException {
+        HttpSession s = request.getSession();
+        s.setAttribute("foo", "bar");
+
+        PrintWriter out = response.getWriter();
+        out.write(request.getSession().getId());
+      }
+    };
+
+    Callback c_2 = new Callback() {
+      @Override
+      public void call(HttpServletRequest request, HttpServletResponse response)
+          throws IOException, ServletException {
+        HttpSession s = request.getSession();
+
+        PrintWriter out = response.getWriter();
+        out.write((String) s.getAttribute("foo"));
+      }
+    };
+
+    tester.setAttribute("callback_1", c_1);
+    tester.setAttribute("callback_2", c_2);
+
+    ServletHolder sh = tester.addServlet(BasicServlet.class, "/request2");
+    sh.setInitParameter("test.callback", "callback_2");
+
+    tester.start();
+//    ContextManager.getInstance().putContext(
+//        sh.getServlet().getServletConfig().getServletContext());
+
+    request.setMethod("GET");
+    request.setURI("/test/hello");
+    request.setHeader("Host", "tester");
+    request.setVersion("HTTP/1.0");
+
+    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
+    String id = response.getContent();
+
+    // Now we simulate the failover by removing the native session from
+    // the stored session
+    Region r = getRegion();
+    GemfireHttpSession sessObj = (GemfireHttpSession) r.get(id);
+    sessObj.setNativeSession(null);
+
+    r.put(id, sessObj);
+
+    request.setHeader("Cookie", "JSESSIONID=" + id);
+    request.setURI("/test/request2");
+    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
+
+    assertEquals("bar", response.getContent());
+  }
+
+  @Test
+  public void testHttpSessionListener1() throws Exception {
+    HttpSessionListenerImpl listener = new HttpSessionListenerImpl();
+    tester.getContext().getSessionHandler().addEventListener(listener);
+
+    Callback c = new Callback() {
+      @Override
+      public void call(HttpServletRequest request, HttpServletResponse response)
+          throws IOException {
+        HttpSession s = request.getSession();
+        // This is set in HttpSessionListenerImpl
+        String result = (String) s.getAttribute("gemfire-session-id");
+        response.getWriter().write(result);
+      }
+    };
+
+    tester.setAttribute("callback_1", c);
+    tester.start();
+//    ContextManager.getInstance().putContext(
+//        servletHolder.getServlet().getServletConfig().getServletContext());
+
+    request.setMethod("GET");
+    request.setURI("/test/hello");
+    request.setHeader("Host", "tester");
+    request.setVersion("HTTP/1.0");
+
+    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
+
+    assertEquals(200, response.getStatus());
+
+    List<Cookie> cookies = getCookies(response);
+
+//        AbstractListener listener = RendezvousManager.getListener();
+    tester.stop();
+
+    assertTrue("Timeout waiting for events",
+        listener.await(1, TimeUnit.SECONDS));
+    assertEquals(ListenerEventType.SESSION_CREATED,
+        listener.events.get(0));
+    assertEquals(ListenerEventType.SESSION_DESTROYED,
+        listener.events.get(1));
+    assertEquals(cookies.get(0).getValue(), response.getContent());
+  }
+
+  @Test
+  public void testHttpSessionListener2() throws Exception {
+    HttpSessionListenerImpl2 listener = new HttpSessionListenerImpl2();
+    tester.getContext().getSessionHandler().addEventListener(listener);
+
+    Callback c = new Callback() {
+      @Override
+      public void call(HttpServletRequest request, HttpServletResponse response)
+          throws IOException {
+        HttpSession s = request.getSession();
+        s.setAttribute("test01", "test01");
+        s = request.getSession(false);
+        s.invalidate();
+        response.getWriter().write(s.getId());
+      }
+    };
+
+    tester.setAttribute("callback_1", c);
+    tester.start();
+//    ContextManager.getInstance().putContext(
+//        servletHolder.getServlet().getServletConfig().getServletContext());
+
+    request.setMethod("GET");
+    request.setURI("/test/hello");
+    request.setHeader("Host", "tester");
+    request.setVersion("HTTP/1.0");
+
+    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
+
+    assertEquals(200, response.getStatus());
+
+    List<Cookie> cookies = getCookies(response);
+
+    tester.stop();
+
+    assertTrue("Timeout waiting for events",
+        listener.await(1, TimeUnit.SECONDS));
+    assertEquals(ListenerEventType.SESSION_CREATED,
+        listener.events.get(0));
+    assertEquals(ListenerEventType.SESSION_DESTROYED,
+        listener.events.get(1));
+    assertEquals(cookies.get(0).getValue(), response.getContent());
+  }
+
+
+
+
+//  @Test
+  public void testJsp() throws Exception {
+    tester.setResourceBase("target/test-classes");
+    ServletHolder jspHolder = tester.addServlet(JspServlet.class, "/test/*");
+    jspHolder.setInitOrder(1);
+
+    jspHolder.setInitParameter("scratchdir", tmpdir.getPath());
+
+    Callback c_1 = new Callback() {
+      @Override
+      public void call(HttpServletRequest request, HttpServletResponse response)
+          throws IOException, ServletException {
+        request.getSession().setAttribute("foo", "bar");
+        request.setAttribute("foo", "baz");
+        RequestDispatcher dispatcher = request.getRequestDispatcher(
+            "pagecontext.jsp");
+        dispatcher.forward(request, response);
+      }
+    };
+
+    tester.getContext().setClassLoader(Thread.currentThread().getContextClassLoader());
+    tester.setAttribute("callback_1", c_1);
+
+    tester.start();
+
+    request.setMethod("GET");
+    request.setURI("/test/hello");
+    request.setHeader("Host", "tester");
+    request.setVersion("HTTP/1.0");
+
+    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
+
+    assertEquals(200, response.getStatus());
+    assertEquals("baz", response.getContent().trim());
+  }
+
+
+  ////////////////////////////////////////////////////////////////////
+  // Private methods
+
+  /**
+   * Why doesn't HttpTester do this already??
+   */
+  private List<Cookie> getCookies(HttpTester.Response response) {
+    List<Cookie> cookies = new ArrayList<Cookie>();
+
+    Enumeration e = response.getValues("Set-Cookie");
+
+    while (e != null && e.hasMoreElements()) {
+      String header = (String) e.nextElement();
+      Cookie c = null;
+
+      StringTokenizer st = new StringTokenizer(header, ";");
+      while (st.hasMoreTokens()) {
+        String[] split = st.nextToken().split("=");
+        String param = split[0].trim();
+        String value = null;
+        if (split.length > 1) {
+          value = split[1].trim();
+        }
+        if ("version".equalsIgnoreCase(param)) {
+          c.setVersion(Integer.parseInt(value));
+        } else if ("comment".equalsIgnoreCase(param)) {
+          c.setComment(value);
+        } else if ("domain".equalsIgnoreCase(param)) {
+          c.setDomain(value);
+        } else if ("max-age".equalsIgnoreCase(param)) {
+          c.setMaxAge(Integer.parseInt(value));
+        } else if ("discard".equalsIgnoreCase(param)) {
+          c.setMaxAge(-1);
+        } else if ("path".equalsIgnoreCase(param)) {
+          c.setPath(value);
+        } else if ("secure".equalsIgnoreCase(param)) {
+          c.setSecure(true);
+        } else if ("httponly".equalsIgnoreCase(param)) {
+          // Ignored??
+        } else {
+          if (c == null) {
+            c = new Cookie(param, value);
+          } else {
+            throw new IllegalStateException("Unknown cookie param: " + param);
+          }
+        }
+      }
+
+      if (c != null) {
+        cookies.add(c);
+      }
+    }
+
+    return cookies;
+  }
+
+  private Region getRegion() {
+    // Yuck...
+    return ((GemfireSessionManager) ((SessionCachingFilter) filterHolder.getFilter()).getSessionManager()).getCache().getCache().getRegion(
+        "gemfire_modules_sessions");
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/890d62e3/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/SessionReplicationJUnitTest.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/SessionReplicationJUnitTest.java b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/SessionReplicationJUnitTest.java
index 5fd6282..0a2bafe 100644
--- a/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/SessionReplicationJUnitTest.java
+++ b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/SessionReplicationJUnitTest.java
@@ -8,7 +8,7 @@
 package com.gemstone.gemfire.modules.session.internal.filter;
 
 import com.gemstone.gemfire.modules.session.filter.SessionCachingFilter;
-import com.gemstone.gemfire.test.junit.categories.UnitTest;
+import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
 import com.mockrunner.mock.web.MockFilterConfig;
 import com.mockrunner.mock.web.WebMockObjectFactory;
 import org.junit.Before;
@@ -17,7 +17,7 @@ import org.junit.experimental.categories.Category;
 /**
  * This runs all tests with a local cache disabled
  */
-@Category(UnitTest.class)
+@Category(IntegrationTest.class)
 public class SessionReplicationJUnitTest extends CommonTests {
 
   @Before

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/890d62e3/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/SessionReplicationLocalCacheJUnitTest.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/SessionReplicationLocalCacheJUnitTest.java b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/SessionReplicationLocalCacheJUnitTest.java
index bd9a513..ed853b4 100644
--- a/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/SessionReplicationLocalCacheJUnitTest.java
+++ b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/SessionReplicationLocalCacheJUnitTest.java
@@ -8,7 +8,7 @@
 package com.gemstone.gemfire.modules.session.internal.filter;
 
 import com.gemstone.gemfire.modules.session.filter.SessionCachingFilter;
-import com.gemstone.gemfire.test.junit.categories.UnitTest;
+import com.gemstone.gemfire.test.junit.categories.IntegrationTest;
 import com.mockrunner.mock.web.MockFilterConfig;
 import com.mockrunner.mock.web.WebMockObjectFactory;
 import org.junit.Before;
@@ -17,7 +17,7 @@ import org.junit.experimental.categories.Category;
 /**
  * This runs all tests with a local cache enabled
  */
-@Category(UnitTest.class)
+@Category(IntegrationTest.class)
 public class SessionReplicationLocalCacheJUnitTest extends CommonTests {
 
   @Before

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/890d62e3/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/junit/ChildFirstClassLoader.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/junit/ChildFirstClassLoader.java b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/junit/ChildFirstClassLoader.java
new file mode 100644
index 0000000..20d0088
--- /dev/null
+++ b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/junit/ChildFirstClassLoader.java
@@ -0,0 +1,76 @@
+/*=========================================================================
+ * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+package com.gemstone.gemfire.modules.session.junit;
+
+import java.net.URL;
+import java.net.URLClassLoader;
+
+public class ChildFirstClassLoader extends URLClassLoader {
+
+  public ChildFirstClassLoader() {
+    super(new URL[]{});
+  }
+
+  public ChildFirstClassLoader(URL[] urls) {
+    super(urls);
+  }
+
+  public ChildFirstClassLoader(URL[] urls, ClassLoader parent) {
+    super(urls, parent);
+  }
+
+  @Override
+  public void addURL(URL url) {
+    super.addURL(url);
+  }
+
+  @Override
+  public Class loadClass(String name) throws ClassNotFoundException {
+    return loadClass(name, false);
+  }
+
+  /**
+   * We override the parent-first behavior established by
+   * java.lang.Classloader.
+   */
+  @Override
+  protected Class loadClass(String name, boolean resolve)
+      throws ClassNotFoundException {
+    Class c = null;
+
+    if (name.startsWith("com.gemstone")) {
+      // First, check if the class has already been loaded
+      c = findLoadedClass(name);
+
+      // if not loaded, search the local (child) resources
+      if (c == null) {
+        try {
+          c = findClass(name);
+        } catch (ClassNotFoundException cnfe) {
+          // ignore
+        }
+      }
+    }
+
+    // if we could not find it, delegate to parent
+    // Note that we don't attempt to catch any ClassNotFoundException
+    if (c == null) {
+      if (getParent() != null) {
+        c = getParent().loadClass(name);
+      } else {
+        c = getSystemClassLoader().loadClass(name);
+      }
+    }
+
+    if (resolve) {
+      resolveClass(c);
+    }
+
+    return c;
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/890d62e3/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/junit/NamedRunner.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/junit/NamedRunner.java b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/junit/NamedRunner.java
new file mode 100644
index 0000000..46283a4
--- /dev/null
+++ b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/junit/NamedRunner.java
@@ -0,0 +1,127 @@
+/*=========================================================================
+ * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+package com.gemstone.gemfire.modules.session.junit;
+
+/**
+ * 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.
+ */
+
+import org.junit.runner.notification.RunNotifier;
+import org.junit.runners.BlockJUnit4ClassRunner;
+import org.junit.runners.model.FrameworkMethod;
+import org.junit.runners.model.InitializationError;
+
+/**
+ * A Junit 4 runner that stores the name of the method that runs.  The methods
+ * marked with @After and @Before (but also the Test method itself) can request
+ * this name for which it is running.
+ *
+ * @author Rudy De Busscher
+ */
+public class NamedRunner extends BlockJUnit4ClassRunner {
+
+  /**
+   * The Constant PREFIX_KEY.
+   */
+  private static final String PREFIX_KEY = "ClassLoaderRunner_TestMethodName_";
+
+  /**
+   * The Constant NO_NAME.
+   */
+  private static final String NO_NAME = "null";
+
+  /**
+   * Instantiates a new named runner.
+   *
+   * @param klass the klass
+   * @throws InitializationError the initialization error
+   */
+  public NamedRunner(Class<?> klass) throws InitializationError {
+    super(klass);
+  }
+
+  @Override
+  protected void runChild(FrameworkMethod method, RunNotifier notifier)
+
+  {
+    storeTestMethodName(method.getName());
+    super.runChild(method, notifier);
+    removeTestMethodName();
+  }
+
+  /**
+   * Gets the test method name.
+   *
+   * @return the test method name
+   */
+  public static String getTestMethodName() {
+    return retrieveTestMethodName();
+  }
+
+  /**
+   * Retrieve test method name.
+   *
+   * @return the string
+   */
+  private static String retrieveTestMethodName() {
+    // We can't use a ThreadLocal variable in the case the TestPerClassLoader runner is used.  Then this
+    // Method is accessed from another classloader and thus reinitialized variables.
+    String result = null;
+    String storedName = System.getProperty(getKey());
+    if (!NO_NAME.equals(storedName)) {
+      result = storedName;
+    }
+    return result;
+  }
+
+  /**
+   * Removes the test method name.
+   */
+  private static void removeTestMethodName() {
+    // We can't use a ThreadLocal variable in the case the TestPerClassLoader runner is used.  Then this
+    // Method is accessed from another classloader and thus reinitialized variables.
+    System.setProperty(getKey(), NO_NAME);
+
+  }
+
+  /**
+   * Store test method name.
+   *
+   * @param name the name
+   */
+  private static void storeTestMethodName(String name) {
+
+    // We can't use a ThreadLocal variable in the case the TestPerClassLoader runner is used.  Then this
+    // Method is accessed from another classloader and thus reinitialized variables.
+    System.setProperty(getKey(), name);
+  }
+
+  /**
+   * Gets the key.
+   *
+   * @return the key
+   */
+  private static String getKey() {
+    StringBuffer buffer = new StringBuffer();
+    buffer.append(PREFIX_KEY).append(Thread.currentThread().getName());
+    return buffer.toString();
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/890d62e3/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/junit/PerTestClassLoaderRunner.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/junit/PerTestClassLoaderRunner.java b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/junit/PerTestClassLoaderRunner.java
new file mode 100644
index 0000000..b5661bf
--- /dev/null
+++ b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/junit/PerTestClassLoaderRunner.java
@@ -0,0 +1,273 @@
+/*=========================================================================
+ * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+package com.gemstone.gemfire.modules.session.junit;
+
+/**
+ * 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
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * 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.
+ */
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.internal.runners.statements.Fail;
+import org.junit.internal.runners.statements.RunAfters;
+import org.junit.internal.runners.statements.RunBefores;
+import org.junit.runners.model.FrameworkMethod;
+import org.junit.runners.model.InitializationError;
+import org.junit.runners.model.Statement;
+import org.junit.runners.model.TestClass;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Method;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.StringTokenizer;
+import java.util.logging.Logger;
+
+public class PerTestClassLoaderRunner extends NamedRunner {
+  private static final Logger LOGGER = Logger
+      .getLogger(PerTestClassLoaderRunner.class.getName());
+
+  // The classpath is needed because the custom class loader looks there to find the classes.
+  private static String classPath;
+  private static boolean classPathDetermined = false;
+
+  // Some data related to the class from the custom class loader.
+  private TestClass testClassFromClassLoader;
+  private Object beforeFromClassLoader;
+  private Object afterFromClassLoader;
+
+  /**
+   * Instantiates a new test per class loader runner.
+   *
+   * @param klass the klass
+   * @throws InitializationError the initialization error
+   */
+  public PerTestClassLoaderRunner(Class<?> klass) throws InitializationError {
+    super(klass);
+  }
+
+  @Override
+  protected Object createTest() throws Exception {
+    // Need an instance now from the class loaded by the custom loader.
+    return testClassFromClassLoader.getJavaClass().newInstance();
+  }
+
+  /**
+   * Load classes (TestCase, @Before and @After with custom class loader.
+   *
+   * @throws ClassNotFoundException the class not found exception
+   */
+  private void loadClassesWithCustomClassLoader()
+      throws ClassNotFoundException {
+    String classPath = System.getProperty("java.class.path");
+    StringTokenizer st = new StringTokenizer(classPath, ":");
+    List<URL> urls = new ArrayList<URL>();
+    while (st.hasMoreTokens()) {
+      String u = st.nextToken();
+      try {
+        if (!u.endsWith(".jar")) {
+          u += "/";
+        }
+        URL url = new URL("file://" + u);
+        urls.add(url);
+      } catch (MalformedURLException e) {
+        e.printStackTrace();
+      }
+    }
+
+    ClassLoader classLoader = new ChildFirstClassLoader(
+        urls.toArray(new URL[]{}),
+        Thread.currentThread().getContextClassLoader()
+    );
+
+    Thread.currentThread().setContextClassLoader(classLoader);
+
+    testClassFromClassLoader = new TestClass(classLoader
+        .loadClass(getTestClass().getJavaClass().getName()));
+    // See withAfters and withBefores for the reason.
+    beforeFromClassLoader = classLoader.loadClass(Before.class.getName());
+    afterFromClassLoader = classLoader.loadClass(After.class.getName());
+  }
+
+  @Override
+  protected Statement methodBlock(FrameworkMethod method) {
+    FrameworkMethod newMethod = null;
+    try {
+      // Need the class from the custom loader now, so lets load the class.
+      loadClassesWithCustomClassLoader();
+      // The method as parameter is from the original class and thus not found in our
+      // class loaded by the custom name (reflection is class loader sensitive)
+      // So find the same method but now in the class from the class Loader.
+      Method methodFromNewlyLoadedClass = testClassFromClassLoader
+          .getJavaClass().getMethod(method.getName());
+      newMethod = new FrameworkMethod(methodFromNewlyLoadedClass);
+    } catch (ClassNotFoundException e) {
+      // Show any problem nicely as a JUnit Test failure.
+      return new Fail(e);
+    } catch (SecurityException e) {
+      return new Fail(e);
+    } catch (NoSuchMethodException e) {
+      return new Fail(e);
+    }
+
+    // We can carry out the normal JUnit functionality with our newly discovered method now.
+    return super.methodBlock(newMethod);
+  }
+
+  @SuppressWarnings("unchecked")
+  @Override
+  protected Statement withAfters(FrameworkMethod method, Object target,
+      Statement statement) {
+    // We now to need to search in the class from the custom loader.
+    // We also need to search with the annotation loaded by the custom
+    // class loader or otherwise we don't find any method.
+    List<FrameworkMethod> afters = testClassFromClassLoader
+        .getAnnotatedMethods(
+            (Class<? extends Annotation>) afterFromClassLoader);
+    return new RunAfters(statement, afters, target);
+  }
+
+  @SuppressWarnings("unchecked")
+  @Override
+  protected Statement withBefores(FrameworkMethod method, Object target,
+      Statement statement) {
+    // We now to need to search in the class from the custom loader.
+    // We also need to search with the annotation loaded by the custom
+    // class loader or otherwise we don't find any method.
+    List<FrameworkMethod> befores = testClassFromClassLoader
+        .getAnnotatedMethods(
+            (Class<? extends Annotation>) beforeFromClassLoader);
+    return new RunBefores(statement, befores, target);
+  }
+
+//    /**
+//     * Gets the class path. This value is cached in a static variable for performance reasons.
+//     *
+//     * @return the class path
+//     */
+//    private static String getClassPath()
+//    {
+//        if (classPathDetermined)
+//        {
+//            return classPath;
+//        }
+//
+//        classPathDetermined = true;
+//        // running from maven, we have the classpath in this property.
+//        classPath = System.getProperty("surefire.test.class.path");
+//        if (classPath != null)
+//        {
+//            return classPath;
+//        }
+//
+//        // For a multi module project, running it from the top we have to find it using another way.
+//        // We also need to set useSystemClassLoader=true in the POM so that we gets a jar with the classpath in it.
+//        String booterClassPath = System.getProperty("java.class.path");
+//        Vector<String> pathItems = null;
+//        if (booterClassPath != null)
+//        {
+//            pathItems = scanPath(booterClassPath);
+//        }
+//        // Do we have just 1 entry as classpath which is a jar?
+//        if (pathItems != null && pathItems.size() == 1
+//                && isJar((String) pathItems.get(0)))
+//        {
+//            classPath = loadJarManifestClassPath((String) pathItems.get(0),
+//                    "META-INF/MANIFEST.MF");
+//        }
+//        return classPath;
+//
+//    }
+
+//    /**
+//     * Load jar manifest class path.
+//     *
+//     * @param path the path
+//     * @param fileName the file name
+//     *
+//     * @return the string
+//     */
+//    private static String loadJarManifestClassPath(String path, String fileName)
+//    {
+//        File archive = new File(path);
+//        if (!archive.exists()) {
+//            return null;
+//        }
+//        ZipFile zipFile = null;
+//
+//        try {
+//            zipFile = new ZipFile(archive);
+//        } catch (IOException io) {
+//            return null;
+//        }
+//
+//        ZipEntry entry = zipFile.getEntry(fileName);
+//        if (entry == null) {
+//            return null;
+//        } try {
+//            Manifest mf = new Manifest();
+//            mf.read(zipFile.getInputStream(entry));
+//
+//            return mf.getMainAttributes().getValue(Attributes.Name.CLASS_PATH)
+//                    .replaceAll(" ", System.getProperty("path.separator"))
+//                    .replaceAll("file:/", "");
+//        } catch (MalformedURLException e) {
+//            LOGGER.throwing("ClassLoaderTestSuite", "loadJarManifestClassPath", e);
+//        } catch (IOException e) {
+//            LOGGER.throwing("ClassLoaderTestSuite", "loadJarManifestClassPath", e);
+//        }
+//        return null;
+//    }
+//
+//    /**
+//     * Checks if is jar.
+//     *
+//     * @param pathEntry the path entry
+//     *
+//     * @return true, if is jar
+//     */
+//    private static boolean isJar(String pathEntry)
+//    {
+//        return pathEntry.endsWith(".jar") || pathEntry.endsWith(".zip");
+//    }
+//
+//    /**
+//     * Scan path for all directories.
+//     *
+//     * @param classPath the class path
+//     *
+//     * @return the vector< string>
+//     */
+//    private static Vector<String> scanPath(String classPath)
+//    {
+//        String separator = System.getProperty("path.separator");
+//        Vector<String> pathItems = new Vector<String>(10);
+//        StringTokenizer st = new StringTokenizer(classPath, separator);
+//        while (st.hasMoreTokens())
+//        {
+//            pathItems.addElement(st.nextToken());
+//        }
+//        return pathItems;
+//    }
+
+}


[23/24] incubator-geode git commit: GEODE-14: Adding session replication assembly module

Posted by je...@apache.org.
GEODE-14: Adding session replication assembly module


Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/65a03287
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/65a03287
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/65a03287

Branch: refs/heads/feature/GEODE-14
Commit: 65a03287b341f2252fb36b5ff23d9f2affae267b
Parents: b63d08c
Author: Jens Deppe <jd...@pivotal.io>
Authored: Tue Dec 29 10:39:58 2015 -0800
Committer: Jens Deppe <jd...@pivotal.io>
Committed: Tue Dec 29 10:39:58 2015 -0800

----------------------------------------------------------------------
 .../gemfire-modules-assembly/build.gradle       |  249 ++++
 ...e_licenses-Pivotal_GemFire_Modules_7.0.2.txt |  469 ++++++
 ...rce_licenses-Pivotal_GemFire_Modules_8.0.txt |  465 ++++++
 ...e_licenses-Pivotal_GemFire_Modules_8.1.0.txt |  472 +++++++
 ...censes-VMware_vFabric_GemFire_Module_7.0.txt |  471 +++++++
 ...ses-VMware_vFabric_GemFire_Modules_7.0.1.txt |  474 +++++++
 ...re_HTTP_Session_Management_Modules_2.0.1.txt | 1316 +++++++++++++++++
 ...Fire_HTTP_Session_Management_Modules_2.0.txt | 1334 ++++++++++++++++++
 ...re_HTTP_Session_Management_Modules_2.1.1.txt | 1326 +++++++++++++++++
 ...Fire_HTTP_Session_Management_Modules_2.1.txt | 1325 +++++++++++++++++
 ...icenses-vFabric_GemFire_Modules_7.0.Beta.txt |  471 +++++++
 .../release/conf/cache-client.xml               |   25 +
 .../release/conf/cache-peer.xml                 |   33 +
 .../release/conf/cache-server.xml               |   59 +
 .../release/hibernate/readme.txt                |   14 +
 .../release/scripts/cacheserver.bat             |  122 ++
 .../release/scripts/cacheserver.sh              |   95 ++
 .../release/scripts/gemfire.bat                 |   23 +
 .../release/scripts/gemfire.sh                  |   43 +
 .../release/scripts/setenv.properties           |    6 +
 .../release/session/bin/cacheserver.bat         |   40 +
 .../release/session/bin/cacheserver.sh          |   41 +
 .../release/session/bin/gemfire.bat             |   37 +
 .../release/session/bin/gemfire.sh              |   53 +
 .../release/session/bin/modify_war              |  377 +++++
 .../release/session/bin/setenv.properties       |    6 +
 .../release/session/conf/cache-client.xml       |   25 +
 .../release/session/conf/cache-peer.xml         |   25 +
 .../release/session/conf/cache-server.xml       |   52 +
 .../release/session/readme.txt                  |   14 +
 .../gemfire-cs-tomcat-7/context-fragment.xml    |   15 +
 .../tcserver/gemfire-cs-tomcat-7/modules.env    |    1 +
 .../gemfire-cs-tomcat-8/context-fragment.xml    |   15 +
 .../tcserver/gemfire-cs-tomcat-8/modules.env    |    1 +
 .../release/tcserver/gemfire-cs/README.txt      |   14 +
 .../gemfire-cs/configuration-prompts.properties |   17 +
 .../tcserver/gemfire-cs/context-fragment.xml    |   13 +
 .../release/tcserver/gemfire-cs/modules.env     |    1 +
 .../tcserver/gemfire-cs/server-fragment.xml     |   12 +
 .../gemfire-p2p-tomcat-7/context-fragment.xml   |   15 +
 .../tcserver/gemfire-p2p-tomcat-7/modules.env   |    1 +
 .../gemfire-p2p-tomcat-8/context-fragment.xml   |   15 +
 .../tcserver/gemfire-p2p-tomcat-8/modules.env   |    1 +
 .../release/tcserver/gemfire-p2p/README.txt     |   14 +
 .../configuration-prompts.properties            |   21 +
 .../tcserver/gemfire-p2p/context-fragment.xml   |   13 +
 .../release/tcserver/gemfire-p2p/modules.env    |    1 +
 .../tcserver/gemfire-p2p/server-fragment.xml    |   16 +
 .../release/tomcat/readme.txt                   |   14 +
 settings.gradle                                 |    1 +
 50 files changed, 9663 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/65a03287/extensions/gemfire-modules-assembly/build.gradle
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-assembly/build.gradle b/extensions/gemfire-modules-assembly/build.gradle
new file mode 100644
index 0000000..fc487a5
--- /dev/null
+++ b/extensions/gemfire-modules-assembly/build.gradle
@@ -0,0 +1,249 @@
+/*
+ * 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.
+ */
+
+configurations {
+  slf4jDeps
+}
+
+configurations {
+  servletApiDeps
+}
+
+dependencies {
+  slf4jDeps 'org.slf4j:slf4j-api:1.7.7'
+  slf4jDeps 'org.slf4j:slf4j-jdk14:1.7.7'
+}
+
+dependencies {
+  servletApiDeps 'javax.servlet:servlet-api:2.5'
+}
+
+def configureTcServerAssembly = {
+  archiveName = "Apache_Geode_Modules-${version}-tcServer.zip"
+
+  // All client-server files
+  into('gemfire-cs/lib') {
+    from project(':extensions/gemfire-modules').configurations.archives.allArtifacts.files
+    from project(':extensions/gemfire-modules-tomcat7').configurations.archives.allArtifacts.files
+    from configurations.slf4jDeps
+    from('release/3rdparty_license') {
+      include "open_source_licenses*${version}.txt"
+    }
+  }
+  into('gemfire-cs/bin') {
+    from('release/scripts') {
+      include '*'
+    }
+    from('release/tcserver/gemfire-cs') {
+      include 'modules.env'
+    }
+    filter { it.replaceAll('@GEMFIRE_MODULES_VERSION@', version) }
+  }
+  into('gemfire-cs/conf') {
+    from('release/conf') {
+      exclude 'cache-peer.xml'
+    }
+    from('release/tcserver/gemfire-cs') {
+      include 'context-fragment.xml'
+      include 'server-fragment.xml'
+    }
+  }
+  into('gemfire-cs') {
+    from('release/tcserver/gemfire-cs') {
+      include 'configuration-prompts.properties'
+      include 'README.txt'
+      filter { it.replaceAll('@VERSION@', version) }
+    }
+  }
+
+  // Tomncat 7 specifics
+  into('gemfire-cs-tomcat-7/conf') {
+    from('release/tcserver/gemfire-cs-tomcat-7') {
+      include 'context-fragment.xml'
+    }
+  }
+  into('gemfire-cs-tomcat-7/bin') {
+    from('release/tcserver/gemfire-cs-tomcat-7') {
+      include 'modules.env'
+    }
+  }
+  // All peer-to-peer files
+  into('gemfire-p2p/lib') {
+    from project(':extensions/gemfire-modules').configurations.archives.allArtifacts.files
+    from project(':extensions/gemfire-modules-tomcat7').configurations.archives.allArtifacts.files
+    from configurations.slf4jDeps
+    from('release/3rdparty_license') {
+      include "open_source_licenses*${version}.txt"
+    }
+  }
+  into('gemfire-p2p/bin') {
+    from('release/scripts') {
+      include 'gemfire.*'
+      include 'setenv.properties'
+    }
+    from('release/tcserver/gemfire-p2p') {
+      include 'modules.env'
+    }
+  }
+  into('gemfire-p2p/conf') {
+    from('release/conf') {
+      include 'cache-peer.xml'
+    }
+    from('release/tcserver/gemfire-p2p') {
+      include 'context-fragment.xml'
+      include 'server-fragment.xml'
+    }
+  }
+  into('gemfire-p2p') {
+    from('release/tcserver/gemfire-p2p') {
+      include 'configuration-prompts.properties'
+      include 'README.txt'
+      filter { it.replaceAll('@VERSION@', version) }
+    }
+  }
+
+  // Tomncat 7 specifics
+  into('gemfire-p2p-tomcat-7/conf') {
+    from('release/tcserver/gemfire-p2p-tomcat-7') {
+      include 'context-fragment.xml'
+    }
+  }
+  into('gemfire-p2p-tomcat-7/bin') {
+    from('release/tcserver/gemfire-p2p-tomcat-7') {
+      include 'modules.env'
+    }
+  }
+}
+
+def configureTcServer30Assembly = {
+  archiveName = "Apache_Geode_Modules-${version}-tcServer30.zip"
+
+  into('gemfire-cs-tomcat-8/bin') {
+    from('release/tcserver/gemfire-cs-tomcat-8') {
+      include 'modules.env'
+    }
+  }
+  into('gemfire-cs-tomcat-8/conf') {
+    from('release/tcserver/gemfire-cs-tomcat-8') {
+      include 'context-fragment.xml'
+    }
+  }
+
+  into('gemfire-p2p-tomcat-8/bin') {
+    from('release/tcserver/gemfire-p2p-tomcat-8') {
+      include 'modules.env'
+    }
+  }
+  into('gemfire-p2p-tomcat-8/conf') {
+    from('release/tcserver/gemfire-p2p-tomcat-8') {
+      include 'context-fragment.xml'
+    }
+  }
+}
+
+task distTomcat(type: Zip) {
+  archiveName = "Apache_Geode_Modules-${version}-Tomcat.zip"
+
+  // All client-server files
+  into('lib') {
+    from project(':extensions/gemfire-modules').configurations.archives.allArtifacts.files
+    from project(':extensions/gemfire-modules-tomcat7').configurations.archives.allArtifacts.files
+    from configurations.slf4jDeps
+    from('release/3rdparty_license') {
+      include "open_source_licenses*${version}.txt"
+    }
+  }
+  into('bin') {
+    from('release/scripts') {
+      include '*'
+      exclude 'setenv.properties'
+    }
+  }
+  into('conf') {
+    from('release/conf') {
+      include '*'
+    }
+  }
+
+  from('release/tomcat') {
+    include 'readme.txt'
+    filter { it.replaceAll('@VERSION@', version) }
+  }
+}
+
+task distHibernate(type: Zip) {
+  archiveName = "Apache_Geode_Modules-${version}-Hibernate.zip"
+
+  into('lib') {
+    from project(':extensions/gemfire-modules-hibernate').configurations.archives.allArtifacts.files
+  }
+  from('release/hibernate') {
+    include 'readme.txt'
+    filter { it.replaceAll('@VERSION@', version) }
+  }
+}
+
+task distAppServer(type: Zip) {
+  archiveName = "Apache_Geode_Modules-${version}-AppServer.zip"
+
+  into('lib') {
+    from project(':extensions/gemfire-modules').configurations.archives.allArtifacts.files
+    from project(':extensions/gemfire-modules-session').configurations.archives.allArtifacts.files
+//    from project(':extensions/gemfire-modules-session-external').configurations.archives.allArtifacts.files
+    from configurations.slf4jDeps
+    from configurations.servletApiDeps
+    from('release/3rdparty_license') {
+      include "open_source_licenses*${version}.txt"
+    }
+  }
+
+  into('bin') {
+    from('release/session/bin/') {
+      include 'setenv.properties'
+      include 'modify_war'
+      include 'cacheserver.*'
+      include 'gemfire.*'
+
+      def slf4j_version = '1.7.7'
+      def servlet_api_version = '2.5'
+      filter { it.replaceAll('@GEMFIRE_MODULES_VERSION@', version) }
+      filter { it.replaceAll('@SLF4J_VERSION@', "${slf4j_version}") }
+      filter { it.replaceAll('@SERVLET_API_VERSION@', "${servlet_api_version}") }
+      filter { it.replaceAll('@GEMFIRE_VERSION@', version) }
+    }
+  }
+
+  into('conf') {
+    from('release/session/conf')
+  }
+
+  from('release/session') {
+    include 'readme.txt'
+    filter { it.replaceAll('@VERSION@', version) }
+  }
+}
+
+task distTcServer(type: Zip, dependsOn: 'build') {
+  configure(configureTcServerAssembly)
+}
+
+task distTcServer30(type: Zip, dependsOn: 'build') {
+  configure(configureTcServerAssembly)
+  configure(configureTcServer30Assembly)
+}
+
+task dist(type: Task, dependsOn: ['distTcServer', 'distTcServer30', 'distTomcat', 'distHibernate', 'distAppServer'])

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/65a03287/extensions/gemfire-modules-assembly/release/3rdparty_license/open_source_licenses-Pivotal_GemFire_Modules_7.0.2.txt
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-assembly/release/3rdparty_license/open_source_licenses-Pivotal_GemFire_Modules_7.0.2.txt b/extensions/gemfire-modules-assembly/release/3rdparty_license/open_source_licenses-Pivotal_GemFire_Modules_7.0.2.txt
new file mode 100755
index 0000000..f651b10
--- /dev/null
+++ b/extensions/gemfire-modules-assembly/release/3rdparty_license/open_source_licenses-Pivotal_GemFire_Modules_7.0.2.txt
@@ -0,0 +1,469 @@
+open_source_license.txt
+
+Pivotal GemFire Modules 7.0.2 GA
+
+
+================================================================
+The following copyright statements and licenses apply to various 
+open source software packages (or portions thereof) that are 
+distributed with this Pivotal, Inc. Product.
+
+The Pivotal Product may also include other Pivotal components, 
+which may contain additional open source software packages. One or 
+more such open_source_licenses.txt files may therefore accompany 
+this Pivotal Product.
+
+The Pivotal Product that includes this file does not necessarily use 
+all the open source software packages referred to below and may also 
+only use portions of a given package.
+
+=================================================================
+TABLE OF CONTENTS
+=================================================================
+The following is a listing of the open source components detailed 
+in this document. This list is provided for your convenience; 
+please read further if you wish to review the copyright notice(s) 
+and the full text of the license associated with each component.
+
+
+
+
+
+SECTION 1: BSD-STYLE, MIT-STYLE, OR SIMILAR STYLE LICENSES
+
+   >>> slf4j-1.5.8
+
+
+
+SECTION 2: Common Development and Distribution License, V1.0
+
+   >>> servlet-api-2.5
+
+
+
+APPENDIX. Standard License Files
+
+   >>> Common Development and Distribution License, V1.0
+
+
+
+
+
+--------------- SECTION 1:  BSD-STYLE, MIT-STYLE, OR SIMILAR STYLE LICENSES ----------
+
+BSD-STYLE, MIT-STYLE, OR SIMILAR STYLE LICENSES are applicable to the following component(s).
+
+
+>>> slf4j-1.5.8
+
+Copyright (c) 2004-2008 QOS.ch
+All rights reserved.
+
+Permission is hereby granted, free  of charge, to any person obtaining
+a  copy  of this  software  and  associated  documentation files  (the
+"Software"), to  deal in  the Software without  restriction, including
+without limitation  the rights to  use, copy, modify,  merge, publish,
+distribute,  sublicense, and/or sell  copies of  the Software,  and to
+permit persons to whom the Software  is furnished to do so, subject to
+the following conditions:
+
+The  above  copyright  notice  and  this permission  notice  shall  be
+included in all copies or substantial portions of the Software.
+
+THE  SOFTWARE IS  PROVIDED  "AS  IS", WITHOUT  WARRANTY  OF ANY  KIND,
+EXPRESS OR  IMPLIED, INCLUDING  BUT NOT LIMITED  TO THE  WARRANTIES OF
+MERCHANTABILITY,    FITNESS    FOR    A   PARTICULAR    PURPOSE    AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE,  ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+
+--------------- SECTION 2: Common Development and Distribution License, V1.0 ----------
+
+Common Development and Distribution License, V1.0 is applicable to the following component(s).
+
+
+>>> servlet-api-2.5
+
+The contents of this file are subject to the terms 
+of the Common Development and Distribution License 
+(the "License"). You may not use this file except 
+in compliance with the License. 
+ 
+You can obtain a copy of the license at 
+glassfish/bootstrap/legal/CDDLv1.0.txt or 
+https://glassfish.dev.java.net/public/CDDLv1.0.html. 
+See the License for the specific language governing 
+permissions and limitations under the License. 
+ 
+When distributing Covered Code, include this CDDL 
+HEADER in each file and include the License file at 
+glassfish/bootstrap/legal/CDDLv1.0.txt. If applicable, 
+add the following below this CDDL HEADER, with the 
+fields enclosed by brackets "[]" replaced with your 
+own identifying information: Portions Copyright [yyyy] 
+[name of copyright owner] 
+ 
+Copyright 2005 Sun Microsystems, Inc. All rights reserved. 
+ 
+Portions Copyright Apache Software Foundation.
+
+
+=============== APPENDIX. Standard License Files ============== 
+
+
+
+--------------- SECTION 1: Common Development and Distribution License, V1.0 -----------
+
+COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
+
+1. Definitions.
+
+1.1. "Contributor" means each individual or entity that creates or
+contributes to the creation of Modifications.
+
+1.2. "Contributor Version" means the combination of the Original Software,
+prior Modifications used by a Contributor (if any), and the Modifications
+made by that particular Contributor.
+
+1.3. "Covered Software" means (a) the Original Software, or (b)
+Modifications, or (c) the combination of files containing Original
+Software with files containing Modifications, in each case including
+portions thereof.
+
+1.4. "Executable" means the Covered Software in any form other than
+Source Code.
+
+1.5. "Initial Developer" means the individual or entity that first makes
+Original Software available under this License.
+
+1.6. "Larger Work" means a work which combines Covered Software or
+portions thereof with code not governed by the terms of this License.
+
+1.7. "License" means this document.
+
+1.8. "Licensable" means having the right to grant, to the maximum extent
+possible, whether at the time of the initial grant or subsequently
+acquired, any and all of the rights conveyed herein.
+
+1.9. "Modifications" means the Source Code and Executable form of any
+of the following:
+
+    A. Any file that results from an addition to, deletion from or
+    modification of the contents of a file containing Original Software
+    or previous Modifications;
+
+    B. Any new file that contains any part of the Original Software or
+    previous Modification; or
+
+    C. Any new file that is contributed or otherwise made available
+    under the terms of this License.
+
+1.10. "Original Software" means the Source Code and Executable form of
+computer software code that is originally released under this License.
+
+1.11. "Patent Claims" means any patent claim(s), now owned or hereafter
+acquired, including without limitation, method, process, and apparatus
+claims, in any patent Licensable by grantor.
+
+1.12. "Source Code" means (a) the common form of computer software code
+in which modifications are made and (b) associated documentation included
+in or with such code.
+
+1.13. "You" (or "Your") means an individual or a legal entity exercising
+rights under, and complying with all of the terms of, this License. For
+legal entities, "You" includes any entity which controls, is controlled
+by, or is under common control with You. For purposes of this definition,
+"control" means (a) the power, direct or indirect, to cause the direction
+or management of such entity, whether by contract or otherwise, or (b)
+ownership of more than fifty percent (50%) of the outstanding shares or
+beneficial ownership of such entity.
+
+2. License Grants. 
+
+2.1. The Initial Developer Grant.
+
+Conditioned upon Your compliance with Section 3.1 below and subject to
+third party intellectual property claims, the Initial Developer hereby
+grants You a world-wide, royalty-free, non-exclusive license:
+
+    (a) under intellectual property rights (other than patent or
+    trademark) Licensable by Initial Developer, to use, reproduce, modify,
+    display, perform, sublicense and distribute the Original Software
+    (or portions thereof), with or without Modifications, and/or as part
+    of a Larger Work; and
+
+    (b) under Patent Claims infringed by the making, using or selling
+    of Original Software, to make, have made, use, practice, sell, and
+    offer for sale, and/or otherwise dispose of the Original Software
+    (or portions thereof).
+
+    (c) The licenses granted in Sections 2.1(a) and (b) are effective
+    on the date Initial Developer first distributes or otherwise makes
+    the Original Software available to a third party under the terms of
+    this License.
+
+    (d) Notwithstanding Section 2.1(b) above, no patent license is
+    granted: (1) for code that You delete from the Original Software,
+    or (2) for infringements caused by: (i) the modification of the
+    Original Software, or (ii) the combination of the Original Software
+    with other software or devices.
+
+2.2. Contributor Grant.
+
+Conditioned upon Your compliance with Section 3.1 below and subject to
+third party intellectual property claims, each Contributor hereby grants
+You a world-wide, royalty-free, non-exclusive license:
+
+    (a) under intellectual property rights (other than patent or
+    trademark) Licensable by Contributor to use, reproduce, modify,
+    display, perform, sublicense and distribute the Modifications created
+    by such Contributor (or portions thereof), either on an unmodified
+    basis, with other Modifications, as Covered Software and/or as part
+    of a Larger Work; and
+
+    (b) under Patent Claims infringed by the making, using, or selling
+    of Modifications made by that Contributor either alone and/or
+    in combination with its Contributor Version (or portions of such
+    combination), to make, use, sell, offer for sale, have made, and/or
+    otherwise dispose of: (1) Modifications made by that Contributor
+    (or portions thereof); and (2) the combination of Modifications
+    made by that Contributor with its Contributor Version (or portions
+    of such combination).
+
+    (c) The licenses granted in Sections 2.2(a) and 2.2(b) are effective
+    on the date Contributor first distributes or otherwise makes the
+    Modifications available to a third party.
+
+    (d) Notwithstanding Section 2.2(b) above, no patent license is
+    granted: (1) for any code that Contributor has deleted from the
+    Contributor Version; (2) for infringements caused by: (i) third
+    party modifications of Contributor Version, or (ii) the combination
+    of Modifications made by that Contributor with other software
+    (except as part of the Contributor Version) or other devices; or (3)
+    under Patent Claims infringed by Covered Software in the absence of
+    Modifications made by that Contributor.
+
+3. Distribution Obligations.
+
+3.1. Availability of Source Code.
+
+Any Covered Software that You distribute or otherwise make available
+in Executable form must also be made available in Source Code form and
+that Source Code form must be distributed only under the terms of this
+License. You must include a copy of this License with every copy of the
+Source Code form of the Covered Software You distribute or otherwise make
+available. You must inform recipients of any such Covered Software in
+Executable form as to how they can obtain such Covered Software in Source
+Code form in a reasonable manner on or through a medium customarily used
+for software exchange.
+
+3.2. Modifications.
+
+The Modifications that You create or to which You contribute are governed
+by the terms of this License. You represent that You believe Your
+Modifications are Your original creation(s) and/or You have sufficient
+rights to grant the rights conveyed by this License.
+
+3.3. Required Notices.
+
+You must include a notice in each of Your Modifications that identifies
+You as the Contributor of the Modification.  You may not remove or alter
+any copyright, patent or trademark notices contained within the Covered
+Software, or any notices of licensing or any descriptive text giving
+attribution to any Contributor or the Initial Developer.
+
+3.4. Application of Additional Terms.
+
+You may not offer or impose any terms on any Covered Software in Source
+Code form that alters or restricts the applicable version of this License
+or the recipients' rights hereunder. You may choose to offer, and to
+charge a fee for, warranty, support, indemnity or liability obligations to
+one or more recipients of Covered Software.  However, you may do so only
+on Your own behalf, and not on behalf of the Initial Developer or any
+Contributor. You must make it absolutely clear that any such warranty,
+support, indemnity or liability obligation is offered by You alone, and
+You hereby agree to indemnify the Initial Developer and every Contributor
+for any liability incurred by the Initial Developer or such Contributor
+as a result of warranty, support, indemnity or liability terms You offer.
+
+3.5. Distribution of Executable Versions.
+
+You may distribute the Executable form of the Covered Software under the
+terms of this License or under the terms of a license of Your choice,
+which may contain terms different from this License, provided that You are
+in compliance with the terms of this License and that the license for the
+Executable form does not attempt to limit or alter the recipient's rights
+in the Source Code form from the rights set forth in this License. If
+You distribute the Covered Software in Executable form under a different
+license, You must make it absolutely clear that any terms which differ
+from this License are offered by You alone, not by the Initial Developer
+or Contributor. You hereby agree to indemnify the Initial Developer and
+every Contributor for any liability incurred by the Initial Developer
+or such Contributor as a result of any such terms You offer.
+
+3.6. Larger Works.
+
+You may create a Larger Work by combining Covered Software with other code
+not governed by the terms of this License and distribute the Larger Work
+as a single product. In such a case, You must make sure the requirements
+of this License are fulfilled for the Covered Software.
+
+4. Versions of the License. 
+
+4.1. New Versions.
+
+Sun Microsystems, Inc. is the initial license steward and may publish
+revised and/or new versions of this License from time to time. Each
+version will be given a distinguishing version number. Except as provided
+in Section 4.3, no one other than the license steward has the right to
+modify this License.
+
+4.2. Effect of New Versions.
+
+You may always continue to use, distribute or otherwise make the Covered
+Software available under the terms of the version of the License under
+which You originally received the Covered Software. If the Initial
+Developer includes a notice in the Original Software prohibiting it
+from being distributed or otherwise made available under any subsequent
+version of the License, You must distribute and make the Covered Software
+available under the terms of the version of the License under which You
+originally received the Covered Software. Otherwise, You may also choose
+to use, distribute or otherwise make the Covered Software available
+under the terms of any subsequent version of the License published by
+the license steward.
+
+4.3. Modified Versions.
+
+When You are an Initial Developer and You want to create a new license
+for Your Original Software, You may create and use a modified version of
+this License if You: (a) rename the license and remove any references
+to the name of the license steward (except to note that the license
+differs from this License); and (b) otherwise make it clear that the
+license contains terms which differ from this License.
+
+5. DISCLAIMER OF WARRANTY.
+
+COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+WITHOUT LIMITATION, WARRANTIES THAT THE COVERED SOFTWARE IS FREE OF
+DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE
+ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED SOFTWARE
+IS WITH YOU. SHOULD ANY COVERED SOFTWARE PROVE DEFECTIVE IN ANY RESPECT,
+YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST
+OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF
+WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY
+COVERED SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
+
+6. TERMINATION. 
+
+6.1. This License and the rights granted hereunder will terminate
+automatically if You fail to comply with terms herein and fail to cure
+such breach within 30 days of becoming aware of the breach. Provisions
+which, by their nature, must remain in effect beyond the termination of
+this License shall survive.
+
+6.2. If You assert a patent infringement claim (excluding declaratory
+judgment actions) against Initial Developer or a Contributor (the
+Initial Developer or Contributor against whom You assert such claim is
+referred to as "Participant") alleging that the Participant Software
+(meaning the Contributor Version where the Participant is a Contributor
+or the Original Software where the Participant is the Initial Developer)
+directly or indirectly infringes any patent, then any and all rights
+granted directly or indirectly to You by such Participant, the Initial
+Developer (if the Initial Developer is not the Participant) and all
+Contributors under Sections 2.1 and/or 2.2 of this License shall, upon 60
+days notice from Participant terminate prospectively and automatically
+at the expiration of such 60 day notice period, unless if within such
+60 day period You withdraw Your claim with respect to the Participant
+Software against such Participant either unilaterally or pursuant to a
+written agreement with Participant.
+
+6.3. In the event of termination under Sections 6.1 or 6.2 above, all end
+user licenses that have been validly granted by You or any distributor
+hereunder prior to termination (excluding licenses granted to You by
+any distributor) shall survive termination.
+
+7. LIMITATION OF LIABILITY.
+
+UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING
+NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL DEVELOPER, ANY
+OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED SOFTWARE, OR ANY SUPPLIER
+OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL,
+INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT
+LIMITATION, DAMAGES FOR LOST PROFITS, LOSS OF GOODWILL, WORK STOPPAGE,
+COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES
+OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY
+OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY
+FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH PARTY'S NEGLIGENCE TO
+THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS
+DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL
+DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
+
+8. U.S. GOVERNMENT END USERS.
+
+The Covered Software is a "commercial item," as that term is defined
+in 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer
+software" (as that term is defined at 48 C.F.R.  252.227-7014(a)(1)) and
+"commercial computer software documentation" as such terms are used in
+48 C.F.R. 12.212 (Sept.  1995). Consistent with 48 C.F.R. 12.212 and 48
+C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End
+Users acquire Covered Software with only those rights set forth herein.
+This U.S. Government Rights clause is in lieu of, and supersedes, any
+other FAR, DFAR, or other clause or provision that addresses Government
+rights in computer software under this License.
+
+9. MISCELLANEOUS.
+
+This License represents the complete agreement concerning subject matter
+hereof. If any provision of this License is held to be unenforceable,
+such provision shall be reformed only to the extent necessary to make it
+enforceable. This License shall be governed by the law of the jurisdiction
+specified in a notice contained within the Original Software (except to
+the extent applicable law, if any, provides otherwise), excluding such
+jurisdiction's conflict-of-law provisions. Any litigation relating to
+this License shall be subject to the jurisdiction of the courts located
+in the jurisdiction and venue specified in a notice contained within
+the Original Software, with the losing party responsible for costs,
+including, without limitation, court costs and reasonable attorneys'
+fees and expenses. The application of the United Nations Convention on
+Contracts for the International Sale of Goods is expressly excluded. Any
+law or regulation which provides that the language of a contract shall
+be construed against the drafter shall not apply to this License.
+You agree that You alone are responsible for compliance with the United
+States export administration regulations (and the export control laws and
+regulation of any other countries) when You use, distribute or otherwise
+make available any Covered Software.
+
+10. RESPONSIBILITY FOR CLAIMS.
+
+As between Initial Developer and the Contributors, each party is
+responsible for claims and damages arising, directly or indirectly, out
+of its utilization of rights under this License and You agree to work
+with Initial Developer and Contributors to distribute such responsibility
+on an equitable basis. Nothing herein is intended or shall be deemed to
+constitute any admission of liability.
+
+
+
+================================================
+
+To the extent any open source components are licensed under the
+GPL and/or LGPL, or other similar licenses that require the
+source code and/or modifications to source code to be made
+available (as would be noted above), you may obtain a copy of
+the source code corresponding to the binaries for such open
+source components and modifications thereto, if any, (the
+"Source Files"), by downloading the Source Files from Pivotal�s website at
+http://www.gopivotal.com/open-source, or by sending a request, with your name and address 
+to: Pivotal Software, Inc., 1900 S. Norfolk Street #125, San Mateo, CA 94403, 
+Attention: General Counsel. All such requests should clearly 
+specify: OPEN SOURCE FILES REQUEST,
+Attention General Counsel. Pivotal shall mail a copy of the
+Source Files to you on a CD or equivalent physical medium. This
+offer to obtain a copy of the Source Files is valid for three
+years from the date you acquired this Software product. 
+Alternatively, the Source Files may accompany the Pivotal product.
+
+[GFEHTTPMODULE702GASS010814]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/65a03287/extensions/gemfire-modules-assembly/release/3rdparty_license/open_source_licenses-Pivotal_GemFire_Modules_8.0.txt
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-assembly/release/3rdparty_license/open_source_licenses-Pivotal_GemFire_Modules_8.0.txt b/extensions/gemfire-modules-assembly/release/3rdparty_license/open_source_licenses-Pivotal_GemFire_Modules_8.0.txt
new file mode 100755
index 0000000..5eb37cb
--- /dev/null
+++ b/extensions/gemfire-modules-assembly/release/3rdparty_license/open_source_licenses-Pivotal_GemFire_Modules_8.0.txt
@@ -0,0 +1,465 @@
+open_source_license.txt
+
+Pivotal GemFire Modules 8.0.0 GA
+
+
+===========================================================================
+
+The following copyright statements and licenses apply to various open
+source software packages (or portions thereof) that are distributed with
+this Pivotal Software, Inc. Product.
+
+The Pivotal Product may also include other Pivotal components, which may
+contain additional open source software packages. One or more such
+open_source_licenses.txt files may therefore accompany this Pivotal
+Product.
+
+The Pivotal Product that includes this file does not necessarily use all
+the open source software packages referred to below and may also only
+use portions of a given package.
+
+
+=============== TABLE OF CONTENTS =============================
+
+
+The following is a listing of the open source components detailed in
+this document. This list is provided for your convenience; please read
+further if you wish to review the copyright notice(s) and the full text
+of the license associated with each component.
+
+
+
+SECTION 1: BSD-STYLE, MIT-STYLE, OR SIMILAR STYLE LICENSES
+
+   >>> slf4j-1.5.8
+
+
+
+SECTION 2: Common Development and Distribution License, V1.0
+
+   >>> servlet-api-2.5
+
+
+
+APPENDIX. Standard License Files
+
+   >>> Common Development and Distribution License, V1.0
+
+
+--------------- SECTION 1:  BSD-STYLE, MIT-STYLE, OR SIMILAR STYLE LICENSES ----------
+
+BSD-STYLE, MIT-STYLE, OR SIMILAR STYLE LICENSES are applicable to the following component(s).
+
+
+>>> slf4j-1.5.8
+
+Copyright (c) 2004-2008 QOS.ch
+All rights reserved.
+
+Permission is hereby granted, free  of charge, to any person obtaining
+a  copy  of this  software  and  associated  documentation files  (the
+"Software"), to  deal in  the Software without  restriction, including
+without limitation  the rights to  use, copy, modify,  merge, publish,
+distribute,  sublicense, and/or sell  copies of  the Software,  and to
+permit persons to whom the Software  is furnished to do so, subject to
+the following conditions:
+
+The  above  copyright  notice  and  this permission  notice  shall  be
+included in all copies or substantial portions of the Software.
+
+THE  SOFTWARE IS  PROVIDED  "AS  IS", WITHOUT  WARRANTY  OF ANY  KIND,
+EXPRESS OR  IMPLIED, INCLUDING  BUT NOT LIMITED  TO THE  WARRANTIES OF
+MERCHANTABILITY,    FITNESS    FOR    A   PARTICULAR    PURPOSE    AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE,  ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+
+--------------- SECTION 2: Common Development and Distribution License, V1.0 ----------
+
+Common Development and Distribution License, V1.0 is applicable to the following component(s).
+
+
+>>> servlet-api-2.5
+
+The contents of this file are subject to the terms 
+of the Common Development and Distribution License 
+(the "License"). You may not use this file except 
+in compliance with the License. 
+ 
+You can obtain a copy of the license at 
+glassfish/bootstrap/legal/CDDLv1.0.txt or 
+https://glassfish.dev.java.net/public/CDDLv1.0.html. 
+See the License for the specific language governing 
+permissions and limitations under the License. 
+ 
+When distributing Covered Code, include this CDDL 
+HEADER in each file and include the License file at 
+glassfish/bootstrap/legal/CDDLv1.0.txt. If applicable, 
+add the following below this CDDL HEADER, with the 
+fields enclosed by brackets "[]" replaced with your 
+own identifying information: Portions Copyright [yyyy] 
+[name of copyright owner] 
+ 
+Copyright 2005 Sun Microsystems, Inc. All rights reserved. 
+ 
+Portions Copyright Apache Software Foundation.
+
+
+=============== APPENDIX. Standard License Files ============== 
+
+
+
+--------------- SECTION 1: Common Development and Distribution License, V1.0 -----------
+
+COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
+
+1. Definitions.
+
+1.1. "Contributor" means each individual or entity that creates or
+contributes to the creation of Modifications.
+
+1.2. "Contributor Version" means the combination of the Original Software,
+prior Modifications used by a Contributor (if any), and the Modifications
+made by that particular Contributor.
+
+1.3. "Covered Software" means (a) the Original Software, or (b)
+Modifications, or (c) the combination of files containing Original
+Software with files containing Modifications, in each case including
+portions thereof.
+
+1.4. "Executable" means the Covered Software in any form other than
+Source Code.
+
+1.5. "Initial Developer" means the individual or entity that first makes
+Original Software available under this License.
+
+1.6. "Larger Work" means a work which combines Covered Software or
+portions thereof with code not governed by the terms of this License.
+
+1.7. "License" means this document.
+
+1.8. "Licensable" means having the right to grant, to the maximum extent
+possible, whether at the time of the initial grant or subsequently
+acquired, any and all of the rights conveyed herein.
+
+1.9. "Modifications" means the Source Code and Executable form of any
+of the following:
+
+    A. Any file that results from an addition to, deletion from or
+    modification of the contents of a file containing Original Software
+    or previous Modifications;
+
+    B. Any new file that contains any part of the Original Software or
+    previous Modification; or
+
+    C. Any new file that is contributed or otherwise made available
+    under the terms of this License.
+
+1.10. "Original Software" means the Source Code and Executable form of
+computer software code that is originally released under this License.
+
+1.11. "Patent Claims" means any patent claim(s), now owned or hereafter
+acquired, including without limitation, method, process, and apparatus
+claims, in any patent Licensable by grantor.
+
+1.12. "Source Code" means (a) the common form of computer software code
+in which modifications are made and (b) associated documentation included
+in or with such code.
+
+1.13. "You" (or "Your") means an individual or a legal entity exercising
+rights under, and complying with all of the terms of, this License. For
+legal entities, "You" includes any entity which controls, is controlled
+by, or is under common control with You. For purposes of this definition,
+"control" means (a) the power, direct or indirect, to cause the direction
+or management of such entity, whether by contract or otherwise, or (b)
+ownership of more than fifty percent (50%) of the outstanding shares or
+beneficial ownership of such entity.
+
+2. License Grants. 
+
+2.1. The Initial Developer Grant.
+
+Conditioned upon Your compliance with Section 3.1 below and subject to
+third party intellectual property claims, the Initial Developer hereby
+grants You a world-wide, royalty-free, non-exclusive license:
+
+    (a) under intellectual property rights (other than patent or
+    trademark) Licensable by Initial Developer, to use, reproduce, modify,
+    display, perform, sublicense and distribute the Original Software
+    (or portions thereof), with or without Modifications, and/or as part
+    of a Larger Work; and
+
+    (b) under Patent Claims infringed by the making, using or selling
+    of Original Software, to make, have made, use, practice, sell, and
+    offer for sale, and/or otherwise dispose of the Original Software
+    (or portions thereof).
+
+    (c) The licenses granted in Sections 2.1(a) and (b) are effective
+    on the date Initial Developer first distributes or otherwise makes
+    the Original Software available to a third party under the terms of
+    this License.
+
+    (d) Notwithstanding Section 2.1(b) above, no patent license is
+    granted: (1) for code that You delete from the Original Software,
+    or (2) for infringements caused by: (i) the modification of the
+    Original Software, or (ii) the combination of the Original Software
+    with other software or devices.
+
+2.2. Contributor Grant.
+
+Conditioned upon Your compliance with Section 3.1 below and subject to
+third party intellectual property claims, each Contributor hereby grants
+You a world-wide, royalty-free, non-exclusive license:
+
+    (a) under intellectual property rights (other than patent or
+    trademark) Licensable by Contributor to use, reproduce, modify,
+    display, perform, sublicense and distribute the Modifications created
+    by such Contributor (or portions thereof), either on an unmodified
+    basis, with other Modifications, as Covered Software and/or as part
+    of a Larger Work; and
+
+    (b) under Patent Claims infringed by the making, using, or selling
+    of Modifications made by that Contributor either alone and/or
+    in combination with its Contributor Version (or portions of such
+    combination), to make, use, sell, offer for sale, have made, and/or
+    otherwise dispose of: (1) Modifications made by that Contributor
+    (or portions thereof); and (2) the combination of Modifications
+    made by that Contributor with its Contributor Version (or portions
+    of such combination).
+
+    (c) The licenses granted in Sections 2.2(a) and 2.2(b) are effective
+    on the date Contributor first distributes or otherwise makes the
+    Modifications available to a third party.
+
+    (d) Notwithstanding Section 2.2(b) above, no patent license is
+    granted: (1) for any code that Contributor has deleted from the
+    Contributor Version; (2) for infringements caused by: (i) third
+    party modifications of Contributor Version, or (ii) the combination
+    of Modifications made by that Contributor with other software
+    (except as part of the Contributor Version) or other devices; or (3)
+    under Patent Claims infringed by Covered Software in the absence of
+    Modifications made by that Contributor.
+
+3. Distribution Obligations.
+
+3.1. Availability of Source Code.
+
+Any Covered Software that You distribute or otherwise make available
+in Executable form must also be made available in Source Code form and
+that Source Code form must be distributed only under the terms of this
+License. You must include a copy of this License with every copy of the
+Source Code form of the Covered Software You distribute or otherwise make
+available. You must inform recipients of any such Covered Software in
+Executable form as to how they can obtain such Covered Software in Source
+Code form in a reasonable manner on or through a medium customarily used
+for software exchange.
+
+3.2. Modifications.
+
+The Modifications that You create or to which You contribute are governed
+by the terms of this License. You represent that You believe Your
+Modifications are Your original creation(s) and/or You have sufficient
+rights to grant the rights conveyed by this License.
+
+3.3. Required Notices.
+
+You must include a notice in each of Your Modifications that identifies
+You as the Contributor of the Modification.  You may not remove or alter
+any copyright, patent or trademark notices contained within the Covered
+Software, or any notices of licensing or any descriptive text giving
+attribution to any Contributor or the Initial Developer.
+
+3.4. Application of Additional Terms.
+
+You may not offer or impose any terms on any Covered Software in Source
+Code form that alters or restricts the applicable version of this License
+or the recipients' rights hereunder. You may choose to offer, and to
+charge a fee for, warranty, support, indemnity or liability obligations to
+one or more recipients of Covered Software.  However, you may do so only
+on Your own behalf, and not on behalf of the Initial Developer or any
+Contributor. You must make it absolutely clear that any such warranty,
+support, indemnity or liability obligation is offered by You alone, and
+You hereby agree to indemnify the Initial Developer and every Contributor
+for any liability incurred by the Initial Developer or such Contributor
+as a result of warranty, support, indemnity or liability terms You offer.
+
+3.5. Distribution of Executable Versions.
+
+You may distribute the Executable form of the Covered Software under the
+terms of this License or under the terms of a license of Your choice,
+which may contain terms different from this License, provided that You are
+in compliance with the terms of this License and that the license for the
+Executable form does not attempt to limit or alter the recipient's rights
+in the Source Code form from the rights set forth in this License. If
+You distribute the Covered Software in Executable form under a different
+license, You must make it absolutely clear that any terms which differ
+from this License are offered by You alone, not by the Initial Developer
+or Contributor. You hereby agree to indemnify the Initial Developer and
+every Contributor for any liability incurred by the Initial Developer
+or such Contributor as a result of any such terms You offer.
+
+3.6. Larger Works.
+
+You may create a Larger Work by combining Covered Software with other code
+not governed by the terms of this License and distribute the Larger Work
+as a single product. In such a case, You must make sure the requirements
+of this License are fulfilled for the Covered Software.
+
+4. Versions of the License. 
+
+4.1. New Versions.
+
+Sun Microsystems, Inc. is the initial license steward and may publish
+revised and/or new versions of this License from time to time. Each
+version will be given a distinguishing version number. Except as provided
+in Section 4.3, no one other than the license steward has the right to
+modify this License.
+
+4.2. Effect of New Versions.
+
+You may always continue to use, distribute or otherwise make the Covered
+Software available under the terms of the version of the License under
+which You originally received the Covered Software. If the Initial
+Developer includes a notice in the Original Software prohibiting it
+from being distributed or otherwise made available under any subsequent
+version of the License, You must distribute and make the Covered Software
+available under the terms of the version of the License under which You
+originally received the Covered Software. Otherwise, You may also choose
+to use, distribute or otherwise make the Covered Software available
+under the terms of any subsequent version of the License published by
+the license steward.
+
+4.3. Modified Versions.
+
+When You are an Initial Developer and You want to create a new license
+for Your Original Software, You may create and use a modified version of
+this License if You: (a) rename the license and remove any references
+to the name of the license steward (except to note that the license
+differs from this License); and (b) otherwise make it clear that the
+license contains terms which differ from this License.
+
+5. DISCLAIMER OF WARRANTY.
+
+COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+WITHOUT LIMITATION, WARRANTIES THAT THE COVERED SOFTWARE IS FREE OF
+DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE
+ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED SOFTWARE
+IS WITH YOU. SHOULD ANY COVERED SOFTWARE PROVE DEFECTIVE IN ANY RESPECT,
+YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST
+OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF
+WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY
+COVERED SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
+
+6. TERMINATION. 
+
+6.1. This License and the rights granted hereunder will terminate
+automatically if You fail to comply with terms herein and fail to cure
+such breach within 30 days of becoming aware of the breach. Provisions
+which, by their nature, must remain in effect beyond the termination of
+this License shall survive.
+
+6.2. If You assert a patent infringement claim (excluding declaratory
+judgment actions) against Initial Developer or a Contributor (the
+Initial Developer or Contributor against whom You assert such claim is
+referred to as "Participant") alleging that the Participant Software
+(meaning the Contributor Version where the Participant is a Contributor
+or the Original Software where the Participant is the Initial Developer)
+directly or indirectly infringes any patent, then any and all rights
+granted directly or indirectly to You by such Participant, the Initial
+Developer (if the Initial Developer is not the Participant) and all
+Contributors under Sections 2.1 and/or 2.2 of this License shall, upon 60
+days notice from Participant terminate prospectively and automatically
+at the expiration of such 60 day notice period, unless if within such
+60 day period You withdraw Your claim with respect to the Participant
+Software against such Participant either unilaterally or pursuant to a
+written agreement with Participant.
+
+6.3. In the event of termination under Sections 6.1 or 6.2 above, all end
+user licenses that have been validly granted by You or any distributor
+hereunder prior to termination (excluding licenses granted to You by
+any distributor) shall survive termination.
+
+7. LIMITATION OF LIABILITY.
+
+UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING
+NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL DEVELOPER, ANY
+OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED SOFTWARE, OR ANY SUPPLIER
+OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL,
+INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT
+LIMITATION, DAMAGES FOR LOST PROFITS, LOSS OF GOODWILL, WORK STOPPAGE,
+COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES
+OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY
+OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY
+FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH PARTY'S NEGLIGENCE TO
+THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS
+DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL
+DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
+
+8. U.S. GOVERNMENT END USERS.
+
+The Covered Software is a "commercial item," as that term is defined
+in 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer
+software" (as that term is defined at 48 C.F.R.  252.227-7014(a)(1)) and
+"commercial computer software documentation" as such terms are used in
+48 C.F.R. 12.212 (Sept.  1995). Consistent with 48 C.F.R. 12.212 and 48
+C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End
+Users acquire Covered Software with only those rights set forth herein.
+This U.S. Government Rights clause is in lieu of, and supersedes, any
+other FAR, DFAR, or other clause or provision that addresses Government
+rights in computer software under this License.
+
+9. MISCELLANEOUS.
+
+This License represents the complete agreement concerning subject matter
+hereof. If any provision of this License is held to be unenforceable,
+such provision shall be reformed only to the extent necessary to make it
+enforceable. This License shall be governed by the law of the jurisdiction
+specified in a notice contained within the Original Software (except to
+the extent applicable law, if any, provides otherwise), excluding such
+jurisdiction's conflict-of-law provisions. Any litigation relating to
+this License shall be subject to the jurisdiction of the courts located
+in the jurisdiction and venue specified in a notice contained within
+the Original Software, with the losing party responsible for costs,
+including, without limitation, court costs and reasonable attorneys'
+fees and expenses. The application of the United Nations Convention on
+Contracts for the International Sale of Goods is expressly excluded. Any
+law or regulation which provides that the language of a contract shall
+be construed against the drafter shall not apply to this License.
+You agree that You alone are responsible for compliance with the United
+States export administration regulations (and the export control laws and
+regulation of any other countries) when You use, distribute or otherwise
+make available any Covered Software.
+
+10. RESPONSIBILITY FOR CLAIMS.
+
+As between Initial Developer and the Contributors, each party is
+responsible for claims and damages arising, directly or indirectly, out
+of its utilization of rights under this License and You agree to work
+with Initial Developer and Contributors to distribute such responsibility
+on an equitable basis. Nothing herein is intended or shall be deemed to
+constitute any admission of liability.
+
+
+
+===========================================================================
+
+To the extent any open source components are licensed under the
+GPL and/or LGPL, or other similar licenses that require the
+source code and/or modifications to source code to be made
+available (as would be noted above), you may obtain a copy of
+the source code corresponding to the binaries for such open
+source components and modifications thereto, if any, (the
+"Source Files"), by downloading the Source Files from Pivotal's website at
+http://www.gopivotal.com/open-source, or by sending a request, 
+with your name and address to: Pivotal Software, Inc., 3496 Deer Creek Rd, 
+Palo Alto, CA 94304, Attention: General Counsel. All such requests should 
+clearly specify: OPEN SOURCE FILES REQUEST, Attention General Counsel. 
+Pivotal shall mail a copy of the Source Files to you on a CD or equivalent physical medium. 
+This offer to obtain a copy of the Source Files is valid for three
+years from the date you acquired this Software product. 
+Alternatively, the Source Files may accompany the Pivotal product.
+
+[GFEHTTPMODULE800GASS072814]

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/65a03287/extensions/gemfire-modules-assembly/release/3rdparty_license/open_source_licenses-Pivotal_GemFire_Modules_8.1.0.txt
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-assembly/release/3rdparty_license/open_source_licenses-Pivotal_GemFire_Modules_8.1.0.txt b/extensions/gemfire-modules-assembly/release/3rdparty_license/open_source_licenses-Pivotal_GemFire_Modules_8.1.0.txt
new file mode 100755
index 0000000..b41b161
--- /dev/null
+++ b/extensions/gemfire-modules-assembly/release/3rdparty_license/open_source_licenses-Pivotal_GemFire_Modules_8.1.0.txt
@@ -0,0 +1,472 @@
+open_source_license.txt
+
+Pivotal GemFire Modules 8.1.0 GA
+
+
+===========================================================================
+
+The following copyright statements and licenses apply to various open
+source software packages (or portions thereof) that are distributed with
+this Pivotal Software, Inc. Product.
+
+The Pivotal Product may also include other Pivotal components, which may
+contain additional open source software packages. One or more such
+open_source_licenses.txt files may therefore accompany this Pivotal
+Product.
+
+The Pivotal Product that includes this file does not necessarily use all
+the open source software packages referred to below and may also only
+use portions of a given package.
+
+
+=============== TABLE OF CONTENTS =============================
+
+
+The following is a listing of the open source components detailed in
+this document. This list is provided for your convenience; please read
+further if you wish to review the copyright notice(s) and the full text
+of the license associated with each component.
+
+
+
+
+
+SECTION 1: BSD-STYLE, MIT-STYLE, OR SIMILAR STYLE LICENSES
+
+   >>> slf4j-1.5.8
+
+
+
+SECTION 2: Common Development and Distribution License, V1.0
+
+   >>> servlet-api-2.5
+
+
+
+APPENDIX. Standard License Files
+
+   >>> Common Development and Distribution License, V1.0
+
+
+
+
+
+--------------- SECTION 1:  BSD-STYLE, MIT-STYLE, OR SIMILAR STYLE LICENSES ----------
+
+BSD-STYLE, MIT-STYLE, OR SIMILAR STYLE LICENSES are applicable to the following component(s).
+
+
+>>> slf4j-1.5.8
+
+Copyright (c) 2004-2008 QOS.ch
+All rights reserved.
+
+Permission is hereby granted, free  of charge, to any person obtaining
+a  copy  of this  software  and  associated  documentation files  (the
+"Software"), to  deal in  the Software without  restriction, including
+without limitation  the rights to  use, copy, modify,  merge, publish,
+distribute,  sublicense, and/or sell  copies of  the Software,  and to
+permit persons to whom the Software  is furnished to do so, subject to
+the following conditions:
+
+The  above  copyright  notice  and  this permission  notice  shall  be
+included in all copies or substantial portions of the Software.
+
+THE  SOFTWARE IS  PROVIDED  "AS  IS", WITHOUT  WARRANTY  OF ANY  KIND,
+EXPRESS OR  IMPLIED, INCLUDING  BUT NOT LIMITED  TO THE  WARRANTIES OF
+MERCHANTABILITY,    FITNESS    FOR    A   PARTICULAR    PURPOSE    AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE,  ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+
+--------------- SECTION 2: Common Development and Distribution License, V1.0 ----------
+
+Common Development and Distribution License, V1.0 is applicable to the following component(s).
+
+
+>>> servlet-api-2.5
+
+The contents of this file are subject to the terms 
+of the Common Development and Distribution License 
+(the "License"). You may not use this file except 
+in compliance with the License. 
+ 
+You can obtain a copy of the license at 
+glassfish/bootstrap/legal/CDDLv1.0.txt or 
+https://glassfish.dev.java.net/public/CDDLv1.0.html. 
+See the License for the specific language governing 
+permissions and limitations under the License. 
+ 
+When distributing Covered Code, include this CDDL 
+HEADER in each file and include the License file at 
+glassfish/bootstrap/legal/CDDLv1.0.txt. If applicable, 
+add the following below this CDDL HEADER, with the 
+fields enclosed by brackets "[]" replaced with your 
+own identifying information: Portions Copyright [yyyy] 
+[name of copyright owner] 
+ 
+Copyright 2005 Sun Microsystems, Inc. All rights reserved. 
+ 
+Portions Copyright Apache Software Foundation.
+
+
+
+=============== APPENDIX. Standard License Files ============== 
+
+
+
+--------------- SECTION 1: Common Development and Distribution License, V1.0 -----------
+
+COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
+
+1. Definitions.
+
+1.1. "Contributor" means each individual or entity that creates or
+contributes to the creation of Modifications.
+
+1.2. "Contributor Version" means the combination of the Original Software,
+prior Modifications used by a Contributor (if any), and the Modifications
+made by that particular Contributor.
+
+1.3. "Covered Software" means (a) the Original Software, or (b)
+Modifications, or (c) the combination of files containing Original
+Software with files containing Modifications, in each case including
+portions thereof.
+
+1.4. "Executable" means the Covered Software in any form other than
+Source Code.
+
+1.5. "Initial Developer" means the individual or entity that first makes
+Original Software available under this License.
+
+1.6. "Larger Work" means a work which combines Covered Software or
+portions thereof with code not governed by the terms of this License.
+
+1.7. "License" means this document.
+
+1.8. "Licensable" means having the right to grant, to the maximum extent
+possible, whether at the time of the initial grant or subsequently
+acquired, any and all of the rights conveyed herein.
+
+1.9. "Modifications" means the Source Code and Executable form of any
+of the following:
+
+    A. Any file that results from an addition to, deletion from or
+    modification of the contents of a file containing Original Software
+    or previous Modifications;
+
+    B. Any new file that contains any part of the Original Software or
+    previous Modification; or
+
+    C. Any new file that is contributed or otherwise made available
+    under the terms of this License.
+
+1.10. "Original Software" means the Source Code and Executable form of
+computer software code that is originally released under this License.
+
+1.11. "Patent Claims" means any patent claim(s), now owned or hereafter
+acquired, including without limitation, method, process, and apparatus
+claims, in any patent Licensable by grantor.
+
+1.12. "Source Code" means (a) the common form of computer software code
+in which modifications are made and (b) associated documentation included
+in or with such code.
+
+1.13. "You" (or "Your") means an individual or a legal entity exercising
+rights under, and complying with all of the terms of, this License. For
+legal entities, "You" includes any entity which controls, is controlled
+by, or is under common control with You. For purposes of this definition,
+"control" means (a) the power, direct or indirect, to cause the direction
+or management of such entity, whether by contract or otherwise, or (b)
+ownership of more than fifty percent (50%) of the outstanding shares or
+beneficial ownership of such entity.
+
+2. License Grants. 
+
+2.1. The Initial Developer Grant.
+
+Conditioned upon Your compliance with Section 3.1 below and subject to
+third party intellectual property claims, the Initial Developer hereby
+grants You a world-wide, royalty-free, non-exclusive license:
+
+    (a) under intellectual property rights (other than patent or
+    trademark) Licensable by Initial Developer, to use, reproduce, modify,
+    display, perform, sublicense and distribute the Original Software
+    (or portions thereof), with or without Modifications, and/or as part
+    of a Larger Work; and
+
+    (b) under Patent Claims infringed by the making, using or selling
+    of Original Software, to make, have made, use, practice, sell, and
+    offer for sale, and/or otherwise dispose of the Original Software
+    (or portions thereof).
+
+    (c) The licenses granted in Sections 2.1(a) and (b) are effective
+    on the date Initial Developer first distributes or otherwise makes
+    the Original Software available to a third party under the terms of
+    this License.
+
+    (d) Notwithstanding Section 2.1(b) above, no patent license is
+    granted: (1) for code that You delete from the Original Software,
+    or (2) for infringements caused by: (i) the modification of the
+    Original Software, or (ii) the combination of the Original Software
+    with other software or devices.
+
+2.2. Contributor Grant.
+
+Conditioned upon Your compliance with Section 3.1 below and subject to
+third party intellectual property claims, each Contributor hereby grants
+You a world-wide, royalty-free, non-exclusive license:
+
+    (a) under intellectual property rights (other than patent or
+    trademark) Licensable by Contributor to use, reproduce, modify,
+    display, perform, sublicense and distribute the Modifications created
+    by such Contributor (or portions thereof), either on an unmodified
+    basis, with other Modifications, as Covered Software and/or as part
+    of a Larger Work; and
+
+    (b) under Patent Claims infringed by the making, using, or selling
+    of Modifications made by that Contributor either alone and/or
+    in combination with its Contributor Version (or portions of such
+    combination), to make, use, sell, offer for sale, have made, and/or
+    otherwise dispose of: (1) Modifications made by that Contributor
+    (or portions thereof); and (2) the combination of Modifications
+    made by that Contributor with its Contributor Version (or portions
+    of such combination).
+
+    (c) The licenses granted in Sections 2.2(a) and 2.2(b) are effective
+    on the date Contributor first distributes or otherwise makes the
+    Modifications available to a third party.
+
+    (d) Notwithstanding Section 2.2(b) above, no patent license is
+    granted: (1) for any code that Contributor has deleted from the
+    Contributor Version; (2) for infringements caused by: (i) third
+    party modifications of Contributor Version, or (ii) the combination
+    of Modifications made by that Contributor with other software
+    (except as part of the Contributor Version) or other devices; or (3)
+    under Patent Claims infringed by Covered Software in the absence of
+    Modifications made by that Contributor.
+
+3. Distribution Obligations.
+
+3.1. Availability of Source Code.
+
+Any Covered Software that You distribute or otherwise make available
+in Executable form must also be made available in Source Code form and
+that Source Code form must be distributed only under the terms of this
+License. You must include a copy of this License with every copy of the
+Source Code form of the Covered Software You distribute or otherwise make
+available. You must inform recipients of any such Covered Software in
+Executable form as to how they can obtain such Covered Software in Source
+Code form in a reasonable manner on or through a medium customarily used
+for software exchange.
+
+3.2. Modifications.
+
+The Modifications that You create or to which You contribute are governed
+by the terms of this License. You represent that You believe Your
+Modifications are Your original creation(s) and/or You have sufficient
+rights to grant the rights conveyed by this License.
+
+3.3. Required Notices.
+
+You must include a notice in each of Your Modifications that identifies
+You as the Contributor of the Modification.  You may not remove or alter
+any copyright, patent or trademark notices contained within the Covered
+Software, or any notices of licensing or any descriptive text giving
+attribution to any Contributor or the Initial Developer.
+
+3.4. Application of Additional Terms.
+
+You may not offer or impose any terms on any Covered Software in Source
+Code form that alters or restricts the applicable version of this License
+or the recipients' rights hereunder. You may choose to offer, and to
+charge a fee for, warranty, support, indemnity or liability obligations to
+one or more recipients of Covered Software.  However, you may do so only
+on Your own behalf, and not on behalf of the Initial Developer or any
+Contributor. You must make it absolutely clear that any such warranty,
+support, indemnity or liability obligation is offered by You alone, and
+You hereby agree to indemnify the Initial Developer and every Contributor
+for any liability incurred by the Initial Developer or such Contributor
+as a result of warranty, support, indemnity or liability terms You offer.
+
+3.5. Distribution of Executable Versions.
+
+You may distribute the Executable form of the Covered Software under the
+terms of this License or under the terms of a license of Your choice,
+which may contain terms different from this License, provided that You are
+in compliance with the terms of this License and that the license for the
+Executable form does not attempt to limit or alter the recipient's rights
+in the Source Code form from the rights set forth in this License. If
+You distribute the Covered Software in Executable form under a different
+license, You must make it absolutely clear that any terms which differ
+from this License are offered by You alone, not by the Initial Developer
+or Contributor. You hereby agree to indemnify the Initial Developer and
+every Contributor for any liability incurred by the Initial Developer
+or such Contributor as a result of any such terms You offer.
+
+3.6. Larger Works.
+
+You may create a Larger Work by combining Covered Software with other code
+not governed by the terms of this License and distribute the Larger Work
+as a single product. In such a case, You must make sure the requirements
+of this License are fulfilled for the Covered Software.
+
+4. Versions of the License. 
+
+4.1. New Versions.
+
+Sun Microsystems, Inc. is the initial license steward and may publish
+revised and/or new versions of this License from time to time. Each
+version will be given a distinguishing version number. Except as provided
+in Section 4.3, no one other than the license steward has the right to
+modify this License.
+
+4.2. Effect of New Versions.
+
+You may always continue to use, distribute or otherwise make the Covered
+Software available under the terms of the version of the License under
+which You originally received the Covered Software. If the Initial
+Developer includes a notice in the Original Software prohibiting it
+from being distributed or otherwise made available under any subsequent
+version of the License, You must distribute and make the Covered Software
+available under the terms of the version of the License under which You
+originally received the Covered Software. Otherwise, You may also choose
+to use, distribute or otherwise make the Covered Software available
+under the terms of any subsequent version of the License published by
+the license steward.
+
+4.3. Modified Versions.
+
+When You are an Initial Developer and You want to create a new license
+for Your Original Software, You may create and use a modified version of
+this License if You: (a) rename the license and remove any references
+to the name of the license steward (except to note that the license
+differs from this License); and (b) otherwise make it clear that the
+license contains terms which differ from this License.
+
+5. DISCLAIMER OF WARRANTY.
+
+COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+WITHOUT LIMITATION, WARRANTIES THAT THE COVERED SOFTWARE IS FREE OF
+DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE
+ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED SOFTWARE
+IS WITH YOU. SHOULD ANY COVERED SOFTWARE PROVE DEFECTIVE IN ANY RESPECT,
+YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST
+OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF
+WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY
+COVERED SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
+
+6. TERMINATION. 
+
+6.1. This License and the rights granted hereunder will terminate
+automatically if You fail to comply with terms herein and fail to cure
+such breach within 30 days of becoming aware of the breach. Provisions
+which, by their nature, must remain in effect beyond the termination of
+this License shall survive.
+
+6.2. If You assert a patent infringement claim (excluding declaratory
+judgment actions) against Initial Developer or a Contributor (the
+Initial Developer or Contributor against whom You assert such claim is
+referred to as "Participant") alleging that the Participant Software
+(meaning the Contributor Version where the Participant is a Contributor
+or the Original Software where the Participant is the Initial Developer)
+directly or indirectly infringes any patent, then any and all rights
+granted directly or indirectly to You by such Participant, the Initial
+Developer (if the Initial Developer is not the Participant) and all
+Contributors under Sections 2.1 and/or 2.2 of this License shall, upon 60
+days notice from Participant terminate prospectively and automatically
+at the expiration of such 60 day notice period, unless if within such
+60 day period You withdraw Your claim with respect to the Participant
+Software against such Participant either unilaterally or pursuant to a
+written agreement with Participant.
+
+6.3. In the event of termination under Sections 6.1 or 6.2 above, all end
+user licenses that have been validly granted by You or any distributor
+hereunder prior to termination (excluding licenses granted to You by
+any distributor) shall survive termination.
+
+7. LIMITATION OF LIABILITY.
+
+UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING
+NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL DEVELOPER, ANY
+OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED SOFTWARE, OR ANY SUPPLIER
+OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL,
+INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT
+LIMITATION, DAMAGES FOR LOST PROFITS, LOSS OF GOODWILL, WORK STOPPAGE,
+COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES
+OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY
+OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY
+FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH PARTY'S NEGLIGENCE TO
+THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS
+DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL
+DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
+
+8. U.S. GOVERNMENT END USERS.
+
+The Covered Software is a "commercial item," as that term is defined
+in 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer
+software" (as that term is defined at 48 C.F.R.  252.227-7014(a)(1)) and
+"commercial computer software documentation" as such terms are used in
+48 C.F.R. 12.212 (Sept.  1995). Consistent with 48 C.F.R. 12.212 and 48
+C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End
+Users acquire Covered Software with only those rights set forth herein.
+This U.S. Government Rights clause is in lieu of, and supersedes, any
+other FAR, DFAR, or other clause or provision that addresses Government
+rights in computer software under this License.
+
+9. MISCELLANEOUS.
+
+This License represents the complete agreement concerning subject matter
+hereof. If any provision of this License is held to be unenforceable,
+such provision shall be reformed only to the extent necessary to make it
+enforceable. This License shall be governed by the law of the jurisdiction
+specified in a notice contained within the Original Software (except to
+the extent applicable law, if any, provides otherwise), excluding such
+jurisdiction's conflict-of-law provisions. Any litigation relating to
+this License shall be subject to the jurisdiction of the courts located
+in the jurisdiction and venue specified in a notice contained within
+the Original Software, with the losing party responsible for costs,
+including, without limitation, court costs and reasonable attorneys'
+fees and expenses. The application of the United Nations Convention on
+Contracts for the International Sale of Goods is expressly excluded. Any
+law or regulation which provides that the language of a contract shall
+be construed against the drafter shall not apply to this License.
+You agree that You alone are responsible for compliance with the United
+States export administration regulations (and the export control laws and
+regulation of any other countries) when You use, distribute or otherwise
+make available any Covered Software.
+
+10. RESPONSIBILITY FOR CLAIMS.
+
+As between Initial Developer and the Contributors, each party is
+responsible for claims and damages arising, directly or indirectly, out
+of its utilization of rights under this License and You agree to work
+with Initial Developer and Contributors to distribute such responsibility
+on an equitable basis. Nothing herein is intended or shall be deemed to
+constitute any admission of liability.
+
+
+
+===========================================================================
+
+To the extent any open source components are licensed under the
+GPL and/or LGPL, or other similar licenses that require the
+source code and/or modifications to source code to be made
+available (as would be noted above), you may obtain a copy of
+the source code corresponding to the binaries for such open
+source components and modifications thereto, if any, (the
+"Source Files"), by downloading the Source Files from Pivotal's website at
+http://www.pivotal.io/open-source, or by sending a request, 
+with your name and address to: Pivotal Software, Inc., 3496 Deer Creek Rd, 
+Palo Alto, CA 94304, Attention: General Counsel. All such requests should 
+clearly specify: OPEN SOURCE FILES REQUEST, Attention General Counsel. 
+Pivotal shall mail a copy of the Source Files to you on a CD or equivalent physical medium. 
+This offer to obtain a copy of the Source Files is valid for three
+years from the date you acquired this Software product. 
+Alternatively, the Source Files may accompany the Pivotal product.
+
+
+[GFEHTTPMODULE810GAKD120914]
\ No newline at end of file


[16/24] incubator-geode git commit: GEODE-14: Adding session replication assembly module

Posted by je...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/65a03287/extensions/gemfire-modules-assembly/release/tomcat/readme.txt
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-assembly/release/tomcat/readme.txt b/extensions/gemfire-modules-assembly/release/tomcat/readme.txt
new file mode 100644
index 0000000..4830780
--- /dev/null
+++ b/extensions/gemfire-modules-assembly/release/tomcat/readme.txt
@@ -0,0 +1,14 @@
+Pivotal(TM) GemFire(R) HTTP Session Management Module @VERSION@ for Tomcat
+
+This module provides fast, scalable, and reliable HTTP session replication for Apache Tomcat.
+
+Access all Pivotal GemFire Documentation at:
+http://gemfire.docs.pivotal.io
+
+Pivotal Support Services can be accessed from the Pivotal or VMware website.
+Access varies by license type, support offering (contract or per-incident) and 
+product. Please see the Pivotal page at http://www.pivotal.io/support or to 
+file a VMware Support Request, please see the VMware page at 
+https://www.vmware.com/support/policies/howto.html for information on "How to 
+File a Support Request."
+

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/65a03287/settings.gradle
----------------------------------------------------------------------
diff --git a/settings.gradle b/settings.gradle
index a4b7395..c49100c 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -30,6 +30,7 @@ include 'extensions/gemfire-modules'
 include 'extensions/gemfire-modules-tomcat7'
 include 'extensions/gemfire-modules-hibernate'
 include 'extensions/gemfire-modules-session'
+include 'extensions/gemfire-modules-assembly'
 
 def minimumGradleVersion = '2.3'
 if (GradleVersion.current() < GradleVersion.version(minimumGradleVersion)) {


[12/24] incubator-geode git commit: GEODE-14: Added session replication integration tests

Posted by je...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/890d62e3/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/junit/ChildFirstClassLoader.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/junit/ChildFirstClassLoader.java b/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/junit/ChildFirstClassLoader.java
deleted file mode 100644
index b566d05..0000000
--- a/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/junit/ChildFirstClassLoader.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-package com.gemstone.gemfire.modules.junit;
-
-import java.net.URL;
-import java.net.URLClassLoader;
-
-public class ChildFirstClassLoader extends URLClassLoader {
-
-  public ChildFirstClassLoader() {
-    super(new URL[]{});
-  }
-
-  public ChildFirstClassLoader(URL[] urls) {
-    super(urls);
-  }
-
-  public ChildFirstClassLoader(URL[] urls, ClassLoader parent) {
-    super(urls, parent);
-  }
-
-  @Override
-  public void addURL(URL url) {
-    super.addURL(url);
-  }
-
-  @Override
-  public Class loadClass(String name) throws ClassNotFoundException {
-    return loadClass(name, false);
-  }
-
-  /**
-   * We override the parent-first behavior established by
-   * java.lang.Classloader.
-   */
-  @Override
-  protected Class loadClass(String name, boolean resolve)
-      throws ClassNotFoundException {
-    Class c = null;
-
-    if (name.startsWith("com.gemstone")) {
-      // First, check if the class has already been loaded
-      c = findLoadedClass(name);
-
-      // if not loaded, search the local (child) resources
-      if (c == null) {
-        try {
-          c = findClass(name);
-        } catch (ClassNotFoundException cnfe) {
-          // ignore
-        }
-      }
-    }
-
-    // if we could not find it, delegate to parent
-    // Note that we don't attempt to catch any ClassNotFoundException
-    if (c == null) {
-      if (getParent() != null) {
-        c = getParent().loadClass(name);
-      } else {
-        c = getSystemClassLoader().loadClass(name);
-      }
-    }
-
-    if (resolve) {
-      resolveClass(c);
-    }
-
-    return c;
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/890d62e3/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/junit/NamedRunner.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/junit/NamedRunner.java b/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/junit/NamedRunner.java
deleted file mode 100644
index 9a3ec3c..0000000
--- a/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/junit/NamedRunner.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-package com.gemstone.gemfire.modules.junit;
-
-/**
- * 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.
- */
-
-import org.junit.runner.notification.RunNotifier;
-import org.junit.runners.BlockJUnit4ClassRunner;
-import org.junit.runners.model.FrameworkMethod;
-import org.junit.runners.model.InitializationError;
-
-/**
- * A Junit 4 runner that stores the name of the method that runs.  The methods
- * marked with @After and @Before (but also the Test method itself) can request
- * this name for which it is running.
- *
- * @author Rudy De Busscher
- */
-public class NamedRunner extends BlockJUnit4ClassRunner {
-
-  /**
-   * The Constant PREFIX_KEY.
-   */
-  private static final String PREFIX_KEY = "ClassLoaderRunner_TestMethodName_";
-
-  /**
-   * The Constant NO_NAME.
-   */
-  private static final String NO_NAME = "null";
-
-  /**
-   * Instantiates a new named runner.
-   *
-   * @param klass the klass
-   * @throws InitializationError the initialization error
-   */
-  public NamedRunner(Class<?> klass) throws InitializationError {
-    super(klass);
-  }
-
-  @Override
-  protected void runChild(FrameworkMethod method, RunNotifier notifier)
-
-  {
-    storeTestMethodName(method.getName());
-    super.runChild(method, notifier);
-    removeTestMethodName();
-  }
-
-  /**
-   * Gets the test method name.
-   *
-   * @return the test method name
-   */
-  public static String getTestMethodName() {
-    return retrieveTestMethodName();
-  }
-
-  /**
-   * Retrieve test method name.
-   *
-   * @return the string
-   */
-  private static String retrieveTestMethodName() {
-    // We can't use a ThreadLocal variable in the case the TestPerClassLoader runner is used.  Then this
-    // Method is accessed from another classloader and thus reinitialized variables.
-    String result = null;
-    String storedName = System.getProperty(getKey());
-    if (!NO_NAME.equals(storedName)) {
-      result = storedName;
-    }
-    return result;
-  }
-
-  /**
-   * Removes the test method name.
-   */
-  private static void removeTestMethodName() {
-    // We can't use a ThreadLocal variable in the case the TestPerClassLoader runner is used.  Then this
-    // Method is accessed from another classloader and thus reinitialized variables.
-    System.setProperty(getKey(), NO_NAME);
-
-  }
-
-  /**
-   * Store test method name.
-   *
-   * @param name the name
-   */
-  private static void storeTestMethodName(String name) {
-
-    // We can't use a ThreadLocal variable in the case the TestPerClassLoader runner is used.  Then this
-    // Method is accessed from another classloader and thus reinitialized variables.
-    System.setProperty(getKey(), name);
-  }
-
-  /**
-   * Gets the key.
-   *
-   * @return the key
-   */
-  private static String getKey() {
-    StringBuffer buffer = new StringBuffer();
-    buffer.append(PREFIX_KEY).append(Thread.currentThread().getName());
-    return buffer.toString();
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/890d62e3/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/junit/PerTestClassLoaderRunner.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/junit/PerTestClassLoaderRunner.java b/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/junit/PerTestClassLoaderRunner.java
deleted file mode 100644
index fce6471..0000000
--- a/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/junit/PerTestClassLoaderRunner.java
+++ /dev/null
@@ -1,273 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-package com.gemstone.gemfire.modules.junit;
-
-/**
- * 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
- * <p/>
- * http://www.apache.org/licenses/LICENSE-2.0
- * <p/>
- * 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.
- */
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.internal.runners.statements.Fail;
-import org.junit.internal.runners.statements.RunAfters;
-import org.junit.internal.runners.statements.RunBefores;
-import org.junit.runners.model.FrameworkMethod;
-import org.junit.runners.model.InitializationError;
-import org.junit.runners.model.Statement;
-import org.junit.runners.model.TestClass;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Method;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.StringTokenizer;
-import java.util.logging.Logger;
-
-public class PerTestClassLoaderRunner extends NamedRunner {
-  private static final Logger LOGGER = Logger
-      .getLogger(PerTestClassLoaderRunner.class.getName());
-
-  // The classpath is needed because the custom class loader looks there to find the classes.
-  private static String classPath;
-  private static boolean classPathDetermined = false;
-
-  // Some data related to the class from the custom class loader.
-  private TestClass testClassFromClassLoader;
-  private Object beforeFromClassLoader;
-  private Object afterFromClassLoader;
-
-  /**
-   * Instantiates a new test per class loader runner.
-   *
-   * @param klass the klass
-   * @throws InitializationError the initialization error
-   */
-  public PerTestClassLoaderRunner(Class<?> klass) throws InitializationError {
-    super(klass);
-  }
-
-  @Override
-  protected Object createTest() throws Exception {
-    // Need an instance now from the class loaded by the custom loader.
-    return testClassFromClassLoader.getJavaClass().newInstance();
-  }
-
-  /**
-   * Load classes (TestCase, @Before and @After with custom class loader.
-   *
-   * @throws ClassNotFoundException the class not found exception
-   */
-  private void loadClassesWithCustomClassLoader()
-      throws ClassNotFoundException {
-    String classPath = System.getProperty("java.class.path");
-    StringTokenizer st = new StringTokenizer(classPath, ":");
-    List<URL> urls = new ArrayList<URL>();
-    while (st.hasMoreTokens()) {
-      String u = st.nextToken();
-      try {
-        if (!u.endsWith(".jar")) {
-          u += "/";
-        }
-        URL url = new URL("file://" + u);
-        urls.add(url);
-      } catch (MalformedURLException e) {
-        e.printStackTrace();
-      }
-    }
-
-    ClassLoader classLoader = new ChildFirstClassLoader(
-        urls.toArray(new URL[]{}),
-        Thread.currentThread().getContextClassLoader()
-    );
-
-    Thread.currentThread().setContextClassLoader(classLoader);
-
-    testClassFromClassLoader = new TestClass(classLoader
-        .loadClass(getTestClass().getJavaClass().getName()));
-    // See withAfters and withBefores for the reason.
-    beforeFromClassLoader = classLoader.loadClass(Before.class.getName());
-    afterFromClassLoader = classLoader.loadClass(After.class.getName());
-  }
-
-  @Override
-  protected Statement methodBlock(FrameworkMethod method) {
-    FrameworkMethod newMethod = null;
-    try {
-      // Need the class from the custom loader now, so lets load the class.
-      loadClassesWithCustomClassLoader();
-      // The method as parameter is from the original class and thus not found in our
-      // class loaded by the custom name (reflection is class loader sensitive)
-      // So find the same method but now in the class from the class Loader.
-      Method methodFromNewlyLoadedClass = testClassFromClassLoader
-          .getJavaClass().getMethod(method.getName());
-      newMethod = new FrameworkMethod(methodFromNewlyLoadedClass);
-    } catch (ClassNotFoundException e) {
-      // Show any problem nicely as a JUnit Test failure.
-      return new Fail(e);
-    } catch (SecurityException e) {
-      return new Fail(e);
-    } catch (NoSuchMethodException e) {
-      return new Fail(e);
-    }
-
-    // We can carry out the normal JUnit functionality with our newly discovered method now.
-    return super.methodBlock(newMethod);
-  }
-
-  @SuppressWarnings("unchecked")
-  @Override
-  protected Statement withAfters(FrameworkMethod method, Object target,
-      Statement statement) {
-    // We now to need to search in the class from the custom loader.
-    // We also need to search with the annotation loaded by the custom
-    // class loader or otherwise we don't find any method.
-    List<FrameworkMethod> afters = testClassFromClassLoader
-        .getAnnotatedMethods(
-            (Class<? extends Annotation>) afterFromClassLoader);
-    return new RunAfters(statement, afters, target);
-  }
-
-  @SuppressWarnings("unchecked")
-  @Override
-  protected Statement withBefores(FrameworkMethod method, Object target,
-      Statement statement) {
-    // We now to need to search in the class from the custom loader.
-    // We also need to search with the annotation loaded by the custom
-    // class loader or otherwise we don't find any method.
-    List<FrameworkMethod> befores = testClassFromClassLoader
-        .getAnnotatedMethods(
-            (Class<? extends Annotation>) beforeFromClassLoader);
-    return new RunBefores(statement, befores, target);
-  }
-
-//    /**
-//     * Gets the class path. This value is cached in a static variable for performance reasons.
-//     *
-//     * @return the class path
-//     */
-//    private static String getClassPath()
-//    {
-//        if (classPathDetermined)
-//        {
-//            return classPath;
-//        }
-//
-//        classPathDetermined = true;
-//        // running from maven, we have the classpath in this property.
-//        classPath = System.getProperty("surefire.test.class.path");
-//        if (classPath != null)
-//        {
-//            return classPath;
-//        }
-//
-//        // For a multi module project, running it from the top we have to find it using another way.
-//        // We also need to set useSystemClassLoader=true in the POM so that we gets a jar with the classpath in it.
-//        String booterClassPath = System.getProperty("java.class.path");
-//        Vector<String> pathItems = null;
-//        if (booterClassPath != null)
-//        {
-//            pathItems = scanPath(booterClassPath);
-//        }
-//        // Do we have just 1 entry as classpath which is a jar?
-//        if (pathItems != null && pathItems.size() == 1
-//                && isJar((String) pathItems.get(0)))
-//        {
-//            classPath = loadJarManifestClassPath((String) pathItems.get(0),
-//                    "META-INF/MANIFEST.MF");
-//        }
-//        return classPath;
-//
-//    }
-
-//    /**
-//     * Load jar manifest class path.
-//     *
-//     * @param path the path
-//     * @param fileName the file name
-//     *
-//     * @return the string
-//     */
-//    private static String loadJarManifestClassPath(String path, String fileName)
-//    {
-//        File archive = new File(path);
-//        if (!archive.exists()) {
-//            return null;
-//        }
-//        ZipFile zipFile = null;
-//
-//        try {
-//            zipFile = new ZipFile(archive);
-//        } catch (IOException io) {
-//            return null;
-//        }
-//
-//        ZipEntry entry = zipFile.getEntry(fileName);
-//        if (entry == null) {
-//            return null;
-//        } try {
-//            Manifest mf = new Manifest();
-//            mf.read(zipFile.getInputStream(entry));
-//
-//            return mf.getMainAttributes().getValue(Attributes.Name.CLASS_PATH)
-//                    .replaceAll(" ", System.getProperty("path.separator"))
-//                    .replaceAll("file:/", "");
-//        } catch (MalformedURLException e) {
-//            LOGGER.throwing("ClassLoaderTestSuite", "loadJarManifestClassPath", e);
-//        } catch (IOException e) {
-//            LOGGER.throwing("ClassLoaderTestSuite", "loadJarManifestClassPath", e);
-//        }
-//        return null;
-//    }
-//
-//    /**
-//     * Checks if is jar.
-//     *
-//     * @param pathEntry the path entry
-//     *
-//     * @return true, if is jar
-//     */
-//    private static boolean isJar(String pathEntry)
-//    {
-//        return pathEntry.endsWith(".jar") || pathEntry.endsWith(".zip");
-//    }
-//
-//    /**
-//     * Scan path for all directories.
-//     *
-//     * @param classPath the class path
-//     *
-//     * @return the vector< string>
-//     */
-//    private static Vector<String> scanPath(String classPath)
-//    {
-//        String separator = System.getProperty("path.separator");
-//        Vector<String> pathItems = new Vector<String>(10);
-//        StringTokenizer st = new StringTokenizer(classPath, separator);
-//        while (st.hasMoreTokens())
-//        {
-//            pathItems.addElement(st.nextToken());
-//        }
-//        return pathItems;
-//    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/890d62e3/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/BasicServlet.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/BasicServlet.java b/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/BasicServlet.java
deleted file mode 100644
index 2c1d7e4..0000000
--- a/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/BasicServlet.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-package com.gemstone.gemfire.modules.session.internal.filter;
-
-import java.io.IOException;
-import javax.servlet.ServletConfig;
-import javax.servlet.ServletContext;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.eclipse.jetty.servlet.DefaultServlet;
-/**
- *
- */
-public class BasicServlet extends DefaultServlet {
-
-  Callback callback = null;
-
-  @Override
-  public void doGet(HttpServletRequest request, HttpServletResponse response)
-      throws IOException, ServletException {
-
-    if (callback != null) {
-      callback.call(request, response);
-    }
-  }
-
-  @Override
-  public void init(ServletConfig config) throws ServletException {
-    super.init(config);
-    ServletContext context = config.getServletContext();
-
-    String cbInitParam = config.getInitParameter("test.callback");
-    callback = (Callback) context.getAttribute(cbInitParam);
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/890d62e3/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionListenerImpl2.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionListenerImpl2.java b/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionListenerImpl2.java
deleted file mode 100644
index ea39f65..0000000
--- a/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionListenerImpl2.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-
-package com.gemstone.gemfire.modules.session.internal.filter;
-
-import com.gemstone.gemfire.modules.session.filter.SessionCachingFilter;
-
-import javax.servlet.http.HttpSession;
-import javax.servlet.http.HttpSessionEvent;
-import javax.servlet.http.HttpSessionListener;
-
-/**
- * @author jdeppe
- */
-public class HttpSessionListenerImpl2 extends AbstractListener
-    implements HttpSessionListener {
-
-  @Override
-  public void sessionCreated(HttpSessionEvent se) {
-    events.add(ListenerEventType.SESSION_CREATED);
-    latch.countDown();
-  }
-
-  @Override
-  public void sessionDestroyed(HttpSessionEvent se) {
-    HttpSession gfeSession = SessionCachingFilter.getWrappingSession(
-        se.getSession());
-    assert (gfeSession != null);
-    events.add(ListenerEventType.SESSION_DESTROYED);
-    latch.countDown();
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/890d62e3/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/IntegrationTest.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/IntegrationTest.java b/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/IntegrationTest.java
deleted file mode 100644
index 11d1029..0000000
--- a/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/IntegrationTest.java
+++ /dev/null
@@ -1,1553 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-package com.gemstone.gemfire.modules.session.internal.filter;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.util.ArrayList;
-import java.util.EnumSet;
-import java.util.Enumeration;
-import java.util.List;
-import java.util.StringTokenizer;
-import java.util.concurrent.TimeUnit;
-import javax.servlet.DispatcherType;
-import javax.servlet.RequestDispatcher;
-import javax.servlet.ServletException;
-import javax.servlet.http.Cookie;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpSession;
-
-import com.gemstone.gemfire.cache.Region;
-import com.gemstone.gemfire.modules.junit.PerTestClassLoaderRunner;
-import com.gemstone.gemfire.modules.session.filter.SessionCachingFilter;
-import org.apache.jasper.servlet.JspServlet;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.eclipse.jetty.servlet.FilterHolder;
-import org.eclipse.jetty.servlet.ServletHolder;
-import org.eclipse.jetty.http.HttpTester;
-
-import static org.junit.Assert.*;
-
-/**
- * In-container testing using Jetty. This allows us to test context listener
- * events as well as dispatching actions.
- */
-@RunWith(PerTestClassLoaderRunner.class)
-public class IntegrationTest {
-
-  private MyServletTester tester;
-
-  private HttpTester.Request request;
-
-  private HttpTester.Response response;
-
-  private ServletHolder servletHolder;
-
-  private FilterHolder filterHolder;
-
-  private static final File tmpdir;
-
-  private static final String gemfire_log;
-
-  static {
-    // Create a per-user scratch directory
-    tmpdir = new File(System.getProperty("java.io.tmpdir"),
-        "gemfire_modules-" + System.getProperty("user.name"));
-    tmpdir.mkdirs();
-    tmpdir.deleteOnExit();
-
-    gemfire_log = tmpdir.getPath() +
-        System.getProperty("file.separator") + "gemfire_modules.log";
-  }
-
-  @Before
-  public void setUp() throws Exception {
-    request = HttpTester.newRequest();
-
-    tester = new MyServletTester();
-    tester.setContextPath("/test");
-
-    filterHolder = tester.addFilter(SessionCachingFilter.class, "/*",
-        EnumSet.of(DispatcherType.REQUEST));
-    filterHolder.setInitParameter("gemfire.property.mcast-port", "0");
-    filterHolder.setInitParameter("gemfire.property.writable-working-dir",
-        tmpdir.getPath());
-    filterHolder.setInitParameter("cache-type", "peer-to-peer");
-    filterHolder.setInitParameter("gemfire.property.log-file",
-        gemfire_log);
-
-    servletHolder = tester.addServlet(BasicServlet.class, "/hello");
-    servletHolder.setInitParameter("test.callback", "callback_1");
-
-    /**
-     * This starts the servlet. Our wrapped servlets *must* start
-     * immediately otherwise the ServletContext is not captured correctly.
-     */
-    servletHolder.setInitOrder(0);
-  }
-
-  @After
-  public void tearDown() throws Exception {
-    if (tester.isStarted()) {
-      ContextManager.getInstance().removeContext(
-          servletHolder.getServlet().getServletConfig().getServletContext());
-    }
-    tester.stop();
-  }
-
-  @Test
-  public void testSanity() throws Exception {
-    Callback c = new Callback() {
-      @Override
-      public void call(HttpServletRequest request, HttpServletResponse response)
-          throws IOException {
-        PrintWriter out = response.getWriter();
-        out.write("Hello World");
-      }
-    };
-
-    tester.setAttribute("callback_1", c);
-    tester.start();
-    ContextManager.getInstance().putContext(
-        servletHolder.getServlet().getServletConfig().getServletContext());
-
-    request.setMethod("GET");
-    request.setURI("/test/hello");
-    request.setHeader("Host", "tester");
-    request.setVersion("HTTP/1.0");
-
-    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
-
-    assertEquals(200, response.getStatus());
-    assertEquals("Hello World", response.getContent());
-  }
-
-  @Test
-  public void testSessionGenerated() throws Exception {
-    Callback c = new Callback() {
-      @Override
-      public void call(HttpServletRequest request, HttpServletResponse response)
-          throws IOException {
-        PrintWriter out = response.getWriter();
-        out.write(request.getSession().getId());
-      }
-    };
-
-    tester.setAttribute("callback_1", c);
-    tester.start();
-    ContextManager.getInstance().putContext(
-        servletHolder.getServlet().getServletConfig().getServletContext());
-
-    request.setMethod("GET");
-    request.setURI("/test/hello");
-    request.setHeader("Host", "tester");
-    request.setVersion("HTTP/1.0");
-
-    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
-
-    assertTrue("Not a correctly generated session id",
-        response.getContent().endsWith("-GF"));
-
-    List<Cookie> cookies = getCookies(response);
-    assertEquals("Session id != JSESSIONID from cookie",
-        response.getContent(), cookies.get(0).getValue());
-
-    Region r = getRegion();
-    assertNotNull("Session not found in region",
-        r.get(cookies.get(0).getValue()));
-  }
-
-
-  /**
-   * Test that getSession(false) does not create a new session
-   */
-  @Test
-  public void testSessionNotGenerated() throws Exception {
-    Callback c = new Callback() {
-      @Override
-      public void call(HttpServletRequest request, HttpServletResponse response)
-          throws IOException {
-        String output = "OK";
-        HttpSession s = request.getSession(false);
-        if (s != null) {
-          output = s.getId();
-        }
-        PrintWriter out = response.getWriter();
-        out.write(output);
-      }
-    };
-
-    tester.setAttribute("callback_1", c);
-    tester.start();
-    ContextManager.getInstance().putContext(
-        servletHolder.getServlet().getServletConfig().getServletContext());
-
-    request.setMethod("GET");
-    request.setURI("/test/hello");
-    request.setHeader("Host", "tester");
-    request.setVersion("HTTP/1.0");
-
-    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
-
-    assertEquals("Session should not have been created", "OK",
-        response.getContent());
-  }
-
-
-  @Test
-  public void testUnknownAttributeIsNull() throws Exception {
-    Callback c = new Callback() {
-      @Override
-      public void call(HttpServletRequest request, HttpServletResponse response)
-          throws IOException {
-        Object o = request.getSession().getAttribute("unknown");
-        PrintWriter out = response.getWriter();
-        if (o == null) {
-          out.write("null");
-        } else {
-          out.write(o.toString());
-        }
-      }
-    };
-
-    tester.setAttribute("callback_1", c);
-    tester.start();
-    ContextManager.getInstance().putContext(
-        servletHolder.getServlet().getServletConfig().getServletContext());
-
-    request.setMethod("GET");
-    request.setURI("/test/hello");
-    request.setHeader("Host", "tester");
-    request.setVersion("HTTP/1.0");
-
-    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
-
-    assertEquals("Unknown attribute should be null", "null",
-        response.getContent());
-  }
-
-
-  @Test
-  public void testSessionRemains1() throws Exception {
-    Callback c = new Callback() {
-      @Override
-      public void call(HttpServletRequest request, HttpServletResponse response)
-          throws IOException {
-        String output = "null";
-        HttpSession session = request.getSession();
-        if (session.isNew()) {
-          output = "new";
-          session.setAttribute("foo", output);
-        } else {
-          output = (String) session.getAttribute("foo");
-          if (output != null) {
-            output = "old";
-          }
-        }
-        PrintWriter out = response.getWriter();
-        out.write(output);
-      }
-    };
-
-    tester.setAttribute("callback_1", c);
-    tester.start();
-    ContextManager.getInstance().putContext(
-        servletHolder.getServlet().getServletConfig().getServletContext());
-
-    request.setMethod("GET");
-    request.setURI("/test/hello");
-    request.setHeader("Host", "tester");
-    request.setVersion("HTTP/1.0");
-
-    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
-
-    assertEquals("Session should be new", "new", response.getContent());
-
-    List<Cookie> cookies = getCookies(response);
-    request.setHeader("Cookie", "JSESSIONID=" + cookies.get(0).getValue());
-
-    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
-
-    assertEquals("Session should be old", "old", response.getContent());
-
-    List<Cookie> cookies2 = getCookies(response);
-    assertEquals("Session IDs should be the same", cookies.get(0).getValue(),
-        cookies2.get(0).getValue());
-
-    Region r = getRegion();
-    assertNotNull("Session object should exist in region",
-        r.get(cookies.get(0).getValue()));
-  }
-
-  /**
-   * Test that attributes are updated on the backend
-   */
-  @Test
-  public void testAttributesUpdatedInRegion() throws Exception {
-    Callback c_1 = new Callback() {
-      @Override
-      public void call(HttpServletRequest request, HttpServletResponse response)
-          throws IOException, ServletException {
-        request.getSession().setAttribute("foo", "bar");
-      }
-    };
-
-    // This is the callback used to invalidate the session
-    Callback c_2 = new Callback() {
-      @Override
-      public void call(HttpServletRequest request, HttpServletResponse response)
-          throws IOException, ServletException {
-        request.getSession().setAttribute("foo", "baz");
-      }
-    };
-
-    tester.setAttribute("callback_1", c_1);
-    tester.setAttribute("callback_2", c_2);
-
-    servletHolder.setInitParameter("test.callback", "callback_1");
-
-    ServletHolder sh2 = tester.addServlet(BasicServlet.class, "/request2");
-    sh2.setInitParameter("test.callback", "callback_2");
-
-    tester.start();
-    ContextManager.getInstance().putContext(
-        servletHolder.getServlet().getServletConfig().getServletContext());
-
-    request.setMethod("GET");
-    request.setURI("/test/hello");
-    request.setHeader("Host", "tester");
-    request.setVersion("HTTP/1.0");
-    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
-
-    List<Cookie> cookies = getCookies(response);
-
-    Region r = getRegion();
-    assertEquals("bar",
-        ((HttpSession) r.get(cookies.get(0).getValue())).getAttribute("foo"));
-
-    request.setHeader("Cookie", "JSESSIONID=" + cookies.get(0).getValue());
-    request.setURI("/test/request2");
-    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
-
-    assertEquals("baz",
-        ((HttpSession) r.get(cookies.get(0).getValue())).getAttribute(
-            "foo"));
-  }
-
-  /**
-   * Test setting an attribute to null deletes it
-   */
-  @Test
-  public void testSetAttributeNullDeletesIt() throws Exception {
-    Callback c_1 = new Callback() {
-      @Override
-      public void call(HttpServletRequest request, HttpServletResponse response)
-          throws IOException, ServletException {
-        request.getSession().setAttribute("foo", "bar");
-      }
-    };
-
-    // This is the callback used to invalidate the session
-    Callback c_2 = new Callback() {
-      @Override
-      public void call(HttpServletRequest request, HttpServletResponse response)
-          throws IOException, ServletException {
-        request.getSession().setAttribute("foo", null);
-      }
-    };
-
-    tester.setAttribute("callback_1", c_1);
-    tester.setAttribute("callback_2", c_2);
-
-    servletHolder.setInitParameter("test.callback", "callback_1");
-
-    ServletHolder sh2 = tester.addServlet(BasicServlet.class, "/request2");
-    sh2.setInitParameter("test.callback", "callback_2");
-
-    tester.start();
-    ContextManager.getInstance().putContext(
-        servletHolder.getServlet().getServletConfig().getServletContext());
-
-    request.setMethod("GET");
-    request.setURI("/test/hello");
-    request.setHeader("Host", "tester");
-    request.setVersion("HTTP/1.0");
-    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
-
-    List<Cookie> cookies = getCookies(response);
-
-    Region r = getRegion();
-    assertEquals("bar",
-        ((HttpSession) r.get(cookies.get(0).getValue())).getAttribute(
-            "foo"));
-
-    request.setHeader("Cookie", "JSESSIONID=" + cookies.get(0).getValue());
-    request.setURI("/test/request2");
-    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
-
-    assertNull(
-        ((HttpSession) r.get(cookies.get(0).getValue())).getAttribute(
-            "foo"));
-  }
-
-// Don't see how to do this currently as the SessionListener needs a full
-// web context to work in.
-
-//    /**
-//     * Test that sessions expire correctly
-//     */
-//    public void testSessionExpiration() throws Exception {
-//        Callback c_1 = new Callback() {
-//            @Override
-//            public void call(HttpServletRequest request, HttpServletResponse response)
-//                    throws IOException, ServletException {
-//                HttpSession s = request.getSession();
-//                s.setAttribute("foo", "bar");
-//                s.setMaxInactiveInterval(1);
-//
-//                PrintWriter out = response.getWriter();
-//                out.write(s.getId());
-//            }
-//        };
-//
-//        // This is the callback used to check if the session is still there
-//        Callback c_2 = new Callback() {
-//            @Override
-//            public void call(HttpServletRequest request, HttpServletResponse response)
-//                    throws IOException, ServletException {
-//                HttpSession s = request.getSession(false);
-//                String output;
-//                if (s == null) {
-//                    output = "null";
-//                } else {
-//                    output = s.getId();
-//                }
-//
-//                PrintWriter out = response.getWriter();
-//                out.write(output);
-//            }
-//        };
-//
-//        tester.addEventListener(new SessionListener());
-//        tester.setAttribute("callback_1", c_1);
-//        tester.setAttribute("callback_2", c_2);
-//
-//        servletHolder.setInitParameter("test.callback", "callback_1");
-//
-//        ServletHolder sh2 = tester.addServlet(BasicServlet.class, "/request2");
-//        sh2.setInitParameter("test.callback", "callback_2");
-//
-//        tester.start();
-//        ContextManager.getInstance().putContext(
-//                servletHolder.getServlet().getServletConfig().getServletContext());
-//
-//        request.setMethod("GET");
-//        request.setURI("/test/hello");
-//        request.setHeader("Host", "tester");
-//        request.setVersion("HTTP/1.0");
-//        response.parse(tester.getResponses(request.generate()));
-//
-//        String id = response.getContent();
-//
-//        // Wait for the session to expire
-//        Thread.sleep(2000);
-//
-//        request.setHeader("Cookie", "JSESSIONID=" + id);
-//        request.setURI("/test/request2");
-//        response.parse(tester.getResponses(request.generate()));
-//
-//        assertEquals("null", response.getContent());
-//
-//        Region r = getRegion();
-//        assertNull("Region should not contain session", r.get(id));
-//    }
-
-  /**
-   * Test that invalidating a session destroys it as well as the backend
-   * object.
-   */
-  @Test
-  public void testInvalidateSession1() throws Exception {
-    Callback c_1 = new Callback() {
-      @Override
-      public void call(HttpServletRequest request, HttpServletResponse response)
-          throws IOException, ServletException {
-        request.getSession().setAttribute("foo", "bar");
-      }
-    };
-
-    // This is the callback used to invalidate the session
-    Callback c_2 = new Callback() {
-      @Override
-      public void call(HttpServletRequest request, HttpServletResponse response)
-          throws IOException, ServletException {
-        request.getSession(false).invalidate();
-      }
-    };
-
-    tester.setAttribute("callback_1", c_1);
-    tester.setAttribute("callback_2", c_2);
-
-    servletHolder.setInitParameter("test.callback", "callback_1");
-
-    ServletHolder sh2 = tester.addServlet(BasicServlet.class, "/request2");
-    sh2.setInitParameter("test.callback", "callback_2");
-
-    tester.start();
-    ContextManager.getInstance().putContext(
-        servletHolder.getServlet().getServletConfig().getServletContext());
-
-    request.setMethod("GET");
-    request.setURI("/test/hello");
-    request.setHeader("Host", "tester");
-    request.setVersion("HTTP/1.0");
-    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
-
-    List<Cookie> cookies = getCookies(response);
-    Region r = getRegion();
-    assertEquals("bar",
-        ((HttpSession) r.get(cookies.get(0).getValue())).getAttribute("foo"));
-
-    request.setHeader("Cookie", "JSESSIONID=" + cookies.get(0).getValue());
-    request.setURI("/test/request2");
-    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
-
-    assertNull("Region should not contain session",
-        r.get(cookies.get(0).getValue()));
-  }
-
-  /**
-   * Test that invalidating a session throws an exception on subsequent access.
-   */
-  @Test
-  public void testInvalidateSession2() throws Exception {
-    Callback c_1 = new Callback() {
-      @Override
-      public void call(HttpServletRequest request, HttpServletResponse response)
-          throws IOException, ServletException {
-        HttpSession s = request.getSession();
-        s.invalidate();
-        PrintWriter out = response.getWriter();
-        try {
-          s.getAttribute("foo");
-        } catch (IllegalStateException iex) {
-          out.write("OK");
-        }
-      }
-    };
-
-    tester.setAttribute("callback_1", c_1);
-
-    servletHolder.setInitParameter("test.callback", "callback_1");
-
-    tester.start();
-    ContextManager.getInstance().putContext(
-        servletHolder.getServlet().getServletConfig().getServletContext());
-
-    request.setMethod("GET");
-    request.setURI("/test/hello");
-    request.setHeader("Host", "tester");
-    request.setVersion("HTTP/1.0");
-    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
-
-    assertEquals("OK", response.getContent());
-  }
-
-  /**
-   * Test that invalidating a session throws an exception on subsequent access.
-   */
-  @Test
-  public void testInvalidateSession3() throws Exception {
-    Callback c_1 = new Callback() {
-      @Override
-      public void call(HttpServletRequest request, HttpServletResponse response)
-          throws IOException, ServletException {
-        HttpSession s = request.getSession();
-        s.invalidate();
-        PrintWriter out = response.getWriter();
-        try {
-          s.getAttributeNames();
-        } catch (IllegalStateException iex) {
-          out.write("OK");
-        }
-      }
-    };
-
-    tester.setAttribute("callback_1", c_1);
-
-    servletHolder.setInitParameter("test.callback", "callback_1");
-
-    tester.start();
-    ContextManager.getInstance().putContext(
-        servletHolder.getServlet().getServletConfig().getServletContext());
-
-    request.setMethod("GET");
-    request.setURI("/test/hello");
-    request.setHeader("Host", "tester");
-    request.setVersion("HTTP/1.0");
-    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
-
-    assertEquals("OK", response.getContent());
-  }
-
-  /**
-   * Test that invalidating a session throws an exception on subsequent access.
-   */
-  @Test
-  public void testInvalidateSession4() throws Exception {
-    Callback c_1 = new Callback() {
-      @Override
-      public void call(HttpServletRequest request, HttpServletResponse response)
-          throws IOException, ServletException {
-        HttpSession s = request.getSession();
-        s.invalidate();
-        PrintWriter out = response.getWriter();
-        try {
-          s.getCreationTime();
-        } catch (IllegalStateException iex) {
-          out.write("OK");
-        }
-      }
-    };
-
-    tester.setAttribute("callback_1", c_1);
-
-    servletHolder.setInitParameter("test.callback", "callback_1");
-
-    tester.start();
-    ContextManager.getInstance().putContext(
-        servletHolder.getServlet().getServletConfig().getServletContext());
-
-    request.setMethod("GET");
-    request.setURI("/test/hello");
-    request.setHeader("Host", "tester");
-    request.setVersion("HTTP/1.0");
-    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
-
-    assertEquals("OK", response.getContent());
-  }
-
-  /**
-   * Test that invalidating a session does not throw an exception for subsequent
-   * getId calls.
-   */
-  @Test
-  public void testInvalidateSession5() throws Exception {
-    Callback c_1 = new Callback() {
-      @Override
-      public void call(HttpServletRequest request, HttpServletResponse response)
-          throws IOException, ServletException {
-        HttpSession s = request.getSession();
-        s.invalidate();
-        s.getId();
-        PrintWriter out = response.getWriter();
-        out.write("OK");
-      }
-    };
-
-    tester.setAttribute("callback_1", c_1);
-
-    servletHolder.setInitParameter("test.callback", "callback_1");
-
-    tester.start();
-    ContextManager.getInstance().putContext(
-        servletHolder.getServlet().getServletConfig().getServletContext());
-
-    request.setMethod("GET");
-    request.setURI("/test/hello");
-    request.setHeader("Host", "tester");
-    request.setVersion("HTTP/1.0");
-    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
-
-    assertEquals("OK", response.getContent());
-  }
-
-  /**
-   * Test that invalidating a session throws an exception on subsequent access.
-   */
-  @Test
-  public void testInvalidateSession6() throws Exception {
-    Callback c_1 = new Callback() {
-      @Override
-      public void call(HttpServletRequest request, HttpServletResponse response)
-          throws IOException, ServletException {
-        HttpSession s = request.getSession();
-        s.invalidate();
-        PrintWriter out = response.getWriter();
-        try {
-          s.getLastAccessedTime();
-        } catch (IllegalStateException iex) {
-          out.write("OK");
-        }
-      }
-    };
-
-    tester.setAttribute("callback_1", c_1);
-
-    servletHolder.setInitParameter("test.callback", "callback_1");
-
-    tester.start();
-    ContextManager.getInstance().putContext(
-        servletHolder.getServlet().getServletConfig().getServletContext());
-
-    request.setMethod("GET");
-    request.setURI("/test/hello");
-    request.setHeader("Host", "tester");
-    request.setVersion("HTTP/1.0");
-    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
-
-    assertEquals("OK", response.getContent());
-  }
-
-  /**
-   * Test that invalidating a session does not throw an exception for
-   * subsequent getMaxInactiveInterval calls.
-   */
-
-// I've commented this out for now as Jetty seems to want to throw an
-// Exception here where the HttpServlet api doesn't specify that.
-  @Test
-  public void testInvalidateSession7() throws Exception {
-    Callback c_1 = new Callback() {
-      @Override
-      public void call(HttpServletRequest request,
-          HttpServletResponse response) throws IOException, ServletException {
-        HttpSession s = request.getSession();
-        s.invalidate();
-        s.getMaxInactiveInterval();
-        PrintWriter out = response.getWriter();
-        out.write("OK");
-      }
-    };
-
-    tester.setAttribute("callback_1", c_1);
-
-    servletHolder.setInitParameter("test.callback", "callback_1");
-
-    tester.start();
-    ContextManager.getInstance().putContext(
-        servletHolder.getServlet().getServletConfig().getServletContext());
-
-    request.setMethod("GET");
-    request.setURI("/test/hello");
-    request.setHeader("Host", "tester");
-    request.setVersion("HTTP/1.0");
-    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
-
-    assertEquals("OK", response.getContent());
-  }
-
-  /**
-   * Test that invalidating a session does not throw an exception for subsequent
-   * getServletContext calls.
-   */
-  @Test
-  public void testInvalidateSession8() throws Exception {
-    Callback c_1 = new Callback() {
-      @Override
-      public void call(HttpServletRequest request, HttpServletResponse response)
-          throws IOException, ServletException {
-        HttpSession s = request.getSession();
-        s.invalidate();
-        s.getServletContext();
-        PrintWriter out = response.getWriter();
-        out.write("OK");
-      }
-    };
-
-    tester.setAttribute("callback_1", c_1);
-
-    servletHolder.setInitParameter("test.callback", "callback_1");
-
-    tester.start();
-    ContextManager.getInstance().putContext(
-        servletHolder.getServlet().getServletConfig().getServletContext());
-
-    request.setMethod("GET");
-    request.setURI("/test/hello");
-    request.setHeader("Host", "tester");
-    request.setVersion("HTTP/1.0");
-    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
-
-    assertEquals("OK", response.getContent());
-  }
-
-  /**
-   * Test that invalidating a session throws an exception on subsequent access.
-   */
-  @Test
-  public void testInvalidateSession9() throws Exception {
-    Callback c_1 = new Callback() {
-      @Override
-      public void call(HttpServletRequest request, HttpServletResponse response)
-          throws IOException, ServletException {
-        HttpSession s = request.getSession();
-        s.invalidate();
-        PrintWriter out = response.getWriter();
-        try {
-          s.isNew();
-        } catch (IllegalStateException iex) {
-          out.write("OK");
-        }
-      }
-    };
-
-    tester.setAttribute("callback_1", c_1);
-
-    servletHolder.setInitParameter("test.callback", "callback_1");
-
-    tester.start();
-    ContextManager.getInstance().putContext(
-        servletHolder.getServlet().getServletConfig().getServletContext());
-
-    request.setMethod("GET");
-    request.setURI("/test/hello");
-    request.setHeader("Host", "tester");
-    request.setVersion("HTTP/1.0");
-    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
-
-    assertEquals("OK", response.getContent());
-  }
-
-  /**
-   * Test that invalidating a session throws an exception on subsequent access.
-   */
-  @Test
-  public void testInvalidateSession10() throws Exception {
-    Callback c_1 = new Callback() {
-      @Override
-      public void call(HttpServletRequest request, HttpServletResponse response)
-          throws IOException, ServletException {
-        HttpSession s = request.getSession();
-        s.invalidate();
-        PrintWriter out = response.getWriter();
-        try {
-          s.removeAttribute("foo");
-        } catch (IllegalStateException iex) {
-          out.write("OK");
-        }
-      }
-    };
-
-    tester.setAttribute("callback_1", c_1);
-
-    servletHolder.setInitParameter("test.callback", "callback_1");
-
-    tester.start();
-    ContextManager.getInstance().putContext(
-        servletHolder.getServlet().getServletConfig().getServletContext());
-
-    request.setMethod("GET");
-    request.setURI("/test/hello");
-    request.setHeader("Host", "tester");
-    request.setVersion("HTTP/1.0");
-    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
-
-    assertEquals("OK", response.getContent());
-  }
-
-  /**
-   * Test that invalidating a session throws an exception on subsequent access.
-   */
-  @Test
-  public void testInvalidateSession11() throws Exception {
-    Callback c_1 = new Callback() {
-      @Override
-      public void call(HttpServletRequest request, HttpServletResponse response)
-          throws IOException, ServletException {
-        HttpSession s = request.getSession();
-        s.invalidate();
-        PrintWriter out = response.getWriter();
-        try {
-          s.setAttribute("foo", "bar");
-        } catch (IllegalStateException iex) {
-          out.write("OK");
-        }
-      }
-    };
-
-    tester.setAttribute("callback_1", c_1);
-
-    servletHolder.setInitParameter("test.callback", "callback_1");
-
-    tester.start();
-    ContextManager.getInstance().putContext(
-        servletHolder.getServlet().getServletConfig().getServletContext());
-
-    request.setMethod("GET");
-    request.setURI("/test/hello");
-    request.setHeader("Host", "tester");
-    request.setVersion("HTTP/1.0");
-    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
-
-    assertEquals("OK", response.getContent());
-  }
-
-  /**
-   * Test that invalidating a session does not throw an exception for subsequent
-   * setMaxInactiveInterval calls.
-   */
-  @Test
-  public void testInvalidateSession12() throws Exception {
-    Callback c_1 = new Callback() {
-      @Override
-      public void call(HttpServletRequest request, HttpServletResponse response)
-          throws IOException, ServletException {
-        HttpSession s = request.getSession();
-        s.invalidate();
-        s.setMaxInactiveInterval(1);
-        PrintWriter out = response.getWriter();
-        out.write("OK");
-      }
-    };
-
-    tester.setAttribute("callback_1", c_1);
-
-    servletHolder.setInitParameter("test.callback", "callback_1");
-
-    tester.start();
-    ContextManager.getInstance().putContext(
-        servletHolder.getServlet().getServletConfig().getServletContext());
-
-    request.setMethod("GET");
-    request.setURI("/test/hello");
-    request.setHeader("Host", "tester");
-    request.setVersion("HTTP/1.0");
-    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
-
-    assertEquals("OK", response.getContent());
-  }
-
-  /**
-   * Test that invalidating a session results in null being returned on
-   * subsequent getSession(false) calls.
-   */
-  @Test
-  public void testInvalidateSession13() throws Exception {
-    Callback c_1 = new Callback() {
-      @Override
-      public void call(HttpServletRequest request, HttpServletResponse response)
-          throws IOException, ServletException {
-        HttpSession s = request.getSession();
-        s.invalidate();
-        s = request.getSession(false);
-        PrintWriter out = response.getWriter();
-        if (s == null) {
-          out.write("OK");
-        } else {
-          out.write(s.toString());
-        }
-      }
-    };
-
-    tester.setAttribute("callback_1", c_1);
-
-    servletHolder.setInitParameter("test.callback", "callback_1");
-
-    tester.start();
-    ContextManager.getInstance().putContext(
-        servletHolder.getServlet().getServletConfig().getServletContext());
-
-    request.setMethod("GET");
-    request.setURI("/test/hello");
-    request.setHeader("Host", "tester");
-    request.setVersion("HTTP/1.0");
-    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
-
-    assertEquals("OK", response.getContent());
-  }
-
-
-  /**
-   * Test that we can invalidate and then recreate a new session
-   */
-  @Test
-  public void testInvalidateAndRecreateSession() throws Exception {
-    Callback c_1 = new Callback() {
-      @Override
-      public void call(HttpServletRequest request, HttpServletResponse response)
-          throws IOException, ServletException {
-
-        PrintWriter out = response.getWriter();
-        out.write(request.getSession().getId());
-      }
-    };
-
-    Callback c_2 = new Callback() {
-      @Override
-      public void call(HttpServletRequest request, HttpServletResponse response)
-          throws IOException, ServletException {
-        HttpSession s = request.getSession();
-        s.invalidate();
-
-        PrintWriter out = response.getWriter();
-        out.write(request.getSession().getId());
-      }
-    };
-
-    tester.setAttribute("callback_1", c_1);
-    tester.setAttribute("callback_2", c_2);
-
-    ServletHolder sh = tester.addServlet(BasicServlet.class, "/dispatch");
-    sh.setInitParameter("test.callback", "callback_2");
-
-    tester.start();
-    ContextManager.getInstance().putContext(
-        sh.getServlet().getServletConfig().getServletContext());
-
-    request.setMethod("GET");
-    request.setURI("/test/hello");
-    request.setHeader("Host", "tester");
-    request.setVersion("HTTP/1.0");
-
-    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
-    String session1 = response.getContent();
-
-    request.setHeader("Cookie", "JSESSIONID=" + session1);
-    request.setURI("/test/request2");
-    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
-
-    String session12 = response.getContent();
-    assertFalse("First and subsequent session ids must not be the same",
-        session1.equals(session12));
-  }
-
-
-  /**
-   * Test that creation time does not change on subsequent access
-   */
-  @Test
-  public void testGetCreationTime() throws Exception {
-    Callback c = new Callback() {
-      @Override
-      public void call(HttpServletRequest request, HttpServletResponse response)
-          throws IOException {
-        HttpSession session = request.getSession();
-        PrintWriter out = response.getWriter();
-        out.write(Long.toString(session.getCreationTime()));
-      }
-    };
-
-    tester.setAttribute("callback_1", c);
-    tester.start();
-    ContextManager.getInstance().putContext(
-        servletHolder.getServlet().getServletConfig().getServletContext());
-
-    request.setMethod("GET");
-    request.setURI("/test/hello");
-    request.setHeader("Host", "tester");
-    request.setVersion("HTTP/1.0");
-
-    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
-
-    long time1 = Long.parseLong(response.getContent());
-    assertTrue("Creation time should be positive", time1 > 0);
-
-    List<Cookie> cookies = getCookies(response);
-    request.setHeader("Cookie", "JSESSIONID=" + cookies.get(0).getValue());
-
-    try {
-      Thread.sleep(1000);
-    } catch (Exception ex) {
-    }
-
-    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
-    long time2 = Long.parseLong(response.getContent());
-    assertTrue("Creation time should be the same across requests",
-        time1 == time2);
-  }
-
-  /**
-   * Test that the last accessed time is updated on subsequent access
-   */
-  @Test
-  public void testGetLastAccessedTime() throws Exception {
-    Callback c = new Callback() {
-      @Override
-      public void call(HttpServletRequest request, HttpServletResponse response)
-          throws IOException {
-        HttpSession session = request.getSession();
-        PrintWriter out = response.getWriter();
-        out.write(Long.toString(session.getLastAccessedTime()));
-      }
-    };
-
-    tester.setAttribute("callback_1", c);
-    tester.start();
-    ContextManager.getInstance().putContext(
-        servletHolder.getServlet().getServletConfig().getServletContext());
-
-    request.setMethod("GET");
-    request.setURI("/test/hello");
-    request.setHeader("Host", "tester");
-    request.setVersion("HTTP/1.0");
-
-    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
-
-    long time1 = Long.parseLong(response.getContent());
-//        assertTrue("Last accessed time should be positive", time1 > 0);
-
-    List<Cookie> cookies = getCookies(response);
-    request.setHeader("Cookie", "JSESSIONID=" + cookies.get(0).getValue());
-
-    Thread.sleep(1000);
-
-    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
-    long time2 = Long.parseLong(response.getContent());
-    assertTrue("Last accessed time should be increasing across requests",
-        time2 > time1);
-  }
-
-  /**
-   * Test that the underlying native session remains the same across requests
-   */
-  @Test
-  public void testNativeSessionRemainsUnchanged() throws Exception {
-    Callback c = new Callback() {
-      @Override
-      public void call(HttpServletRequest request, HttpServletResponse response)
-          throws IOException {
-        GemfireHttpSession session = (GemfireHttpSession) request.getSession();
-        PrintWriter out = response.getWriter();
-        out.write(session.getNativeSession().getId());
-      }
-    };
-
-    tester.setAttribute("callback_1", c);
-    tester.start();
-    ContextManager.getInstance().putContext(
-        servletHolder.getServlet().getServletConfig().getServletContext());
-
-    request.setMethod("GET");
-    request.setURI("/test/hello");
-    request.setHeader("Host", "tester");
-    request.setVersion("HTTP/1.0");
-
-    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
-    String nativeSessionId = response.getContent();
-
-    List<Cookie> cookies = getCookies(response);
-    String sessionId = cookies.get(0).getValue();
-    Region r = getRegion();
-
-    assertEquals(
-        "Cached native session id does not match servlet returned native session id",
-        nativeSessionId,
-        ((GemfireHttpSession) r.get(sessionId)).getNativeSession().getId());
-
-    request.setHeader("Cookie", "JSESSIONID=" + cookies.get(0).getValue());
-    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
-
-    assertEquals(
-        "Underlying native sessions must remain the same across requests",
-        nativeSessionId,
-        ((GemfireHttpSession) r.get(sessionId)).getNativeSession().getId());
-  }
-
-  /**
-   * Test session id embedded in the URL
-   */
-  @Test
-  public void testSessionIdEmbeddedInUrl() throws Exception {
-    Callback c = new Callback() {
-      @Override
-      public void call(HttpServletRequest request, HttpServletResponse response)
-          throws IOException {
-        GemfireHttpSession session = (GemfireHttpSession) request.getSession();
-        PrintWriter out = response.getWriter();
-        out.write(session.getId());
-      }
-    };
-
-    tester.setAttribute("callback_1", c);
-    tester.start();
-    ContextManager.getInstance().putContext(
-        servletHolder.getServlet().getServletConfig().getServletContext());
-
-    request.setMethod("GET");
-    request.setURI("/test/hello");
-    request.setHeader("Host", "tester");
-    request.setVersion("HTTP/1.0");
-
-    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
-    List<Cookie> cookies = getCookies(response);
-    String sessionId = response.getContent();
-    assertEquals("Session ids should be the same", sessionId,
-        cookies.get(0).getValue());
-
-    request.setURI("/test/hello;jsessionid=" + sessionId);
-    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
-    cookies = getCookies(response);
-
-    assertEquals("Session ids should be the same", sessionId,
-        cookies.get(0).getValue());
-  }
-
-
-  /**
-   * Test that request forward dispatching works
-   */
-  @Test
-  public void testDispatchingForward1() throws Exception {
-    Callback c_1 = new Callback() {
-      @Override
-      public void call(HttpServletRequest request, HttpServletResponse response)
-          throws IOException, ServletException {
-        RequestDispatcher dispatcher = request.getRequestDispatcher("dispatch");
-        dispatcher.forward(request, response);
-
-        // This should not appear in the output
-        PrintWriter out = response.getWriter();
-        out.write("bang");
-      }
-    };
-
-    // This is the callback used by the forward servlet
-    Callback c_2 = new Callback() {
-      @Override
-      public void call(HttpServletRequest request, HttpServletResponse response)
-          throws IOException, ServletException {
-        PrintWriter out = response.getWriter();
-        out.write("dispatched");
-      }
-    };
-
-    tester.setAttribute("callback_1", c_1);
-    tester.setAttribute("callback_2", c_2);
-
-    ServletHolder sh = tester.addServlet(BasicServlet.class, "/dispatch");
-    sh.setInitParameter("test.callback", "callback_2");
-
-    tester.start();
-    ContextManager.getInstance().putContext(
-        sh.getServlet().getServletConfig().getServletContext());
-
-    request.setMethod("GET");
-    request.setURI("/test/hello");
-    request.setHeader("Host", "tester");
-    request.setVersion("HTTP/1.0");
-
-    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
-    assertEquals("dispatched", response.getContent());
-
-    ContextManager.getInstance().removeContext(
-        sh.getServlet().getServletConfig().getServletContext());
-  }
-
-
-  /**
-   * Test that request include dispatching works
-   */
-  @Test
-  public void testDispatchingInclude() throws Exception {
-    Callback c_1 = new Callback() {
-      @Override
-      public void call(HttpServletRequest request, HttpServletResponse response)
-          throws IOException, ServletException {
-        RequestDispatcher dispatcher = request.getRequestDispatcher("dispatch");
-        dispatcher.include(request, response);
-
-        // This *should* appear in the output
-        PrintWriter out = response.getWriter();
-        out.write("_bang");
-      }
-    };
-
-    // This is the callback used by the include servlet
-    Callback c_2 = new Callback() {
-      @Override
-      public void call(HttpServletRequest request, HttpServletResponse response)
-          throws IOException, ServletException {
-        PrintWriter out = response.getWriter();
-        out.write("dispatched");
-      }
-    };
-
-    tester.setAttribute("callback_1", c_1);
-    tester.setAttribute("callback_2", c_2);
-
-    ServletHolder sh = tester.addServlet(BasicServlet.class, "/dispatch");
-    sh.setInitParameter("test.callback", "callback_2");
-
-    tester.start();
-    ContextManager.getInstance().putContext(
-        sh.getServlet().getServletConfig().getServletContext());
-
-    request.setMethod("GET");
-    request.setURI("/test/hello");
-    request.setHeader("Host", "tester");
-    request.setVersion("HTTP/1.0");
-
-    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
-    assertEquals("dispatched_bang", response.getContent());
-
-    ContextManager.getInstance().removeContext(
-        sh.getServlet().getServletConfig().getServletContext());
-  }
-
-
-  /**
-   * Test to try and simulate a failover scenario
-   */
-  @Test
-  public void testFailover1() throws Exception {
-    Callback c_1 = new Callback() {
-      @Override
-      public void call(HttpServletRequest request, HttpServletResponse response)
-          throws IOException, ServletException {
-        HttpSession s = request.getSession();
-        s.setAttribute("foo", "bar");
-
-        PrintWriter out = response.getWriter();
-        out.write(request.getSession().getId());
-      }
-    };
-
-    Callback c_2 = new Callback() {
-      @Override
-      public void call(HttpServletRequest request, HttpServletResponse response)
-          throws IOException, ServletException {
-        HttpSession s = request.getSession();
-
-        PrintWriter out = response.getWriter();
-        out.write((String) s.getAttribute("foo"));
-      }
-    };
-
-    tester.setAttribute("callback_1", c_1);
-    tester.setAttribute("callback_2", c_2);
-
-    ServletHolder sh = tester.addServlet(BasicServlet.class, "/request2");
-    sh.setInitParameter("test.callback", "callback_2");
-
-    tester.start();
-    ContextManager.getInstance().putContext(
-        sh.getServlet().getServletConfig().getServletContext());
-
-    request.setMethod("GET");
-    request.setURI("/test/hello");
-    request.setHeader("Host", "tester");
-    request.setVersion("HTTP/1.0");
-
-    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
-    String id = response.getContent();
-
-    // Now we simulate the failover by removing the native session from
-    // the stored session
-    Region r = getRegion();
-    GemfireHttpSession sessObj = (GemfireHttpSession) r.get(id);
-    sessObj.setNativeSession(null);
-
-    r.put(id, sessObj);
-
-    request.setHeader("Cookie", "JSESSIONID=" + id);
-    request.setURI("/test/request2");
-    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
-
-    assertEquals("bar", response.getContent());
-  }
-
-  @Test
-  public void testHttpSessionListener1() throws Exception {
-    HttpSessionListenerImpl listener = new HttpSessionListenerImpl();
-    tester.getContext().getSessionHandler().addEventListener(listener);
-
-    Callback c = new Callback() {
-      @Override
-      public void call(HttpServletRequest request, HttpServletResponse response)
-          throws IOException {
-        HttpSession s = request.getSession();
-        // This is set in HttpSessionListenerImpl
-        String result = (String) s.getAttribute("gemfire-session-id");
-        response.getWriter().write(result);
-      }
-    };
-
-    tester.setAttribute("callback_1", c);
-    tester.start();
-    ContextManager.getInstance().putContext(
-        servletHolder.getServlet().getServletConfig().getServletContext());
-
-    request.setMethod("GET");
-    request.setURI("/test/hello");
-    request.setHeader("Host", "tester");
-    request.setVersion("HTTP/1.0");
-
-    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
-
-    assertEquals(200, response.getStatus());
-
-    List<Cookie> cookies = getCookies(response);
-
-//        AbstractListener listener = RendezvousManager.getListener();
-    tester.stop();
-
-    assertTrue("Timeout waiting for events",
-        listener.await(1, TimeUnit.SECONDS));
-    assertEquals(ListenerEventType.SESSION_CREATED,
-        listener.events.get(0));
-    assertEquals(ListenerEventType.SESSION_DESTROYED,
-        listener.events.get(1));
-    assertEquals(cookies.get(0).getValue(), response.getContent());
-  }
-
-  @Test
-  public void testHttpSessionListener2() throws Exception {
-    HttpSessionListenerImpl2 listener = new HttpSessionListenerImpl2();
-    tester.getContext().getSessionHandler().addEventListener(listener);
-
-    Callback c = new Callback() {
-      @Override
-      public void call(HttpServletRequest request, HttpServletResponse response)
-          throws IOException {
-        HttpSession s = request.getSession();
-        s.setAttribute("test01", "test01");
-        s = request.getSession(false);
-        s.invalidate();
-        response.getWriter().write(s.getId());
-      }
-    };
-
-    tester.setAttribute("callback_1", c);
-    tester.start();
-    ContextManager.getInstance().putContext(
-        servletHolder.getServlet().getServletConfig().getServletContext());
-
-    request.setMethod("GET");
-    request.setURI("/test/hello");
-    request.setHeader("Host", "tester");
-    request.setVersion("HTTP/1.0");
-
-    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
-
-    assertEquals(200, response.getStatus());
-
-    List<Cookie> cookies = getCookies(response);
-
-    tester.stop();
-
-    assertTrue("Timeout waiting for events",
-        listener.await(1, TimeUnit.SECONDS));
-    assertEquals(ListenerEventType.SESSION_CREATED,
-        listener.events.get(0));
-    assertEquals(ListenerEventType.SESSION_DESTROYED,
-        listener.events.get(1));
-    assertEquals(cookies.get(0).getValue(), response.getContent());
-  }
-
-
-
-
-//  @Test
-  public void testJsp() throws Exception {
-    tester.setResourceBase("target/test-classes");
-    ServletHolder jspHolder = tester.addServlet(JspServlet.class, "/test/*");
-    jspHolder.setInitOrder(1);
-
-    jspHolder.setInitParameter("scratchdir", tmpdir.getPath());
-
-    Callback c_1 = new Callback() {
-      @Override
-      public void call(HttpServletRequest request, HttpServletResponse response)
-          throws IOException, ServletException {
-        request.getSession().setAttribute("foo", "bar");
-        request.setAttribute("foo", "baz");
-        RequestDispatcher dispatcher = request.getRequestDispatcher(
-            "pagecontext.jsp");
-        dispatcher.forward(request, response);
-      }
-    };
-
-    tester.getContext().setClassLoader(Thread.currentThread().getContextClassLoader());
-    tester.setAttribute("callback_1", c_1);
-
-    tester.start();
-
-    request.setMethod("GET");
-    request.setURI("/test/hello");
-    request.setHeader("Host", "tester");
-    request.setVersion("HTTP/1.0");
-
-    response = HttpTester.parseResponse(tester.getResponses(request.generate()));
-
-    assertEquals(200, response.getStatus());
-    assertEquals("baz", response.getContent().trim());
-  }
-
-
-  ////////////////////////////////////////////////////////////////////
-  // Private methods
-
-  /**
-   * Why doesn't HttpTester do this already??
-   */
-  private List<Cookie> getCookies(HttpTester.Response response) {
-    List<Cookie> cookies = new ArrayList<Cookie>();
-
-    Enumeration e = response.getValues("Set-Cookie");
-
-    while (e != null && e.hasMoreElements()) {
-      String header = (String) e.nextElement();
-      Cookie c = null;
-
-      StringTokenizer st = new StringTokenizer(header, ";");
-      while (st.hasMoreTokens()) {
-        String[] split = st.nextToken().split("=");
-        String param = split[0].trim();
-        String value = null;
-        if (split.length > 1) {
-          value = split[1].trim();
-        }
-        if ("version".equalsIgnoreCase(param)) {
-          c.setVersion(Integer.parseInt(value));
-        } else if ("comment".equalsIgnoreCase(param)) {
-          c.setComment(value);
-        } else if ("domain".equalsIgnoreCase(param)) {
-          c.setDomain(value);
-        } else if ("max-age".equalsIgnoreCase(param)) {
-          c.setMaxAge(Integer.parseInt(value));
-        } else if ("discard".equalsIgnoreCase(param)) {
-          c.setMaxAge(-1);
-        } else if ("path".equalsIgnoreCase(param)) {
-          c.setPath(value);
-        } else if ("secure".equalsIgnoreCase(param)) {
-          c.setSecure(true);
-        } else if ("httponly".equalsIgnoreCase(param)) {
-          // Ignored??
-        } else {
-          if (c == null) {
-            c = new Cookie(param, value);
-          } else {
-            throw new IllegalStateException("Unknown cookie param: " + param);
-          }
-        }
-      }
-
-      if (c != null) {
-        cookies.add(c);
-      }
-    }
-
-    return cookies;
-  }
-
-  private Region getRegion() {
-    // Yuck...
-    return ((GemfireSessionManager) ((SessionCachingFilter) filterHolder.getFilter()).getSessionManager()).getCache().getCache().getRegion(
-        "gemfire_modules_sessions");
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/890d62e3/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/MyServletTester.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/MyServletTester.java b/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/MyServletTester.java
deleted file mode 100644
index 1ff6e70..0000000
--- a/modules/gemfire-modules-session-integration-test/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/MyServletTester.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-
-package com.gemstone.gemfire.modules.session.internal.filter;
-
-import org.eclipse.jetty.servlet.ServletTester;
-
-/**
- * Extend the base ServletTester class with a couple of helper methods. This
- * depends on a patched ServletTester class which exposes the _server variable
- * as package-private.
- */
-public class MyServletTester extends ServletTester {
-
-  public boolean isStarted() {
-//    return _server.isStarted();
-    return false;
-  }
-
-  public boolean isStopped() {
-//    return _server.isStopped();
-    return false;
-  }
-}


[17/24] incubator-geode git commit: GEODE-14: Adding session replication assembly module

Posted by je...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/65a03287/extensions/gemfire-modules-assembly/release/3rdparty_license/open_source_licenses-vFabric_GemFire_Modules_7.0.Beta.txt
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-assembly/release/3rdparty_license/open_source_licenses-vFabric_GemFire_Modules_7.0.Beta.txt b/extensions/gemfire-modules-assembly/release/3rdparty_license/open_source_licenses-vFabric_GemFire_Modules_7.0.Beta.txt
new file mode 100755
index 0000000..8253152
--- /dev/null
+++ b/extensions/gemfire-modules-assembly/release/3rdparty_license/open_source_licenses-vFabric_GemFire_Modules_7.0.Beta.txt
@@ -0,0 +1,471 @@
+open_source_license.txt
+
+VMware vFabric GemFire HTTP Session Management Module 7.0 Beta
+	
+
+===========================================================================
+
+The following copyright statements and licenses apply to various open
+source software components (or portions thereof) that are distributed with
+this VMware software products.
+
+The VMware Product may also include other VMware components, which may contain additional open 
+source software packages. One or more such open_source_licenses.txt files may therefore 
+accompany this VMware Product. 
+
+The VMware product that includes this file does not necessarily use all the
+open source software components referred to below and may also only use
+portions of a given component.
+
+
+=============== TABLE OF CONTENTS =============================
+
+
+The following is a listing of the open source components detailed in this
+document.  This list is provided for your convenience; please read further if
+you wish to review the copyright notice(s) and the full text of the license
+associated with each component.
+
+
+
+SECTION 1: BSD-STYLE, MIT-STYLE, OR SIMILAR STYLE LICENSES
+
+   >>> slf4j-1.5.8
+
+
+
+SECTION 2: Common Development and Distribution License, V1.0
+
+   >>> servlet-api-2.5
+
+
+
+APPENDIX. Standard License Files
+
+   >>> Common Development and Distribution License, V1.0
+
+
+
+
+
+--------------- SECTION 1:  BSD-STYLE, MIT-STYLE, OR SIMILAR STYLE LICENSES ----------
+
+BSD-STYLE, MIT-STYLE, OR SIMILAR STYLE LICENSES are applicable to the following component(s).
+
+
+>>> slf4j-1.5.8
+
+Copyright (c) 2004-2008 QOS.ch
+All rights reserved.
+
+Permission is hereby granted, free  of charge, to any person obtaining
+a  copy  of this  software  and  associated  documentation files  (the
+"Software"), to  deal in  the Software without  restriction, including
+without limitation  the rights to  use, copy, modify,  merge, publish,
+distribute,  sublicense, and/or sell  copies of  the Software,  and to
+permit persons to whom the Software  is furnished to do so, subject to
+the following conditions:
+
+The  above  copyright  notice  and  this permission  notice  shall  be
+included in all copies or substantial portions of the Software.
+
+THE  SOFTWARE IS  PROVIDED  "AS  IS", WITHOUT  WARRANTY  OF ANY  KIND,
+EXPRESS OR  IMPLIED, INCLUDING  BUT NOT LIMITED  TO THE  WARRANTIES OF
+MERCHANTABILITY,    FITNESS    FOR    A   PARTICULAR    PURPOSE    AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE,  ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+
+--------------- SECTION 2: Common Development and Distribution License, V1.0 ----------
+
+Common Development and Distribution License, V1.0 is applicable to the following component(s).
+
+
+>>> servlet-api-2.5
+
+The contents of this file are subject to the terms 
+of the Common Development and Distribution License 
+(the "License"). You may not use this file except 
+in compliance with the License. 
+ 
+You can obtain a copy of the license at 
+glassfish/bootstrap/legal/CDDLv1.0.txt or 
+https://glassfish.dev.java.net/public/CDDLv1.0.html. 
+See the License for the specific language governing 
+permissions and limitations under the License. 
+ 
+When distributing Covered Code, include this CDDL 
+HEADER in each file and include the License file at 
+glassfish/bootstrap/legal/CDDLv1.0.txt. If applicable, 
+add the following below this CDDL HEADER, with the 
+fields enclosed by brackets "[]" replaced with your 
+own identifying information: Portions Copyright [yyyy] 
+[name of copyright owner] 
+ 
+Copyright 2005 Sun Microsystems, Inc. All rights reserved. 
+ 
+Portions Copyright Apache Software Foundation.
+
+
+
+
+=============== APPENDIX. Standard License Files ============== 
+
+
+
+--------- SECTION 1: Common Development and Distribution License, V1.0 -----------
+
+COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
+
+1. Definitions.
+
+1.1. "Contributor" means each individual or entity that creates or
+contributes to the creation of Modifications.
+
+1.2. "Contributor Version" means the combination of the Original Software,
+prior Modifications used by a Contributor (if any), and the Modifications
+made by that particular Contributor.
+
+1.3. "Covered Software" means (a) the Original Software, or (b)
+Modifications, or (c) the combination of files containing Original
+Software with files containing Modifications, in each case including
+portions thereof.
+
+1.4. "Executable" means the Covered Software in any form other than
+Source Code.
+
+1.5. "Initial Developer" means the individual or entity that first makes
+Original Software available under this License.
+
+1.6. "Larger Work" means a work which combines Covered Software or
+portions thereof with code not governed by the terms of this License.
+
+1.7. "License" means this document.
+
+1.8. "Licensable" means having the right to grant, to the maximum extent
+possible, whether at the time of the initial grant or subsequently
+acquired, any and all of the rights conveyed herein.
+
+1.9. "Modifications" means the Source Code and Executable form of any
+of the following:
+
+    A. Any file that results from an addition to, deletion from or
+    modification of the contents of a file containing Original Software
+    or previous Modifications;
+
+    B. Any new file that contains any part of the Original Software or
+    previous Modification; or
+
+    C. Any new file that is contributed or otherwise made available
+    under the terms of this License.
+
+1.10. "Original Software" means the Source Code and Executable form of
+computer software code that is originally released under this License.
+
+1.11. "Patent Claims" means any patent claim(s), now owned or hereafter
+acquired, including without limitation, method, process, and apparatus
+claims, in any patent Licensable by grantor.
+
+1.12. "Source Code" means (a) the common form of computer software code
+in which modifications are made and (b) associated documentation included
+in or with such code.
+
+1.13. "You" (or "Your") means an individual or a legal entity exercising
+rights under, and complying with all of the terms of, this License. For
+legal entities, "You" includes any entity which controls, is controlled
+by, or is under common control with You. For purposes of this definition,
+"control" means (a) the power, direct or indirect, to cause the direction
+or management of such entity, whether by contract or otherwise, or (b)
+ownership of more than fifty percent (50%) of the outstanding shares or
+beneficial ownership of such entity.
+
+2. License Grants. 
+
+2.1. The Initial Developer Grant.
+
+Conditioned upon Your compliance with Section 3.1 below and subject to
+third party intellectual property claims, the Initial Developer hereby
+grants You a world-wide, royalty-free, non-exclusive license:
+
+    (a) under intellectual property rights (other than patent or
+    trademark) Licensable by Initial Developer, to use, reproduce, modify,
+    display, perform, sublicense and distribute the Original Software
+    (or portions thereof), with or without Modifications, and/or as part
+    of a Larger Work; and
+
+    (b) under Patent Claims infringed by the making, using or selling
+    of Original Software, to make, have made, use, practice, sell, and
+    offer for sale, and/or otherwise dispose of the Original Software
+    (or portions thereof).
+
+    (c) The licenses granted in Sections 2.1(a) and (b) are effective
+    on the date Initial Developer first distributes or otherwise makes
+    the Original Software available to a third party under the terms of
+    this License.
+
+    (d) Notwithstanding Section 2.1(b) above, no patent license is
+    granted: (1) for code that You delete from the Original Software,
+    or (2) for infringements caused by: (i) the modification of the
+    Original Software, or (ii) the combination of the Original Software
+    with other software or devices.
+
+2.2. Contributor Grant.
+
+Conditioned upon Your compliance with Section 3.1 below and subject to
+third party intellectual property claims, each Contributor hereby grants
+You a world-wide, royalty-free, non-exclusive license:
+
+    (a) under intellectual property rights (other than patent or
+    trademark) Licensable by Contributor to use, reproduce, modify,
+    display, perform, sublicense and distribute the Modifications created
+    by such Contributor (or portions thereof), either on an unmodified
+    basis, with other Modifications, as Covered Software and/or as part
+    of a Larger Work; and
+
+    (b) under Patent Claims infringed by the making, using, or selling
+    of Modifications made by that Contributor either alone and/or
+    in combination with its Contributor Version (or portions of such
+    combination), to make, use, sell, offer for sale, have made, and/or
+    otherwise dispose of: (1) Modifications made by that Contributor
+    (or portions thereof); and (2) the combination of Modifications
+    made by that Contributor with its Contributor Version (or portions
+    of such combination).
+
+    (c) The licenses granted in Sections 2.2(a) and 2.2(b) are effective
+    on the date Contributor first distributes or otherwise makes the
+    Modifications available to a third party.
+
+    (d) Notwithstanding Section 2.2(b) above, no patent license is
+    granted: (1) for any code that Contributor has deleted from the
+    Contributor Version; (2) for infringements caused by: (i) third
+    party modifications of Contributor Version, or (ii) the combination
+    of Modifications made by that Contributor with other software
+    (except as part of the Contributor Version) or other devices; or (3)
+    under Patent Claims infringed by Covered Software in the absence of
+    Modifications made by that Contributor.
+
+3. Distribution Obligations.
+
+3.1. Availability of Source Code.
+
+Any Covered Software that You distribute or otherwise make available
+in Executable form must also be made available in Source Code form and
+that Source Code form must be distributed only under the terms of this
+License. You must include a copy of this License with every copy of the
+Source Code form of the Covered Software You distribute or otherwise make
+available. You must inform recipients of any such Covered Software in
+Executable form as to how they can obtain such Covered Software in Source
+Code form in a reasonable manner on or through a medium customarily used
+for software exchange.
+
+3.2. Modifications.
+
+The Modifications that You create or to which You contribute are governed
+by the terms of this License. You represent that You believe Your
+Modifications are Your original creation(s) and/or You have sufficient
+rights to grant the rights conveyed by this License.
+
+3.3. Required Notices.
+
+You must include a notice in each of Your Modifications that identifies
+You as the Contributor of the Modification.  You may not remove or alter
+any copyright, patent or trademark notices contained within the Covered
+Software, or any notices of licensing or any descriptive text giving
+attribution to any Contributor or the Initial Developer.
+
+3.4. Application of Additional Terms.
+
+You may not offer or impose any terms on any Covered Software in Source
+Code form that alters or restricts the applicable version of this License
+or the recipients' rights hereunder. You may choose to offer, and to
+charge a fee for, warranty, support, indemnity or liability obligations to
+one or more recipients of Covered Software.  However, you may do so only
+on Your own behalf, and not on behalf of the Initial Developer or any
+Contributor. You must make it absolutely clear that any such warranty,
+support, indemnity or liability obligation is offered by You alone, and
+You hereby agree to indemnify the Initial Developer and every Contributor
+for any liability incurred by the Initial Developer or such Contributor
+as a result of warranty, support, indemnity or liability terms You offer.
+
+3.5. Distribution of Executable Versions.
+
+You may distribute the Executable form of the Covered Software under the
+terms of this License or under the terms of a license of Your choice,
+which may contain terms different from this License, provided that You are
+in compliance with the terms of this License and that the license for the
+Executable form does not attempt to limit or alter the recipient's rights
+in the Source Code form from the rights set forth in this License. If
+You distribute the Covered Software in Executable form under a different
+license, You must make it absolutely clear that any terms which differ
+from this License are offered by You alone, not by the Initial Developer
+or Contributor. You hereby agree to indemnify the Initial Developer and
+every Contributor for any liability incurred by the Initial Developer
+or such Contributor as a result of any such terms You offer.
+
+3.6. Larger Works.
+
+You may create a Larger Work by combining Covered Software with other code
+not governed by the terms of this License and distribute the Larger Work
+as a single product. In such a case, You must make sure the requirements
+of this License are fulfilled for the Covered Software.
+
+4. Versions of the License. 
+
+4.1. New Versions.
+
+Sun Microsystems, Inc. is the initial license steward and may publish
+revised and/or new versions of this License from time to time. Each
+version will be given a distinguishing version number. Except as provided
+in Section 4.3, no one other than the license steward has the right to
+modify this License.
+
+4.2. Effect of New Versions.
+
+You may always continue to use, distribute or otherwise make the Covered
+Software available under the terms of the version of the License under
+which You originally received the Covered Software. If the Initial
+Developer includes a notice in the Original Software prohibiting it
+from being distributed or otherwise made available under any subsequent
+version of the License, You must distribute and make the Covered Software
+available under the terms of the version of the License under which You
+originally received the Covered Software. Otherwise, You may also choose
+to use, distribute or otherwise make the Covered Software available
+under the terms of any subsequent version of the License published by
+the license steward.
+
+4.3. Modified Versions.
+
+When You are an Initial Developer and You want to create a new license
+for Your Original Software, You may create and use a modified version of
+this License if You: (a) rename the license and remove any references
+to the name of the license steward (except to note that the license
+differs from this License); and (b) otherwise make it clear that the
+license contains terms which differ from this License.
+
+5. DISCLAIMER OF WARRANTY.
+
+COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+WITHOUT LIMITATION, WARRANTIES THAT THE COVERED SOFTWARE IS FREE OF
+DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE
+ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED SOFTWARE
+IS WITH YOU. SHOULD ANY COVERED SOFTWARE PROVE DEFECTIVE IN ANY RESPECT,
+YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST
+OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF
+WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY
+COVERED SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
+
+6. TERMINATION. 
+
+6.1. This License and the rights granted hereunder will terminate
+automatically if You fail to comply with terms herein and fail to cure
+such breach within 30 days of becoming aware of the breach. Provisions
+which, by their nature, must remain in effect beyond the termination of
+this License shall survive.
+
+6.2. If You assert a patent infringement claim (excluding declaratory
+judgment actions) against Initial Developer or a Contributor (the
+Initial Developer or Contributor against whom You assert such claim is
+referred to as "Participant") alleging that the Participant Software
+(meaning the Contributor Version where the Participant is a Contributor
+or the Original Software where the Participant is the Initial Developer)
+directly or indirectly infringes any patent, then any and all rights
+granted directly or indirectly to You by such Participant, the Initial
+Developer (if the Initial Developer is not the Participant) and all
+Contributors under Sections 2.1 and/or 2.2 of this License shall, upon 60
+days notice from Participant terminate prospectively and automatically
+at the expiration of such 60 day notice period, unless if within such
+60 day period You withdraw Your claim with respect to the Participant
+Software against such Participant either unilaterally or pursuant to a
+written agreement with Participant.
+
+6.3. In the event of termination under Sections 6.1 or 6.2 above, all end
+user licenses that have been validly granted by You or any distributor
+hereunder prior to termination (excluding licenses granted to You by
+any distributor) shall survive termination.
+
+7. LIMITATION OF LIABILITY.
+
+UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING
+NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL DEVELOPER, ANY
+OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED SOFTWARE, OR ANY SUPPLIER
+OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL,
+INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT
+LIMITATION, DAMAGES FOR LOST PROFITS, LOSS OF GOODWILL, WORK STOPPAGE,
+COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES
+OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY
+OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY
+FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH PARTY'S NEGLIGENCE TO
+THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS
+DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL
+DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
+
+8. U.S. GOVERNMENT END USERS.
+
+The Covered Software is a "commercial item," as that term is defined
+in 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer
+software" (as that term is defined at 48 C.F.R.  252.227-7014(a)(1)) and
+"commercial computer software documentation" as such terms are used in
+48 C.F.R. 12.212 (Sept.  1995). Consistent with 48 C.F.R. 12.212 and 48
+C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End
+Users acquire Covered Software with only those rights set forth herein.
+This U.S. Government Rights clause is in lieu of, and supersedes, any
+other FAR, DFAR, or other clause or provision that addresses Government
+rights in computer software under this License.
+
+9. MISCELLANEOUS.
+
+This License represents the complete agreement concerning subject matter
+hereof. If any provision of this License is held to be unenforceable,
+such provision shall be reformed only to the extent necessary to make it
+enforceable. This License shall be governed by the law of the jurisdiction
+specified in a notice contained within the Original Software (except to
+the extent applicable law, if any, provides otherwise), excluding such
+jurisdiction's conflict-of-law provisions. Any litigation relating to
+this License shall be subject to the jurisdiction of the courts located
+in the jurisdiction and venue specified in a notice contained within
+the Original Software, with the losing party responsible for costs,
+including, without limitation, court costs and reasonable attorneys'
+fees and expenses. The application of the United Nations Convention on
+Contracts for the International Sale of Goods is expressly excluded. Any
+law or regulation which provides that the language of a contract shall
+be construed against the drafter shall not apply to this License.
+You agree that You alone are responsible for compliance with the United
+States export administration regulations (and the export control laws and
+regulation of any other countries) when You use, distribute or otherwise
+make available any Covered Software.
+
+10. RESPONSIBILITY FOR CLAIMS.
+
+As between Initial Developer and the Contributors, each party is
+responsible for claims and damages arising, directly or indirectly, out
+of its utilization of rights under this License and You agree to work
+with Initial Developer and Contributors to distribute such responsibility
+on an equitable basis. Nothing herein is intended or shall be deemed to
+constitute any admission of liability.
+
+
+
+===========================================================================
+
+To the extent any open source components are licensed under the
+GPL and/or LGPL, or other similar licenses that require the
+source code and/or modifications to source code to be made
+available (as would be noted above), you may obtain a copy of
+the source code corresponding to the binaries for such open
+source components and modifications thereto, if any, (the
+"Source Files"), by downloading the Source Files from VMware's website at
+http://www.vmware.com/download/open_source.html, or by sending a request, with
+your name and address to: VMware, Inc., 3401 Hillview Avenue,
+Palo Alto, CA 94304,United States of America. All such
+requests should clearly specify: OPEN SOURCE FILES REQUEST,
+Attention General Counsel. VMware shall mail a copy of the
+Source Files to you on a CD or equivalent physical medium. This
+offer to obtain a copy of the Source Files is valid for three
+years from the date you acquired this Software product. Alternatively,
+the Source Files may accompany the VMware product.
+
+
+[GFEHTTPMODULE70BKR100512]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/65a03287/extensions/gemfire-modules-assembly/release/conf/cache-client.xml
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-assembly/release/conf/cache-client.xml b/extensions/gemfire-modules-assembly/release/conf/cache-client.xml
new file mode 100755
index 0000000..c8444b2
--- /dev/null
+++ b/extensions/gemfire-modules-assembly/release/conf/cache-client.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE client-cache PUBLIC
+  "-//GemStone Systems, Inc.//GemFire Declarative Caching 6.5//EN"
+  "http://www.gemstone.com/dtd/cache6_6.dtd">
+  
+<client-cache>
+
+  <!-- The default pool connects to a cache server running on  localhost at
+       port 40404. To connect to a different server host and port, modify
+       the following pool server host and port. -->
+  <pool name="sessions" subscription-enabled="true">
+    <server host="localhost" port="40404"/>
+  </pool>
+
+  <!-- To configure the client to use a locator instead of a server, replace
+       the server pool above with the locator pool below and modify the locator
+       host and port as necessary. -->
+  <!--
+  <pool name="sessions" subscription-enabled="true">
+    <locator host="localhost" port="10334"/>
+  </pool>
+  -->
+  
+</client-cache>

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/65a03287/extensions/gemfire-modules-assembly/release/conf/cache-peer.xml
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-assembly/release/conf/cache-peer.xml b/extensions/gemfire-modules-assembly/release/conf/cache-peer.xml
new file mode 100755
index 0000000..1a49637
--- /dev/null
+++ b/extensions/gemfire-modules-assembly/release/conf/cache-peer.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE cache PUBLIC
+  "-//GemStone Systems, Inc.//GemFire Declarative Caching 6.5//EN"
+  "http://www.gemstone.com/dtd/cache6_6.dtd">
+  
+<cache>
+
+  <!-- Uncomment the following disk-store element to modify the default disk store directory -->
+  <!--
+  <disk-store name="DEFAULT">
+    <disk-dirs>
+      <disk-dir>/path/to/persistent/data</disk-dir>
+    </disk-dirs>
+  </disk-store>
+  -->
+
+  <!-- This is the definition of the default session region -->
+  <!--
+  <region name="gemfire_modules_sessions">
+    <region-attributes scope="distributed-ack" enable-gateway="false" data-policy="replicate" statistics-enabled="true">
+      <entry-idle-time>
+        <expiration-attributes timeout="0" action="invalidate">
+          <custom-expiry>
+            <class-name>com.gemstone.gemfire.modules.util.SessionCustomExpiry</class-name>
+          </custom-expiry>
+        </expiration-attributes>
+      </entry-idle-time>
+    </region-attributes>
+  </region>
+  -->
+  
+</cache>

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/65a03287/extensions/gemfire-modules-assembly/release/conf/cache-server.xml
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-assembly/release/conf/cache-server.xml b/extensions/gemfire-modules-assembly/release/conf/cache-server.xml
new file mode 100755
index 0000000..6ee2223
--- /dev/null
+++ b/extensions/gemfire-modules-assembly/release/conf/cache-server.xml
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE cache PUBLIC
+  "-//GemStone Systems, Inc.//GemFire Declarative Caching 6.5//EN"
+  "http://www.gemstone.com/dtd/cache6_6.dtd">
+  
+<cache>
+
+  <!-- Uncomment the following gateway-hub element to create a gateway hub -->
+  <!--
+  <gateway-hub id="NY" port="11110">
+    <gateway id="LN">
+      <gateway-endpoint id="LN-1" host="localhost" port="22220"/>
+      <gateway-queue disk-store-name="NY_GATEWAY"/>
+    </gateway>
+  </gateway-hub>
+  -->
+
+  <!-- Uncomment the following cache-server element to modify the listen port -->
+  <!--
+  <cache-server port="44444"/>
+  -->
+
+  <!-- Uncomment the following disk-store element to modify the default disk store directory -->
+  <!--
+  <disk-store name="DEFAULT">
+    <disk-dirs>
+      <disk-dir>/path/to/persistent/data</disk-dir>
+    </disk-dirs>
+  </disk-store>
+  -->
+  
+  <!-- Uncomment the following disk-store element to create the NY_GATEWAY disk store
+       (for the gateway-hub element defined above) -->
+  <!--
+  <disk-store name="NY_GATEWAY">
+    <disk-dirs>
+      <disk-dir>/path/to/persistent/data</disk-dir>
+    </disk-dirs>
+  </disk-store>
+  -->
+  
+  <!-- This is the definition of the default session region -->
+  <!--
+  <region name="gemfire_modules_sessions">
+    <region-attributes enable-gateway="false" data-policy="partition" statistics-enabled="true">
+      <entry-idle-time>
+        <expiration-attributes timeout="0" action="invalidate">
+          <custom-expiry>
+            <class-name>com.gemstone.gemfire.modules.util.SessionCustomExpiry</class-name>
+          </custom-expiry>
+        </expiration-attributes>
+      </entry-idle-time>
+      <partition-attributes redundant-copies="1" total-num-buckets="113"/>
+    </region-attributes>
+  </region>
+  -->
+
+</cache>

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/65a03287/extensions/gemfire-modules-assembly/release/hibernate/readme.txt
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-assembly/release/hibernate/readme.txt b/extensions/gemfire-modules-assembly/release/hibernate/readme.txt
new file mode 100644
index 0000000..58a4c91
--- /dev/null
+++ b/extensions/gemfire-modules-assembly/release/hibernate/readme.txt
@@ -0,0 +1,14 @@
+Pivotal(TM) GemFire(R) Hibernate Cache Module @VERSION@
+
+This module provides fast, scalable, distributed L2 caching for JBoss Hibernate.
+
+Access all Pivotal GemFire Documentation at:
+http://gemfire.docs.pivotal.io/
+
+Pivotal Support Services can be accessed from the Pivotal or VMware website.
+Access varies by license type, support offering (contract or per-incident) and 
+product. Please see the Pivotal page at http://www.pivotal.io/support or to 
+file a VMware Support Request, please see the VMware page at 
+https://www.vmware.com/support/policies/howto.html for information on "How to 
+File a Support Request."
+

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/65a03287/extensions/gemfire-modules-assembly/release/scripts/cacheserver.bat
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-assembly/release/scripts/cacheserver.bat b/extensions/gemfire-modules-assembly/release/scripts/cacheserver.bat
new file mode 100755
index 0000000..538bd7a
--- /dev/null
+++ b/extensions/gemfire-modules-assembly/release/scripts/cacheserver.bat
@@ -0,0 +1,122 @@
+@echo off
+rem
+rem Copyright 2015 Pivotal Software, Inc.
+rem cacheserver.bat - The script used to control the cacheserver. 
+rem Release Version - @bundle.version@
+rem 
+
+setlocal
+setlocal enableextensions
+setlocal enabledelayedexpansion
+set scriptdir=%~dp0
+set gf=%scriptdir:\bin\=%
+if exist "%gf%\lib\gemfire.jar" @goto gfok
+echo Could not determine GEMFIRE location
+rem verify other 2>nul
+goto done
+:gfok
+
+if exist "%gf%\bin\modules.env" (
+  FOR /F "tokens=*" %%i in ('type %gf%\bin\modules.env') do SET %%i
+)
+
+rem Check for the -d argument
+set /a FOUND_ARG=0
+set TC_INSTALL_DIR=
+FOR %%A IN (%*) DO (
+  if !FOUND_ARG! == 1 (
+    set /a FOUND_ARG-=1
+    set TC_INSTALL_DIR=%%~fA
+  )
+  if %%A == -d (
+    set /a FOUND_ARG+=1
+  )
+)
+
+rem Pull out the unused args for the java class
+set CLASS_ARGS=
+:loop
+IF "%1"=="" GOTO ENDLOOP
+  if "%1" == "-d" (
+    shift
+    shift
+  ) else ( 
+    set "CLASS_ARGS=!CLASS_ARGS! %1" 
+    shift
+  )
+GOTO loop
+
+:ENDLOOP
+
+IF NOT "%TC_INSTALL_DIR%" == "" goto SET_TOMCAT_DIR
+FOR /f %%f in ('forfiles /P %gf%\.. /m tomcat-%TOMCAT_MAJOR_VER%* /c "cmd /c echo @path"') do set TOMCAT_DIR=%%f
+REM Strip the surrounding quotes
+set TOMCAT_DIR=%TOMCAT_DIR:"=%
+goto TEST_TOMCAT_DIR
+
+:SET_TOMCAT_DIR
+set /p TOMCAT_VER=<"%gf%\conf\tomcat.version"
+set TOMCAT_DIR="!TC_INSTALL_DIR!\tomcat-!TOMCAT_VER!"
+
+:TEST_TOMCAT_DIR
+if not exist "!TOMCAT_DIR!\lib\catalina.jar" goto TOMCAT_NOT_FOUND
+goto FIND_MOD_JAR
+
+:FIND_MOD_JAR
+FOR %%f in (!gf!\lib\gemfire-modules-?.*.jar) do set MOD_JAR=%%f
+IF NOT "%MOD_JAR%" == "" goto FIND_LOG_API
+rem This is the default modules jar
+set MOD_JAR="!gf!\lib\gemfire-modules.jar"
+
+:FIND_LOG_API
+FOR %%f in (!gf!\lib\log4j-api*.jar) do set LOG_API_JAR=%%f
+IF NOT "%LOG_API_JAR%" == "" goto FIND_LOG_CORE
+echo ERROR: Log4J API jar not found.
+goto LIBS_NOT_FOUND
+
+:FIND_LOG_CORE
+FOR %%f in (!gf!\lib\log4j-core*.jar) do set LOG_CORE_JAR=%%f
+IF NOT "%LOG_CORE_JAR%" == "" goto MAIN_PROCESSING
+echo ERROR: Log4J Core jar not found.
+goto LIBS_NOT_FOUND
+
+
+:LIBS_NOT_FOUND
+echo ERROR: The required libraries could not be located. 
+echo Try using the -d ^<tc Server installation directory^> option or make sure it was installed correctly.
+echo Example: cacheserver.bat start -d "c:\Program Files\Pivotal\tcServer\pivotal-tc-server-standard"
+exit /b 1
+
+:TOMCAT_NOT_FOUND
+echo ERROR: The TOMCAT libraries could not be located. 
+echo Try using the -d ^<tc Server installation directory^> option or make sure it was installed correctly.
+echo Example: cacheserver.bat start -d "c:\Program Files\Pivotal\tcServer\pivotal-tc-server-standard"
+exit /b 1
+
+:MAIN_PROCESSING
+REM Initialize classpath
+
+REM Add GemFire classes
+set GEMFIRE_JARS=%MOD_JAR%;%LOG_API_JAR%;%LOG_CORE_JAR%;%gf%/lib/gemfire.jar;%gf%/lib/antlr.jar;%gf%/lib/mail.jar
+
+REM Add Tomcat classes
+set GEMFIRE_JARS=%GEMFIRE_JARS%;%TOMCAT_DIR%/lib/servlet-api.jar;%TOMCAT_DIR%/lib/catalina.jar;%gf%/lib/gemfire-modules.jar;%TOMCAT_DIR%/bin/tomcat-juli.jar;%TOMCAT_DIR%/lib/tomcat-util.jar
+
+REM Add conf directory
+set GEMFIRE_JARS=%GEMFIRE_JARS%;%gf%/conf
+
+
+if defined CLASSPATH set GEMFIRE_JARS=%GEMFIRE_JARS%;%CLASSPATH%
+
+if not defined GF_JAVA (
+  REM %GF_JAVA% is not defined, assume it is on the PATH
+  set GF_JAVA=java
+)
+
+"%GF_JAVA%" %JAVA_ARGS% -classpath "%GEMFIRE_JARS%" com.gemstone.gemfire.internal.cache.CacheServerLauncher !CLASS_ARGS!
+:done
+set scriptdir=
+set gf=
+set GEMFIRE_JARS=
+
+endlocal

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/65a03287/extensions/gemfire-modules-assembly/release/scripts/cacheserver.sh
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-assembly/release/scripts/cacheserver.sh b/extensions/gemfire-modules-assembly/release/scripts/cacheserver.sh
new file mode 100755
index 0000000..f37270f
--- /dev/null
+++ b/extensions/gemfire-modules-assembly/release/scripts/cacheserver.sh
@@ -0,0 +1,95 @@
+#!/usr/bin/env bash
+
+#
+# Copyright 2015 Pivotal Software, Inc
+# cacheserver.sh - Script used to control the cacheserver
+# Release Version - @bundle.version@
+#
+
+# Set GEMFIRE to the product toplevel directory
+GEMFIRE=`dirname $0`
+OLDPWD=$PWD
+cd $GEMFIRE
+GEMFIRE=`dirname $PWD`
+cd $OLDPWD
+
+TOMCAT_VER=`cat "${GEMFIRE}/conf/tomcat.version"`
+
+if [ -f $GEMFIRE/bin/modules.env ]; then
+  # Pull in TOMCAT_MAJOR_VER
+  . $GEMFIRE/bin/modules.env
+fi
+
+# Pull out the installation directory arguments passed in
+ARGS=( "$@" )
+ARGS_LENGTH=${#ARGS[@]}
+CLASS_ARGS=()
+for (( i==0; i<$ARGS_LENGTH; i++ )); 
+do
+	if [ "${ARGS[$i]}" == "-d" ]; then
+		i=$(($i+1))
+	else 
+		CLASS_ARGS="${CLASS_ARGS} ${ARGS[$i]}"
+	fi
+done
+# End pulling out arguments
+
+# See if the user specified the tomcat installation directory location
+while [ $# -gt 0 ]; do
+  case $1 in
+    -d )
+      TC_INSTALL_DIR="$2"
+      break
+      ;;
+  esac
+  shift
+done
+
+
+if [[ -n $TC_INSTALL_DIR && -d $TC_INSTALL_DIR ]]; then
+  TOMCAT_DIR="$TC_INSTALL_DIR/tomcat-${TOMCAT_VER}"
+else
+  TOMCAT_DIR=`ls -d "${GEMFIRE}"/../tomcat-${TOMCAT_MAJOR_VER}* 2> /dev/null`
+fi
+
+if [[ -z "$TOMCAT_DIR" || ! -f "$TOMCAT_DIR/lib/catalina.jar" ]]; then
+  echo "ERROR: Could not determine TOMCAT library location."
+  echo "       Use the -d <tc Server installation directory> option."
+  echo "       Example: ./cacheserver.sh start -d /opt/pivotal/tcserver/pivotal-tc-server-standard"
+  exit 1
+fi
+
+if [ "x$WINDIR" != "x" ]; then
+  echo "ERROR: The variable WINDIR is set indicating this script is running in a Windows OS, please use the .bat file version instead."
+  exit 1
+fi
+
+if [ ! -f $GEMFIRE/lib/gemfire.jar ]; then
+  echo "ERROR: Could not determine GEMFIRE location."
+  exit 1
+fi
+
+# Initialize classpath
+
+LOG4J_API=$( ls $GEMFIRE/lib/log4j-api*jar )
+LOG4J_CORE=$( ls $GEMFIRE/lib/log4j-core*jar )
+
+MOD_JAR=`ls $GEMFIRE/lib/gemfire-modules-?.*.jar` 2>/dev/null
+if [ -z "$MOD_JAR" ]; then
+  MOD_JAR=$GEMFIRE/lib/gemfire-modules.jar
+fi
+
+# Add GemFire classes
+GEMFIRE_JARS=$GEMFIRE/lib/gemfire.jar:$GEMFIRE/lib/antlr.jar:$LOG4J_API:$LOG4J_CORE
+
+# Add Tomcat classes
+GEMFIRE_JARS=$GEMFIRE_JARS:$MOD_JAR:$TOMCAT_DIR/lib/servlet-api.jar:$TOMCAT_DIR/lib/catalina.jar:$TOMCAT_DIR/lib/tomcat-util.jar:$TOMCAT_DIR/bin/tomcat-juli.jar
+
+# Add configuration
+GEMFIRE_JARS=$GEMFIRE_JARS:$GEMFIRE/conf
+
+if [ "x$CLASSPATH" != "x" ]; then
+  GEMFIRE_JARS=$GEMFIRE_JARS:$CLASSPATH
+fi
+
+${GF_JAVA:-java} ${JAVA_ARGS} -classpath ${GEMFIRE_JARS} com.gemstone.gemfire.internal.cache.CacheServerLauncher ${CLASS_ARGS}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/65a03287/extensions/gemfire-modules-assembly/release/scripts/gemfire.bat
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-assembly/release/scripts/gemfire.bat b/extensions/gemfire-modules-assembly/release/scripts/gemfire.bat
new file mode 100755
index 0000000..96d2564
--- /dev/null
+++ b/extensions/gemfire-modules-assembly/release/scripts/gemfire.bat
@@ -0,0 +1,23 @@
+@setlocal enableextensions
+@set scriptdir=%~dp0
+@set gf=%scriptdir:\bin\=%
+@if exist "%gf%\lib\gemfire.jar" @goto gfok
+@echo Could not determine GEMFIRE location
+@verify other 2>nul
+@goto done
+:gfok
+
+@set GEMFIRE_JARS=%gf%/lib/gemfire.jar;%gf%/lib/antlr.jar;%gf%/lib/mail.jar
+@if defined CLASSPATH set GEMFIRE_JARS=%GEMFIRE_JARS%;%CLASSPATH%
+
+@if not defined GF_JAVA (
+@REM %GF_JAVA% is not defined, assume it is on the PATH
+@set GF_JAVA=java
+)
+
+@"%GF_JAVA%" %JAVA_ARGS% -classpath "%GEMFIRE_JARS%" com.gemstone.gemfire.internal.SystemAdmin %*
+:done
+@set scriptdir=
+@set gf=
+@set GEMFIRE_JARS=
+

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/65a03287/extensions/gemfire-modules-assembly/release/scripts/gemfire.sh
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-assembly/release/scripts/gemfire.sh b/extensions/gemfire-modules-assembly/release/scripts/gemfire.sh
new file mode 100755
index 0000000..c080f87
--- /dev/null
+++ b/extensions/gemfire-modules-assembly/release/scripts/gemfire.sh
@@ -0,0 +1,43 @@
+#!/bin/bash
+# Set GEMFIRE to the product toplevel directory
+GEMFIRE=`dirname $0`
+OLDPWD=$PWD
+cd $GEMFIRE
+GEMFIRE=`dirname $PWD`
+cd $OLDPWD
+
+if [ "x$WINDIR" != "x" ]; then
+  echo "ERROR: The variable WINDIR is set indicating this script is running in a Windows OS, please use the .bat file version instead."
+  exit 1
+fi
+
+if [ ! -f $GEMFIRE/lib/gemfire.jar ]; then
+  echo "ERROR: Could not determine GEMFIRE location."
+  exit 1
+fi
+
+LOG4J_API=$( ls $GEMFIRE/lib/log4j-api*jar )
+LOG4J_CORE=$( ls $GEMFIRE/lib/log4j-core*jar )
+GEMFIRE_JARS=$GEMFIRE/lib/gemfire.jar:$GEMFIRE/lib/antlr.jar:$LOG4J_API:$LOG4J_CORE
+
+if [ "x$CLASSPATH" != "x" ]; then
+  GEMFIRE_JARS=$GEMFIRE_JARS:$CLASSPATH
+fi
+
+# Command line args that start with -J will be passed to the java vm in JARGS.
+# See java --help for a listing of valid vm args.
+# Example: -J-Xmx1g sets the max heap size to 1 gigabyte.
+
+JARGS=
+GEMFIRE_ARGS=
+for i in "$@"
+do
+  if [ "-J" == "${i:0:2}" ]
+  then
+    JARGS="${JARGS} \"${i#-J}\""
+  else
+    GEMFIRE_ARGS="${GEMFIRE_ARGS} \"${i}\""
+  fi
+done
+
+eval ${GF_JAVA:-java} ${JAVA_ARGS} ${JARGS} -classpath ${GEMFIRE_JARS} com.gemstone.gemfire.internal.SystemAdmin ${GEMFIRE_ARGS}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/65a03287/extensions/gemfire-modules-assembly/release/scripts/setenv.properties
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-assembly/release/scripts/setenv.properties b/extensions/gemfire-modules-assembly/release/scripts/setenv.properties
new file mode 100644
index 0000000..fc8918b
--- /dev/null
+++ b/extensions/gemfire-modules-assembly/release/scripts/setenv.properties
@@ -0,0 +1,6 @@
+java.opt.1=-Xms${initial.vm.heap.size.mb:512}M
+java.opt.2=-Xmx${maximum.vm.heap.size.mb:512}M
+java.opt.hotspot.1=-XX:+UseParNewGC
+java.opt.hotspot.2=-XX:+UseConcMarkSweepGC
+java.opt.hotspot.3=-XX:CMSInitiatingOccupancyFraction=${cms.initiating.heap.percentage:50}
+java.opt.j9.1=-Xgcpolicy:gencon
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/65a03287/extensions/gemfire-modules-assembly/release/session/bin/cacheserver.bat
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-assembly/release/session/bin/cacheserver.bat b/extensions/gemfire-modules-assembly/release/session/bin/cacheserver.bat
new file mode 100755
index 0000000..6a5b219
--- /dev/null
+++ b/extensions/gemfire-modules-assembly/release/session/bin/cacheserver.bat
@@ -0,0 +1,40 @@
+@echo off
+@echo off
+setlocal enableextensions
+set scriptdir=%~dp0
+set gf=%scriptdir:\bin\=%
+
+set GEMFIRE_JARS=%gf%\lib\gemfire.jar
+set GEMFIRE_JARS=%GEMFIRE_JARS%;%gf%\lib\antlr.jar
+set GEMFIRE_JARS=%GEMFIRE_JARS%;%gf%\lib\spring-core-3.1.1.RELEASE.jar
+set GEMFIRE_JARS=%GEMFIRE_JARS%;%gf%\lib\spring-shell-1.0.0.RC1.jar
+if exist "%GEMFIRE_JARS%" goto gfok
+echo Could not determine GEMFIRE location
+verify other 2>nul
+goto done
+:gfok
+
+REM Initialize classpath
+set GEMFIRE_JARS=%GEMFIRE_JARS%;%gf%\lib\gemfire-modules-@GEMFIRE_MODULES_VERSION@.jar
+set GEMFIRE_JARS=%GEMFIRE_JARS%;%gf%\lib\gemfire-modules-session-@GEMFIRE_MODULES_VERSION@.jar
+set GEMFIRE_JARS=%GEMFIRE_JARS%;%gf%\lib\gemfire-modules-session-external-@GEMFIRE_MODULES_VERSION@.jar
+set GEMFIRE_JARS=%GEMFIRE_JARS%;%gf%\lib\servlet-api-@SERVLET_API_VERSION@.jar
+set GEMFIRE_JARS=%GEMFIRE_JARS%;%gf%\lib\slf4j-api-@SLF4J_VERSION@.jar
+set GEMFIRE_JARS=%GEMFIRE_JARS%;%gf%\lib\slf4j-jdk14-@SLF4J_VERSION@.jar
+
+REM Add conf directory
+set GEMFIRE_JARS=%GEMFIRE_JARS%;%gf%\conf
+
+if defined CLASSPATH set GEMFIRE_JARS=%GEMFIRE_JARS%;%CLASSPATH%
+
+if not defined GF_JAVA (
+REM %GF_JAVA% is not defined, assume it is on the PATH
+set GF_JAVA=java
+)
+
+"%GF_JAVA%" %JAVA_ARGS% -classpath "%GEMFIRE_JARS%" com.gemstone.gemfire.internal.cache.CacheServerLauncher %*
+:done
+set scriptdir=
+set gf=
+set GEMFIRE_JARS=
+

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/65a03287/extensions/gemfire-modules-assembly/release/session/bin/cacheserver.sh
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-assembly/release/session/bin/cacheserver.sh b/extensions/gemfire-modules-assembly/release/session/bin/cacheserver.sh
new file mode 100755
index 0000000..2fa707b
--- /dev/null
+++ b/extensions/gemfire-modules-assembly/release/session/bin/cacheserver.sh
@@ -0,0 +1,41 @@
+#!/bin/bash
+# Set GEMFIRE to the product toplevel directory
+GEMFIRE=`dirname $0`
+OLDPWD=$PWD
+cd $GEMFIRE
+GEMFIRE=`dirname $PWD`
+cd $OLDPWD
+
+if [ "x$WINDIR" != "x" ]; then
+  echo "ERROR: The variable WINDIR is set indicating this script is running in a Windows OS, please use the .bat file version instead."
+  exit 1
+fi
+
+GEMFIRE_JARS=$GEMFIRE/lib/gemfire.jar
+
+if [ ! -f "${GEMFIRE_JARS}" ]; then
+  echo "ERROR: Could not determine GEMFIRE location."
+  exit 1
+fi
+
+LOG4J_API=$( ls $GEMFIRE/lib/log4j-api*jar )
+LOG4J_CORE=$( ls $GEMFIRE/lib/log4j-core*jar )
+
+GEMFIRE_JARS=$GEMFIRE_JARS:$GEMFIRE/lib/antlr.jar:$LOG4J_API:$LOG4J_CORE
+
+# Initialize classpath
+GEMFIRE_JARS=$GEMFIRE_JARS:$GEMFIRE/lib/gemfire-modules-@GEMFIRE_MODULES_VERSION@.jar \
+GEMFIRE_JARS=$GEMFIRE_JARS:$GEMFIRE/lib/gemfire-modules-session-@GEMFIRE_MODULES_VERSION@.jar \
+GEMFIRE_JARS=$GEMFIRE_JARS:$GEMFIRE/lib/servlet-api-@SERVLET_API_VERSION@.jar \
+GEMFIRE_JARS=$GEMFIRE_JARS:$GEMFIRE/lib/gemfire-modules-session-external-@GEMFIRE_MODULES_VERSION@.jar \
+GEMFIRE_JARS=$GEMFIRE_JARS:$GEMFIRE/lib/slf4j-api-@SLF4J_VERSION@.jar \
+GEMFIRE_JARS=$GEMFIRE_JARS:$GEMFIRE/lib/slf4j-jdk14-@SLF4J_VERSION@.jar
+
+# Add configuration
+GEMFIRE_JARS=$GEMFIRE_JARS:$GEMFIRE/conf
+
+if [ "x$CLASSPATH" != "x" ]; then
+  GEMFIRE_JARS=$GEMFIRE_JARS:$CLASSPATH
+fi
+
+${GF_JAVA:-java} ${JAVA_ARGS} -classpath ${GEMFIRE_JARS} com.gemstone.gemfire.internal.cache.CacheServerLauncher "$@"

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/65a03287/extensions/gemfire-modules-assembly/release/session/bin/gemfire.bat
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-assembly/release/session/bin/gemfire.bat b/extensions/gemfire-modules-assembly/release/session/bin/gemfire.bat
new file mode 100755
index 0000000..9aef6e2
--- /dev/null
+++ b/extensions/gemfire-modules-assembly/release/session/bin/gemfire.bat
@@ -0,0 +1,37 @@
+@echo off
+@echo off
+setlocal enableextensions
+set scriptdir=%~dp0
+set gf=%scriptdir:\bin\=%
+
+set GEMFIRE_JARS=%gf%\lib\gemfire.jar
+set GEMFIRE_JARS=%GEMFIRE_JARS%;%gf%\lib\antlr.jar
+set GEMFIRE_JARS=%GEMFIRE_JARS%;%gf%\lib\spring-core-3.1.1.RELEASE.jar
+set GEMFIRE_JARS=%GEMFIRE_JARS%;%gf%\lib\spring-shell-1.0.0.RC1.jar
+if exist "%GEMFIRE_JARS%" goto gfok
+echo Could not determine GEMFIRE location
+verify other 2>nul
+goto done
+:gfok
+
+REM Initialize classpath
+set GEMFIRE_JARS=%GEMFIRE_JARS%;%gf%\lib\gemfire-modules-@GEMFIRE_MODULES_VERSION@.jar
+set GEMFIRE_JARS=%GEMFIRE_JARS%;%gf%\lib\gemfire-modules-session-@GEMFIRE_MODULES_VERSION@.jar
+set GEMFIRE_JARS=%GEMFIRE_JARS%;%gf%\lib\gemfire-modules-session-external-@GEMFIRE_MODULES_VERSION@.jar
+set GEMFIRE_JARS=%GEMFIRE_JARS%;%gf%\lib\servlet-api-@SERVLET_API_VERSION@.jar
+set GEMFIRE_JARS=%GEMFIRE_JARS%;%gf%\lib\slf4j-api-@SLF4J_VERSION@.jar
+set GEMFIRE_JARS=%GEMFIRE_JARS%;%gf%\lib\slf4j-jdk14-@SLF4J_VERSION@.jar
+
+if defined CLASSPATH set GEMFIRE_JARS=%GEMFIRE_JARS%;%CLASSPATH%
+
+if not defined GF_JAVA (
+REM %GF_JAVA% is not defined, assume it is on the PATH
+set GF_JAVA=java
+)
+
+"%GF_JAVA%" %JAVA_ARGS% -classpath "%GEMFIRE_JARS%" com.gemstone.gemfire.internal.SystemAdmin %*
+:done
+set scriptdir=
+set gf=
+set GEMFIRE_JARS=
+

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/65a03287/extensions/gemfire-modules-assembly/release/session/bin/gemfire.sh
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-assembly/release/session/bin/gemfire.sh b/extensions/gemfire-modules-assembly/release/session/bin/gemfire.sh
new file mode 100755
index 0000000..74ec1c4
--- /dev/null
+++ b/extensions/gemfire-modules-assembly/release/session/bin/gemfire.sh
@@ -0,0 +1,53 @@
+#!/bin/bash
+# Set GEMFIRE to the product toplevel directory
+GEMFIRE=`dirname $0`
+OLDPWD=$PWD
+cd $GEMFIRE
+GEMFIRE=`dirname $PWD`
+cd $OLDPWD
+
+if [ "x$WINDIR" != "x" ]; then
+  echo "ERROR: The variable WINDIR is set indicating this script is running in a Windows OS, please use the .bat file version instead."
+  exit 1
+fi
+
+GEMFIRE_JARS=$GEMFIRE/lib/gemfire.jar
+if [ ! -f "${GEMFIRE_JARS}" ]; then
+  echo "ERROR: Could not determine GEMFIRE location."
+  exit 1
+fi
+
+LOG4J_API=$( ls $GEMFIRE/lib/log4j-api*jar )
+LOG4J_CORE=$( ls $GEMFIRE/lib/log4j-core*jar )
+
+GEMFIRE_JARS=$GEMFIRE_JARS:$GEMFIRE/lib/antlr.jar:$LOG4J_API:$LOG4J_CORE
+
+# Initialize classpath
+GEMFIRE_JARS=$GEMFIRE_JARS:$GEMFIRE/lib/gemfire-modules-@GEMFIRE_MODULES_VERSION@.jar
+GEMFIRE_JARS=$GEMFIRE_JARS:$GEMFIRE/lib/gemfire-modules-session-@GEMFIRE_MODULES_VERSION@.jar
+GEMFIRE_JARS=$GEMFIRE_JARS:$GEMFIRE/lib/gemfire-modules-session-external-@GEMFIRE_MODULES_VERSION@.jar
+GEMFIRE_JARS=$GEMFIRE_JARS:$GEMFIRE/lib/servlet-api-@SERVLET_API_VERSION@.jar
+GEMFIRE_JARS=$GEMFIRE_JARS:$GEMFIRE/lib/slf4j-api-@SLF4J_VERSION@.jar
+GEMFIRE_JARS=$GEMFIRE_JARS:$GEMFIRE/lib/slf4j-jdk14-@SLF4J_VERSION@.jar
+
+if [ "x$CLASSPATH" != "x" ]; then
+  GEMFIRE_JARS=$GEMFIRE_JARS:$CLASSPATH
+fi
+
+# Command line args that start with -J will be passed to the java vm in JARGS.
+# See java --help for a listing of valid vm args.
+# Example: -J-Xmx1g sets the max heap size to 1 gigabyte.
+
+JARGS=
+GEMFIRE_ARGS=
+for i in "$@"
+do
+  if [ "-J" == "${i:0:2}" ]
+  then
+    JARGS="${JARGS} \"${i#-J}\""
+  else
+    GEMFIRE_ARGS="${GEMFIRE_ARGS} \"${i}\""
+  fi
+done
+
+eval ${GF_JAVA:-java} ${JAVA_ARGS} ${JARGS} -classpath ${GEMFIRE_JARS} com.gemstone.gemfire.internal.SystemAdmin ${GEMFIRE_ARGS}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/65a03287/extensions/gemfire-modules-assembly/release/session/bin/modify_war
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-assembly/release/session/bin/modify_war b/extensions/gemfire-modules-assembly/release/session/bin/modify_war
new file mode 100755
index 0000000..ed8999b
--- /dev/null
+++ b/extensions/gemfire-modules-assembly/release/session/bin/modify_war
@@ -0,0 +1,377 @@
+#!/usr/bin/env bash
+
+X=`dirname $0`
+EXE_DIR=`cd $X; pwd`
+LIB_DIR=`cd ${X}/../lib; pwd`
+
+SESSION_JAR="${LIB_DIR}/gemfire-modules-session-external-@GEMFIRE_MODULES_VERSION@.jar"
+
+declare -a OTHER_JARS
+OTHER_JARS=(${LIB_DIR}/gemfire.jar \
+    ${LIB_DIR}/antlr.jar
+    ${LIB_DIR}/gemfire-modules-@GEMFIRE_MODULES_VERSION@.jar \
+    ${LIB_DIR}/gemfire-modules-session-@GEMFIRE_MODULES_VERSION@.jar \
+    ${LIB_DIR}/slf4j-api-@SLF4J_VERSION@.jar)
+
+# This is required for GemFire 8.1
+LOG4J_API=$(ls ${LIB_DIR}/log4j-api*jar)
+LOG4J_CORE=$(ls ${LIB_DIR}/log4j-core*jar)
+if [ -f ${LOG4J_API} -a -f ${LOG4J_CORE} ]; then
+    OTHER_JARS[${#OTHER_JARS[*]}]=$LOG4J_API
+    OTHER_JARS[${#OTHER_JARS[*]}]=$LOG4J_CORE
+fi
+
+TMP_DIR="/tmp/modify_war.$$"
+
+ARG_INPUT_FILE=""
+ARG_WAR_LIB_DIR="WEB-INF/lib"
+ARG_EAR_LIB_DIR="lib"
+ARG_OUTPUT_FILE=""
+ARG_TEST_RUN=0
+ARG_CACHE_TYPE="peer-to-peer"
+ARG_PROCESS_LIBS=1
+declare -a ARG_GEMFIRE_PARAMETERS=""
+declare -a ARG_WAR_LIBS="$SESSION_JAR"
+declare -a ARG_EAR_LIBS=""
+declare -a ARG_JVM_OPTS=""
+
+function usage() {
+    cat <<EOF
+USAGE: modify_war <args>
+WHERE <args>:
+
+    -e <jar>
+                    Assumes the input file is an .ear file and will add the
+                    given jar as a shared, application library. The file will
+                    be added in a /lib directory (by default) and any embedded
+                    .war files will have a corresponding Class-Path entry added
+                    to their MANIFEST.MF file. The option can be given multiple times.
+
+    -h
+                    Displays this help message.
+
+    -j <jar>
+                    Additional library to add to the input file. Can be given
+                    multiple times.
+
+    -J <jvm opt>
+                    JVM argument to pass to sub-commands. Typically this might
+                    be to define proxy values. For example -J"-Dhttp.proxyHost=my-proxy"
+
+    -l <lib>
+                    Library directory where new jars will be placed inside war.
+                    Defaults to WEB-INF/lib.
+
+    -m <lib>
+                    Library directory where new jars will be placed inside ear.
+                    Defaults to /lib.
+
+    -o <file>
+                    The output file.
+
+    -p <param=value>
+                    Specific parameter for inclusion into the session filter
+                    definition as a regular init-param. Can be given multiple times.
+
+    -r
+                    Test run which only outputs an updated web.xml file.
+
+    -t <cache-type>
+                    Type of cache. Must be one of 'peer-to-peer' or
+                    'client-server'. Default is peer-to-peer.
+
+    -v              
+                    Verbose output
+ 
+    -w <war/ear file>
+                    The input file - either a WAR or EAR. The following actions
+                    will be performed depending on the type of file:
+                    WARs will have a <filter> element added to the web.xml and
+                    will have the appropriate jars copied to WEB-INF/lib.
+                    If the file is an EAR, then the appropriate jars will be
+                    copied to lib, within the ear and each embedded war files'
+                    manifest will have a Class-Path entry added (if one does
+                    not already exist).
+                    An appropriate slf4j binding jar must be included for ears
+                    or wars using -e or -j respectively. The following jars are
+                    provided:
+                        slf4j-jdk14
+                        slf4j-log4j12
+                        gemfire-modules-slf4j-weblogic
+
+    -x
+                    Do not create a self-contained war/ear file by copying all
+                    necessary jars into the file. When this option is used,
+                    additional jars will need to be made available to the
+                    container:
+                        gemfire.jar
+                        gemfire-modules.jar
+                        gemfire-modules-session.jar
+                        slf4j-api.jar
+                        slf4j-jdk14.jar (not for WebLogic)
+                        gemfire-modules-slf4j-weblogic.jar (WebLogic only)
+                    This option still modifes any web.xml files.
+                        
+EOF
+}
+
+
+# Two logging levels - 'I'nfo and 'D'ebug
+function log() {
+    local MSG=$1
+    local LVL=${2:-I}
+
+    if [ "$LVL" == "D" ]; then
+        if [ -n "$DEBUG" ]; then
+            echo "$(date '+%Y-%m-%d %H:%M:%S')  $LVL  $MSG" >&2
+        fi
+    else
+        echo "$(date '+%Y-%m-%d %H:%M:%S')  $LVL  $MSG" >&2
+    fi
+}
+
+
+function exiting() {
+    local MSG=$1
+    local CODE=${2:-0}
+
+    if [ -n "$MSG" ]; then
+        echo "ERROR: $MSG"
+    fi
+
+    rm -rf $TMP_DIR
+    exit $CODE
+}
+
+
+function add_war_jars() {
+    local WAR_LIB_DIR=$1/$ARG_WAR_LIB_DIR/
+    mkdir -p $WAR_LIB_DIR
+
+    log "Copying jar(s) into war's '$ARG_WAR_LIB_DIR' directory" D
+    for J in ${ARG_WAR_LIBS[*]}; do
+        log "    $J" D
+        cp $J $WAR_LIB_DIR || exiting "Unable to copy $J to temp location $WAR_LIB_DIR" 1
+    done
+}
+
+
+function process_manifest() {
+    local MANIFEST=$1
+    local TMP_MANIFEST
+
+    log "Processing manifest $MANIFEST" D
+
+    CP_LIBS=""
+    for J in ${OTHER_JARS[*]} ${ARG_EAR_LIBS[*]}; do
+        CP_LIBS="$CP_LIBS $ARG_EAR_LIB_DIR/$(basename $J)"
+    done
+
+    TMP_MANIFEST="$TMP_DIR/manifest.mf.$$"
+    cp $MANIFEST $TMP_MANIFEST
+
+    awk -v CP_LIBS="$CP_LIBS" '
+        BEGIN {
+            cp = 0
+            split(CP_LIBS, cp_array)
+        }
+        /^Class-Path/ {print $0 CP_LIBS; cp = 1; getline}
+        /^ *\r?$/ {
+            if (cp == 0) {
+                print "Class-Path:" CP_LIBS
+                cp = 1
+            }
+        }
+        {print $0}
+        END { if (cp == 0) print "Class-Path:" CP_LIBS }
+    ' $TMP_MANIFEST > $MANIFEST
+
+    rm $TMP_MANIFEST
+}
+
+
+function process_web_xml() {
+    local WORK_DIR=$1
+    local ARG_P=""
+    local JVM_OPTS=""
+
+    for i in ${ARG_GEMFIRE_PARAMETERS[*]}; do
+        ARG_P="$ARG_P -p $i"
+    done
+
+    for j in ${ARG_JVM_OPTS[*]}; do
+        JVM_OPTS="$JVM_OPTS $j"
+    done
+    
+    WEB_XML=$(find $WORK_DIR -name web.xml)
+    TMP_WEB_XML="${WORK_DIR}/web.xml.$$"
+    JAVA_CMD="java $JVM_OPTS -jar $SESSION_JAR $ARG_P -t $ARG_CACHE_TYPE -w $WEB_XML"
+    log "Executing java cmd: $JAVA_CMD" D
+
+    if [ $ARG_TEST_RUN -eq 0 ]; then
+        eval $JAVA_CMD > $TMP_WEB_XML || exiting "Error updating web.xml" 1
+        cp $TMP_WEB_XML $WEB_XML
+        rm -f $TMP_WEB_XML
+    else
+        eval $JAVA_CMD || exiting "Error updating web.xml" 1
+    fi
+}
+
+
+function process_input_file() {
+    local WORK_DIR=$1
+
+    if [[ "$ARG_INPUT_FILE" =~ \.war$ ]]; then
+        process_web_xml $WORK_DIR
+        add_war_jars $WORK_DIR
+        return
+    fi
+ 
+    WAR_LIST=$( find $WORK_DIR -name '*.war' )
+    for WAR in $WAR_LIST; do
+        log "Processing embedded war file $WAR" D
+        TMP_WAR_DIR="${WAR}.$$"
+
+        log "Unzipping war to $TMP_WAR_DIR" D
+        unzip -q -o -d $TMP_WAR_DIR $WAR
+
+        process_web_xml $TMP_WAR_DIR
+        if [ $ARG_TEST_RUN -eq 0 ]; then
+            add_war_jars $TMP_WAR_DIR
+
+            MANIFEST=$( find $TMP_WAR_DIR -name MANIFEST.MF )
+
+            if [ $ARG_PROCESS_LIBS -eq 1 -a -n "$MANIFEST" ]; then
+                process_manifest $MANIFEST
+            fi
+
+            log "Creating new war $WAR" D
+            if [ -n "$MANIFEST" ]; then
+                jar cmf $MANIFEST $WAR -C $TMP_WAR_DIR .
+            else
+                jar cf $WAR -C $TMP_WAR_DIR .
+            fi
+        fi
+
+        rm -rf $TMP_WAR_DIR
+    done
+}
+
+trap exiting INT QUIT TERM
+
+mkdir $TMP_DIR
+
+CMD_ARGS="-j $SESSION_JAR"
+
+while getopts "e:hj:J:l:m:o:p:rt:vw:x" OPT; do
+    case $OPT in
+        e)
+            if [ ! -f $OPTARG ]; then
+                exiting "Cannot read file '$OPTARG' given with option -e" 1
+            fi
+            ARG_EAR_LIBS[${#ARG_EAR_LIBS[@]}]=$OPTARG
+            ;;
+        h)
+            usage
+            exiting "" 1
+            ;;
+        j)
+            if [ ! -f $OPTARG ]; then
+                exiting "Cannot read file '$OPTARG' given with option -j" 1
+            fi
+            ARG_WAR_LIBS[${#ARG_WAR_LIBS[@]}]=$OPTARG
+            ;;
+        J)
+            ARG_JVM_OPTS[${#ARG_JVM_OPTS[@]}]=$OPTARG
+            ;;
+        l)
+            ARG_WAR_LIB_DIR=$OPTARG
+            ;;
+        m)
+            ARG_EAR_LIB_DIR=$OPTARG
+            ;;
+        o)
+            ARG_OUTPUT_FILE=$OPTARG
+            ;;
+        p)
+            ARG_GEMFIRE_PARAMETERS[${#ARG_GEMFIRE_PARAMETERS[@]}]=$OPTARG
+            ;;
+        r)
+            ARG_TEST_RUN=1
+            ;;
+        t)
+            case $OPTARG in
+                peer-to-peer|client-server)
+                    ARG_CACHE_TYPE=$OPTARG
+                    ;;
+                *)
+                    exiting "Invalid cache type '$OPTARG' given with option -t. Options are 'peer-to-peer' or 'client-server'." 1
+                    ;;
+            esac
+            ;;
+        v)
+            DEBUG=1
+            ;;
+        w)
+            if [ ! -f $OPTARG ]; then
+                exiting "Cannot read file '$OPTARG' given with option -w" 1
+            fi
+            ARG_INPUT_FILE=$OPTARG
+            ;;
+        x)
+            ARG_PROCESS_LIBS=0
+            ;;
+        [?])
+            echo "Unknown option '$OPTARG'"
+            echo
+            usage
+            exit 1
+            ;;
+        :)
+            echo "Option '$OPTARG' requires an argument"
+            echo
+            usage
+            exit 1
+            ;;
+    esac
+done
+
+# Some validation
+if [ -z "$ARG_INPUT_FILE" ]; then
+    exiting "Please supply an input file with the -w option" 1
+fi
+
+if [ -z "$ARG_OUTPUT_FILE" ]; then
+    ARG_OUTPUT_FILE="sessions-$(basename $ARG_INPUT_FILE)"
+fi
+
+if [[ "$ARG_INPUT_FILE" =~ \.war$ && -n "${ARG_EAR_LIBS[*]}" ]]; then
+    log "Input file appears to be a war but -e also specified. EAR processing will be skipped." W
+fi
+
+if [[ "$ARG_INPUT_FILE" =~ \.war$ && $ARG_PROCESS_LIBS -eq 1 ]]; then
+    for J in ${OTHER_JARS[*]}; do
+        ARG_WAR_LIBS[${#ARG_WAR_LIBS[@]}]=$J
+    done
+fi
+
+unzip -q -o -d $TMP_DIR $ARG_INPUT_FILE
+process_input_file $TMP_DIR
+
+if [[ $ARG_TEST_RUN -eq 0 && $ARG_PROCESS_LIBS -eq 1 && "$ARG_INPUT_FILE" =~ \.ear$ ]]; then
+    log "Copying additional jars into ear's '$ARG_EAR_LIB_DIR' directory" D
+    mkdir -p $TMP_DIR/$ARG_EAR_LIB_DIR
+    for i in ${OTHER_JARS[*]} ${ARG_EAR_LIBS[*]}; do
+        log "    $i" D
+        cp $i $TMP_DIR/$ARG_EAR_LIB_DIR/ || exiting "Unable to copy $i to $TMP_DIR/$ARG_EAR_LIB_DIR" 1
+    done
+fi
+
+if [ $ARG_TEST_RUN -eq 0 ]; then
+    mkdir -p $TMP_DIR/META-INF
+    touch $TMP_DIR/META-INF/MANIFEST.MF
+    jar cmf $TMP_DIR/META-INF/MANIFEST.MF $ARG_OUTPUT_FILE -C $TMP_DIR .
+    log "Created file: $ARG_OUTPUT_FILE" I
+fi
+
+exiting

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/65a03287/extensions/gemfire-modules-assembly/release/session/bin/setenv.properties
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-assembly/release/session/bin/setenv.properties b/extensions/gemfire-modules-assembly/release/session/bin/setenv.properties
new file mode 100644
index 0000000..fc8918b
--- /dev/null
+++ b/extensions/gemfire-modules-assembly/release/session/bin/setenv.properties
@@ -0,0 +1,6 @@
+java.opt.1=-Xms${initial.vm.heap.size.mb:512}M
+java.opt.2=-Xmx${maximum.vm.heap.size.mb:512}M
+java.opt.hotspot.1=-XX:+UseParNewGC
+java.opt.hotspot.2=-XX:+UseConcMarkSweepGC
+java.opt.hotspot.3=-XX:CMSInitiatingOccupancyFraction=${cms.initiating.heap.percentage:50}
+java.opt.j9.1=-Xgcpolicy:gencon
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/65a03287/extensions/gemfire-modules-assembly/release/session/conf/cache-client.xml
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-assembly/release/session/conf/cache-client.xml b/extensions/gemfire-modules-assembly/release/session/conf/cache-client.xml
new file mode 100755
index 0000000..63986ad
--- /dev/null
+++ b/extensions/gemfire-modules-assembly/release/session/conf/cache-client.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE client-cache PUBLIC
+  "-//GemStone Systems, Inc.//GemFire Declarative Caching 6.5//EN"
+  "http://www.gemstone.com/dtd/cache6_6.dtd">
+  
+<client-cache>
+
+  <!-- The default pool connects to a cache server running on  localhost at
+       port 40404. To connect to a different server host and port, modify
+       the following pool server host and port. -->
+  <pool name="sessions" subscription-enabled="true">
+    <server host="localhost" port="40404"/>
+  </pool>
+
+  <!-- To configure the client to use a locator instead of a server, replace
+       the server pool above with the locator pool below and modify the locator
+       host and port as necessary. -->
+  <!--
+  <pool name="sessions" subscription-enabled="true">
+    <locator host="localhost" port="10334"/>
+  </pool>
+  -->
+  
+</client-cache>

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/65a03287/extensions/gemfire-modules-assembly/release/session/conf/cache-peer.xml
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-assembly/release/session/conf/cache-peer.xml b/extensions/gemfire-modules-assembly/release/session/conf/cache-peer.xml
new file mode 100755
index 0000000..83300f1
--- /dev/null
+++ b/extensions/gemfire-modules-assembly/release/session/conf/cache-peer.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE cache PUBLIC
+  "-//GemStone Systems, Inc.//GemFire Declarative Caching 6.5//EN"
+  "http://www.gemstone.com/dtd/cache6_6.dtd">
+  
+<cache>
+
+  <!-- Uncomment the following disk-store element to modify the default disk store directory -->
+  <!--
+  <disk-store name="DEFAULT">
+    <disk-dirs>
+      <disk-dir>/path/to/persistent/data</disk-dir>
+    </disk-dirs>
+  </disk-store>
+  -->
+
+  <!-- This is the definition of the default session region -->
+  <!--
+  <region name="gemfire_modules_sessions">
+    <region-attributes scope="distributed-ack" enable-gateway="false" data-policy="replicate" statistics-enabled="true"/>
+  </region>
+  -->
+  
+</cache>

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/65a03287/extensions/gemfire-modules-assembly/release/session/conf/cache-server.xml
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-assembly/release/session/conf/cache-server.xml b/extensions/gemfire-modules-assembly/release/session/conf/cache-server.xml
new file mode 100755
index 0000000..74caee7
--- /dev/null
+++ b/extensions/gemfire-modules-assembly/release/session/conf/cache-server.xml
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE cache PUBLIC
+  "-//GemStone Systems, Inc.//GemFire Declarative Caching 6.5//EN"
+  "http://www.gemstone.com/dtd/cache6_6.dtd">
+  
+<cache>
+
+  <!-- Uncomment the following gateway-hub element to create a gateway hub -->
+  <!--
+  <gateway-hub id="NY" port="11110">
+    <gateway id="LN">
+      <gateway-endpoint id="LN-1" host="localhost" port="22220"/>
+      <gateway-queue disk-store-name="NY_GATEWAY"/>
+    </gateway>
+  </gateway-hub>
+  -->
+
+  <!-- Uncomment the following cache-server element to modify the listen port -->
+  <!--
+  <cache-server port="44444"/>
+  -->
+
+  <!-- Uncomment the following disk-store element to modify the default disk store directory -->
+  <!--
+  <disk-store name="DEFAULT">
+    <disk-dirs>
+      <disk-dir>/path/to/persistent/data</disk-dir>
+    </disk-dirs>
+  </disk-store>
+  -->
+  
+  <!-- Uncomment the following disk-store element to create the NY_GATEWAY disk store
+       (for the gateway-hub element defined above) -->
+  <!--
+  <disk-store name="NY_GATEWAY">
+    <disk-dirs>
+      <disk-dir>/path/to/persistent/data</disk-dir>
+    </disk-dirs>
+  </disk-store>
+  -->
+  
+  <!-- This is the definition of the default session region -->
+  <!--
+  <region name="gemfire_modules_sessions">
+    <region-attributes enable-gateway="false" data-policy="partition" statistics-enabled="true">
+      <partition-attributes redundant-copies="1" total-num-buckets="113"/>
+    </region-attributes>
+  </region>
+  -->
+
+</cache>

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/65a03287/extensions/gemfire-modules-assembly/release/session/readme.txt
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-assembly/release/session/readme.txt b/extensions/gemfire-modules-assembly/release/session/readme.txt
new file mode 100644
index 0000000..3fa92d8
--- /dev/null
+++ b/extensions/gemfire-modules-assembly/release/session/readme.txt
@@ -0,0 +1,14 @@
+Pivotal(TM) GemFire(R) Session Management Module @VERSION@ for AppServers
+
+This module provides fast, scalable, distributed L2 caching for Weblogic and other Application Servers.
+
+Access all Pivotal GemFire Documentation at:
+http://gemfire.docs.pivotal.io
+
+Pivotal Support Services can be accessed from the Pivotal or VMware website.
+Access varies by license type, support offering (contract or per-incident) and 
+product. Please see the Pivotal page at http://www.pivotal.io/support or to 
+file a VMware Support Request, please see the VMware page at 
+https://www.vmware.com/support/policies/howto.html for information on "How to 
+File a Support Request."
+

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/65a03287/extensions/gemfire-modules-assembly/release/tcserver/gemfire-cs-tomcat-7/context-fragment.xml
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-assembly/release/tcserver/gemfire-cs-tomcat-7/context-fragment.xml b/extensions/gemfire-modules-assembly/release/tcserver/gemfire-cs-tomcat-7/context-fragment.xml
new file mode 100644
index 0000000..72faee2
--- /dev/null
+++ b/extensions/gemfire-modules-assembly/release/tcserver/gemfire-cs-tomcat-7/context-fragment.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Context>
+
+    <remove:Manager className="com.gemstone.gemfire.modules.session.catalina.Tomcat6DeltaSessionManager"/>
+
+    <add:Manager className="com.gemstone.gemfire.modules.session.catalina.Tomcat7DeltaSessionManager"
+      enableDebugListener="${enable.debug.listener:false}"
+      enableGatewayReplication="${enable.gateway.replication:false}"
+      enableLocalCache="${enable.local.cache:true}"
+      enableCommitValve="${enable.commit.valve:true}"
+      preferDeserializedForm="${prefer.deserialized.form:true}"
+      regionAttributesId="${region.attributes.id:PARTITION_REDUNDANT}"
+      regionName="${region.name:gemfire_modules_sessions}"/>
+
+</Context>

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/65a03287/extensions/gemfire-modules-assembly/release/tcserver/gemfire-cs-tomcat-7/modules.env
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-assembly/release/tcserver/gemfire-cs-tomcat-7/modules.env b/extensions/gemfire-modules-assembly/release/tcserver/gemfire-cs-tomcat-7/modules.env
new file mode 100644
index 0000000..1c14a6c
--- /dev/null
+++ b/extensions/gemfire-modules-assembly/release/tcserver/gemfire-cs-tomcat-7/modules.env
@@ -0,0 +1 @@
+TOMCAT_MAJOR_VER=7

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/65a03287/extensions/gemfire-modules-assembly/release/tcserver/gemfire-cs-tomcat-8/context-fragment.xml
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-assembly/release/tcserver/gemfire-cs-tomcat-8/context-fragment.xml b/extensions/gemfire-modules-assembly/release/tcserver/gemfire-cs-tomcat-8/context-fragment.xml
new file mode 100644
index 0000000..72faee2
--- /dev/null
+++ b/extensions/gemfire-modules-assembly/release/tcserver/gemfire-cs-tomcat-8/context-fragment.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Context>
+
+    <remove:Manager className="com.gemstone.gemfire.modules.session.catalina.Tomcat6DeltaSessionManager"/>
+
+    <add:Manager className="com.gemstone.gemfire.modules.session.catalina.Tomcat7DeltaSessionManager"
+      enableDebugListener="${enable.debug.listener:false}"
+      enableGatewayReplication="${enable.gateway.replication:false}"
+      enableLocalCache="${enable.local.cache:true}"
+      enableCommitValve="${enable.commit.valve:true}"
+      preferDeserializedForm="${prefer.deserialized.form:true}"
+      regionAttributesId="${region.attributes.id:PARTITION_REDUNDANT}"
+      regionName="${region.name:gemfire_modules_sessions}"/>
+
+</Context>

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/65a03287/extensions/gemfire-modules-assembly/release/tcserver/gemfire-cs-tomcat-8/modules.env
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-assembly/release/tcserver/gemfire-cs-tomcat-8/modules.env b/extensions/gemfire-modules-assembly/release/tcserver/gemfire-cs-tomcat-8/modules.env
new file mode 100644
index 0000000..d220675
--- /dev/null
+++ b/extensions/gemfire-modules-assembly/release/tcserver/gemfire-cs-tomcat-8/modules.env
@@ -0,0 +1 @@
+TOMCAT_MAJOR_VER=8

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/65a03287/extensions/gemfire-modules-assembly/release/tcserver/gemfire-cs/README.txt
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-assembly/release/tcserver/gemfire-cs/README.txt b/extensions/gemfire-modules-assembly/release/tcserver/gemfire-cs/README.txt
new file mode 100644
index 0000000..51340e7
--- /dev/null
+++ b/extensions/gemfire-modules-assembly/release/tcserver/gemfire-cs/README.txt
@@ -0,0 +1,14 @@
+Pivotal(TM) GemFire(R) HTTP Session Management Module @VERSION@ for vFabric tc Server (client/server template)
+
+This module provides fast, scalable, and reliable HTTP session replication for tc Server.
+
+Access all Pivotal GemFire Documentation at:
+http://gemfire.docs.pivotal.io
+
+Pivotal Support Services can be accessed from the Pivotal or VMware website.
+Access varies by license type, support offering (contract or per-incident) and 
+product. Please see the Pivotal page at http://www.pivotal.io/support or to 
+file a VMware Support Request, please see the VMware page at 
+https://www.vmware.com/support/policies/howto.html for information on "How to 
+File a Support Request."
+

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/65a03287/extensions/gemfire-modules-assembly/release/tcserver/gemfire-cs/configuration-prompts.properties
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-assembly/release/tcserver/gemfire-cs/configuration-prompts.properties b/extensions/gemfire-modules-assembly/release/tcserver/gemfire-cs/configuration-prompts.properties
new file mode 100644
index 0000000..0ebae97
--- /dev/null
+++ b/extensions/gemfire-modules-assembly/release/tcserver/gemfire-cs/configuration-prompts.properties
@@ -0,0 +1,17 @@
+cache.configuration.file=Please enter the name of the GemFire cache configuration file. Default '${default}':
+critical.heap.percentage=Please enter the percentage of heap at which updates to the cache are refused. 0.0 means disabled. Default '${default}':
+enable.debug.listener=Please specify whether to enable a GemFire listener that logs session create, update, destroy and expiration events. Default '${default}':
+enable.gateway.replication=Please specify whether session modifications should be replicated across the WAN. Default '${default}':
+enable.local.cache=Please specify whether to maintain a local GemFire cache. Default '${default}':
+enable.commit.valve=Please specify whether to commit sessions once per request. Default '${default}':
+prefer.deserialized.form=Please specify whether to prefer keeping attributes in deserialized form. Default '${default}':
+eviction.heap.percentage=Please enter the percentage of heap at which sessions will be evicted from the local cache. Default '${default}':
+log.file=Please enter the name of the file used to log GemFire messages. Default '${default}':
+region.attributes.id=Please enter the id of the attributes of the GemFire region used to cache sessions. Default '${default}':
+region.name=Please enter the name of the GemFire region used to cache sessions. Default '${default}':
+statistic.archive.file=Please enter the name of the file used to store GemFire statistics. Default '${default}':
+statistic.sampling.enabled=Please specify whether GemFire statistic sampling should be enabled. Default '${default}':
+initial.vm.heap.size.mb=Please specify the initial VM heap size in MB (-Xms). Default '${default}':
+maximum.vm.heap.size.mb=Please specify the maximum VM heap size in MB (-Xmx). Default '${default}':
+cms.initiating.heap.percentage=Please specify the percentage of VM heap utilization before a concurrent collection is initiated (--XX:CMSInitiatingOccupancyFraction [Hotspot-only]). Default '${default}':
+tomcat.version=Please enter the major version of Tomcat you will be using (6, 7 or 8). Default '${default}'

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/65a03287/extensions/gemfire-modules-assembly/release/tcserver/gemfire-cs/context-fragment.xml
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-assembly/release/tcserver/gemfire-cs/context-fragment.xml b/extensions/gemfire-modules-assembly/release/tcserver/gemfire-cs/context-fragment.xml
new file mode 100644
index 0000000..fac3044
--- /dev/null
+++ b/extensions/gemfire-modules-assembly/release/tcserver/gemfire-cs/context-fragment.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Context>
+
+    <add:Manager className="com.gemstone.gemfire.modules.session.catalina.Tomcat6DeltaSessionManager"
+      enableDebugListener="${enable.debug.listener:false}"
+      enableGatewayReplication="${enable.gateway.replication:false}"
+      enableLocalCache="${enable.local.cache:true}"
+      enableCommitValve="${enable.commit.valve:true}"
+      preferDeserializedForm="${prefer.deserialized.form:true}"
+      regionAttributesId="${region.attributes.id:PARTITION_REDUNDANT}"
+      regionName="${region.name:gemfire_modules_sessions}"/>
+
+</Context>

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/65a03287/extensions/gemfire-modules-assembly/release/tcserver/gemfire-cs/modules.env
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-assembly/release/tcserver/gemfire-cs/modules.env b/extensions/gemfire-modules-assembly/release/tcserver/gemfire-cs/modules.env
new file mode 100644
index 0000000..9c4c00a
--- /dev/null
+++ b/extensions/gemfire-modules-assembly/release/tcserver/gemfire-cs/modules.env
@@ -0,0 +1 @@
+TOMCAT_MAJOR_VER=6

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/65a03287/extensions/gemfire-modules-assembly/release/tcserver/gemfire-cs/server-fragment.xml
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-assembly/release/tcserver/gemfire-cs/server-fragment.xml b/extensions/gemfire-modules-assembly/release/tcserver/gemfire-cs/server-fragment.xml
new file mode 100644
index 0000000..c4adc66
--- /dev/null
+++ b/extensions/gemfire-modules-assembly/release/tcserver/gemfire-cs/server-fragment.xml
@@ -0,0 +1,12 @@
+<?xml version='1.0' encoding='utf-8'?>
+<Server>
+
+    <add:Listener className="com.gemstone.gemfire.modules.session.catalina.ClientServerCacheLifecycleListener"
+      cache-xml-file="${cache.configuration.file:cache-client.xml}"
+      criticalHeapPercentage="${critical.heap.percentage:0.0}"
+      evictionHeapPercentage="${eviction.heap.percentage:80.0}"
+      log-file="${log.file:gemfire_modules.log}"
+      statistic-archive-file="${statistic.archive.file:gemfire_modules.gfs}"
+      statistic-sampling-enabled="${statistic.sampling.enabled:false}"/>
+
+</Server>

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/65a03287/extensions/gemfire-modules-assembly/release/tcserver/gemfire-p2p-tomcat-7/context-fragment.xml
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-assembly/release/tcserver/gemfire-p2p-tomcat-7/context-fragment.xml b/extensions/gemfire-modules-assembly/release/tcserver/gemfire-p2p-tomcat-7/context-fragment.xml
new file mode 100644
index 0000000..155aa2a
--- /dev/null
+++ b/extensions/gemfire-modules-assembly/release/tcserver/gemfire-p2p-tomcat-7/context-fragment.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Context>
+
+    <remove:Manager className="com.gemstone.gemfire.modules.session.catalina.Tomcat6DeltaSessionManager"/>
+
+    <add:Manager className="com.gemstone.gemfire.modules.session.catalina.Tomcat7DeltaSessionManager"
+      enableDebugListener="${enable.debug.listener:false}"
+      enableGatewayReplication="${enable.gateway.replication:false}"
+      enableLocalCache="${enable.local.cache:false}"
+      enableCommitValve="${enable.commit.valve:true}"
+      preferDeserializedForm="${prefer.deserialized.form:true}"
+      regionAttributesId="${region.attributes.id:REPLICATE}"
+      regionName="${region.name:gemfire_modules_sessions}"/>
+
+</Context>

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/65a03287/extensions/gemfire-modules-assembly/release/tcserver/gemfire-p2p-tomcat-7/modules.env
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-assembly/release/tcserver/gemfire-p2p-tomcat-7/modules.env b/extensions/gemfire-modules-assembly/release/tcserver/gemfire-p2p-tomcat-7/modules.env
new file mode 100644
index 0000000..1c14a6c
--- /dev/null
+++ b/extensions/gemfire-modules-assembly/release/tcserver/gemfire-p2p-tomcat-7/modules.env
@@ -0,0 +1 @@
+TOMCAT_MAJOR_VER=7

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/65a03287/extensions/gemfire-modules-assembly/release/tcserver/gemfire-p2p-tomcat-8/context-fragment.xml
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-assembly/release/tcserver/gemfire-p2p-tomcat-8/context-fragment.xml b/extensions/gemfire-modules-assembly/release/tcserver/gemfire-p2p-tomcat-8/context-fragment.xml
new file mode 100644
index 0000000..155aa2a
--- /dev/null
+++ b/extensions/gemfire-modules-assembly/release/tcserver/gemfire-p2p-tomcat-8/context-fragment.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Context>
+
+    <remove:Manager className="com.gemstone.gemfire.modules.session.catalina.Tomcat6DeltaSessionManager"/>
+
+    <add:Manager className="com.gemstone.gemfire.modules.session.catalina.Tomcat7DeltaSessionManager"
+      enableDebugListener="${enable.debug.listener:false}"
+      enableGatewayReplication="${enable.gateway.replication:false}"
+      enableLocalCache="${enable.local.cache:false}"
+      enableCommitValve="${enable.commit.valve:true}"
+      preferDeserializedForm="${prefer.deserialized.form:true}"
+      regionAttributesId="${region.attributes.id:REPLICATE}"
+      regionName="${region.name:gemfire_modules_sessions}"/>
+
+</Context>

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/65a03287/extensions/gemfire-modules-assembly/release/tcserver/gemfire-p2p-tomcat-8/modules.env
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-assembly/release/tcserver/gemfire-p2p-tomcat-8/modules.env b/extensions/gemfire-modules-assembly/release/tcserver/gemfire-p2p-tomcat-8/modules.env
new file mode 100644
index 0000000..d220675
--- /dev/null
+++ b/extensions/gemfire-modules-assembly/release/tcserver/gemfire-p2p-tomcat-8/modules.env
@@ -0,0 +1 @@
+TOMCAT_MAJOR_VER=8

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/65a03287/extensions/gemfire-modules-assembly/release/tcserver/gemfire-p2p/README.txt
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-assembly/release/tcserver/gemfire-p2p/README.txt b/extensions/gemfire-modules-assembly/release/tcserver/gemfire-p2p/README.txt
new file mode 100644
index 0000000..db6ebce
--- /dev/null
+++ b/extensions/gemfire-modules-assembly/release/tcserver/gemfire-p2p/README.txt
@@ -0,0 +1,14 @@
+Pivotal(TM) GemFire(R) HTTP Session Management Module @VERSION@ for vFabric tc Server (peer-to-peer template)
+
+This module provides fast, scalable, and reliable HTTP session replication for tc Server.
+
+Access all Pivotal GemFire Documentation at:
+http://gemfire.docs.pivotal.io
+
+Pivotal Support Services can be accessed from the Pivotal or VMware website.
+Access varies by license type, support offering (contract or per-incident) and 
+product. Please see the Pivotal page at http://www.pivotal.io/support or to 
+file a VMware Support Request, please see the VMware page at 
+https://www.vmware.com/support/policies/howto.html for information on "How to 
+File a Support Request."
+

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/65a03287/extensions/gemfire-modules-assembly/release/tcserver/gemfire-p2p/configuration-prompts.properties
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-assembly/release/tcserver/gemfire-p2p/configuration-prompts.properties b/extensions/gemfire-modules-assembly/release/tcserver/gemfire-p2p/configuration-prompts.properties
new file mode 100644
index 0000000..f109d82
--- /dev/null
+++ b/extensions/gemfire-modules-assembly/release/tcserver/gemfire-p2p/configuration-prompts.properties
@@ -0,0 +1,21 @@
+cache.configuration.file=Please enter the name of the GemFire cache configuration file. Default '${default}':
+critical.heap.percentage=Please enter the percentage of heap at which updates to the cache are refused. 0.0 means disabled. Default '${default}':
+enable.debug.listener=Please specify whether to enable a GemFire listener that logs session create, update, destroy and expiration events. Default '${default}':
+enable.gateway.replication=Please specify whether session modifications should be replicated across the WAN. Default '${default}':
+enable.local.cache=Please specify whether to maintain a local GemFire cache. Default '${default}':
+enable.commit.valve=Please specify whether to commit sessions once per request. Default '${default}':
+prefer.deserialized.form=Please specify whether to prefer keeping attributes in deserialized form. Default '${default}':
+eviction.heap.percentage=Please enter the percentage of heap at which sessions will be evicted from the local cache. Default '${default}':
+locators=Please enter the list of locators used by GemFire members to discover each other. The format is a comma-separated list of host[port]. Default '${default}':
+log.file=Please enter the name of the file used to log GemFire messages. Default '${default}':
+multicast.discovery.port=Please enter the port used by GemFire members to discover each other using multicast networking. Default '${default}':
+multicast.discovery.address=Please enter the address used by GemFire members to discover each other using multicast networking. Default '${default}':
+rebalance=Please specify whether to rebalance the GemFire cache at startup. Default '${default}':
+region.attributes.id=Please enter the id of the attributes of the GemFire region used to cache sessions. Default '${default}':
+region.name=Please enter the name of the GemFire region used to cache sessions. Default '${default}':
+statistic.archive.file=Please enter the name of the file used to store GemFire statistics. Default '${default}':
+statistic.sampling.enabled=Please specify whether GemFire statistic sampling should be enabled. Default '${default}':
+initial.vm.heap.size.mb=Please specify the initial VM heap size in MB (-Xms). Default '${default}':
+maximum.vm.heap.size.mb=Please specify the maximum VM heap size in MB (-Xmx). Default '${default}':
+cms.initiating.heap.percentage=Please specify the percentage of VM heap utilization before a concurrent collection is initiated (--XX:CMSInitiatingOccupancyFraction [Hotspot-only]). Default '${default}':
+tomcat.version=Please enter the major version of Tomcat you will be using (6, 7 or 8). Default '${default}':

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/65a03287/extensions/gemfire-modules-assembly/release/tcserver/gemfire-p2p/context-fragment.xml
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-assembly/release/tcserver/gemfire-p2p/context-fragment.xml b/extensions/gemfire-modules-assembly/release/tcserver/gemfire-p2p/context-fragment.xml
new file mode 100644
index 0000000..2b3d25c
--- /dev/null
+++ b/extensions/gemfire-modules-assembly/release/tcserver/gemfire-p2p/context-fragment.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Context>
+
+    <add:Manager className="com.gemstone.gemfire.modules.session.catalina.Tomcat6DeltaSessionManager"
+      enableDebugListener="${enable.debug.listener:false}"
+      enableGatewayReplication="${enable.gateway.replication:false}"
+      enableLocalCache="${enable.local.cache:false}"
+      enableCommitValve="${enable.commit.valve:true}"
+      preferDeserializedForm="${prefer.deserialized.form:true}"
+      regionAttributesId="${region.attributes.id:REPLICATE}"
+      regionName="${region.name:gemfire_modules_sessions}"/>
+
+</Context>

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/65a03287/extensions/gemfire-modules-assembly/release/tcserver/gemfire-p2p/modules.env
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-assembly/release/tcserver/gemfire-p2p/modules.env b/extensions/gemfire-modules-assembly/release/tcserver/gemfire-p2p/modules.env
new file mode 100644
index 0000000..9c4c00a
--- /dev/null
+++ b/extensions/gemfire-modules-assembly/release/tcserver/gemfire-p2p/modules.env
@@ -0,0 +1 @@
+TOMCAT_MAJOR_VER=6

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/65a03287/extensions/gemfire-modules-assembly/release/tcserver/gemfire-p2p/server-fragment.xml
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-assembly/release/tcserver/gemfire-p2p/server-fragment.xml b/extensions/gemfire-modules-assembly/release/tcserver/gemfire-p2p/server-fragment.xml
new file mode 100644
index 0000000..d1983c0
--- /dev/null
+++ b/extensions/gemfire-modules-assembly/release/tcserver/gemfire-p2p/server-fragment.xml
@@ -0,0 +1,16 @@
+<?xml version='1.0' encoding='utf-8'?>
+<Server>
+
+    <add:Listener className="com.gemstone.gemfire.modules.session.catalina.PeerToPeerCacheLifecycleListener"
+      cache-xml-file="${cache.configuration.file:cache-peer.xml}"
+      criticalHeapPercentage="${critical.heap.percentage:0.0}"
+      evictionHeapPercentage="${eviction.heap.percentage:80.0}"
+      locators="${locators: }"
+      log-file="${log.file:gemfire_modules.log}"
+      mcast-port="${multicast.discovery.port:10334}"
+      mcast-address="${multicast.discovery.address:239.192.81.1}"
+      rebalance="${rebalance:false}"
+      statistic-archive-file="${statistic.archive.file:gemfire_modules.gfs}"
+      statistic-sampling-enabled="${statistic.sampling.enabled:false}"/>
+
+</Server>



[24/24] incubator-geode git commit: GEODE-14: Updates for producing artifacts

Posted by je...@apache.org.
GEODE-14: Updates for producing artifacts


Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/18be1c05
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/18be1c05
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/18be1c05

Branch: refs/heads/feature/GEODE-14
Commit: 18be1c059ef67982ba81f7ce54b23a82b7252188
Parents: 65a0328
Author: Jens Deppe <jd...@pivotal.io>
Authored: Tue Dec 29 13:10:33 2015 -0800
Committer: Jens Deppe <jd...@pivotal.io>
Committed: Tue Dec 29 13:10:33 2015 -0800

----------------------------------------------------------------------
 build.gradle                                    | 15 +++++++++++++
 .../gemfire-modules-assembly/build.gradle       |  2 ++
 .../gemfire-modules-hibernate/build.gradle      |  4 ++++
 extensions/gemfire-modules-session/build.gradle | 22 +++++++++++++++++++-
 extensions/gemfire-modules-tomcat7/build.gradle |  7 +++----
 extensions/gemfire-modules/build.gradle         |  7 +++----
 6 files changed, 48 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/18be1c05/build.gradle
----------------------------------------------------------------------
diff --git a/build.gradle b/build.gradle
index 6f81c6f..2248658 100755
--- a/build.gradle
+++ b/build.gradle
@@ -479,6 +479,21 @@ subprojects {
     description 'Run this task before checking in code to validate changes. This task combines the following tasks: build, integrationTest, and distributedTest'
   }
 
+  task modulesDist(dependsOn: [ ':extensions/gemfire-modules-assembly:dist' ])
+
+  task modulesTest(dependsOn: [
+      ':extensions/gemfire-modules:test',
+      ':extensions/gemfire-modules:test',
+      ':extensions/gemfire-modules-tomcat7:test',
+      ':extensions/gemfire-modules-session:test',
+      ':extensions/gemfire-modules-hibernate:test',
+      ':extensions/gemfire-modules:integrationTest',
+      ':extensions/gemfire-modules:integrationTest',
+      ':extensions/gemfire-modules-tomcat7:integrationTest',
+      ':extensions/gemfire-modules-session:integrationTest',
+      ':extensions/gemfire-modules-hibernate:integrationTest',
+  ])
+
   check.dependsOn checkMissedTests, rat
   combineReports.mustRunAfter check, test, integrationTest, distributedTest, checkMissedTests
   build.finalizedBy combineReports

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/18be1c05/extensions/gemfire-modules-assembly/build.gradle
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-assembly/build.gradle b/extensions/gemfire-modules-assembly/build.gradle
index fc487a5..6995fb7 100644
--- a/extensions/gemfire-modules-assembly/build.gradle
+++ b/extensions/gemfire-modules-assembly/build.gradle
@@ -32,6 +32,8 @@ dependencies {
   servletApiDeps 'javax.servlet:servlet-api:2.5'
 }
 
+jar.enabled = false
+
 def configureTcServerAssembly = {
   archiveName = "Apache_Geode_Modules-${version}-tcServer.zip"
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/18be1c05/extensions/gemfire-modules-hibernate/build.gradle
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-hibernate/build.gradle b/extensions/gemfire-modules-hibernate/build.gradle
index 370c220..928e8bf 100644
--- a/extensions/gemfire-modules-hibernate/build.gradle
+++ b/extensions/gemfire-modules-hibernate/build.gradle
@@ -15,6 +15,10 @@
  * limitations under the License.
  */
 
+jar {
+  baseName = 'gemfire-modules-hibernate'
+}
+
 dependencies {
   compile project(':extensions/gemfire-modules')
   compile 'org.hibernate:hibernate-core:3.5.0-Final'

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/18be1c05/extensions/gemfire-modules-session/build.gradle
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/build.gradle b/extensions/gemfire-modules-session/build.gradle
index 430199b..71d59dc 100644
--- a/extensions/gemfire-modules-session/build.gradle
+++ b/extensions/gemfire-modules-session/build.gradle
@@ -28,4 +28,24 @@ dependencies {
   testCompile(group: 'org.eclipse.jetty', name: 'jetty-servlet', version: project.'jetty.version', classifier: 'tests')
 
   provided project(path: ':gemfire-junit', configuration: 'testOutput')
-}
\ No newline at end of file
+}
+
+jar {
+  include '**/session/filter/**/*'
+  include '**/session/installer/**/*'
+  includeEmptyDirs = false
+  baseName = 'gemfire-modules-session-external'
+
+  manifest {
+    attributes 'Main-Class': 'com.gemstone.gemfire.modules.session.installer.Installer'
+  }
+}
+
+task internalJar(type: Jar) {
+  from sourceSets.main.output
+  include '**/internal/**/*'
+  includeEmptyDirs = false
+  baseName = 'gemfire-modules-session'
+}
+
+assemble.dependsOn(internalJar)

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/18be1c05/extensions/gemfire-modules-tomcat7/build.gradle
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-tomcat7/build.gradle b/extensions/gemfire-modules-tomcat7/build.gradle
index 7750069..10b8803 100644
--- a/extensions/gemfire-modules-tomcat7/build.gradle
+++ b/extensions/gemfire-modules-tomcat7/build.gradle
@@ -22,11 +22,10 @@ test  {
       into 'build/test/tomcat/'
     }
   }
+}
 
-  testLogging {
-    events 'passed', 'skipped', 'failed'
-    exceptionFormat = 'full'
-  }
+jar {
+  baseName = 'gemfire-modules-tomcat7'
 }
 
 dependencies {

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/18be1c05/extensions/gemfire-modules/build.gradle
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules/build.gradle b/extensions/gemfire-modules/build.gradle
index 6a44cff..1d45ab8 100644
--- a/extensions/gemfire-modules/build.gradle
+++ b/extensions/gemfire-modules/build.gradle
@@ -22,11 +22,10 @@ test  {
       into 'build/test/tomcat/'
     }
   }
+}
 
-  testLogging {
-    events 'passed', 'skipped', 'failed'
-    exceptionFormat = 'full'
-  }
+jar {
+  baseName = 'gemfire-modules'
 }
 
 dependencies {


[18/24] incubator-geode git commit: GEODE-14: Adding session replication assembly module

Posted by je...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/65a03287/extensions/gemfire-modules-assembly/release/3rdparty_license/open_source_licenses-vFabric_GemFire_HTTP_Session_Management_Modules_2.1.txt
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-assembly/release/3rdparty_license/open_source_licenses-vFabric_GemFire_HTTP_Session_Management_Modules_2.1.txt b/extensions/gemfire-modules-assembly/release/3rdparty_license/open_source_licenses-vFabric_GemFire_HTTP_Session_Management_Modules_2.1.txt
new file mode 100755
index 0000000..6050b30
--- /dev/null
+++ b/extensions/gemfire-modules-assembly/release/3rdparty_license/open_source_licenses-vFabric_GemFire_HTTP_Session_Management_Modules_2.1.txt
@@ -0,0 +1,1325 @@
+
+VMware vFabric GemFire HTTP Session Management Module 2.1.0.2
+
+===========================================================================
+
+The following copyright statements and licenses apply to various open
+source software components (or portions thereof) that are distributed with
+this VMware software products.
+
+The VMware Product may also include other VMware components, which may contain additional open 
+source software packages. One or more such open_source_licenses.txt files may therefore 
+accompany this VMware Product. 
+
+The VMware product that includes this file does not necessarily use all the
+open source software components referred to below and may also only use
+portions of a given component.
+
+
+=============== TABLE OF CONTENTS =============================
+
+
+The following is a listing of the open source components detailed in this
+document.  This list is provided for your convenience; please read further if
+you wish to review the copyright notice(s) and the full text of the license
+associated with each component.
+
+
+
+SECTION 1: BSD-STYLE, MIT-STYLE, OR SIMILAR STYLE LICENSES
+
+   >>> antlr-2.7.3
+   >>> backport-util-concurrent-java_5.0
+   >>> mx4j-2.0.1
+   >>> slf4j-1.5.8
+
+
+
+SECTION 2: Apache License, V2.0
+
+   >>> commons-modeler-2.0
+
+
+
+SECTION 3: Common Development and Distribution License, V1.0
+
+   >>> servlet-api-2.5
+
+
+
+SECTION 4: GNU Lesser General Public License, V2.1
+
+   >>> jgroups-2.10
+   >>> trove-1.1.b3
+
+
+
+APPENDIX. Standard License Files
+
+   >>> Apache License, V2.0
+
+   >>> GNU Lesser General Public License, V2.1
+
+   >>> Common Development and Distribution License, V1.0
+
+
+
+
+
+--------------- SECTION 1:  BSD-STYLE, MIT-STYLE, OR SIMILAR STYLE LICENSES ----------
+
+BSD-STYLE, MIT-STYLE, OR SIMILAR STYLE LICENSES are applicable to the following component(s).
+
+
+>>> antlr-2.7.3
+
+SOFTWARE RIGHTS
+
+ANTLR 1989-2004 Developed by Terence Parr
+Partially supported by University of San Francisco & jGuru.com
+
+We reserve no legal rights to the ANTLR--it is fully in the
+public domain. An individual or company may do whatever
+they wish with source code distributed with ANTLR or the
+code generated by ANTLR, including the incorporation of
+ANTLR, or its output, into commerical software.
+
+We encourage users to develop software with ANTLR. However,
+we do ask that credit is given to us for developing
+ANTLR. By "credit", we mean that if you use ANTLR or
+incorporate any source code into one of your programs
+(commercial product, research project, or otherwise) that
+you acknowledge this fact somewhere in the documentation,
+research report, etc... If you like ANTLR and have
+developed a nice tool with the output, please mention that
+you developed it using ANTLR. In addition, we ask that the
+headers remain intact in our source code. As long as these
+guidelines are kept, we expect to continue enhancing this
+system and expect to make other tools available as they are
+completed.
+
+The primary ANTLR guy:
+
+Terence Parr
+parrt@cs.usfca.edu
+parrt@antlr.org
+
+
+>>> backport-util-concurrent-java_5.0
+
+License
+This software is released to the public domain, in the spirit of the original code written by Doug Lea. 
+The code can be used for any purpose, modified, and redistributed without acknowledgment. No 
+warranty is provided, either express or implied.
+
+
+>>> mx4j-2.0.1
+
+The MX4J License, Version 1.0
+
+Copyright (c) 2001-2004 by the MX4J contributors.  All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+         1. Redistributions of source code must retain the above copyright
+            notice, this list of conditions and the following disclaimer.
+
+         2. Redistributions in binary form must reproduce the above copyright
+            notice, this list of conditions and the following disclaimer in
+            the documentation and/or other materials provided with the
+            distribution.
+
+         3. The end-user documentation included with the redistribution,
+            if any, must include the following acknowledgment:
+               "This product includes software developed by the
+                MX4J project (http://mx4j.sourceforge.net)."
+            Alternately, this acknowledgment may appear in the software itself,
+            if and wherever such third-party acknowledgments normally appear.
+
+         4. The name "MX4J" must not be used to endorse or promote
+            products derived from this software without prior written
+            permission.
+            For written permission, please contact
+            biorn_steedom [at] users [dot] sourceforge [dot] net
+
+         5. Products derived from this software may not be called "MX4J",
+            nor may "MX4J" appear in their name, without prior written
+            permission of Simone Bordet.
+
+THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED.  IN NO EVENT SHALL THE MX4J CONTRIBUTORS
+BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
+
+This software consists of voluntary contributions made by many
+individuals on behalf of the MX4J project.  For more information on
+MX4J, please see
+the MX4J website.
+
+
+>>> slf4j-1.5.8
+
+Copyright (c) 2004-2008 QOS.ch
+All rights reserved.
+
+Permission is hereby granted, free  of charge, to any person obtaining
+a  copy  of this  software  and  associated  documentation files  (the
+"Software"), to  deal in  the Software without  restriction, including
+without limitation  the rights to  use, copy, modify,  merge, publish,
+distribute,  sublicense, and/or sell  copies of  the Software,  and to
+permit persons to whom the Software  is furnished to do so, subject to
+the following conditions:
+
+The  above  copyright  notice  and  this permission  notice  shall  be
+included in all copies or substantial portions of the Software.
+
+THE  SOFTWARE IS  PROVIDED  "AS  IS", WITHOUT  WARRANTY  OF ANY  KIND,
+EXPRESS OR  IMPLIED, INCLUDING  BUT NOT LIMITED  TO THE  WARRANTIES OF
+MERCHANTABILITY,    FITNESS    FOR    A   PARTICULAR    PURPOSE    AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE,  ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+
+--------------- SECTION 2: Apache License, V2.0 ----------
+
+Apache License, V2.0 is applicable to the following component(s).
+
+
+>>> commons-modeler-2.0
+
+This product includes software developed by
+The Apache Software Foundation (http://www.apache.org/).
+
+
+--------------- SECTION 3: Common Development and Distribution License, V1.0 ----------
+
+Common Development and Distribution License, V1.0 is applicable to the following component(s).
+
+
+>>> servlet-api-2.5
+
+The contents of this file are subject to the terms 
+of the Common Development and Distribution License 
+(the "License"). You may not use this file except 
+in compliance with the License. 
+ 
+You can obtain a copy of the license at 
+glassfish/bootstrap/legal/CDDLv1.0.txt or 
+https://glassfish.dev.java.net/public/CDDLv1.0.html. 
+See the License for the specific language governing 
+permissions and limitations under the License. 
+ 
+When distributing Covered Code, include this CDDL 
+HEADER in each file and include the License file at 
+glassfish/bootstrap/legal/CDDLv1.0.txt. If applicable, 
+add the following below this CDDL HEADER, with the 
+fields enclosed by brackets "[]" replaced with your 
+own identifying information: Portions Copyright [yyyy] 
+[name of copyright owner] 
+ 
+Copyright 2005 Sun Microsystems, Inc. All rights reserved. 
+ 
+Portions Copyright Apache Software Foundation.
+
+
+--------------- SECTION 4: GNU Lesser General Public License, V2.1 ----------
+
+GNU Lesser General Public License, V2.1 is applicable to the following component(s).
+
+
+>>> jgroups-2.10
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+
+>>> trove-1.1.b3
+
+The Trove library is licensed under the Lesser GNU Public License,
+which is included with the distribution in a file called LICENSE.txt.
+
+The PrimeFinder and HashFunctions classes in Trove are subject to the
+following license restrictions:
+
+Copyright (c) 1999 CERN - European Organization for Nuclear Research.
+
+Permission to use, copy, modify, distribute and sell this software and
+its documentation for any purpose is hereby granted without fee,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation. CERN makes no representations about the
+suitability of this software for any purpose. It is provided "as is"
+without expressed or implied warranty.
+
+
+
+
+
+=============== APPENDIX. Standard License Files ============== 
+
+
+
+--------------- SECTION 1: Apache License, V2.0 -----------
+
+Apache License 
+
+Version 2.0, January 2004 
+http://www.apache.org/licenses/ 
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 
+
+1. Definitions.
+
+"License" shall mean the terms and conditions for use, reproduction,
+and distribution as defined by Sections 1 through 9 of this document.
+
+"Licensor" shall mean the copyright owner or entity authorized by the
+copyright owner that is granting the License.  
+
+"Legal Entity" shall mean the union of the acting entity and all other
+entities that control, are controlled by, or are under common control
+with that entity. For the purposes of this definition, "control" means
+(i) the power, direct or indirect, to cause the direction or management
+of such entity, whether by contract or otherwise, or (ii) ownership
+of fifty percent (50%) or more of the outstanding shares, or (iii)
+beneficial ownership of such entity.
+
+"You" (or "Your") shall mean an individual or Legal Entity exercising
+permissions granted by this License.  
+
+"Source" form shall mean the preferred form for making modifications,
+including but not limited to software source code, documentation source,
+and configuration files.
+
+"Object" form shall mean any form resulting from mechanical transformation
+or translation of a Source form, including but not limited to compiled
+object code, generated documentation, and conversions to other media
+types.  
+
+"Work" shall mean the work of authorship, whether in Source or
+Object form, made available under the License, as indicated by a copyright
+notice that is included in or attached to the work (an example is provided
+in the Appendix below).  
+
+"Derivative Works" shall mean any work, whether in Source or Object form,
+that is based on (or derived from) the Work and for which the editorial
+revisions, annotations, elaborations, or other modifications represent,
+as a whole, an original work of authorship. For the purposes of this
+License, Derivative Works shall not include works that remain separable
+from, or merely link (or bind by name) to the interfaces of, the Work
+and Derivative Works thereof.
+
+"Contribution" shall mean any work of authorship, including the
+original version of the Work and any modifications or additions to
+that Work or Derivative Works thereof, that is intentionally submitted
+to Licensor for inclusion in the Work by the copyright owner or by an
+individual or Legal Entity authorized to submit on behalf of the copyright
+owner. For the purposes of this definition, "submitted" means any form of
+electronic, verbal, or written communication sent to the Licensor or its
+representatives, including but not limited to communication on electronic
+mailing lists, source code control systems, and issue tracking systems
+that are managed by, or on behalf of, the Licensor for the purpose of
+discussing and improving the Work, but excluding communication that is
+conspicuously marked or otherwise designated in writing by the copyright
+owner as "Not a Contribution."
+
+"Contributor" shall mean Licensor and any individual or Legal Entity
+on behalf of whom a Contribution has been received by Licensor and
+subsequently incorporated within the Work.
+
+2. Grant of Copyright License.
+Subject to the terms and conditions of this License, each Contributor
+hereby grants to You a perpetual, worldwide, non-exclusive, no-charge,
+royalty-free, irrevocable copyright license to reproduce, prepare
+Derivative Works of, publicly display, publicly perform, sublicense, and
+distribute the Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License.
+Subject to the terms and conditions of this License, each Contributor
+hereby grants to You a perpetual, worldwide, non-exclusive, no-charge,
+royalty- free, irrevocable (except as stated in this section) patent
+license to make, have made, use, offer to sell, sell, import, and
+otherwise transfer the Work, where such license applies only to those
+patent claims licensable by such Contributor that are necessarily
+infringed by their Contribution(s) alone or by combination of
+their Contribution(s) with the Work to which such Contribution(s)
+was submitted. If You institute patent litigation against any entity
+(including a cross-claim or counterclaim in a lawsuit) alleging that the
+Work or a Contribution incorporated within the Work constitutes direct
+or contributory patent infringement, then any patent licenses granted
+to You under this License for that Work shall terminate as of the date
+such litigation is filed.
+
+4. Redistribution.
+You may reproduce and distribute copies of the Work or Derivative Works
+thereof in any medium, with or without modifications, and in Source or
+Object form, provided that You meet the following conditions:
+
+  a. You must give any other recipients of the Work or Derivative Works
+     a copy of this License; and
+
+  b. You must cause any modified files to carry prominent notices stating
+     that You changed the files; and
+
+  c. You must retain, in the Source form of any Derivative Works that
+     You distribute, all copyright, patent, trademark, and attribution
+     notices from the Source form of the Work, excluding those notices
+     that do not pertain to any part of the Derivative Works; and
+
+  d. If the Work includes a "NOTICE" text file as part of its
+     distribution, then any Derivative Works that You distribute must
+     include a readable copy of the attribution notices contained
+     within such NOTICE file, excluding those notices that do not
+     pertain to any part of the Derivative Works, in at least one of
+     the following places: within a NOTICE text file distributed as part
+     of the Derivative Works; within the Source form or documentation,
+     if provided along with the Derivative Works; or, within a display
+     generated by the Derivative Works, if and wherever such third-party
+     notices normally appear. The contents of the NOTICE file are for
+     informational purposes only and do not modify the License. You
+     may add Your own attribution notices within Derivative Works that
+     You distribute, alongside or as an addendum to the NOTICE text
+     from the Work, provided that such additional attribution notices
+     cannot be construed as modifying the License.  You may add Your own
+     copyright statement to Your modifications and may provide additional
+     or different license terms and conditions for use, reproduction, or
+     distribution of Your modifications, or for any such Derivative Works
+     as a whole, provided Your use, reproduction, and distribution of the
+     Work otherwise complies with the conditions stated in this License.
+
+5. Submission of Contributions.
+Unless You explicitly state otherwise, any Contribution intentionally
+submitted for inclusion in the Work by You to the Licensor shall be
+under the terms and conditions of this License, without any additional
+terms or conditions.  Notwithstanding the above, nothing herein shall
+supersede or modify the terms of any separate license agreement you may
+have executed with Licensor regarding such Contributions.
+
+6. Trademarks.
+This License does not grant permission to use the trade names, trademarks,
+service marks, or product names of the Licensor, except as required for
+reasonable and customary use in describing the origin of the Work and
+reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty.
+Unless required by applicable law or agreed to in writing, Licensor
+provides the Work (and each Contributor provides its Contributions) on
+an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+express or implied, including, without limitation, any warranties or
+conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR
+A PARTICULAR PURPOSE. You are solely responsible for determining the
+appropriateness of using or redistributing the Work and assume any risks
+associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability.
+In no event and under no legal theory, whether in tort (including
+negligence), contract, or otherwise, unless required by applicable law
+(such as deliberate and grossly negligent acts) or agreed to in writing,
+shall any Contributor be liable to You for damages, including any direct,
+indirect, special, incidental, or consequential damages of any character
+arising as a result of this License or out of the use or inability to
+use the Work (including but not limited to damages for loss of goodwill,
+work stoppage, computer failure or malfunction, or any and all other
+commercial damages or losses), even if such Contributor has been advised
+of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability.
+While redistributing the Work or Derivative Works thereof, You may
+choose to offer, and charge a fee for, acceptance of support, warranty,
+indemnity, or other liability obligations and/or rights consistent with
+this License. However, in accepting such obligations, You may act only
+on Your own behalf and on Your sole responsibility, not on behalf of
+any other Contributor, and only if You agree to indemnify, defend, and
+hold each Contributor harmless for any liability incurred by, or claims
+asserted against, such Contributor by reason of your accepting any such
+warranty or additional liability.
+
+END OF TERMS AND CONDITIONS 
+
+
+
+--------------- SECTION 2: GNU Lesser General Public License, V2.1 -----------
+
+		  GNU LESSER GENERAL PUBLIC LICENSE
+		       Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+ 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL.  It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+  This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it.  You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+  When we speak of free software, we are referring to freedom of use,
+not price.  Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+  To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights.  These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+  For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you.  You must make sure that they, too, receive or can get the source
+code.  If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it.  And you must show them these terms so they know their rights.
+
+  We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+  To protect each distributor, we want to make it very clear that
+there is no warranty for the free library.  Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+
+  Finally, software patents pose a constant threat to the existence of
+any free program.  We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder.  Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+  Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License.  This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License.  We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+  When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library.  The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom.  The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+  We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License.  It also provides other free software developers Less
+of an advantage over competing non-free programs.  These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries.  However, the Lesser license provides advantages in certain
+special circumstances.
+
+  For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard.  To achieve this, non-free programs must be
+allowed to use the library.  A more frequent case is that a free
+library does the same job as widely used non-free libraries.  In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+  In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software.  For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+  Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.  Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library".  The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+
+		  GNU LESSER GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+  A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+  The "Library", below, refers to any such software library or work
+which has been distributed under these terms.  A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language.  (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+  "Source code" for a work means the preferred form of the work for
+making modifications to it.  For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+  Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it).  Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+  1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+  You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+  2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) The modified work must itself be a software library.
+
+    b) You must cause the files modified to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    c) You must cause the whole of the work to be licensed at no
+    charge to all third parties under the terms of this License.
+
+    d) If a facility in the modified Library refers to a function or a
+    table of data to be supplied by an application program that uses
+    the facility, other than as an argument passed when the facility
+    is invoked, then you must make a good faith effort to ensure that,
+    in the event an application does not supply such function or
+    table, the facility still operates, and performs whatever part of
+    its purpose remains meaningful.
+
+    (For example, a function in a library to compute square roots has
+    a purpose that is entirely well-defined independent of the
+    application.  Therefore, Subsection 2d requires that any
+    application-supplied function or table used by this function must
+    be optional: if the application does not supply it, the square
+    root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library.  To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License.  (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.)  Do not make any other change in
+these notices.
+
+  Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+  This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+  4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+  If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library".  Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+  However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library".  The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+  When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library.  The
+threshold for this to be true is not precisely defined by law.
+
+  If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work.  (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+  Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+  6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+  You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License.  You must supply a copy of this License.  If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License.  Also, you must do one
+of these things:
+
+    a) Accompany the work with the complete corresponding
+    machine-readable source code for the Library including whatever
+    changes were used in the work (which must be distributed under
+    Sections 1 and 2 above); and, if the work is an executable linked
+    with the Library, with the complete machine-readable "work that
+    uses the Library", as object code and/or source code, so that the
+    user can modify the Library and then relink to produce a modified
+    executable containing the modified Library.  (It is understood
+    that the user who changes the contents of definitions files in the
+    Library will not necessarily be able to recompile the application
+    to use the modified definitions.)
+
+    b) Use a suitable shared library mechanism for linking with the
+    Library.  A suitable mechanism is one that (1) uses at run time a
+    copy of the library already present on the user's computer system,
+    rather than copying library functions into the executable, and (2)
+    will operate properly with a modified version of the library, if
+    the user installs one, as long as the modified version is
+    interface-compatible with the version that the work was made with.
+
+    c) Accompany the work with a written offer, valid for at
+    least three years, to give the same user the materials
+    specified in Subsection 6a, above, for a charge no more
+    than the cost of performing this distribution.
+
+    d) If distribution of the work is made by offering access to copy
+    from a designated place, offer equivalent access to copy the above
+    specified materials from the same place.
+
+    e) Verify that the user has already received a copy of these
+    materials or that you have already sent this user a copy.
+
+  For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it.  However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+  It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system.  Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+  7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+    a) Accompany the combined library with a copy of the same work
+    based on the Library, uncombined with any other library
+    facilities.  This must be distributed under the terms of the
+    Sections above.
+
+    b) Give prominent notice with the combined library of the fact
+    that part of it is a work based on the Library, and explaining
+    where to find the accompanying uncombined form of the same work.
+
+  8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License.  Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License.  However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+  9. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Library or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+  10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+
+  11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded.  In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+  13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation.  If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+  14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission.  For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this.  Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+			    NO WARRANTY
+
+  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
+
+           How to Apply These Terms to Your New Libraries
+
+  If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change.  You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+  To apply these terms, attach the following notices to the library.  It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the library's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the
+  library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+  <signature of Ty Coon>, 1 April 1990
+  Ty Coon, President of Vice
+
+That's all there is to it!
+
+
+
+
+--------------- SECTION 3: Common Development and Distribution License, V1.0 -----------
+
+COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
+
+1. Definitions.
+
+1.1. "Contributor" means each individual or entity that creates or
+contributes to the creation of Modifications.
+
+1.2. "Contributor Version" means the combination of the Original Software,
+prior Modifications used by a Contributor (if any), and the Modifications
+made by that particular Contributor.
+
+1.3. "Covered Software" means (a) the Original Software, or (b)
+Modifications, or (c) the combination of files containing Original
+Software with files containing Modifications, in each case including
+portions thereof.
+
+1.4. "Executable" means the Covered Software in any form other than
+Source Code.
+
+1.5. "Initial Developer" means the individual or entity that first makes
+Original Software available under this License.
+
+1.6. "Larger Work" means a work which combines Covered Software or
+portions thereof with code not governed by the terms of this License.
+
+1.7. "License" means this document.
+
+1.8. "Licensable" means having the right to grant, to the maximum extent
+possible, whether at the time of the initial grant or subsequently
+acquired, any and all of the rights conveyed herein.
+
+1.9. "Modifications" means the Source Code and Executable form of any
+of the following:
+
+    A. Any file that results from an addition to, deletion from or
+    modification of the contents of a file containing Original Software
+    or previous Modifications;
+
+    B. Any new file that contains any part of the Original Software or
+    previous Modification; or
+
+    C. Any new file that is contributed or otherwise made available
+    under the terms of this License.
+
+1.10. "Original Software" means the Source Code and Executable form of
+computer software code that is originally released under this License.
+
+1.11. "Patent Claims" means any patent claim(s), now owned or hereafter
+acquired, including without limitation, method, process, and apparatus
+claims, in any patent Licensable by grantor.
+
+1.12. "Source Code" means (a) the common form of computer software code
+in which modifications are made and (b) associated documentation included
+in or with such code.
+
+1.13. "You" (or "Your") means an individual or a legal entity exercising
+rights under, and complying with all of the terms of, this License. For
+legal entities, "You" includes any entity which controls, is controlled
+by, or is under common control with You. For purposes of this definition,
+"control" means (a) the power, direct or indirect, to cause the direction
+or management of such entity, whether by contract or otherwise, or (b)
+ownership of more than fifty percent (50%) of the outstanding shares or
+beneficial ownership of such entity.
+
+2. License Grants. 
+
+2.1. The Initial Developer Grant.
+
+Conditioned upon Your compliance with Section 3.1 below and subject to
+third party intellectual property claims, the Initial Developer hereby
+grants You a world-wide, royalty-free, non-exclusive license:
+
+    (a) under intellectual property rights (other than patent or
+    trademark) Licensable by Initial Developer, to use, reproduce, modify,
+    display, perform, sublicense and distribute the Original Software
+    (or portions thereof), with or without Modifications, and/or as part
+    of a Larger Work; and
+
+    (b) under Patent Claims infringed by the making, using or selling
+    of Original Software, to make, have made, use, practice, sell, and
+    offer for sale, and/or otherwise dispose of the Original Software
+    (or portions thereof).
+
+    (c) The licenses granted in Sections 2.1(a) and (b) are effective
+    on the date Initial Developer first distributes or otherwise makes
+    the Original Software available to a third party under the terms of
+    this License.
+
+    (d) Notwithstanding Section 2.1(b) above, no patent license is
+    granted: (1) for code that You delete from the Original Software,
+    or (2) for infringements caused by: (i) the modification of the
+    Original Software, or (ii) the combination of the Original Software
+    with other software or devices.
+
+2.2. Contributor Grant.
+
+Conditioned upon Your compliance with Section 3.1 below and subject to
+third party intellectual property claims, each Contributor hereby grants
+You a world-wide, royalty-free, non-exclusive license:
+
+    (a) under intellectual property rights (other than patent or
+    trademark) Licensable by Contributor to use, reproduce, modify,
+    display, perform, sublicense and distribute the Modifications created
+    by such Contributor (or portions thereof), either on an unmodified
+    basis, with other Modifications, as Covered Software and/or as part
+    of a Larger Work; and
+
+    (b) under Patent Claims infringed by the making, using, or selling
+    of Modifications made by that Contributor either alone and/or
+    in combination with its Contributor Version (or portions of such
+    combination), to make, use, sell, offer for sale, have made, and/or
+    otherwise dispose of: (1) Modifications made by that Contributor
+    (or portions thereof); and (2) the combination of Modifications
+    made by that Contributor with its Contributor Version (or portions
+    of such combination).
+
+    (c) The licenses granted in Sections 2.2(a) and 2.2(b) are effective
+    on the date Contributor first distributes or otherwise makes the
+    Modifications available to a third party.
+
+    (d) Notwithstanding Section 2.2(b) above, no patent license is
+    granted: (1) for any code that Contributor has deleted from the
+    Contributor Version; (2) for infringements caused by: (i) third
+    party modifications of Contributor Version, or (ii) the combination
+    of Modifications made by that Contributor with other software
+    (except as part of the Contributor Version) or other devices; or (3)
+    under Patent Claims infringed by Covered Software in the absence of
+    Modifications made by that Contributor.
+
+3. Distribution Obligations.
+
+3.1. Availability of Source Code.
+
+Any Covered Software that You distribute or otherwise make available
+in Executable form must also be made available in Source Code form and
+that Source Code form must be distributed only under the terms of this
+License. You must include a copy of this License with every copy of the
+Source Code form of the Covered Software You distribute or otherwise make
+available. You must inform recipients of any such Covered Software in
+Executable form as to how they can obtain such Covered Software in Source
+Code form in a reasonable manner on or through a medium customarily used
+for software exchange.
+
+3.2. Modifications.
+
+The Modifications that You create or to which You contribute are governed
+by the terms of this License. You represent that You believe Your
+Modifications are Your original creation(s) and/or You have sufficient
+rights to grant the rights conveyed by this License.
+
+3.3. Required Notices.
+
+You must include a notice in each of Your Modifications that identifies
+You as the Contributor of the Modification.  You may not remove or alter
+any copyright, patent or trademark notices contained within the Covered
+Software, or any notices of licensing or any descriptive text giving
+attribution to any Contributor or the Initial Developer.
+
+3.4. Application of Additional Terms.
+
+You may not offer or impose any terms on any Covered Software in Source
+Code form that alters or restricts the applicable version of this License
+or the recipients' rights hereunder. You may choose to offer, and to
+charge a fee for, warranty, support, indemnity or liability obligations to
+one or more recipients of Covered Software.  However, you may do so only
+on Your own behalf, and not on behalf of the Initial Developer or any
+Contributor. You must make it absolutely clear that any such warranty,
+support, indemnity or liability obligation is offered by You alone, and
+You hereby agree to indemnify the Initial Developer and every Contributor
+for any liability incurred by the Initial Developer or such Contributor
+as a result of warranty, support, indemnity or liability terms You offer.
+
+3.5. Distribution of Executable Versions.
+
+You may distribute the Executable form of the Covered Software under the
+terms of this License or under the terms of a license of Your choice,
+which may contain terms different from this License, provided that You are
+in compliance with the terms of this License and that the license for the
+Executable form does not attempt to limit or alter the recipient's rights
+in the Source Code form from the rights set forth in this License. If
+You distribute the Covered Software in Executable form under a different
+license, You must make it absolutely clear that any terms which differ
+from this License are offered by You alone, not by the Initial Developer
+or Contributor. You hereby agree to indemnify the Initial Developer and
+every Contributor for any liability incurred by the Initial Developer
+or such Contributor as a result of any such terms You offer.
+
+3.6. Larger Works.
+
+You may create a Larger Work by combining Covered Software with other code
+not governed by the terms of this License and distribute the Larger Work
+as a single product. In such a case, You must make sure the requirements
+of this License are fulfilled for the Covered Software.
+
+4. Versions of the License. 
+
+4.1. New Versions.
+
+Sun Microsystems, Inc. is the initial license steward and may publish
+revised and/or new versions of this License from time to time. Each
+version will be given a distinguishing version number. Except as provided
+in Section 4.3, no one other than the license steward has the right to
+modify this License.
+
+4.2. Effect of New Versions.
+
+You may always continue to use, distribute or otherwise make the Covered
+Software available under the terms of the version of the License under
+which You originally received the Covered Software. If the Initial
+Developer includes a notice in the Original Software prohibiting it
+from being distributed or otherwise made available under any subsequent
+version of the License, You must distribute and make the Covered Software
+available under the terms of the version of the License under which You
+originally received the Covered Software. Otherwise, You may also choose
+to use, distribute or otherwise make the Covered Software available
+under the terms of any subsequent version of the License published by
+the license steward.
+
+4.3. Modified Versions.
+
+When You are an Initial Developer and You want to create a new license
+for Your Original Software, You may create and use a modified version of
+this License if You: (a) rename the license and remove any references
+to the name of the license steward (except to note that the license
+differs from this License); and (b) otherwise make it clear that the
+license contains terms which differ from this License.
+
+5. DISCLAIMER OF WARRANTY.
+
+COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+WITHOUT LIMITATION, WARRANTIES THAT THE COVERED SOFTWARE IS FREE OF
+DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE
+ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED SOFTWARE
+IS WITH YOU. SHOULD ANY COVERED SOFTWARE PROVE DEFECTIVE IN ANY RESPECT,
+YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST
+OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF
+WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY
+COVERED SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
+
+6. TERMINATION. 
+
+6.1. This License and the rights granted hereunder will terminate
+automatically if You fail to comply with terms herein and fail to cure
+such breach within 30 days of becoming aware of the breach. Provisions
+which, by their nature, must remain in effect beyond the termination of
+this License shall survive.
+
+6.2. If You assert a patent infringement claim (excluding declaratory
+judgment actions) against Initial Developer or a Contributor (the
+Initial Developer or Contributor against whom You assert such claim is
+referred to as "Participant") alleging that the Participant Software
+(meaning the Contributor Version where the Participant is a Contributor
+or the Original Software where the Participant is the Initial Developer)
+directly or indirectly infringes any patent, then any and all rights
+granted directly or indirectly to You by such Participant, the Initial
+Developer (if the Initial Developer is not the Participant) and all
+Contributors under Sections 2.1 and/or 2.2 of this License shall, upon 60
+days notice from Participant terminate prospectively and automatically
+at the expiration of such 60 day notice period, unless if within such
+60 day period You withdraw Your claim with respect to the Participant
+Software against such Participant either unilaterally or pursuant to a
+written agreement with Participant.
+
+6.3. In the event of termination under Sections 6.1 or 6.2 above, all end
+user licenses that have been validly granted by You or any distributor
+hereunder prior to termination (excluding licenses granted to You by
+any distributor) shall survive termination.
+
+7. LIMITATION OF LIABILITY.
+
+UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING
+NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL DEVELOPER, ANY
+OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED SOFTWARE, OR ANY SUPPLIER
+OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL,
+INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT
+LIMITATION, DAMAGES FOR LOST PROFITS, LOSS OF GOODWILL, WORK STOPPAGE,
+COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES
+OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY
+OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY
+FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH PARTY'S NEGLIGENCE TO
+THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS
+DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL
+DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
+
+8. U.S. GOVERNMENT END USERS.
+
+The Covered Software is a "commercial item," as that term is defined
+in 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer
+software" (as that term is defined at 48 C.F.R.  252.227-7014(a)(1)) and
+"commercial computer software documentation" as such terms are used in
+48 C.F.R. 12.212 (Sept.  1995). Consistent with 48 C.F.R. 12.212 and 48
+C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End
+Users acquire Covered Software with only those rights set forth herein.
+This U.S. Government Rights clause is in lieu of, and supersedes, any
+other FAR, DFAR, or other clause or provision that addresses Government
+rights in computer software under this License.
+
+9. MISCELLANEOUS.
+
+This License represents the complete agreement concerning subject matter
+hereof. If any provision of this License is held to be unenforceable,
+such provision shall be reformed only to the extent necessary to make it
+enforceable. This License shall be governed by the law of the jurisdiction
+specified in a notice contained within the Original Software (except to
+the extent applicable law, if any, provides otherwise), excluding such
+jurisdiction's conflict-of-law provisions. Any litigation relating to
+this License shall be subject to the jurisdiction of the courts located
+in the jurisdiction and venue specified in a notice contained within
+the Original Software, with the losing party responsible for costs,
+including, without limitation, court costs and reasonable attorneys'
+fees and expenses. The application of the United Nations Convention on
+Contracts for the International Sale of Goods is expressly excluded. Any
+law or regulation which provides that the language of a contract shall
+be construed against the drafter shall not apply to this License.
+You agree that You alone are responsible for compliance with the United
+States export administration regulations (and the export control laws and
+regulation of any other countries) when You use, distribute or otherwise
+make available any Covered Software.
+
+10. RESPONSIBILITY FOR CLAIMS.
+
+As between Initial Developer and the Contributors, each party is
+responsible for claims and damages arising, directly or indirectly, out
+of its utilization of rights under this License and You agree to work
+with Initial Developer and Contributors to distribute such responsibility
+on an equitable basis. Nothing herein is intended or shall be deemed to
+constitute any admission of liability.
+
+
+
+===========================================================================
+
+To the extent any open source components are licensed under the
+GPL and/or LGPL, or other similar licenses that require the
+source code and/or modifications to source code to be made
+available (as would be noted above), you may obtain a copy of
+the source code corresponding to the binaries for such open
+source components and modifications thereto, if any, (the
+"Source Files"), by downloading the Source Files from VMware's website at
+http://www.vmware.com/download/open_source.html, or by sending a request, with
+your name and address to: VMware, Inc., 3401 Hillview Avenue,
+Palo Alto, CA 94304,United States of America. All such
+requests should clearly specify: OPEN SOURCE FILES REQUEST,
+Attention General Counsel. VMware shall mail a copy of the
+Source Files to you on a CD or equivalent physical medium. This
+offer to obtain a copy of the Source Files is valid for three
+years from the date you acquired this Software product. Alternatively,
+the Source Files may accompany the VMware product.
+
+
+[VFABRICGEMFIREHTTPSESSIONMANAGEMENTMODULE21GAKR021412]


[10/24] incubator-geode git commit: GEODE-14: Adding integration tests from '-external'

Posted by je...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/db02660d/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/CommonTests.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/CommonTests.java b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/CommonTests.java
new file mode 100644
index 0000000..b9b182d
--- /dev/null
+++ b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/CommonTests.java
@@ -0,0 +1,576 @@
+/*=========================================================================
+ * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package com.gemstone.gemfire.modules.session.internal.filter;
+
+import com.mockrunner.mock.web.MockHttpServletRequest;
+import com.mockrunner.mock.web.MockHttpServletResponse;
+import com.mockrunner.mock.web.MockHttpSession;
+import com.mockrunner.servlet.BasicServletTestCaseAdapter;
+import org.junit.Ignore;
+import org.junit.Test;
+
+import java.util.concurrent.TimeUnit;
+import javax.servlet.http.Cookie;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+import javax.servlet.http.HttpSessionAttributeListener;
+
+import static junit.framework.Assert.assertEquals;
+import static org.junit.Assert.*;
+
+/**
+ * This servlet tests the effects of the downstream SessionCachingFilter filter.
+ * When these tests are performed, the filter would already have taken effect.
+ */
+public abstract class CommonTests extends BasicServletTestCaseAdapter {
+
+  protected static final String CONTEXT_PATH = "/test";
+
+  @Test
+  public void testGetSession1() throws Exception {
+    doFilter();
+    HttpSession session1 =
+        ((HttpServletRequest) getFilteredRequest()).getSession();
+    HttpSession session2 =
+        ((HttpServletRequest) getFilteredRequest()).getSession();
+
+    assertSame("Session should be the same", session1, session2);
+  }
+
+  @Test
+  public void testGetSession2() throws Exception {
+    doFilter();
+
+    HttpSession session1 = ((HttpServletRequest) getFilteredRequest()).getSession();
+
+    MockHttpServletResponse response = getWebMockObjectFactory().getMockResponse();
+    Cookie cookie = (Cookie) response.getCookies().get(0);
+    getWebMockObjectFactory().getMockRequest().addCookie(cookie);
+
+    doFilter();
+
+    HttpSession session2 = ((HttpServletRequest) getFilteredRequest()).getSession();
+
+    assertEquals("Session objects across requests should be the same", session1, session2);
+  }
+
+  @Test
+  public void testGetAttributeRequest1() throws Exception {
+    doFilter();
+
+    getFilteredRequest().setAttribute("foo", "bar");
+
+    assertEquals("bar", getFilteredRequest().getAttribute("foo"));
+    assertNull("Unknown attribute should be null",
+        getFilteredRequest().getAttribute("baz"));
+  }
+
+  @Test
+  public void testGetAttributeRequest2() throws Exception {
+    // Setup
+    CallbackServlet s = (CallbackServlet) getServlet();
+    s.setCallback(new Callback() {
+      @Override
+      public void call(HttpServletRequest request, HttpServletResponse response) {
+        request.setAttribute("foo", "bar");
+      }
+    });
+    doFilter();
+
+    assertEquals("bar", getFilteredRequest().getAttribute("foo"));
+    assertNull("Unknown attribute should be null",
+        getFilteredRequest().getAttribute("baz"));
+  }
+
+  @Test
+  public void testGetAttributeSession1() throws Exception {
+    doFilter();
+
+    ((HttpServletRequest) getFilteredRequest()).getSession().setAttribute("foo", "bar");
+
+    HttpServletRequest request = (HttpServletRequest) getFilteredRequest();
+    assertEquals("bar", request.getSession().getAttribute("foo"));
+  }
+
+  /**
+   * Are attributes preserved across client requests?
+   */
+  @Test
+  public void testGetAttributeSession2() throws Exception {
+    doFilter();
+
+    ((HttpServletRequest) getFilteredRequest()).getSession().setAttribute("foo", "bar");
+
+    MockHttpServletResponse response = getWebMockObjectFactory().getMockResponse();
+    Cookie cookie = (Cookie) response.getCookies().get(0);
+    getWebMockObjectFactory().getMockRequest().addCookie(cookie);
+
+    doFilter();
+    HttpServletRequest request = (HttpServletRequest) getFilteredRequest();
+
+    assertEquals("bar", request.getSession().getAttribute("foo"));
+  }
+
+  /**
+   * Setting a session attribute to null should remove it
+   */
+  @Test
+  public void testSetAttributeNullSession1() throws Exception {
+    // Setup
+    CallbackServlet s = (CallbackServlet) getServlet();
+    s.setCallback(new Callback() {
+      private boolean called = false;
+
+      @Override
+      public void call(HttpServletRequest request, HttpServletResponse response) {
+        if (called) {
+          request.getSession().setAttribute("foo", null);
+        } else {
+          request.getSession().setAttribute("foo", "bar");
+          called = true;
+        }
+      }
+    });
+
+    doFilter();
+    doFilter();
+
+    HttpSession session = ((HttpServletRequest) getFilteredRequest()).getSession();
+
+    String attr = (String) session.getAttribute("foo");
+    assertNull("Attribute should be null but is " + attr, attr);
+  }
+
+
+  /**
+   * Test that various methods throw the appropriate exception when the session is
+   * invalid.
+   */
+  @Test
+  public void testInvalidate1() throws Exception {
+    doFilter();
+
+    HttpSession session = ((HttpServletRequest) getFilteredRequest()).getSession();
+    session.invalidate();
+
+    try {
+      session.getAttribute("foo");
+      fail("Session should be invalid and an exception should be thrown");
+    } catch (IllegalStateException iex) {
+      // Pass
+    }
+  }
+
+  @Test
+  public void testInvalidate2() throws Exception {
+    doFilter();
+
+    HttpSession session = ((HttpServletRequest) getFilteredRequest()).getSession();
+    session.invalidate();
+
+    try {
+      session.getAttributeNames();
+      fail("Session should be invalid and an exception should be thrown");
+    } catch (IllegalStateException iex) {
+      // Pass
+    }
+  }
+
+  @Ignore(value = "until mockrunner 1.0.9 - see pull request #23")
+  public void testInvalidate3() throws Exception {
+    doFilter();
+
+    HttpSession session = ((HttpServletRequest) getFilteredRequest()).getSession();
+    session.invalidate();
+
+    try {
+      session.getCreationTime();
+      fail("Session should be invalid and an exception should be thrown");
+    } catch (IllegalStateException iex) {
+      // Pass
+    }
+  }
+
+  @Test
+  public void testInvalidate4() throws Exception {
+    doFilter();
+
+    HttpSession session = ((HttpServletRequest) getFilteredRequest()).getSession();
+    session.invalidate();
+
+    try {
+      session.getId();
+    } catch (Exception iex) {
+      fail("Exception should not be thrown");
+    }
+  }
+
+  @Test
+  public void testInvalidate5() throws Exception {
+    doFilter();
+
+    HttpSession session = ((HttpServletRequest) getFilteredRequest()).getSession();
+    session.invalidate();
+
+    try {
+      session.getLastAccessedTime();
+      fail("Session should be invalid and an exception should be thrown");
+    } catch (IllegalStateException iex) {
+      // Pass
+    }
+  }
+
+  @Test
+  public void testInvalidate6() throws Exception {
+    doFilter();
+
+    HttpSession session = ((HttpServletRequest) getFilteredRequest()).getSession();
+    session.invalidate();
+
+    try {
+      session.getMaxInactiveInterval();
+    } catch (Exception ex) {
+      fail("Exception should not be thrown");
+    }
+  }
+
+  @Test
+  public void testInvalidate7() throws Exception {
+    doFilter();
+
+    HttpSession session = ((HttpServletRequest) getFilteredRequest()).getSession();
+    session.invalidate();
+
+    try {
+      session.getServletContext();
+    } catch (Exception ex) {
+      fail("Exception should not be thrown");
+    }
+  }
+
+  @Test
+  public void testInvalidate8() throws Exception {
+    doFilter();
+
+    HttpSession session = ((HttpServletRequest) getFilteredRequest()).getSession();
+    session.invalidate();
+
+    try {
+      session.isNew();
+      fail("Session should be invalid and an exception should be thrown");
+    } catch (IllegalStateException iex) {
+      // Pass
+    }
+  }
+
+  @Test
+  public void testInvalidate9() throws Exception {
+    doFilter();
+
+    HttpSession session = ((HttpServletRequest) getFilteredRequest()).getSession();
+    session.invalidate();
+
+    try {
+      session.removeAttribute("foo");
+      fail("Session should be invalid and an exception should be thrown");
+    } catch (IllegalStateException iex) {
+      // Pass
+    }
+  }
+
+  @Test
+  public void testInvalidate10() throws Exception {
+    doFilter();
+
+    HttpSession session = ((HttpServletRequest) getFilteredRequest()).getSession();
+    session.invalidate();
+
+    try {
+      session.setAttribute("foo", "bar");
+      fail("Session should be invalid and an exception should be thrown");
+    } catch (IllegalStateException iex) {
+      // Pass
+    }
+  }
+
+  @Test
+  public void testInvalidate11() throws Exception {
+    doFilter();
+
+    HttpSession session = ((HttpServletRequest) getFilteredRequest()).getSession();
+    session.invalidate();
+
+    try {
+      session.setMaxInactiveInterval(1);
+    } catch (Exception ex) {
+      fail("Exception should not be thrown");
+    }
+  }
+
+  /**
+   * Test that Session Attribute events get triggered
+   */
+  @Test
+  public void testSessionAttributeListener1() throws Exception {
+    AbstractListener listener = new HttpSessionAttributeListenerImpl();
+    RendezvousManager.registerListener(listener);
+    listener.setLatch(3);
+
+    doFilter();
+
+    // Ugh
+    MockHttpSession session = (MockHttpSession) ((GemfireHttpSession) ((HttpServletRequest) getFilteredRequest()).getSession()).getNativeSession();
+    session.addAttributeListener((HttpSessionAttributeListener) listener);
+    session.setAttribute("foo", "bar");
+    session.setAttribute("foo", "baz");
+    session.setAttribute("foo", null);
+
+    assertTrue("Event timeout", listener.await(1, TimeUnit.SECONDS));
+    assertEquals(ListenerEventType.SESSION_ATTRIBUTE_ADDED, listener.getEvents().get(0));
+    assertEquals(ListenerEventType.SESSION_ATTRIBUTE_REPLACED,
+        listener.getEvents().get(1));
+    assertEquals(ListenerEventType.SESSION_ATTRIBUTE_REMOVED,
+        listener.getEvents().get(2));
+  }
+
+  /**
+   * Test that both replace and remove events get triggered
+   */
+  @Test
+  public void testHttpSessionBindingListener1() throws Exception {
+    doFilter();
+
+    HttpSession session =
+        ((HttpServletRequest) getFilteredRequest()).getSession();
+
+    HttpSessionBindingListenerImpl listener1 =
+        new HttpSessionBindingListenerImpl(2);
+    HttpSessionBindingListenerImpl listener2 =
+        new HttpSessionBindingListenerImpl(2);
+
+    session.setAttribute("foo", listener1);
+    session.setAttribute("foo", listener2);
+    session.setAttribute("foo", null);
+
+    assertTrue("Event timeout", listener1.await(1, TimeUnit.SECONDS));
+    assertTrue("Event timeout", listener2.await(1, TimeUnit.SECONDS));
+
+    assertEquals("Event list size incorrect", 2, listener1.getEvents().size());
+    assertEquals("Event list size incorrect", 2, listener2.getEvents().size());
+    assertEquals(ListenerEventType.SESSION_VALUE_BOUND, listener1.getEvents().get(0));
+    assertEquals(ListenerEventType.SESSION_VALUE_UNBOUND,
+        listener1.getEvents().get(1));
+    assertEquals(ListenerEventType.SESSION_VALUE_BOUND, listener2.getEvents().get(0));
+    assertEquals(ListenerEventType.SESSION_VALUE_UNBOUND,
+        listener2.getEvents().get(1));
+  }
+
+  @Test
+  public void testGetId1() throws Exception {
+    doFilter();
+
+    assertNotNull("Session Id should not be null",
+        ((HttpServletRequest) getFilteredRequest()).getSession().getId());
+  }
+
+  /**
+   * Test that multiple calls from the same client return the same session id
+   */
+  @Test
+  public void testGetId2() throws Exception {
+    doFilter();
+
+    String sessionId = ((HttpServletRequest) getFilteredRequest()).getSession().getId();
+
+    MockHttpServletResponse response = getWebMockObjectFactory().getMockResponse();
+    Cookie cookie = (Cookie) response.getCookies().get(0);
+    getWebMockObjectFactory().getMockRequest().addCookie(cookie);
+
+    doFilter();
+
+    assertEquals("Session Ids should be the same", sessionId,
+        ((HttpServletRequest) getFilteredRequest()).getSession().getId());
+  }
+
+  @Test
+  public void testGetCreationTime1() throws Exception {
+    doFilter();
+
+    HttpServletRequest request = (HttpServletRequest) getFilteredRequest();
+    assertTrue("Session should have a non-zero creation time",
+        request.getSession().getCreationTime() > 0);
+  }
+
+
+  /**
+   * Test that multiple calls from the same client don't change the creation time.
+   */
+  @Test
+  public void testGetCreationTime2() throws Exception {
+    doFilter();
+
+    long creationTime = ((HttpServletRequest) getFilteredRequest()).getSession().getCreationTime();
+
+    MockHttpServletResponse response = getWebMockObjectFactory().getMockResponse();
+    Cookie cookie = (Cookie) response.getCookies().get(0);
+    getWebMockObjectFactory().getMockRequest().addCookie(cookie);
+
+    doFilter();
+
+    assertEquals("Session creation time should be the same", creationTime,
+        ((HttpServletRequest) getFilteredRequest()).getSession().getCreationTime());
+  }
+
+  @Test
+  public void testResponseContainsRequestedSessionId1() throws Exception {
+    Cookie cookie = new Cookie("JSESSIONID", "999-GF");
+    getWebMockObjectFactory().getMockRequest().addCookie(cookie);
+
+    doFilter();
+
+    HttpServletRequest request = (HttpServletRequest) getFilteredRequest();
+
+    assertEquals("Request does not contain requested session ID", "999-GF",
+        request.getRequestedSessionId());
+  }
+
+  @Test
+  public void testGetLastAccessedTime1() throws Exception {
+    doFilter();
+
+    HttpServletRequest request = (HttpServletRequest) getFilteredRequest();
+    assertTrue("Session should have a non-zero last access time",
+        request.getSession().getLastAccessedTime() > 0);
+  }
+
+
+  /**
+   * Test that repeated accesses update the last accessed time
+   */
+  @Test
+  public void testGetLastAccessedTime2() throws Exception {
+    // Setup
+    CallbackServlet s = (CallbackServlet) getServlet();
+    s.setCallback(new Callback() {
+
+      @Override
+      public void call(HttpServletRequest request, HttpServletResponse response) {
+        request.getSession();
+      }
+    });
+
+    doFilter();
+
+    HttpServletRequest request = (HttpServletRequest) getFilteredRequest();
+    long lastAccess = request.getSession().getLastAccessedTime();
+    assertTrue("Session should have a non-zero last access time", lastAccess > 0);
+
+    MockHttpServletResponse response = getWebMockObjectFactory().getMockResponse();
+    Cookie cookie = (Cookie) response.getCookies().get(0);
+
+    MockHttpServletRequest mRequest = getWebMockObjectFactory().createMockRequest();
+    mRequest.setRequestURL("/test/foo/bar");
+    mRequest.setContextPath(CONTEXT_PATH);
+    mRequest.addCookie(cookie);
+    getWebMockObjectFactory().addRequestWrapper(mRequest);
+
+    Thread.sleep(50);
+    doFilter();
+
+    assertTrue("Last access time should be changing",
+        request.getSession().getLastAccessedTime() > lastAccess);
+  }
+
+  @Test
+  public void testGetSetMaxInactiveInterval() throws Exception {
+    doFilter();
+
+    HttpServletRequest request = (HttpServletRequest) getFilteredRequest();
+    request.getSession().setMaxInactiveInterval(50);
+
+    assertEquals(50, request.getSession().getMaxInactiveInterval());
+  }
+
+  @Test
+  public void testIsNew1() throws Exception {
+    doFilter();
+
+    HttpServletRequest request = (HttpServletRequest) getFilteredRequest();
+    assertTrue("Session should be new", request.getSession().isNew());
+  }
+
+  /**
+   * Subsequent calls should not return true
+   */
+  @Test
+  public void testIsNew2() throws Exception {
+    // Setup
+    CallbackServlet s = (CallbackServlet) getServlet();
+    s.setCallback(new Callback() {
+
+      @Override
+      public void call(HttpServletRequest request, HttpServletResponse response) {
+        request.getSession();
+      }
+    });
+
+    doFilter();
+
+    HttpServletRequest request = (HttpServletRequest) getFilteredRequest();
+    request.getSession();
+
+    MockHttpServletResponse response = getWebMockObjectFactory().getMockResponse();
+    Cookie cookie = (Cookie) response.getCookies().get(0);
+
+    MockHttpServletRequest mRequest = getWebMockObjectFactory().createMockRequest();
+    mRequest.setRequestURL("/test/foo/bar");
+    mRequest.setContextPath(CONTEXT_PATH);
+    mRequest.addCookie(cookie);
+    getWebMockObjectFactory().addRequestWrapper(mRequest);
+
+    doFilter();
+
+    request = (HttpServletRequest) getFilteredRequest();
+    HttpSession s1 = request.getSession();
+
+    assertFalse("Subsequent isNew() calls should be false", request.getSession().isNew());
+  }
+
+  @Test
+  public void testIsRequestedSessionIdFromCookie() {
+    MockHttpServletRequest mRequest = getWebMockObjectFactory().getMockRequest();
+    Cookie c = new Cookie("JSESSIONID", "1-GF");
+    mRequest.addCookie(c);
+
+    doFilter();
+    HttpServletRequest request = (HttpServletRequest) getFilteredRequest();
+    request.getSession();
+
+    assertTrue(request.isRequestedSessionIdFromCookie());
+  }
+
+  @Test
+  public void testIsRequestedSessionIdFromURL() {
+    MockHttpServletRequest mRequest = getWebMockObjectFactory().getMockRequest();
+    mRequest.setRequestURL("/foo/bar;jsessionid=1");
+
+    doFilter();
+    HttpServletRequest request = (HttpServletRequest) getFilteredRequest();
+    request.getSession();
+
+    assertFalse("Session ID should not be from cookie",
+        request.isRequestedSessionIdFromCookie());
+    assertTrue("Session ID should be from URL", request.isRequestedSessionIdFromURL());
+  }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/db02660d/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionAttributeListenerImpl.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionAttributeListenerImpl.java b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionAttributeListenerImpl.java
new file mode 100644
index 0000000..a374e4d
--- /dev/null
+++ b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionAttributeListenerImpl.java
@@ -0,0 +1,37 @@
+/*=========================================================================
+ * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+
+package com.gemstone.gemfire.modules.session.internal.filter;
+
+import javax.servlet.http.HttpSessionAttributeListener;
+import javax.servlet.http.HttpSessionBindingEvent;
+
+/**
+ *
+ */
+public class HttpSessionAttributeListenerImpl extends AbstractListener
+    implements HttpSessionAttributeListener {
+
+  @Override
+  public synchronized void attributeAdded(HttpSessionBindingEvent se) {
+    events.add(ListenerEventType.SESSION_ATTRIBUTE_ADDED);
+    latch.countDown();
+  }
+
+  @Override
+  public synchronized void attributeRemoved(HttpSessionBindingEvent se) {
+    events.add(ListenerEventType.SESSION_ATTRIBUTE_REMOVED);
+    latch.countDown();
+  }
+
+  @Override
+  public synchronized void attributeReplaced(HttpSessionBindingEvent se) {
+    events.add(ListenerEventType.SESSION_ATTRIBUTE_REPLACED);
+    latch.countDown();
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/db02660d/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionBindingListenerImpl.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionBindingListenerImpl.java b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionBindingListenerImpl.java
new file mode 100644
index 0000000..2e6ae0c
--- /dev/null
+++ b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionBindingListenerImpl.java
@@ -0,0 +1,40 @@
+/*=========================================================================
+ * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package com.gemstone.gemfire.modules.session.internal.filter;
+
+import java.io.Serializable;
+import javax.servlet.http.HttpSessionBindingEvent;
+import javax.servlet.http.HttpSessionBindingListener;
+
+/**
+ * @author jdeppe
+ */
+public class HttpSessionBindingListenerImpl extends AbstractListener implements
+    HttpSessionBindingListener, Serializable {
+
+  public HttpSessionBindingListenerImpl(int i) {
+    super(i);
+  }
+
+  @Override
+  public synchronized void valueBound(HttpSessionBindingEvent event) {
+    events.add(ListenerEventType.SESSION_VALUE_BOUND);
+    latch.countDown();
+  }
+
+  @Override
+  public synchronized void valueUnbound(HttpSessionBindingEvent event) {
+    events.add(ListenerEventType.SESSION_VALUE_UNBOUND);
+    latch.countDown();
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/db02660d/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionListenerImpl.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionListenerImpl.java b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionListenerImpl.java
new file mode 100644
index 0000000..0e18e1e
--- /dev/null
+++ b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionListenerImpl.java
@@ -0,0 +1,33 @@
+/*=========================================================================
+ * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package com.gemstone.gemfire.modules.session.internal.filter;
+
+import javax.servlet.http.HttpSessionEvent;
+import javax.servlet.http.HttpSessionListener;
+
+/**
+ * @author jdeppe
+ */
+public class HttpSessionListenerImpl extends AbstractListener
+    implements HttpSessionListener {
+
+  public synchronized void sessionCreated(HttpSessionEvent se) {
+    events.add(ListenerEventType.SESSION_CREATED);
+    latch.countDown();
+  }
+
+  public synchronized void sessionDestroyed(HttpSessionEvent se) {
+    events.add(ListenerEventType.SESSION_DESTROYED);
+    latch.countDown();
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/db02660d/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/RendezvousManager.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/RendezvousManager.java b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/RendezvousManager.java
new file mode 100644
index 0000000..b2cacf8
--- /dev/null
+++ b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/RendezvousManager.java
@@ -0,0 +1,37 @@
+/*=========================================================================
+ * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+
+package com.gemstone.gemfire.modules.session.internal.filter;
+
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+
+/**
+ *
+ */
+public class RendezvousManager {
+
+  private static AbstractListener listener = null;
+
+  private static CountDownLatch latch = new CountDownLatch(1);
+
+  public static void registerListener(AbstractListener listener) {
+    RendezvousManager.listener = listener;
+    latch.countDown();
+  }
+
+  public static AbstractListener getListener() {
+    try {
+      latch.await(2, TimeUnit.SECONDS);
+    } catch (InterruptedException ex) {
+    }
+
+    return listener;
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/db02660d/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/ServletRequestAttributeListenerImpl.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/ServletRequestAttributeListenerImpl.java b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/ServletRequestAttributeListenerImpl.java
new file mode 100644
index 0000000..1eea4c0
--- /dev/null
+++ b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/ServletRequestAttributeListenerImpl.java
@@ -0,0 +1,40 @@
+/*=========================================================================
+ * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package com.gemstone.gemfire.modules.session.internal.filter;
+
+import javax.servlet.ServletRequestAttributeEvent;
+import javax.servlet.ServletRequestAttributeListener;
+
+/**
+ * @author jdeppe
+ */
+public class ServletRequestAttributeListenerImpl extends AbstractListener
+    implements ServletRequestAttributeListener {
+
+  public synchronized void attributeAdded(ServletRequestAttributeEvent srae) {
+    events.add(ListenerEventType.SERVLET_REQUEST_ATTRIBUTE_ADDED);
+    latch.countDown();
+  }
+
+  public synchronized void attributeRemoved(ServletRequestAttributeEvent srae) {
+    events.add(ListenerEventType.SERVLET_REQUEST_ATTRIBUTE_REMOVED);
+    latch.countDown();
+  }
+
+  public synchronized void attributeReplaced(
+      ServletRequestAttributeEvent srae) {
+    events.add(ListenerEventType.SERVLET_REQUEST_ATTRIBUTE_REPLACED);
+    latch.countDown();
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/db02660d/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/ServletRequestListenerImpl.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/ServletRequestListenerImpl.java b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/ServletRequestListenerImpl.java
new file mode 100644
index 0000000..0c1dda2
--- /dev/null
+++ b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/ServletRequestListenerImpl.java
@@ -0,0 +1,34 @@
+/*=========================================================================
+ * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package com.gemstone.gemfire.modules.session.internal.filter;
+
+import javax.servlet.ServletRequestEvent;
+import javax.servlet.ServletRequestListener;
+
+/**
+ * @author jdeppe
+ */
+public class ServletRequestListenerImpl extends AbstractListener
+    implements ServletRequestListener {
+
+  public synchronized void requestDestroyed(ServletRequestEvent sre) {
+    events.add(ListenerEventType.SERVLET_REQUEST_DESTROYED);
+    latch.countDown();
+  }
+
+  public synchronized void requestInitialized(ServletRequestEvent sre) {
+    events.add(ListenerEventType.SERVLET_REQUEST_INITIALIZED);
+    latch.countDown();
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/db02660d/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/SessionReplicationJUnitTest.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/SessionReplicationJUnitTest.java b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/SessionReplicationJUnitTest.java
new file mode 100644
index 0000000..5fd6282
--- /dev/null
+++ b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/SessionReplicationJUnitTest.java
@@ -0,0 +1,43 @@
+/*=========================================================================
+ * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+package com.gemstone.gemfire.modules.session.internal.filter;
+
+import com.gemstone.gemfire.modules.session.filter.SessionCachingFilter;
+import com.gemstone.gemfire.test.junit.categories.UnitTest;
+import com.mockrunner.mock.web.MockFilterConfig;
+import com.mockrunner.mock.web.WebMockObjectFactory;
+import org.junit.Before;
+import org.junit.experimental.categories.Category;
+
+/**
+ * This runs all tests with a local cache disabled
+ */
+@Category(UnitTest.class)
+public class SessionReplicationJUnitTest extends CommonTests {
+
+  @Before
+  public void setUp() throws Exception {
+    super.setUp();
+
+    WebMockObjectFactory factory = getWebMockObjectFactory();
+    MockFilterConfig config = factory.getMockFilterConfig();
+
+    config.setInitParameter("gemfire.property.mcast-port", "0");
+    config.setInitParameter("cache-type", "peer-to-peer");
+
+    factory.getMockServletContext().setContextPath(CONTEXT_PATH);
+
+    factory.getMockRequest().setRequestURL("/test/foo/bar");
+    factory.getMockRequest().setContextPath(CONTEXT_PATH);
+
+    createFilter(SessionCachingFilter.class);
+    createServlet(CallbackServlet.class);
+
+    setDoChain(true);
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/db02660d/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/SessionReplicationLocalCacheJUnitTest.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/SessionReplicationLocalCacheJUnitTest.java b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/SessionReplicationLocalCacheJUnitTest.java
new file mode 100644
index 0000000..bd9a513
--- /dev/null
+++ b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/SessionReplicationLocalCacheJUnitTest.java
@@ -0,0 +1,44 @@
+/*=========================================================================
+ * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
+ * This product is protected by U.S. and international copyright
+ * and intellectual property laws. Pivotal products are covered by
+ * one or more patents listed at http://www.pivotal.io/patents.
+ *=========================================================================
+ */
+package com.gemstone.gemfire.modules.session.internal.filter;
+
+import com.gemstone.gemfire.modules.session.filter.SessionCachingFilter;
+import com.gemstone.gemfire.test.junit.categories.UnitTest;
+import com.mockrunner.mock.web.MockFilterConfig;
+import com.mockrunner.mock.web.WebMockObjectFactory;
+import org.junit.Before;
+import org.junit.experimental.categories.Category;
+
+/**
+ * This runs all tests with a local cache enabled
+ */
+@Category(UnitTest.class)
+public class SessionReplicationLocalCacheJUnitTest extends CommonTests {
+
+  @Before
+  public void setUp() throws Exception {
+    super.setUp();
+
+    WebMockObjectFactory factory = getWebMockObjectFactory();
+    MockFilterConfig config = factory.getMockFilterConfig();
+
+    config.setInitParameter("gemfire.property.mcast-port", "0");
+    config.setInitParameter("cache-type", "peer-to-peer");
+    config.setInitParameter("gemfire.cache.enable_local_cache", "true");
+
+    factory.getMockServletContext().setContextPath(CONTEXT_PATH);
+
+    factory.getMockRequest().setRequestURL("/test/foo/bar");
+    factory.getMockRequest().setContextPath(CONTEXT_PATH);
+
+    createFilter(SessionCachingFilter.class);
+    createServlet(CallbackServlet.class);
+
+    setDoChain(true);
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/db02660d/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/junit/SeparateClassloaderTestRunner.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/junit/SeparateClassloaderTestRunner.java b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/junit/SeparateClassloaderTestRunner.java
new file mode 100644
index 0000000..6e47aa9
--- /dev/null
+++ b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/junit/SeparateClassloaderTestRunner.java
@@ -0,0 +1,39 @@
+package com.gemstone.gemfire.modules.session.junit;
+
+import org.junit.runners.BlockJUnit4ClassRunner;
+import org.junit.runners.model.InitializationError;
+
+import java.net.URLClassLoader;
+
+/**
+ * @author StackOverflow
+ */
+public class SeparateClassloaderTestRunner extends BlockJUnit4ClassRunner {
+
+  public SeparateClassloaderTestRunner(Class<?> clazz) throws InitializationError {
+    super(getFromTestClassloader(clazz));
+  }
+
+  private static Class<?> getFromTestClassloader(Class<?> clazz) throws InitializationError {
+    try {
+      ClassLoader testClassLoader = new TestClassLoader();
+      return Class.forName(clazz.getName(), true, testClassLoader);
+    } catch (ClassNotFoundException e) {
+      throw new InitializationError(e);
+    }
+  }
+
+  public static class TestClassLoader extends URLClassLoader {
+    public TestClassLoader() {
+      super(((URLClassLoader)getSystemClassLoader()).getURLs());
+    }
+
+    @Override
+    public Class<?> loadClass(String name) throws ClassNotFoundException {
+      if (name.startsWith("com.gemstone.gemfire.modules.session.")) {
+        return super.findClass(name);
+      }
+      return super.loadClass(name);
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/db02660d/modules/gemfire-modules-session-external/src/main/java/com/gemstone/gemfire/modules/session/installer/Installer.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-external/src/main/java/com/gemstone/gemfire/modules/session/installer/Installer.java b/modules/gemfire-modules-session-external/src/main/java/com/gemstone/gemfire/modules/session/installer/Installer.java
deleted file mode 100644
index 57bdde6..0000000
--- a/modules/gemfire-modules-session-external/src/main/java/com/gemstone/gemfire/modules/session/installer/Installer.java
+++ /dev/null
@@ -1,287 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-
-package com.gemstone.gemfire.modules.session.installer;
-
-import com.gemstone.gemfire.modules.session.installer.args.Argument;
-import com.gemstone.gemfire.modules.session.installer.args.ArgumentProcessor;
-import com.gemstone.gemfire.modules.session.installer.args.ArgumentValues;
-import com.gemstone.gemfire.modules.session.installer.args.UnknownArgumentHandler;
-import com.gemstone.gemfire.modules.session.installer.args.UsageException;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.transform.OutputKeys;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
-import java.io.ByteArrayOutputStream;
-import java.io.FileInputStream;
-import java.io.InputStream;
-import java.io.OutputStream;
-
-/**
- *
- */
-public class Installer {
-
-  private static final String GEMFIRE_FILTER_CLASS =
-      "com.gemstone.gemfire.modules.session.filter.internal.SessionCachingFilter";
-
-  private static final String GEMFIRE_LISTENER_CLASS =
-      "com.gemstone.gemfire.modules.session.filter.internal.SessionListener";
-
-  private ArgumentValues argValues;
-
-  private static final Argument ARG_HELP =
-      new Argument("-h", false).
-          setDescription("Displays this help message.");
-
-  private static Argument ARG_GEMFIRE_PARAMETERS =
-      new Argument("-p", false, "param=value").
-          setDescription("Specific parameter for inclusion into the "
-              + "session filter definition as a regular "
-              + "init-param. Can be given multiple times.");
-
-  private static Argument ARG_CACHE_TYPE =
-      new Argument("-t", false, "cache-type").
-          setDescription(
-              "Type of cache. Must be one of 'peer-to-peer' or "
-                  + "'client-server'. Default is peer-to-peer.").
-          setDefaults("peer-to-peer");
-
-  private static Argument ARG_WEB_XML_FILE =
-      new Argument("-w", true, "web.xml file").
-          setDescription("The web.xml file to be modified.");
-
-
-  /**
-   * Class main method
-   *
-   * @param args Arguments passed in via the command line
-   * @throws Exception in the event of any errors
-   */
-  public static void main(final String[] args) throws Exception {
-    new Installer(args).process();
-  }
-
-  public static void log(String message) {
-    System.err.println(message);
-  }
-
-
-  public Installer(String[] args) throws Exception {
-    final ArgumentProcessor processor = new ArgumentProcessor("Installer");
-
-    argValues = null;
-    try {
-      // These are ordered so as to keep the options alphabetical
-      processor.addArgument(ARG_HELP);
-      processor.addArgument(ARG_GEMFIRE_PARAMETERS);
-      processor.addArgument(ARG_CACHE_TYPE);
-      processor.addArgument(ARG_WEB_XML_FILE);
-
-      processor.setUnknownArgumentHandler(new UnknownArgumentHandler() {
-        @Override
-        public void handleUnknownArgument(
-            final String form, final String[] params) {
-          log("Unknown argument being ignored: "
-              + form + " (" + params.length + " params)");
-          log("Use '-h' argument to display usage");
-        }
-      });
-      argValues = processor.process(args);
-
-      if (argValues.isDefined(ARG_HELP)) {
-        final UsageException usageException =
-            new UsageException("Usage requested by user");
-        usageException.setUsage(processor.getUsage());
-        throw (usageException);
-      }
-
-    } catch (UsageException ux) {
-      final StringBuilder error = new StringBuilder();
-      error.append("\nERROR: ");
-      error.append(ux.getMessage());
-      error.append("\n");
-      if (ux.getUsage() != null) {
-        error.append(ux.getUsage());
-      }
-      log(error.toString());
-      System.exit(2);
-    }
-
-  }
-
-
-  /**
-   * The main entry point for processing
-   *
-   * @throws Exception if any errors occur.
-   */
-  public void process() throws Exception {
-    String argInputFile = argValues.getFirstResult(ARG_WEB_XML_FILE);
-
-    ByteArrayOutputStream output = new ByteArrayOutputStream();
-    InputStream input = new FileInputStream(argInputFile);
-
-    processWebXml(input, output);
-    input.close();
-
-    System.out.println(output.toString());
-  }
-
-
-  private void processWebXml(final InputStream webXml,
-      final OutputStream out) throws Exception {
-
-    Document doc = createWebXmlDoc(webXml);
-    mangleWebXml(doc);
-
-    streamXML(doc, out);
-  }
-
-
-  private Document createWebXmlDoc(final InputStream webXml)
-      throws Exception {
-    Document doc;
-    final DocumentBuilderFactory factory =
-        DocumentBuilderFactory.newInstance();
-    final DocumentBuilder builder = factory.newDocumentBuilder();
-    doc = builder.parse(webXml);
-
-    return doc;
-  }
-
-
-  private Document mangleWebXml(final Document doc) {
-    final Element docElement = doc.getDocumentElement();
-    final NodeList nodelist = docElement.getChildNodes();
-    Node firstFilter = null;
-    Node displayElement = null;
-    Node afterDisplayElement = null;
-
-    for (int i = 0; i < nodelist.getLength(); i++) {
-      final Node node = nodelist.item(i);
-      final String name = node.getNodeName();
-      if ("display-name".equals(name)) {
-        displayElement = node;
-      } else {
-        if ("filter".equals(name)) {
-          if (firstFilter == null) {
-            firstFilter = node;
-          }
-        }
-        if (displayElement != null && afterDisplayElement == null) {
-          afterDisplayElement = node;
-        }
-      }
-    }
-
-    Node initParam;
-    final Element filter = doc.createElement("filter");
-    append(doc, filter, "filter-name", "gemfire-session-filter");
-    append(doc, filter, "filter-class", GEMFIRE_FILTER_CLASS);
-
-    // Set the type of cache
-    initParam = append(doc, filter, "init-param", null);
-    append(doc, initParam, "param-name", "cache-type");
-    append(doc, initParam, "param-value",
-        argValues.getFirstResult(ARG_CACHE_TYPE));
-
-
-    if (argValues.isDefined(ARG_GEMFIRE_PARAMETERS)) {
-      for (String[] val : argValues.getAllResults(ARG_GEMFIRE_PARAMETERS)) {
-        String gfParam = val[0];
-        int idx = gfParam.indexOf("=");
-        initParam = append(doc, filter, "init-param", null);
-        append(doc, initParam, "param-name", gfParam.substring(0, idx));
-        append(doc, initParam, "param-value", gfParam.substring(idx + 1));
-      }
-    }
-
-    Node first = firstFilter;
-    if (first == null) {
-      if (afterDisplayElement != null) {
-        first = afterDisplayElement;
-      }
-    }
-    if (first == null) {
-      first = docElement.getFirstChild();
-    }
-    docElement.insertBefore(filter, first);
-    final Element filterMapping = doc.createElement("filter-mapping");
-    append(doc, filterMapping, "filter-name", "gemfire-session-filter");
-    append(doc, filterMapping, "url-pattern", "/*");
-    append(doc, filterMapping, "dispatcher", "FORWARD");
-    append(doc, filterMapping, "dispatcher", "INCLUDE");
-    append(doc, filterMapping, "dispatcher", "REQUEST");
-    append(doc, filterMapping, "dispatcher", "ERROR");
-    final Element contextListener = doc.createElement("listener");
-    append(doc, contextListener, "listener-class", GEMFIRE_LISTENER_CLASS);
-    docElement.insertBefore(filterMapping, after(docElement, "filter"));
-    docElement.insertBefore(contextListener,
-        after(docElement, "filter-mapping"));
-    return doc;
-  }
-
-  private Node after(final Node parent, final String nodeName) {
-    final NodeList nodelist = parent.getChildNodes();
-    int index = -1;
-    for (int i = 0; i < nodelist.getLength(); i++) {
-      final Node node = nodelist.item(i);
-      final String name = node.getNodeName();
-      if (nodeName.equals(name)) {
-        index = i;
-      }
-    }
-    if (index == -1)
-      return null;
-    if (nodelist.getLength() > (index + 1)) {
-      return nodelist.item(index + 1);
-    }
-    return null;
-  }
-
-  private Node append(final Document doc, final Node parent,
-      final String element,
-      final String value) {
-    final Element child = doc.createElement(element);
-    if (value != null)
-      child.setTextContent(value);
-    parent.appendChild(child);
-    return child;
-  }
-
-  private void streamXML(final Document doc, final OutputStream out) {
-    try {// Use a Transformer for output
-      final TransformerFactory tFactory = TransformerFactory.newInstance();
-      final Transformer transformer = tFactory.newTransformer();
-      if (doc.getDoctype() != null) {
-        final String systemId = doc.getDoctype().getSystemId();
-        final String publicId = doc.getDoctype().getPublicId();
-        transformer.setOutputProperty(OutputKeys.DOCTYPE_PUBLIC, publicId);
-        transformer.setOutputProperty(OutputKeys.DOCTYPE_SYSTEM, systemId);
-      }
-      transformer.setOutputProperty(OutputKeys.INDENT, "yes");
-      transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount",
-          "4");
-      final DOMSource source = new DOMSource(doc);
-      final StreamResult result = new StreamResult(out);
-      transformer.transform(source, result);
-    } catch (final Exception e) {
-      e.printStackTrace();
-    }
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/db02660d/modules/gemfire-modules-session-external/src/main/java/com/gemstone/gemfire/modules/session/installer/JarClassLoader.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-external/src/main/java/com/gemstone/gemfire/modules/session/installer/JarClassLoader.java b/modules/gemfire-modules-session-external/src/main/java/com/gemstone/gemfire/modules/session/installer/JarClassLoader.java
deleted file mode 100644
index 1d850bf..0000000
--- a/modules/gemfire-modules-session-external/src/main/java/com/gemstone/gemfire/modules/session/installer/JarClassLoader.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-package com.gemstone.gemfire.modules.session.installer;
-
-import java.io.Closeable;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.util.Enumeration;
-import java.util.jar.JarEntry;
-import java.util.jar.JarFile;
-
-/**
- * Classloader, grabbed from the web, which allows finding classes in jars
- * within jars. This is used to check whether a listener, as found in web.xml,
- * is a ServletContextListener
- */
-public class JarClassLoader extends URLClassLoader {
-
-  public JarClassLoader(URL[] urls, ClassLoader parent) {
-    super(urls, parent);
-
-    try {
-      for (URL url : urls) {
-        if (isJar(url.getFile())) {
-          addJarResource(new File(url.getPath()));
-        }
-      }
-    } catch (IOException e) {
-      e.printStackTrace();
-    }
-  }
-
-  private void addJarResource(File file) throws IOException {
-    JarFile jarFile = new JarFile(file);
-    addURL(file.toURL());
-    Enumeration<JarEntry> jarEntries = jarFile.entries();
-    while (jarEntries.hasMoreElements()) {
-      JarEntry jarEntry = jarEntries.nextElement();
-      if (!jarEntry.isDirectory() && isJar(jarEntry.getName())) {
-        addJarResource(jarEntryAsFile(jarFile, jarEntry));
-      }
-    }
-  }
-
-  @Override
-  protected synchronized Class<?> loadClass(String name, boolean resolve)
-      throws ClassNotFoundException {
-    try {
-      Class<?> clazz = findLoadedClass(name);
-      if (clazz == null) {
-        clazz = findClass(name);
-        if (resolve) {
-          resolveClass(clazz);
-        }
-      }
-      return clazz;
-    } catch (ClassNotFoundException e) {
-      return super.loadClass(name, resolve);
-    }
-  }
-
-  private static void close(Closeable closeable) {
-    if (closeable != null) {
-      try {
-        closeable.close();
-      } catch (IOException e) {
-        e.printStackTrace();
-      }
-    }
-  }
-
-  private static boolean isJar(String fileName) {
-    return fileName != null && (fileName.toLowerCase().endsWith(".jar") ||
-        fileName.toLowerCase().endsWith(".war") ||
-        fileName.toLowerCase().endsWith(".ear"));
-  }
-
-  private static File jarEntryAsFile(JarFile jarFile,
-      JarEntry jarEntry) throws IOException {
-    InputStream input = null;
-    OutputStream output = null;
-    try {
-      String name = jarEntry.getName().replace('/', '_');
-      int i = name.lastIndexOf(".");
-      String extension = i > -1 ? name.substring(i) : "";
-      File file = File.createTempFile(
-          name.substring(0, name.length() - extension.length()) + ".",
-          extension);
-      file.deleteOnExit();
-      input = jarFile.getInputStream(jarEntry);
-      output = new FileOutputStream(file);
-      int readCount;
-      byte[] buffer = new byte[4096];
-      while ((readCount = input.read(buffer)) != -1) {
-        output.write(buffer, 0, readCount);
-      }
-      return file;
-    } finally {
-      close(input);
-      close(output);
-    }
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/db02660d/modules/gemfire-modules-session-external/src/main/java/com/gemstone/gemfire/modules/session/installer/args/Argument.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-external/src/main/java/com/gemstone/gemfire/modules/session/installer/args/Argument.java b/modules/gemfire-modules-session-external/src/main/java/com/gemstone/gemfire/modules/session/installer/args/Argument.java
deleted file mode 100644
index bb1a73d..0000000
--- a/modules/gemfire-modules-session-external/src/main/java/com/gemstone/gemfire/modules/session/installer/args/Argument.java
+++ /dev/null
@@ -1,265 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-package com.gemstone.gemfire.modules.session.installer.args;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Class representing a single command line argument.
- */
-public class Argument {
-
-  /**
-   * Parameter names.
-   */
-  private final String[] paramNames;
-
-  /**
-   * Default values for the parameters when not explicitly set.
-   */
-  private String[] defaults;
-
-  /**
-   * Environment variable names forfor each parameter where values will be
-   * pulled in, if not explicitly provided and if the environment variable
-   * exists.
-   */
-  private String[] envVars;
-
-  /**
-   * Flag indicating whether this argument is required on the command line.
-   */
-  private final boolean required;
-
-  /**
-   * Handler used to hook into processing.
-   */
-  private ArgumentHandler handler;
-
-  /**
-   * List of all representation forms.
-   */
-  private final List<String> forms = new ArrayList<String>();
-
-  /**
-   * Usage description.
-   */
-  private String description;
-
-  ///////////////////////////////////////////////////////////////////////////
-  // Constructor:
-
-  /**
-   * Contructor to create an argument definition.
-   *
-   * @param primaryForm    the form of the argument (e.g., --foo).  Should start
-   *                       with a dash.
-   * @param argRequired    flag indicating whether or not the argument is
-   *                       required to be onthe command line
-   * @param parameterNames names of the parameters to this argument for use in
-   *                       the usage generation
-   */
-  public Argument(
-      final String primaryForm,
-      final boolean argRequired,
-      final String... parameterNames) {
-    forms.add(primaryForm);
-    paramNames = parameterNames;
-    required = argRequired;
-  }
-
-  /**
-   * Returns the number of parameters that this argument takes.
-   *
-   * @return parameter count
-   */
-  public int getParameterCount() {
-    return paramNames.length;
-  }
-
-  /**
-   * Returns the name of the parameter position requested.
-   *
-   * @param idx parameter index
-   * @return parameter name
-   */
-  public String getParameterName(final int idx) {
-    return paramNames[idx];
-  }
-
-  /**
-   * Returns whether or not this argument is required to be defined.
-   *
-   * @return true if required, false if optional
-   */
-  public boolean isRequired() {
-    return required;
-  }
-
-  /**
-   * Determines if the argument provisioning has been done via the environment.
-   */
-  public boolean isDefinedInEnv() {
-    if (envVars == null || paramNames.length == 0) {
-      return false;
-    }
-    for (String var : envVars) {
-      if (System.getenv(var) == null) {
-        return false;
-      }
-    }
-    return true;
-  }
-
-  /**
-   * Sets the argument handler.
-   *
-   * @param aHandler argument handler
-   * @return this argument (for chained calls)
-   */
-  public Argument setArgumentHandler(final ArgumentHandler aHandler) {
-    handler = aHandler;
-    return this;
-  }
-
-  /**
-   * Returns the argument handler.
-   *
-   * @return argument handler
-   */
-  public ArgumentHandler getArgumentHandler() {
-    return handler;
-  }
-
-  /**
-   * Adds a possible representation of the command line argument.
-   *
-   * @param aliasName additional form to accept
-   * @return this argument (for chained calls)
-   */
-  public Argument addForm(final String aliasName) {
-    forms.add(aliasName);
-    return this;
-  }
-
-  /**
-   * Returns the primary form of the argument.
-   *
-   * @return primary form
-   */
-  public String getPrimaryForm() {
-    if (forms.isEmpty()) {
-      return null;
-    } else {
-      return forms.get(0);
-    }
-  }
-
-  /**
-   * Returns a list of all valid representations of this command line argument.
-   *
-   * @return list of all registered forms
-   */
-  public List<String> getForms() {
-    return forms;
-  }
-
-  /**
-   * Sets a usage description for this argument.
-   *
-   * @param str usage description
-   * @return this argument (for chained calls)
-   */
-  public Argument setDescription(final String str) {
-    description = str;
-    return this;
-  }
-
-  /**
-   * Returns a usage description of this argument.
-   *
-   * @return description
-   */
-  public String getDescription() {
-    return description;
-  }
-
-  /**
-   * Sets the default values when no explicit values were provided.
-   *
-   * @param newDefaults default values for all argument parameters
-   * @return this argument (for chained calls)
-   */
-  public Argument setDefaults(final String... newDefaults) {
-    if (newDefaults.length != paramNames.length) {
-      throw (new IllegalArgumentException(
-          "Defaults array length provided is not the correct size"));
-    }
-    defaults = newDefaults;
-    return this;
-  }
-
-  /**
-   * Returns the defaults.
-   *
-   * @return default parameter values
-   */
-  public String[] getDefaults() {
-    return defaults;
-  }
-
-  /**
-   * Sets the environment variables which will be checked for values before
-   * falling back on the default values.
-   *
-   * @param newEnvVars environment variable name array
-   * @return this argument (for chained calls)
-   */
-  public Argument setEnvVars(final String... newEnvVars) {
-    if (newEnvVars.length != paramNames.length) {
-      throw (new IllegalArgumentException(
-          "Environment variables array length provided is not "
-              + "the correct size"));
-    }
-    envVars = newEnvVars;
-    return this;
-  }
-
-  /**
-   * Returns the environment variable names for each parameter.
-   *
-   * @return environment variable names
-   */
-  public String[] getEnvVars() {
-    return envVars;
-  }
-
-  /**
-   * Returns a human readable form.
-   *
-   * @return human readable string
-   */
-  @Override
-  public String toString() {
-    final StringBuilder builder = new StringBuilder();
-    builder.append("[Argument '");
-    builder.append(forms.get(0));
-    builder.append("'");
-    if (paramNames.length > 0) {
-      for (int i = 0; i < paramNames.length; i++) {
-        builder.append(" <");
-        builder.append(paramNames[i]);
-        builder.append(">");
-      }
-    }
-    builder.append("]");
-    return builder.toString();
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/db02660d/modules/gemfire-modules-session-external/src/main/java/com/gemstone/gemfire/modules/session/installer/args/ArgumentHandler.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-external/src/main/java/com/gemstone/gemfire/modules/session/installer/args/ArgumentHandler.java b/modules/gemfire-modules-session-external/src/main/java/com/gemstone/gemfire/modules/session/installer/args/ArgumentHandler.java
deleted file mode 100644
index a165148..0000000
--- a/modules/gemfire-modules-session-external/src/main/java/com/gemstone/gemfire/modules/session/installer/args/ArgumentHandler.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-package com.gemstone.gemfire.modules.session.installer.args;
-
-/**
- * Interface specifying the requirements for objects wiching to be able to
- * examine arguments (potentially tweaking parameters) at the time of parsing,
- * thereby allowing for usage display to occur automatically.
- */
-public interface ArgumentHandler {
-
-  /**
-   * Process the argument values specified.
-   *
-   * @param arg    argument definition
-   * @param form   form which was used on the command line
-   * @param params parameters supplied to the argument
-   * @throws UsageException when usage was suboptimal
-   */
-  void handleArgument(Argument arg, String form, String[] params)
-      throws UsageException;
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/db02660d/modules/gemfire-modules-session-external/src/main/java/com/gemstone/gemfire/modules/session/installer/args/ArgumentProcessor.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-external/src/main/java/com/gemstone/gemfire/modules/session/installer/args/ArgumentProcessor.java b/modules/gemfire-modules-session-external/src/main/java/com/gemstone/gemfire/modules/session/installer/args/ArgumentProcessor.java
deleted file mode 100644
index 950f2f0..0000000
--- a/modules/gemfire-modules-session-external/src/main/java/com/gemstone/gemfire/modules/session/installer/args/ArgumentProcessor.java
+++ /dev/null
@@ -1,387 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-package com.gemstone.gemfire.modules.session.installer.args;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.logging.Logger;
-
-/**
- * This class is used to process command line arguments for Java programs in a
- * flexible and powerful manner.
- */
-public class ArgumentProcessor {
-  /**
-   * Logger.
-   */
-  private static final Logger LOG =
-      Logger.getLogger(ArgumentProcessor.class.getName());
-
-  /**
-   * Description line length.
-   */
-  private static final int LINE_LENGTH = 60;
-
-  /**
-   * Map containing all arguments defined, indexed by their unique IDs.
-   */
-  private final List<Argument> args = new ArrayList<Argument>();
-
-  /**
-   * Unknown argument handler.
-   */
-  private UnknownArgumentHandler handler;
-
-  /**
-   * Program name to display in usage.
-   */
-  private String programName;
-
-  ///////////////////////////////////////////////////////////////////////////
-  // Classes:
-
-  /**
-   * Structure used to represent an argument match.
-   */
-  private static class Match {
-    /**
-     * The argument which matched.
-     */
-    private final Argument arg;
-
-    /**
-     * The specific form which matched.
-     */
-    private final String form;
-
-    /**
-     * The parameters to the argument form.
-     */
-    private final String[] params;
-
-    /**
-     * Constructor.
-     *
-     * @param theArgument the argument which matched
-     * @param theForm     the form used
-     * @param theParams   the parameters supplied
-     */
-    public Match(
-        final Argument theArgument,
-        final String theForm, final String[] theParams) {
-      arg = theArgument;
-      form = theForm;
-      params = theParams;
-    }
-
-    /**
-     * Accessor.
-     *
-     * @return argument which matched
-     */
-    public Argument getArgument() {
-      return arg;
-    }
-
-    /**
-     * Accessor.
-     *
-     * @return form which was used
-     */
-    public String getForm() {
-      return form;
-    }
-
-    /**
-     * Accessor.
-     *
-     * @return parameters supplied
-     */
-    public String[] getParams() {
-      return params;
-    }
-  }
-
-  ///////////////////////////////////////////////////////////////////////////
-  // Constructors:
-
-  /**
-   * Creates a new Argument processor instance for te program name given.
-   *
-   * @param progName program name used in usage
-   */
-  public ArgumentProcessor(final String progName) {
-    programName = progName;
-  }
-
-
-  ///////////////////////////////////////////////////////////////////////////
-  // Public methods:
-
-  /**
-   * Adds a new argument.
-   *
-   * @param arg argument to add
-   */
-  public void addArgument(final Argument arg) {
-    args.add(arg);
-  }
-
-  /**
-   * Sets the handler to call when an unknown argument is encountered.
-   *
-   * @param aHandler unknown arg handler, or null to unset
-   */
-  public void setUnknownArgumentHandler(
-      final UnknownArgumentHandler aHandler) {
-    handler = aHandler;
-  }
-
-  /**
-   * Process the command line arguments provided.
-   *
-   * @param programArgs command line arguments supplied to program
-   * @return argument values parsed out of command line
-   * @throws UsageException when usge sucked
-   */
-  public ArgumentValues process(final String[] programArgs)
-      throws UsageException {
-    ArgumentHandler argHandler;
-    final ArgumentValues result = new ArgumentValues();
-    List<Argument> unmatched;
-    List<Match> matches;
-
-    // Find all argument matches and set postArgs
-    matches = checkMatches(programArgs, result);
-
-    // Find arguments which didnt match
-    unmatched = new ArrayList<Argument>();
-    unmatched.addAll(args);
-    for (Match match : matches) {
-      unmatched.remove(match.getArgument());
-    }
-
-    // Error on unmatched yet required args
-    for (Argument arg : unmatched) {
-      if (arg.isRequired() && !arg.isDefinedInEnv()) {
-        final UsageException usageException = new UsageException(
-            "Required argument not provided: " + arg);
-        usageException.setUsage(getUsage());
-        throw usageException;
-      }
-    }
-
-    // Handle the arguments
-    for (Match match : matches) {
-      final Argument arg = match.getArgument();
-      argHandler = arg.getArgumentHandler();
-      if (argHandler != null) {
-        argHandler.handleArgument(
-            arg, match.getForm(), match.getParams());
-      }
-      result.addResult(arg, match.getParams());
-    }
-
-    return result;
-  }
-
-
-  /**
-   * Generates command line usage text for display to user.
-   *
-   * @return usage to dusplay to user
-   */
-  public String getUsage() {
-    final StringBuilder builder = new StringBuilder();
-    List<String> descriptionLines;
-    final String blank20 = "                    ";
-
-    builder.append("\nUSAGE: ");
-    if (programName == null) {
-      builder.append("<program>");
-    } else {
-      builder.append(programName);
-    }
-    if (args.isEmpty()) {
-      builder.append("\nNo arguments supported.\n");
-    } else {
-      builder.append(" <args>\nWHERE <args>:\n\n");
-      for (Argument arg : args) {
-        for (String form : arg.getForms()) {
-          builder.append("    ");
-          builder.append(form);
-
-          for (int i = 0; i < arg.getParameterCount(); i++) {
-            builder.append(" <");
-            builder.append(arg.getParameterName(i));
-            builder.append(">");
-          }
-          builder.append("\n");
-        }
-
-        descriptionLines =
-            breakupString(arg.getDescription(), LINE_LENGTH);
-        if (descriptionLines.isEmpty()) {
-          builder.append(blank20);
-          builder.append("No argument description provided.");
-          builder.append("\n\n");
-        } else {
-          for (String line : descriptionLines) {
-            builder.append(blank20);
-            builder.append(line.trim());
-            builder.append("\n");
-          }
-          builder.append("\n");
-        }
-      }
-    }
-    builder.append("\n");
-
-    return builder.toString();
-  }
-
-
-  ///////////////////////////////////////////////////////////////////////////
-  // Private methods:
-
-  /**
-   * Builds a listof all argument matches and sets the postArgs array.
-   *
-   * @param programArgs command line arguments to search through
-   * @param values      values object in which to store results
-   * @return list of matches
-   * @throws UsageException when there is EBKAC
-   */
-  private List<Match> checkMatches(
-      final String[] programArgs, final ArgumentValues values)
-      throws UsageException {
-    final List<Match> result = new ArrayList<Match>();
-    Match match;
-    String[] params;
-    String[] postArgs;
-    int idx = 0;
-    int idx2;
-
-    while (idx < programArgs.length) {
-      // Check for end-of-parameters arg
-      if ("--".equals(programArgs[idx])) {
-        if (++idx < programArgs.length) {
-          postArgs = new String[programArgs.length - idx];
-          System.arraycopy(programArgs, idx,
-              postArgs, 0, postArgs.length);
-          values.setPostArgs(postArgs);
-        }
-        // We're done processing args'
-        break;
-      }
-
-      // Determine parameter count
-      idx2 = idx;
-      while ((idx2 + 1) < programArgs.length
-          && programArgs[idx2 + 1].charAt(0) != '-') {
-        idx2++;
-      }
-
-      // Generate parameter array
-      params = new String[idx2 - idx];
-      System.arraycopy(programArgs, idx + 1, params, 0, params.length);
-
-      LOG.fine("Arg: " + programArgs[idx]);
-      LOG.fine("Params: " + params.length);
-
-      // Find first argument matches
-      match = null;
-      for (Argument arg : args) {
-        match = checkMatch(programArgs[idx], arg, params);
-        if (match != null) {
-          result.add(match);
-          LOG.fine("Match found: ");
-          LOG.fine("     ID: " + arg);
-          LOG.fine("   Form: " + match.getForm());
-          break;
-        }
-      }
-      if (match == null) {
-        if (handler == null) {
-          final UsageException usageException = new UsageException(
-              "Unknown argument: " + programArgs[idx]
-                  + " with " + params.length + " parameters.");
-          usageException.setUsage(getUsage());
-          throw (usageException);
-        } else {
-          handler.handleUnknownArgument(programArgs[idx], params);
-        }
-      }
-
-      idx += params.length + 1;
-    }
-
-    return result;
-  }
-
-  /**
-   * Checks to see if an rgument form matches the suppies parameter list.
-   *
-   * @param argName argument name
-   * @param arg     argument
-   * @param params  parameters supplied
-   * @return match object on match, null otherwise
-   */
-  private Match checkMatch(
-      final String argName, final Argument arg, final String[] params) {
-    // Look for a matching form
-    for (String form : arg.getForms()) {
-      if (
-          form.equals(argName)
-              && arg.getParameterCount() == params.length) {
-        return new Match(arg, form, params);
-      }
-    }
-
-    return null;
-  }
-
-  /**
-   * Breaks up a string into sub-strings, each with a length equal to or less
-   * than the max length specified.
-   *
-   * @param str       string to break up
-   * @param maxLength maximum line length to use
-   * @return broken up string
-   */
-  private List<String> breakupString(
-      final String str, final int maxLength) {
-    final List<String> result = new ArrayList<String>();
-    int startIdx = -1;
-    int lastIdx;
-    int idx;
-
-    if (str == null) {
-      return result;
-    }
-
-    do {
-      idx = startIdx;
-      do {
-        lastIdx = idx;
-        idx = str.indexOf(' ', lastIdx + 1);
-        LOG.fine("startIdx=" + startIdx + "  lastIdx=" + lastIdx
-            + "  idx=" + idx);
-        if (idx < 0) {
-          // Canot break line up any further
-          result.add(str.substring(startIdx + 1));
-          return result;
-        }
-      } while ((idx - startIdx) <= maxLength);
-
-      result.add(str.substring(startIdx + 1, lastIdx));
-      startIdx = lastIdx;
-    } while (true);
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/db02660d/modules/gemfire-modules-session-external/src/main/java/com/gemstone/gemfire/modules/session/installer/args/ArgumentValues.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-external/src/main/java/com/gemstone/gemfire/modules/session/installer/args/ArgumentValues.java b/modules/gemfire-modules-session-external/src/main/java/com/gemstone/gemfire/modules/session/installer/args/ArgumentValues.java
deleted file mode 100644
index 7be926c..0000000
--- a/modules/gemfire-modules-session-external/src/main/java/com/gemstone/gemfire/modules/session/installer/args/ArgumentValues.java
+++ /dev/null
@@ -1,212 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-package com.gemstone.gemfire.modules.session.installer.args;
-
-import java.util.ArrayList;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * Result object capturing the result of processing command line arguments.
- */
-public class ArgumentValues {
-
-  /**
-   * Storage location for all arguments found after the "--" pseudo-arg.
-   */
-  private String[] postArgs = new String[]{};
-
-  /**
-   * Storage location for the command line argument values.
-   */
-  private final Map<Argument, List<String[]>> values =
-      new LinkedHashMap<Argument, List<String[]>>();
-
-  /**
-   * Constructor.
-   */
-  ArgumentValues() {
-    // Empty.
-  }
-
-  /**
-   * Sets the post-arguments found after the "--" pseudo-argument.
-   *
-   * @param newPostArgs arguments defined after the special "--" argument
-   */
-  void setPostArgs(final String[] newPostArgs) {
-    postArgs = newPostArgs;
-  }
-
-  /**
-   * After processing the command line arguments, this method may be used to
-   * return all arguments which were excluded from processing by their placement
-   * after the "<code>--</code>" psuedo-argument.
-   *
-   * @return all unprocess arguments
-   */
-  public String[] getPostArgs() {
-    return postArgs;
-  }
-
-  /**
-   * Sets the data values found for a specific argument.
-   *
-   * @param arg         argument
-   * @param paramValues parameter values for the argument
-   */
-  public void addResult(final Argument arg, final String[] paramValues) {
-    List<String[]> list = values.get(arg);
-    if (list == null) {
-      list = new ArrayList<String[]>();
-      list.add(paramValues);
-      values.put(arg, list);
-    } else {
-      list.add(paramValues);
-    }
-  }
-
-  /**
-   * Returns a list of all defined arguments.
-   *
-   * @return set of arguments
-   */
-  public Set<Argument> getDefinedArguments() {
-    return values.keySet();
-  }
-
-  /**
-   * Counts the number of arguments defined on the command line which are in the
-   * list provided.
-   *
-   * @param ofThese the arguments to search for, or null to count all supplied
-   *                arguments
-   * @return count of the defined arguments
-   */
-  public int getDefinedCount(Argument... ofThese) {
-    if (ofThese.length == 0) {
-      return values.keySet().size();
-    }
-
-    int count = 0;
-    for (Argument arg : values.keySet()) {
-      boolean found = false;
-      for (int i = 0; !found && i < ofThese.length; i++) {
-        if (ofThese[i].equals(arg)) {
-          count++;
-          found = true;
-        }
-      }
-    }
-    return count;
-  }
-
-  /**
-   * Returns whetheror not the command line argument was actually provided on
-   * the command line.
-   *
-   * @param arg argument to query
-   * @return true if the argument is defined by the command line, false
-   * otherwise
-   */
-  public boolean isDefined(final Argument arg) {
-    final List<String[]> result = values.get(arg);
-    return (result != null);
-  }
-
-  /**
-   * Returns all results for the specified argument.  If a command line option
-   * is specified more than once, this is the method to use to get all values.
-   *
-   * @param arg argument to query
-   * @return list of all parameter lists defined for this argument
-   */
-  public List<String[]> getAllResults(final Argument arg) {
-    List<String[]> result = values.get(arg);
-
-    if (result == null) {
-      final String[] envVars = arg.getEnvVars();
-      final String[] defaults = arg.getDefaults();
-      final String[] vals = new String[arg.getParameterCount()];
-      boolean found = defaults != null;
-
-      for (int i = 0; i < arg.getParameterCount(); i++) {
-        if (defaults != null) {
-          vals[i] = defaults[i];
-        }
-        if (envVars != null) {
-          String val = System.getenv(envVars[i]);
-          if (val != null) {
-            found = true;
-            vals[i] = val;
-          }
-        }
-      }
-
-      if (found) {
-        result = new ArrayList<String[]>();
-        result.add(vals);
-      }
-    }
-    return result;
-  }
-
-  /**
-   * Convenience method to retrieve the first instance of the command line
-   * argument's values.
-   *
-   * @param arg argument to query
-   * @return first parameter list defined for this argument
-   */
-  public String[] getResult(final Argument arg) {
-    final List<String[]> all = getAllResults(arg);
-    if (all == null) {
-      return null;
-    } else {
-      return all.get(0);
-    }
-  }
-
-  /**
-   * Convenience method to return the first value of the first instance of the
-   * command line argument values for the specified argument.
-   *
-   * @param arg argument to query
-   * @return first parameter of the first list of parameters supplied
-   */
-  public String getFirstResult(final Argument arg) {
-    final String[] all = getResult(arg);
-    if (all == null) {
-      return null;
-    } else {
-      return all[0];
-    }
-  }
-
-  /**
-   * Convenience method to return the result of getFirstResult method as an
-   * integer.
-   *
-   * @param arg            argument to query
-   * @param undefinedValue value to return when argument is not defined or is
-   *                       illegally defined
-   * @return value specified, or default value provided
-   */
-  public int getFirstResultAsInt(
-      final Argument arg, final int undefinedValue) {
-    final String value = getFirstResult(arg);
-    if (value == null) {
-      return undefinedValue;
-    } else {
-      return Integer.parseInt(value);
-    }
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/db02660d/modules/gemfire-modules-session-external/src/main/java/com/gemstone/gemfire/modules/session/installer/args/URLArgumentHandler.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-external/src/main/java/com/gemstone/gemfire/modules/session/installer/args/URLArgumentHandler.java b/modules/gemfire-modules-session-external/src/main/java/com/gemstone/gemfire/modules/session/installer/args/URLArgumentHandler.java
deleted file mode 100644
index f0800d4..0000000
--- a/modules/gemfire-modules-session-external/src/main/java/com/gemstone/gemfire/modules/session/installer/args/URLArgumentHandler.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-package com.gemstone.gemfire.modules.session.installer.args;
-
-import java.io.File;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/**
- * Argument handler implementation which accepts file paths or URLs and
- * normalizes the parameters to URLs.
- */
-public class URLArgumentHandler implements ArgumentHandler {
-
-  /**
-   * Logger.
-   */
-  private static final Logger LOG =
-      Logger.getLogger(URLArgumentHandler.class.getName());
-
-  /**
-   * Ensure that the argument is either a file path or a properly formatted URL.
-   *  If it is a file path, convert to a URL.  If neither, throws a
-   * UsageException.
-   *
-   * @param arg        argument
-   * @param form       form used
-   * @param parameters parameters supplied
-   * @throws UsageException when file not found or not a workable URL
-   */
-  public void handleArgument(
-      final Argument arg,
-      final String form,
-      final String[] parameters)
-      throws UsageException {
-    final File file = new File(parameters[0]);
-    URL result = null;
-
-    if (file.exists()) {
-      try {
-        result = file.toURI().toURL();
-      } catch (MalformedURLException mux) {
-        LOG.log(Level.FINEST, "Caught Exception", mux);
-      }
-    }
-    if (result == null) {
-      try {
-        result = new URL(parameters[0]);
-      } catch (MalformedURLException mux) {
-        LOG.log(Level.FINEST, "Caught Exception", mux);
-      }
-    }
-    if (result == null) {
-      throw (new UsageException(
-          "Argument parameter value is not a valid file "
-              + "path or URL: " + arg));
-    }
-    parameters[0] = result.toString();
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/db02660d/modules/gemfire-modules-session-external/src/main/java/com/gemstone/gemfire/modules/session/installer/args/UnknownArgumentHandler.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-external/src/main/java/com/gemstone/gemfire/modules/session/installer/args/UnknownArgumentHandler.java b/modules/gemfire-modules-session-external/src/main/java/com/gemstone/gemfire/modules/session/installer/args/UnknownArgumentHandler.java
deleted file mode 100644
index 1cf0ecc..0000000
--- a/modules/gemfire-modules-session-external/src/main/java/com/gemstone/gemfire/modules/session/installer/args/UnknownArgumentHandler.java
+++ /dev/null
@@ -1,19 +0,0 @@
-package com.gemstone.gemfire.modules.session.installer.args;
-
-/**
- * Interface defining unknown argument handlers, given the opportunity to either
- * ignore the issue or force the parameter to be dealt with.
- */
-public interface UnknownArgumentHandler {
-
-  /**
-   * Called when an unknown argument is supplied.
-   *
-   * @param form   argument name used
-   * @param params parameters passed into it
-   * @throws UsageException when the user needs to fix it
-   */
-  void handleUnknownArgument(String form, String[] params)
-      throws UsageException;
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/db02660d/modules/gemfire-modules-session-external/src/main/java/com/gemstone/gemfire/modules/session/installer/args/UsageException.java
----------------------------------------------------------------------
diff --git a/modules/gemfire-modules-session-external/src/main/java/com/gemstone/gemfire/modules/session/installer/args/UsageException.java b/modules/gemfire-modules-session-external/src/main/java/com/gemstone/gemfire/modules/session/installer/args/UsageException.java
deleted file mode 100644
index 1d22dee..0000000
--- a/modules/gemfire-modules-session-external/src/main/java/com/gemstone/gemfire/modules/session/installer/args/UsageException.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-package com.gemstone.gemfire.modules.session.installer.args;
-
-/**
- * Invalid usage exception.
- */
-public class UsageException extends Exception {
-
-  /**
-   * Serial format version.
-   */
-  private static final long serialVersionUID = 1L;
-
-  /**
-   * Stored usage message.
-   */
-  private String usage;
-
-  /**
-   * Creates a new UsageException.
-   */
-  public UsageException() {
-    super();
-  }
-
-  /**
-   * Creates a new UsageException.
-   *
-   * @param message description of exceptional condition
-   */
-  public UsageException(final String message) {
-    super(message);
-  }
-
-  /**
-   * Creates a new UsageException.
-   *
-   * @param message description of exceptional condition
-   * @param cause   provoking exception
-   */
-  public UsageException(final String message, final Throwable cause) {
-    super(message, cause);
-  }
-
-  /**
-   * Creates a new UsageException.
-   *
-   * @param cause provoking exception
-   */
-  public UsageException(final Throwable cause) {
-    super(cause);
-  }
-
-
-  /**
-   * Attaches a usage message to the exception for later consumption.
-   *
-   * @param usageText text to display to user to guide them to correct usage.
-   *                  This is generated and set by the <code>ArgsProcessor</code>.
-   */
-  public void setUsage(final String usageText) {
-    usage = usageText;
-  }
-
-  /**
-   * Returns the usage message previously set.
-   *
-   * @return message or null if not set.
-   */
-  public String getUsage() {
-    return usage;
-  }
-}


[21/24] incubator-geode git commit: GEODE-14: Adding session replication assembly module

Posted by je...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/65a03287/extensions/gemfire-modules-assembly/release/3rdparty_license/open_source_licenses-vFabric_GemFire_HTTP_Session_Management_Modules_2.0.1.txt
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-assembly/release/3rdparty_license/open_source_licenses-vFabric_GemFire_HTTP_Session_Management_Modules_2.0.1.txt b/extensions/gemfire-modules-assembly/release/3rdparty_license/open_source_licenses-vFabric_GemFire_HTTP_Session_Management_Modules_2.0.1.txt
new file mode 100755
index 0000000..82db8ad
--- /dev/null
+++ b/extensions/gemfire-modules-assembly/release/3rdparty_license/open_source_licenses-vFabric_GemFire_HTTP_Session_Management_Modules_2.0.1.txt
@@ -0,0 +1,1316 @@
+open_source_licenses.txt
+
+vFabric GemFire HTTP Session Management Module 2.0.1
+
+===========================================================================
+
+The following copyright statements and licenses apply to various open
+source software packages (or portions thereof) that are distributed with
+this VMware Product.
+
+The VMware Product may also include other VMware components, which may
+contain additional open source software packages. One or more such
+open_source_licenses.txt files may therefore accompany this VMware Product.
+
+The VMware Product that includes this file does not necessarily use all the
+open source software packages referred to below and may also only use
+portions of a given package.
+
+===========================================================================
+TABLE OF CONTENTS
+===========================================================================
+
+The following is a listing of the open source components detailed in this
+document. This list is provided for your convenience; please read further if
+you wish to review the copyright notice(s) and the full text of the license
+associated with each component.
+
+
+SECTION 1: BSD-STYLE, MIT-STYLE, OR SIMILAR STYLE LICENSES
+
+   >>> antlr-2.7.3
+   >>> backport-util-concurrent-java_5.0
+   >>> mx4j-2.0.1
+   >>> slf4j-1.5.8
+
+
+
+SECTION 2: Apache License, V2.0
+
+    >>> commons-modeler-2.0
+
+
+
+SECTION 3: Common Development and Distribution License, V1.0
+
+   >>> servlet-api-2.5
+
+
+
+SECTION 4: GNU Lesser General Public License, V2.1
+
+   >>> jgroups-2.10
+   >>> trove-1.1.b3
+
+
+
+APPENDIX. Standard License Files
+
+   >>> Apache License, V2.0
+
+   >>> GNU Lesser General Public License, V2.1
+
+   >>> Common Development and Distribution License, V1.0
+
+
+--------------- SECTION 1:  BSD-STYLE, MIT-STYLE, OR SIMILAR STYLE LICENSES ----------
+
+BSD-STYLE, MIT-STYLE, OR SIMILAR STYLE LICENSES are applicable to the following component(s).
+
+
+
+>>> antlr-2.7.3
+
+SOFTWARE RIGHTS
+
+ANTLR 1989-2004 Developed by Terence Parr
+Partially supported by University of San Francisco & jGuru.com
+
+We reserve no legal rights to the ANTLR--it is fully in the
+public domain. An individual or company may do whatever
+they wish with source code distributed with ANTLR or the
+code generated by ANTLR, including the incorporation of
+ANTLR, or its output, into commerical software.
+
+We encourage users to develop software with ANTLR. However,
+we do ask that credit is given to us for developing
+ANTLR. By "credit", we mean that if you use ANTLR or
+incorporate any source code into one of your programs
+(commercial product, research project, or otherwise) that
+you acknowledge this fact somewhere in the documentation,
+research report, etc... If you like ANTLR and have
+developed a nice tool with the output, please mention that
+you developed it using ANTLR. In addition, we ask that the
+headers remain intact in our source code. As long as these
+guidelines are kept, we expect to continue enhancing this
+system and expect to make other tools available as they are
+completed.
+
+The primary ANTLR guy:
+
+Terence Parr
+parrt@cs.usfca.edu
+parrt@antlr.org
+
+
+>>> backport-util-concurrent-java_5.0
+
+License
+This software is released to the public domain, in the spirit of the original code written by Doug Lea. The code can be used for any purpose, modified, and redistributed without acknowledgment. No warranty is provided, either express or implied.
+
+
+>>> mx4j-2.0.1
+
+The MX4J License, Version 1.0
+
+Copyright (c) 2001-2004 by the MX4J contributors.  All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+         1. Redistributions of source code must retain the above copyright
+            notice, this list of conditions and the following disclaimer.
+
+         2. Redistributions in binary form must reproduce the above copyright
+            notice, this list of conditions and the following disclaimer in
+            the documentation and/or other materials provided with the
+            distribution.
+
+         3. The end-user documentation included with the redistribution,
+            if any, must include the following acknowledgment:
+               "This product includes software developed by the
+                MX4J project (http://mx4j.sourceforge.net)."
+            Alternately, this acknowledgment may appear in the software itself,
+            if and wherever such third-party acknowledgments normally appear.
+
+         4. The name "MX4J" must not be used to endorse or promote
+            products derived from this software without prior written
+            permission.
+            For written permission, please contact
+            biorn_steedom [at] users [dot] sourceforge [dot] net
+
+         5. Products derived from this software may not be called "MX4J",
+            nor may "MX4J" appear in their name, without prior written
+            permission of Simone Bordet.
+
+THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED.  IN NO EVENT SHALL THE MX4J CONTRIBUTORS
+BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
+
+This software consists of voluntary contributions made by many
+individuals on behalf of the MX4J project.  For more information on
+MX4J, please see
+the MX4J website.
+
+
+>>> slf4j-1.5.8
+
+Copyright (c) 2004-2008 QOS.ch
+All rights reserved.
+
+Permission is hereby granted, free  of charge, to any person obtaining
+a  copy  of this  software  and  associated  documentation files  (the
+"Software"), to  deal in  the Software without  restriction, including
+without limitation  the rights to  use, copy, modify,  merge, publish,
+distribute,  sublicense, and/or sell  copies of  the Software,  and to
+permit persons to whom the Software  is furnished to do so, subject to
+the following conditions:
+
+The  above  copyright  notice  and  this permission  notice  shall  be
+included in all copies or substantial portions of the Software.
+
+THE  SOFTWARE IS  PROVIDED  "AS  IS", WITHOUT  WARRANTY  OF ANY  KIND,
+EXPRESS OR  IMPLIED, INCLUDING  BUT NOT LIMITED  TO THE  WARRANTIES OF
+MERCHANTABILITY,    FITNESS    FOR    A   PARTICULAR    PURPOSE    AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE,  ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+
+--------------- SECTION 2: Apache License, V2.0 ----------
+
+Apache License, V2.0 are applicable to the following component(s).
+
+>>> commons-modeler-2.0
+
+This product includes software developed by
+The Apache Software Foundation (http://www.apache.org/).
+
+
+--------------- SECTION 3: Common Development and Distribution License, V1.0 ----------
+
+Common Development and Distribution License, V1.0 are applicable to the following component(s).
+
+
+>>> servlet-api-2.5
+
+The contents of this file are subject to the terms 
+of the Common Development and Distribution License 
+(the "License"). You may not use this file except 
+in compliance with the License. 
+ 
+You can obtain a copy of the license at 
+glassfish/bootstrap/legal/CDDLv1.0.txt or 
+https://glassfish.dev.java.net/public/CDDLv1.0.html. 
+See the License for the specific language governing 
+permissions and limitations under the License. 
+ 
+When distributing Covered Code, include this CDDL 
+HEADER in each file and include the License file at 
+glassfish/bootstrap/legal/CDDLv1.0.txt. If applicable, 
+add the following below this CDDL HEADER, with the 
+fields enclosed by brackets "[]" replaced with your 
+own identifying information: Portions Copyright [yyyy] 
+[name of copyright owner] 
+ 
+Copyright 2005 Sun Microsystems, Inc. All rights reserved. 
+ 
+Portions Copyright Apache Software Foundation.
+
+
+--------------- SECTION 4: GNU Lesser General Public License, V2.1 ----------
+
+GNU Lesser General Public License, V2.1 are applicable to the following component(s).
+
+
+>>> jgroups-2.10
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+
+>>> trove-1.1.b3
+
+The Trove library is licensed under the Lesser GNU Public License,
+which is included with the distribution in a file called LICENSE.txt.
+
+The PrimeFinder and HashFunctions classes in Trove are subject to the
+following license restrictions:
+
+Copyright (c) 1999 CERN - European Organization for Nuclear Research.
+
+Permission to use, copy, modify, distribute and sell this software and
+its documentation for any purpose is hereby granted without fee,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation. CERN makes no representations about the
+suitability of this software for any purpose. It is provided "as is"
+without expressed or implied warranty.
+
+
+=============== APPENDIX. Standard License Files ============== 
+
+
+
+--------------- SECTION 1: Apache License, V2.0 -----------
+
+Apache License 
+
+Version 2.0, January 2004 
+http://www.apache.org/licenses/ 
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 
+
+1. Definitions.
+
+"License" shall mean the terms and conditions for use, reproduction,
+and distribution as defined by Sections 1 through 9 of this document.
+
+"Licensor" shall mean the copyright owner or entity authorized by the
+copyright owner that is granting the License.  
+
+"Legal Entity" shall mean the union of the acting entity and all other
+entities that control, are controlled by, or are under common control
+with that entity. For the purposes of this definition, "control" means
+(i) the power, direct or indirect, to cause the direction or management
+of such entity, whether by contract or otherwise, or (ii) ownership
+of fifty percent (50%) or more of the outstanding shares, or (iii)
+beneficial ownership of such entity.
+
+"You" (or "Your") shall mean an individual or Legal Entity exercising
+permissions granted by this License.  
+
+"Source" form shall mean the preferred form for making modifications,
+including but not limited to software source code, documentation source,
+and configuration files.
+
+"Object" form shall mean any form resulting from mechanical transformation
+or translation of a Source form, including but not limited to compiled
+object code, generated documentation, and conversions to other media
+types.  
+
+"Work" shall mean the work of authorship, whether in Source or
+Object form, made available under the License, as indicated by a copyright
+notice that is included in or attached to the work (an example is provided
+in the Appendix below).  
+
+"Derivative Works" shall mean any work, whether in Source or Object form,
+that is based on (or derived from) the Work and for which the editorial
+revisions, annotations, elaborations, or other modifications represent,
+as a whole, an original work of authorship. For the purposes of this
+License, Derivative Works shall not include works that remain separable
+from, or merely link (or bind by name) to the interfaces of, the Work
+and Derivative Works thereof.
+
+"Contribution" shall mean any work of authorship, including the
+original version of the Work and any modifications or additions to
+that Work or Derivative Works thereof, that is intentionally submitted
+to Licensor for inclusion in the Work by the copyright owner or by an
+individual or Legal Entity authorized to submit on behalf of the copyright
+owner. For the purposes of this definition, "submitted" means any form of
+electronic, verbal, or written communication sent to the Licensor or its
+representatives, including but not limited to communication on electronic
+mailing lists, source code control systems, and issue tracking systems
+that are managed by, or on behalf of, the Licensor for the purpose of
+discussing and improving the Work, but excluding communication that is
+conspicuously marked or otherwise designated in writing by the copyright
+owner as "Not a Contribution."
+
+"Contributor" shall mean Licensor and any individual or Legal Entity
+on behalf of whom a Contribution has been received by Licensor and
+subsequently incorporated within the Work.
+
+2. Grant of Copyright License.
+Subject to the terms and conditions of this License, each Contributor
+hereby grants to You a perpetual, worldwide, non-exclusive, no-charge,
+royalty-free, irrevocable copyright license to reproduce, prepare
+Derivative Works of, publicly display, publicly perform, sublicense, and
+distribute the Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License.
+Subject to the terms and conditions of this License, each Contributor
+hereby grants to You a perpetual, worldwide, non-exclusive, no-charge,
+royalty- free, irrevocable (except as stated in this section) patent
+license to make, have made, use, offer to sell, sell, import, and
+otherwise transfer the Work, where such license applies only to those
+patent claims licensable by such Contributor that are necessarily
+infringed by their Contribution(s) alone or by combination of
+their Contribution(s) with the Work to which such Contribution(s)
+was submitted. If You institute patent litigation against any entity
+(including a cross-claim or counterclaim in a lawsuit) alleging that the
+Work or a Contribution incorporated within the Work constitutes direct
+or contributory patent infringement, then any patent licenses granted
+to You under this License for that Work shall terminate as of the date
+such litigation is filed.
+
+4. Redistribution.
+You may reproduce and distribute copies of the Work or Derivative Works
+thereof in any medium, with or without modifications, and in Source or
+Object form, provided that You meet the following conditions:
+
+  a. You must give any other recipients of the Work or Derivative Works
+     a copy of this License; and
+
+  b. You must cause any modified files to carry prominent notices stating
+     that You changed the files; and
+
+  c. You must retain, in the Source form of any Derivative Works that
+     You distribute, all copyright, patent, trademark, and attribution
+     notices from the Source form of the Work, excluding those notices
+     that do not pertain to any part of the Derivative Works; and
+
+  d. If the Work includes a "NOTICE" text file as part of its
+     distribution, then any Derivative Works that You distribute must
+     include a readable copy of the attribution notices contained
+     within such NOTICE file, excluding those notices that do not
+     pertain to any part of the Derivative Works, in at least one of
+     the following places: within a NOTICE text file distributed as part
+     of the Derivative Works; within the Source form or documentation,
+     if provided along with the Derivative Works; or, within a display
+     generated by the Derivative Works, if and wherever such third-party
+     notices normally appear. The contents of the NOTICE file are for
+     informational purposes only and do not modify the License. You
+     may add Your own attribution notices within Derivative Works that
+     You distribute, alongside or as an addendum to the NOTICE text
+     from the Work, provided that such additional attribution notices
+     cannot be construed as modifying the License.  You may add Your own
+     copyright statement to Your modifications and may provide additional
+     or different license terms and conditions for use, reproduction, or
+     distribution of Your modifications, or for any such Derivative Works
+     as a whole, provided Your use, reproduction, and distribution of the
+     Work otherwise complies with the conditions stated in this License.
+
+5. Submission of Contributions.
+Unless You explicitly state otherwise, any Contribution intentionally
+submitted for inclusion in the Work by You to the Licensor shall be
+under the terms and conditions of this License, without any additional
+terms or conditions.  Notwithstanding the above, nothing herein shall
+supersede or modify the terms of any separate license agreement you may
+have executed with Licensor regarding such Contributions.
+
+6. Trademarks.
+This License does not grant permission to use the trade names, trademarks,
+service marks, or product names of the Licensor, except as required for
+reasonable and customary use in describing the origin of the Work and
+reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty.
+Unless required by applicable law or agreed to in writing, Licensor
+provides the Work (and each Contributor provides its Contributions) on
+an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+express or implied, including, without limitation, any warranties or
+conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR
+A PARTICULAR PURPOSE. You are solely responsible for determining the
+appropriateness of using or redistributing the Work and assume any risks
+associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability.
+In no event and under no legal theory, whether in tort (including
+negligence), contract, or otherwise, unless required by applicable law
+(such as deliberate and grossly negligent acts) or agreed to in writing,
+shall any Contributor be liable to You for damages, including any direct,
+indirect, special, incidental, or consequential damages of any character
+arising as a result of this License or out of the use or inability to
+use the Work (including but not limited to damages for loss of goodwill,
+work stoppage, computer failure or malfunction, or any and all other
+commercial damages or losses), even if such Contributor has been advised
+of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability.
+While redistributing the Work or Derivative Works thereof, You may
+choose to offer, and charge a fee for, acceptance of support, warranty,
+indemnity, or other liability obligations and/or rights consistent with
+this License. However, in accepting such obligations, You may act only
+on Your own behalf and on Your sole responsibility, not on behalf of
+any other Contributor, and only if You agree to indemnify, defend, and
+hold each Contributor harmless for any liability incurred by, or claims
+asserted against, such Contributor by reason of your accepting any such
+warranty or additional liability.
+
+END OF TERMS AND CONDITIONS 
+
+
+
+--------------- SECTION 2: GNU Lesser General Public License, V2.1 -----------
+
+		  GNU LESSER GENERAL PUBLIC LICENSE
+		       Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+ 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL.  It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+  This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it.  You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+  When we speak of free software, we are referring to freedom of use,
+not price.  Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+  To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights.  These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+  For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you.  You must make sure that they, too, receive or can get the source
+code.  If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it.  And you must show them these terms so they know their rights.
+
+  We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+  To protect each distributor, we want to make it very clear that
+there is no warranty for the free library.  Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+
+  Finally, software patents pose a constant threat to the existence of
+any free program.  We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder.  Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+  Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License.  This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License.  We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+  When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library.  The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom.  The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+  We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License.  It also provides other free software developers Less
+of an advantage over competing non-free programs.  These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries.  However, the Lesser license provides advantages in certain
+special circumstances.
+
+  For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard.  To achieve this, non-free programs must be
+allowed to use the library.  A more frequent case is that a free
+library does the same job as widely used non-free libraries.  In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+  In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software.  For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+  Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.  Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library".  The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+
+		  GNU LESSER GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+  A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+  The "Library", below, refers to any such software library or work
+which has been distributed under these terms.  A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language.  (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+  "Source code" for a work means the preferred form of the work for
+making modifications to it.  For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+  Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it).  Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+  1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+  You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+  2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) The modified work must itself be a software library.
+
+    b) You must cause the files modified to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    c) You must cause the whole of the work to be licensed at no
+    charge to all third parties under the terms of this License.
+
+    d) If a facility in the modified Library refers to a function or a
+    table of data to be supplied by an application program that uses
+    the facility, other than as an argument passed when the facility
+    is invoked, then you must make a good faith effort to ensure that,
+    in the event an application does not supply such function or
+    table, the facility still operates, and performs whatever part of
+    its purpose remains meaningful.
+
+    (For example, a function in a library to compute square roots has
+    a purpose that is entirely well-defined independent of the
+    application.  Therefore, Subsection 2d requires that any
+    application-supplied function or table used by this function must
+    be optional: if the application does not supply it, the square
+    root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library.  To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License.  (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.)  Do not make any other change in
+these notices.
+
+  Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+  This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+  4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+  If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library".  Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+  However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library".  The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+  When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library.  The
+threshold for this to be true is not precisely defined by law.
+
+  If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work.  (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+  Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+  6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+  You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License.  You must supply a copy of this License.  If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License.  Also, you must do one
+of these things:
+
+    a) Accompany the work with the complete corresponding
+    machine-readable source code for the Library including whatever
+    changes were used in the work (which must be distributed under
+    Sections 1 and 2 above); and, if the work is an executable linked
+    with the Library, with the complete machine-readable "work that
+    uses the Library", as object code and/or source code, so that the
+    user can modify the Library and then relink to produce a modified
+    executable containing the modified Library.  (It is understood
+    that the user who changes the contents of definitions files in the
+    Library will not necessarily be able to recompile the application
+    to use the modified definitions.)
+
+    b) Use a suitable shared library mechanism for linking with the
+    Library.  A suitable mechanism is one that (1) uses at run time a
+    copy of the library already present on the user's computer system,
+    rather than copying library functions into the executable, and (2)
+    will operate properly with a modified version of the library, if
+    the user installs one, as long as the modified version is
+    interface-compatible with the version that the work was made with.
+
+    c) Accompany the work with a written offer, valid for at
+    least three years, to give the same user the materials
+    specified in Subsection 6a, above, for a charge no more
+    than the cost of performing this distribution.
+
+    d) If distribution of the work is made by offering access to copy
+    from a designated place, offer equivalent access to copy the above
+    specified materials from the same place.
+
+    e) Verify that the user has already received a copy of these
+    materials or that you have already sent this user a copy.
+
+  For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it.  However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+  It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system.  Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+  7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+    a) Accompany the combined library with a copy of the same work
+    based on the Library, uncombined with any other library
+    facilities.  This must be distributed under the terms of the
+    Sections above.
+
+    b) Give prominent notice with the combined library of the fact
+    that part of it is a work based on the Library, and explaining
+    where to find the accompanying uncombined form of the same work.
+
+  8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License.  Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License.  However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+  9. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Library or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+  10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+
+  11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded.  In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+  13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation.  If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+  14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission.  For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this.  Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+			    NO WARRANTY
+
+  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
+
+           How to Apply These Terms to Your New Libraries
+
+  If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change.  You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+  To apply these terms, attach the following notices to the library.  It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the library's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the
+  library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+  <signature of Ty Coon>, 1 April 1990
+  Ty Coon, President of Vice
+
+That's all there is to it!
+
+
+
+
+--------------- SECTION 3: Common Development and Distribution License, V1.0 -----------
+
+COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
+
+1. Definitions.
+
+1.1. "Contributor" means each individual or entity that creates or
+contributes to the creation of Modifications.
+
+1.2. "Contributor Version" means the combination of the Original Software,
+prior Modifications used by a Contributor (if any), and the Modifications
+made by that particular Contributor.
+
+1.3. "Covered Software" means (a) the Original Software, or (b)
+Modifications, or (c) the combination of files containing Original
+Software with files containing Modifications, in each case including
+portions thereof.
+
+1.4. "Executable" means the Covered Software in any form other than
+Source Code.
+
+1.5. "Initial Developer" means the individual or entity that first makes
+Original Software available under this License.
+
+1.6. "Larger Work" means a work which combines Covered Software or
+portions thereof with code not governed by the terms of this License.
+
+1.7. "License" means this document.
+
+1.8. "Licensable" means having the right to grant, to the maximum extent
+possible, whether at the time of the initial grant or subsequently
+acquired, any and all of the rights conveyed herein.
+
+1.9. "Modifications" means the Source Code and Executable form of any
+of the following:
+
+    A. Any file that results from an addition to, deletion from or
+    modification of the contents of a file containing Original Software
+    or previous Modifications;
+
+    B. Any new file that contains any part of the Original Software or
+    previous Modification; or
+
+    C. Any new file that is contributed or otherwise made available
+    under the terms of this License.
+
+1.10. "Original Software" means the Source Code and Executable form of
+computer software code that is originally released under this License.
+
+1.11. "Patent Claims" means any patent claim(s), now owned or hereafter
+acquired, including without limitation, method, process, and apparatus
+claims, in any patent Licensable by grantor.
+
+1.12. "Source Code" means (a) the common form of computer software code
+in which modifications are made and (b) associated documentation included
+in or with such code.
+
+1.13. "You" (or "Your") means an individual or a legal entity exercising
+rights under, and complying with all of the terms of, this License. For
+legal entities, "You" includes any entity which controls, is controlled
+by, or is under common control with You. For purposes of this definition,
+"control" means (a) the power, direct or indirect, to cause the direction
+or management of such entity, whether by contract or otherwise, or (b)
+ownership of more than fifty percent (50%) of the outstanding shares or
+beneficial ownership of such entity.
+
+2. License Grants. 
+
+2.1. The Initial Developer Grant.
+
+Conditioned upon Your compliance with Section 3.1 below and subject to
+third party intellectual property claims, the Initial Developer hereby
+grants You a world-wide, royalty-free, non-exclusive license:
+
+    (a) under intellectual property rights (other than patent or
+    trademark) Licensable by Initial Developer, to use, reproduce, modify,
+    display, perform, sublicense and distribute the Original Software
+    (or portions thereof), with or without Modifications, and/or as part
+    of a Larger Work; and
+
+    (b) under Patent Claims infringed by the making, using or selling
+    of Original Software, to make, have made, use, practice, sell, and
+    offer for sale, and/or otherwise dispose of the Original Software
+    (or portions thereof).
+
+    (c) The licenses granted in Sections 2.1(a) and (b) are effective
+    on the date Initial Developer first distributes or otherwise makes
+    the Original Software available to a third party under the terms of
+    this License.
+
+    (d) Notwithstanding Section 2.1(b) above, no patent license is
+    granted: (1) for code that You delete from the Original Software,
+    or (2) for infringements caused by: (i) the modification of the
+    Original Software, or (ii) the combination of the Original Software
+    with other software or devices.
+
+2.2. Contributor Grant.
+
+Conditioned upon Your compliance with Section 3.1 below and subject to
+third party intellectual property claims, each Contributor hereby grants
+You a world-wide, royalty-free, non-exclusive license:
+
+    (a) under intellectual property rights (other than patent or
+    trademark) Licensable by Contributor to use, reproduce, modify,
+    display, perform, sublicense and distribute the Modifications created
+    by such Contributor (or portions thereof), either on an unmodified
+    basis, with other Modifications, as Covered Software and/or as part
+    of a Larger Work; and
+
+    (b) under Patent Claims infringed by the making, using, or selling
+    of Modifications made by that Contributor either alone and/or
+    in combination with its Contributor Version (or portions of such
+    combination), to make, use, sell, offer for sale, have made, and/or
+    otherwise dispose of: (1) Modifications made by that Contributor
+    (or portions thereof); and (2) the combination of Modifications
+    made by that Contributor with its Contributor Version (or portions
+    of such combination).
+
+    (c) The licenses granted in Sections 2.2(a) and 2.2(b) are effective
+    on the date Contributor first distributes or otherwise makes the
+    Modifications available to a third party.
+
+    (d) Notwithstanding Section 2.2(b) above, no patent license is
+    granted: (1) for any code that Contributor has deleted from the
+    Contributor Version; (2) for infringements caused by: (i) third
+    party modifications of Contributor Version, or (ii) the combination
+    of Modifications made by that Contributor with other software
+    (except as part of the Contributor Version) or other devices; or (3)
+    under Patent Claims infringed by Covered Software in the absence of
+    Modifications made by that Contributor.
+
+3. Distribution Obligations.
+
+3.1. Availability of Source Code.
+
+Any Covered Software that You distribute or otherwise make available
+in Executable form must also be made available in Source Code form and
+that Source Code form must be distributed only under the terms of this
+License. You must include a copy of this License with every copy of the
+Source Code form of the Covered Software You distribute or otherwise make
+available. You must inform recipients of any such Covered Software in
+Executable form as to how they can obtain such Covered Software in Source
+Code form in a reasonable manner on or through a medium customarily used
+for software exchange.
+
+3.2. Modifications.
+
+The Modifications that You create or to which You contribute are governed
+by the terms of this License. You represent that You believe Your
+Modifications are Your original creation(s) and/or You have sufficient
+rights to grant the rights conveyed by this License.
+
+3.3. Required Notices.
+
+You must include a notice in each of Your Modifications that identifies
+You as the Contributor of the Modification.  You may not remove or alter
+any copyright, patent or trademark notices contained within the Covered
+Software, or any notices of licensing or any descriptive text giving
+attribution to any Contributor or the Initial Developer.
+
+3.4. Application of Additional Terms.
+
+You may not offer or impose any terms on any Covered Software in Source
+Code form that alters or restricts the applicable version of this License
+or the recipients' rights hereunder. You may choose to offer, and to
+charge a fee for, warranty, support, indemnity or liability obligations to
+one or more recipients of Covered Software.  However, you may do so only
+on Your own behalf, and not on behalf of the Initial Developer or any
+Contributor. You must make it absolutely clear that any such warranty,
+support, indemnity or liability obligation is offered by You alone, and
+You hereby agree to indemnify the Initial Developer and every Contributor
+for any liability incurred by the Initial Developer or such Contributor
+as a result of warranty, support, indemnity or liability terms You offer.
+
+3.5. Distribution of Executable Versions.
+
+You may distribute the Executable form of the Covered Software under the
+terms of this License or under the terms of a license of Your choice,
+which may contain terms different from this License, provided that You are
+in compliance with the terms of this License and that the license for the
+Executable form does not attempt to limit or alter the recipient's rights
+in the Source Code form from the rights set forth in this License. If
+You distribute the Covered Software in Executable form under a different
+license, You must make it absolutely clear that any terms which differ
+from this License are offered by You alone, not by the Initial Developer
+or Contributor. You hereby agree to indemnify the Initial Developer and
+every Contributor for any liability incurred by the Initial Developer
+or such Contributor as a result of any such terms You offer.
+
+3.6. Larger Works.
+
+You may create a Larger Work by combining Covered Software with other code
+not governed by the terms of this License and distribute the Larger Work
+as a single product. In such a case, You must make sure the requirements
+of this License are fulfilled for the Covered Software.
+
+4. Versions of the License. 
+
+4.1. New Versions.
+
+Sun Microsystems, Inc. is the initial license steward and may publish
+revised and/or new versions of this License from time to time. Each
+version will be given a distinguishing version number. Except as provided
+in Section 4.3, no one other than the license steward has the right to
+modify this License.
+
+4.2. Effect of New Versions.
+
+You may always continue to use, distribute or otherwise make the Covered
+Software available under the terms of the version of the License under
+which You originally received the Covered Software. If the Initial
+Developer includes a notice in the Original Software prohibiting it
+from being distributed or otherwise made available under any subsequent
+version of the License, You must distribute and make the Covered Software
+available under the terms of the version of the License under which You
+originally received the Covered Software. Otherwise, You may also choose
+to use, distribute or otherwise make the Covered Software available
+under the terms of any subsequent version of the License published by
+the license steward.
+
+4.3. Modified Versions.
+
+When You are an Initial Developer and You want to create a new license
+for Your Original Software, You may create and use a modified version of
+this License if You: (a) rename the license and remove any references
+to the name of the license steward (except to note that the license
+differs from this License); and (b) otherwise make it clear that the
+license contains terms which differ from this License.
+
+5. DISCLAIMER OF WARRANTY.
+
+COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+WITHOUT LIMITATION, WARRANTIES THAT THE COVERED SOFTWARE IS FREE OF
+DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE
+ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED SOFTWARE
+IS WITH YOU. SHOULD ANY COVERED SOFTWARE PROVE DEFECTIVE IN ANY RESPECT,
+YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST
+OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF
+WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY
+COVERED SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
+
+6. TERMINATION. 
+
+6.1. This License and the rights granted hereunder will terminate
+automatically if You fail to comply with terms herein and fail to cure
+such breach within 30 days of becoming aware of the breach. Provisions
+which, by their nature, must remain in effect beyond the termination of
+this License shall survive.
+
+6.2. If You assert a patent infringement claim (excluding declaratory
+judgment actions) against Initial Developer or a Contributor (the
+Initial Developer or Contributor against whom You assert such claim is
+referred to as "Participant") alleging that the Participant Software
+(meaning the Contributor Version where the Participant is a Contributor
+or the Original Software where the Participant is the Initial Developer)
+directly or indirectly infringes any patent, then any and all rights
+granted directly or indirectly to You by such Participant, the Initial
+Developer (if the Initial Developer is not the Participant) and all
+Contributors under Sections 2.1 and/or 2.2 of this License shall, upon 60
+days notice from Participant terminate prospectively and automatically
+at the expiration of such 60 day notice period, unless if within such
+60 day period You withdraw Your claim with respect to the Participant
+Software against such Participant either unilaterally or pursuant to a
+written agreement with Participant.
+
+6.3. In the event of termination under Sections 6.1 or 6.2 above, all end
+user licenses that have been validly granted by You or any distributor
+hereunder prior to termination (excluding licenses granted to You by
+any distributor) shall survive termination.
+
+7. LIMITATION OF LIABILITY.
+
+UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING
+NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL DEVELOPER, ANY
+OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED SOFTWARE, OR ANY SUPPLIER
+OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL,
+INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT
+LIMITATION, DAMAGES FOR LOST PROFITS, LOSS OF GOODWILL, WORK STOPPAGE,
+COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES
+OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY
+OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY
+FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH PARTY'S NEGLIGENCE TO
+THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS
+DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL
+DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
+
+8. U.S. GOVERNMENT END USERS.
+
+The Covered Software is a "commercial item," as that term is defined
+in 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer
+software" (as that term is defined at 48 C.F.R.  252.227-7014(a)(1)) and
+"commercial computer software documentation" as such terms are used in
+48 C.F.R. 12.212 (Sept.  1995). Consistent with 48 C.F.R. 12.212 and 48
+C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End
+Users acquire Covered Software with only those rights set forth herein.
+This U.S. Government Rights clause is in lieu of, and supersedes, any
+other FAR, DFAR, or other clause or provision that addresses Government
+rights in computer software under this License.
+
+9. MISCELLANEOUS.
+
+This License represents the complete agreement concerning subject matter
+hereof. If any provision of this License is held to be unenforceable,
+such provision shall be reformed only to the extent necessary to make it
+enforceable. This License shall be governed by the law of the jurisdiction
+specified in a notice contained within the Original Software (except to
+the extent applicable law, if any, provides otherwise), excluding such
+jurisdiction's conflict-of-law provisions. Any litigation relating to
+this License shall be subject to the jurisdiction of the courts located
+in the jurisdiction and venue specified in a notice contained within
+the Original Software, with the losing party responsible for costs,
+including, without limitation, court costs and reasonable attorneys'
+fees and expenses. The application of the United Nations Convention on
+Contracts for the International Sale of Goods is expressly excluded. Any
+law or regulation which provides that the language of a contract shall
+be construed against the drafter shall not apply to this License.
+You agree that You alone are responsible for compliance with the United
+States export administration regulations (and the export control laws and
+regulation of any other countries) when You use, distribute or otherwise
+make available any Covered Software.
+
+10. RESPONSIBILITY FOR CLAIMS.
+
+As between Initial Developer and the Contributors, each party is
+responsible for claims and damages arising, directly or indirectly, out
+of its utilization of rights under this License and You agree to work
+with Initial Developer and Contributors to distribute such responsibility
+on an equitable basis. Nothing herein is intended or shall be deemed to
+constitute any admission of liability.
+
+
+
+===========================================================================
+
+To the extent any open source components are licensed under the
+GPL and/or LGPL, or other similar licenses that require the
+source code and/or modifications to source code to be made
+available (as would be noted above), you may obtain a copy of
+the source code corresponding to the binaries for such open
+source components and modifications thereto, if any, (the
+"Source Files"), by downloading the Source Files from VMware's website at
+http://www.vmware.com/download/open_source.html, or by sending a request, with
+your name and address to: VMware, Inc., 3401 Hillview Avenue,
+Palo Alto, CA 94304,United States of America or email info@vmware.com.  All such
+requests should clearly specify:  OPEN SOURCE FILES REQUEST,
+Attention General Counsel. VMware shall mail a copy of the
+Source Files to you on a CD or equivalent physical medium.  This
+offer to obtain a copy of the Source Files is valid for three
+years from the date you acquired this Software product. Alternatively, 
+the Source Files may accompany the VMware product.
+
+[GFEHTTP201KP101911]


[15/24] incubator-geode git commit: GEODE-14: Adding license headers

Posted by je...@apache.org.
GEODE-14: Adding license headers


Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/b63d08cb
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/b63d08cb
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/b63d08cb

Branch: refs/heads/feature/GEODE-14
Commit: b63d08cbe3920f3e8a03107f63f005fd6abf5085
Parents: 890d62e
Author: Jens Deppe <jd...@pivotal.io>
Authored: Tue Dec 29 07:13:16 2015 -0800
Committer: Jens Deppe <jd...@pivotal.io>
Committed: Tue Dec 29 07:13:16 2015 -0800

----------------------------------------------------------------------
 extensions/gemfire-modules-session/build.gradle | 22 ++++++--
 extensions/gemfire-modules-session/pom.xml      | 46 ---------------
 .../release/bin/cacheserver.bat                 | 33 -----------
 .../release/bin/cacheserver.sh                  | 33 -----------
 .../release/bin/gemfire.bat                     | 23 --------
 .../release/bin/gemfire.sh                      | 41 --------------
 .../release/bin/setenv.properties               |  6 --
 .../release/conf/cache-client.xml               | 25 ---------
 .../release/conf/cache-peer.xml                 | 33 -----------
 .../release/conf/cache-server.xml               | 59 --------------------
 .../session/filter/SessionCachingFilter.java    | 24 +++++---
 .../modules/session/filter/SessionListener.java | 24 +++++---
 .../modules/session/installer/Installer.java    | 23 +++++---
 .../session/installer/JarClassLoader.java       | 29 ++++++----
 .../session/installer/args/Argument.java        | 24 +++++---
 .../session/installer/args/ArgumentHandler.java | 24 +++++---
 .../installer/args/ArgumentProcessor.java       | 24 +++++---
 .../session/installer/args/ArgumentValues.java  | 24 +++++---
 .../installer/args/URLArgumentHandler.java      | 24 +++++---
 .../installer/args/UnknownArgumentHandler.java  | 17 ++++++
 .../session/installer/args/UsageException.java  | 24 +++++---
 .../internal/common/AbstractSessionCache.java   | 24 +++++---
 .../session/internal/common/CacheProperty.java  | 23 +++++---
 .../common/ClientServerSessionCache.java        | 24 +++++---
 .../internal/common/PeerToPeerSessionCache.java | 24 +++++---
 .../session/internal/common/SessionCache.java   | 23 +++++---
 .../common/SessionExpirationCacheListener.java  | 24 +++++---
 .../session/internal/filter/Constants.java      | 16 ++++++
 .../internal/filter/DummySessionManager.java    | 27 +++++----
 .../internal/filter/GemfireHttpSession.java     | 23 +++++---
 .../filter/GemfireSessionException.java         | 25 +++++----
 .../internal/filter/GemfireSessionManager.java  | 25 ++++++---
 .../internal/filter/ListenerEventType.java      | 25 +++++----
 .../session/internal/filter/SessionManager.java | 23 +++++---
 .../AbstractDeltaSessionAttributes.java         | 24 +++++---
 .../attributes/AbstractSessionAttributes.java   | 23 +++++---
 .../internal/filter/attributes/DeltaEvent.java  | 24 +++++---
 .../DeltaQueuedSessionAttributes.java           | 24 +++++---
 .../attributes/DeltaSessionAttributes.java      | 24 +++++---
 .../attributes/ImmediateSessionAttributes.java  | 24 +++++---
 .../attributes/QueuedSessionAttributes.java     | 24 +++++---
 .../filter/attributes/SessionAttributes.java    | 23 +++++---
 .../filter/util/NamedThreadFactory.java         | 23 +++++---
 .../filter/util/ThreadLocalSession.java         | 24 +++++---
 .../internal/filter/util/TypeAwareMap.java      | 25 +++++----
 .../session/internal/jmx/SessionStatistics.java | 23 +++++---
 .../internal/jmx/SessionStatisticsMXBean.java   | 16 ++++++
 .../internal/filter/AbstractListener.java       | 25 +++++----
 .../session/internal/filter/BasicServlet.java   | 26 +++++----
 .../session/internal/filter/Callback.java       | 18 +++++-
 .../internal/filter/CallbackServlet.java        | 29 +++++-----
 .../session/internal/filter/CommonTests.java    | 28 ++++++----
 .../HttpSessionAttributeListenerImpl.java       | 23 +++++---
 .../filter/HttpSessionBindingListenerImpl.java  | 28 +++++-----
 .../filter/HttpSessionListenerImpl.java         | 28 +++++-----
 .../filter/HttpSessionListenerImpl2.java        | 28 +++++-----
 .../internal/filter/MyServletTester.java        | 25 +++++----
 .../internal/filter/RendezvousManager.java      | 23 +++++---
 .../ServletRequestAttributeListenerImpl.java    | 25 +++++----
 .../filter/ServletRequestListenerImpl.java      | 28 +++++-----
 .../SessionReplicationIntegrationJUnitTest.java | 26 +++++----
 .../filter/SessionReplicationJUnitTest.java     | 26 ++++++---
 .../SessionReplicationLocalCacheJUnitTest.java  | 26 ++++++---
 .../session/junit/ChildFirstClassLoader.java    | 24 +++++---
 .../modules/session/junit/NamedRunner.java      | 41 ++++++--------
 .../session/junit/PerTestClassLoaderRunner.java | 24 +++++---
 .../junit/SeparateClassloaderTestRunner.java    | 17 ++++++
 gradle/rat.gradle                               |  1 +
 68 files changed, 951 insertions(+), 757 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b63d08cb/extensions/gemfire-modules-session/build.gradle
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/build.gradle b/extensions/gemfire-modules-session/build.gradle
index 942d3f4..430199b 100644
--- a/extensions/gemfire-modules-session/build.gradle
+++ b/extensions/gemfire-modules-session/build.gradle
@@ -1,9 +1,19 @@
-integrationTest {
-  testLogging {
-    events 'passed', 'skipped', 'failed'
-    exceptionFormat = 'full'
-  }
-}
+/*
+ * 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.
+ */
 
 dependencies {
   compile project(':extensions/gemfire-modules')

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b63d08cb/extensions/gemfire-modules-session/pom.xml
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/pom.xml b/extensions/gemfire-modules-session/pom.xml
deleted file mode 100644
index b274ab3..0000000
--- a/extensions/gemfire-modules-session/pom.xml
+++ /dev/null
@@ -1,46 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-  <modelVersion>4.0.0</modelVersion>
-  <groupId>com.gemstone</groupId>
-  <artifactId>gemfire-modules-session</artifactId>
-  <packaging>jar</packaging>
-  <version>${gemfire.modules.version}</version>
-  <url>http://maven.apache.org</url>
-  <name>gemfire-modules-session</name>
-
-  <parent>
-    <groupId>com.gemstone</groupId>
-    <artifactId>gemfire-modules-parent</artifactId>
-    <version>1.0-SNAPSHOT</version>
-  </parent>
-
-  <dependencies>
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-    </dependency>
-
-    <dependency>
-      <groupId>javax.servlet</groupId>
-      <artifactId>servlet-api</artifactId>
-    </dependency>
-
-    <dependency>
-      <groupId>com.gemstone</groupId>
-      <artifactId>gemfire-modules</artifactId>
-    </dependency>
-
-    <dependency>
-      <groupId>com.gemstone.gemfire</groupId>
-      <artifactId>gemfire</artifactId>
-    </dependency>
-
-    <!--<dependency>-->
-      <!--<groupId>org.slf4j</groupId>-->
-      <!--<artifactId>slf4j-log4j12</artifactId>-->
-      <!--<scope>compile</scope>-->
-    <!--</dependency>-->
-
-  </dependencies>
-</project>

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b63d08cb/extensions/gemfire-modules-session/release/bin/cacheserver.bat
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/release/bin/cacheserver.bat b/extensions/gemfire-modules-session/release/bin/cacheserver.bat
deleted file mode 100755
index 2632dc7..0000000
--- a/extensions/gemfire-modules-session/release/bin/cacheserver.bat
+++ /dev/null
@@ -1,33 +0,0 @@
-@setlocal enableextensions
-@set scriptdir=%~dp0
-@set gf=%scriptdir:\bin\=%
-@if exist "%gf%\lib\gemfire.jar" @goto gfok
-@echo Could not determine GEMFIRE location
-@verify other 2>nul
-@goto done
-:gfok
-
-@REM Initialize classpath
-
-@REM Add GemFire classes
-@set GEMFIRE_JARS=%gf%/lib/gemfire.jar;%gf%/lib/antlr.jar;%gf%/lib/mail.jar
-
-@REM Add Tomcat classes
-@set GEMFIRE_JARS=%GEMFIRE_JARS%;%gf%/lib/servlet-api.jar;%gf%/lib/catalina.jar;%gf%/lib/${artifact.artifactId}-${artifact.version}.jar;%gf%/bin/tomcat-juli.jar
-
-@REM Add conf directory
-@set GEMFIRE_JARS=%GEMFIRE_JARS%;%gf%/conf
-
-@if defined CLASSPATH set GEMFIRE_JARS=%GEMFIRE_JARS%;%CLASSPATH%
-
-@if not defined GF_JAVA (
-@REM %GF_JAVA% is not defined, assume it is on the PATH
-@set GF_JAVA=java
-)
-
-@"%GF_JAVA%" %JAVA_ARGS% -classpath "%GEMFIRE_JARS%" com.gemstone.gemfire.internal.cache.CacheServerLauncher %*
-:done
-@set scriptdir=
-@set gf=
-@set GEMFIRE_JARS=
-

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b63d08cb/extensions/gemfire-modules-session/release/bin/cacheserver.sh
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/release/bin/cacheserver.sh b/extensions/gemfire-modules-session/release/bin/cacheserver.sh
deleted file mode 100755
index e395001..0000000
--- a/extensions/gemfire-modules-session/release/bin/cacheserver.sh
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/bin/bash
-# Set GEMFIRE to the product toplevel directory
-GEMFIRE=`dirname $0`
-OLDPWD=$PWD
-cd $GEMFIRE
-GEMFIRE=`dirname $PWD`
-cd $OLDPWD
-
-if [ "x$WINDIR" != "x" ]; then
-  echo "ERROR: The variable WINDIR is set indicating this script is running in a Windows OS, please use the .bat file version instead."
-  exit 1
-fi
-
-GEMFIRE_JARS=$GEMFIRE/lib/gemfire-[0-9]*.jar
-if [ ! -f ${GEMFIRE_JARS} ]; then
-  echo "ERROR: Could not determine GEMFIRE location."
-  exit 1
-fi
-
-# Initialize classpath
-GEMFIRE_JARS=$GEMFIRE_JARS:$GEMFIRE/lib/gemfire-modules-[0-9]*
-GEMFIRE_JARS=$GEMFIRE_JARS:$GEMFIRE/lib/servlet-api-[0-9]*
-GEMFIRE_JARS=$GEMFIRE_JARS:$GEMFIRE/lib/slf4j-api-[0-9]*
-GEMFIRE_JARS=$GEMFIRE_JARS:$GEMFIRE/lib/slf4j-jdk14-[0-9]*
-
-# Add configuration
-GEMFIRE_JARS=$GEMFIRE_JARS:$GEMFIRE/conf
-
-if [ "x$CLASSPATH" != "x" ]; then
-  GEMFIRE_JARS=$GEMFIRE_JARS:$CLASSPATH
-fi
-
-${GF_JAVA:-java} ${JAVA_ARGS} -classpath ${GEMFIRE_JARS} com.gemstone.gemfire.internal.cache.CacheServerLauncher "$@"

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b63d08cb/extensions/gemfire-modules-session/release/bin/gemfire.bat
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/release/bin/gemfire.bat b/extensions/gemfire-modules-session/release/bin/gemfire.bat
deleted file mode 100755
index 96d2564..0000000
--- a/extensions/gemfire-modules-session/release/bin/gemfire.bat
+++ /dev/null
@@ -1,23 +0,0 @@
-@setlocal enableextensions
-@set scriptdir=%~dp0
-@set gf=%scriptdir:\bin\=%
-@if exist "%gf%\lib\gemfire.jar" @goto gfok
-@echo Could not determine GEMFIRE location
-@verify other 2>nul
-@goto done
-:gfok
-
-@set GEMFIRE_JARS=%gf%/lib/gemfire.jar;%gf%/lib/antlr.jar;%gf%/lib/mail.jar
-@if defined CLASSPATH set GEMFIRE_JARS=%GEMFIRE_JARS%;%CLASSPATH%
-
-@if not defined GF_JAVA (
-@REM %GF_JAVA% is not defined, assume it is on the PATH
-@set GF_JAVA=java
-)
-
-@"%GF_JAVA%" %JAVA_ARGS% -classpath "%GEMFIRE_JARS%" com.gemstone.gemfire.internal.SystemAdmin %*
-:done
-@set scriptdir=
-@set gf=
-@set GEMFIRE_JARS=
-

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b63d08cb/extensions/gemfire-modules-session/release/bin/gemfire.sh
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/release/bin/gemfire.sh b/extensions/gemfire-modules-session/release/bin/gemfire.sh
deleted file mode 100755
index fa5f4cd..0000000
--- a/extensions/gemfire-modules-session/release/bin/gemfire.sh
+++ /dev/null
@@ -1,41 +0,0 @@
-#!/bin/bash
-# Set GEMFIRE to the product toplevel directory
-GEMFIRE=`dirname $0`
-OLDPWD=$PWD
-cd $GEMFIRE
-GEMFIRE=`dirname $PWD`
-cd $OLDPWD
-
-if [ "x$WINDIR" != "x" ]; then
-  echo "ERROR: The variable WINDIR is set indicating this script is running in a Windows OS, please use the .bat file version instead."
-  exit 1
-fi
-
-if [ ! -f $GEMFIRE/lib/gemfire.jar ]; then
-  echo "ERROR: Could not determine GEMFIRE location."
-  exit 1
-fi
-
-GEMFIRE_JARS=$GEMFIRE/lib/gemfire.jar:$GEMFIRE/lib/antlr.jar
-
-if [ "x$CLASSPATH" != "x" ]; then
-  GEMFIRE_JARS=$GEMFIRE_JARS:$CLASSPATH
-fi
-
-# Command line args that start with -J will be passed to the java vm in JARGS.
-# See java --help for a listing of valid vm args.
-# Example: -J-Xmx1g sets the max heap size to 1 gigabyte.
-
-JARGS=
-GEMFIRE_ARGS=
-for i in "$@"
-do
-  if [ "-J" == "${i:0:2}" ]
-  then
-    JARGS="${JARGS} \"${i#-J}\""
-  else
-    GEMFIRE_ARGS="${GEMFIRE_ARGS} \"${i}\""
-  fi
-done
-
-eval ${GF_JAVA:-java} ${JAVA_ARGS} ${JARGS} -classpath ${GEMFIRE_JARS} com.gemstone.gemfire.internal.SystemAdmin ${GEMFIRE_ARGS}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b63d08cb/extensions/gemfire-modules-session/release/bin/setenv.properties
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/release/bin/setenv.properties b/extensions/gemfire-modules-session/release/bin/setenv.properties
deleted file mode 100644
index fc8918b..0000000
--- a/extensions/gemfire-modules-session/release/bin/setenv.properties
+++ /dev/null
@@ -1,6 +0,0 @@
-java.opt.1=-Xms${initial.vm.heap.size.mb:512}M
-java.opt.2=-Xmx${maximum.vm.heap.size.mb:512}M
-java.opt.hotspot.1=-XX:+UseParNewGC
-java.opt.hotspot.2=-XX:+UseConcMarkSweepGC
-java.opt.hotspot.3=-XX:CMSInitiatingOccupancyFraction=${cms.initiating.heap.percentage:50}
-java.opt.j9.1=-Xgcpolicy:gencon
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b63d08cb/extensions/gemfire-modules-session/release/conf/cache-client.xml
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/release/conf/cache-client.xml b/extensions/gemfire-modules-session/release/conf/cache-client.xml
deleted file mode 100755
index c8444b2..0000000
--- a/extensions/gemfire-modules-session/release/conf/cache-client.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!DOCTYPE client-cache PUBLIC
-  "-//GemStone Systems, Inc.//GemFire Declarative Caching 6.5//EN"
-  "http://www.gemstone.com/dtd/cache6_6.dtd">
-  
-<client-cache>
-
-  <!-- The default pool connects to a cache server running on  localhost at
-       port 40404. To connect to a different server host and port, modify
-       the following pool server host and port. -->
-  <pool name="sessions" subscription-enabled="true">
-    <server host="localhost" port="40404"/>
-  </pool>
-
-  <!-- To configure the client to use a locator instead of a server, replace
-       the server pool above with the locator pool below and modify the locator
-       host and port as necessary. -->
-  <!--
-  <pool name="sessions" subscription-enabled="true">
-    <locator host="localhost" port="10334"/>
-  </pool>
-  -->
-  
-</client-cache>

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b63d08cb/extensions/gemfire-modules-session/release/conf/cache-peer.xml
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/release/conf/cache-peer.xml b/extensions/gemfire-modules-session/release/conf/cache-peer.xml
deleted file mode 100755
index 1a49637..0000000
--- a/extensions/gemfire-modules-session/release/conf/cache-peer.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!DOCTYPE cache PUBLIC
-  "-//GemStone Systems, Inc.//GemFire Declarative Caching 6.5//EN"
-  "http://www.gemstone.com/dtd/cache6_6.dtd">
-  
-<cache>
-
-  <!-- Uncomment the following disk-store element to modify the default disk store directory -->
-  <!--
-  <disk-store name="DEFAULT">
-    <disk-dirs>
-      <disk-dir>/path/to/persistent/data</disk-dir>
-    </disk-dirs>
-  </disk-store>
-  -->
-
-  <!-- This is the definition of the default session region -->
-  <!--
-  <region name="gemfire_modules_sessions">
-    <region-attributes scope="distributed-ack" enable-gateway="false" data-policy="replicate" statistics-enabled="true">
-      <entry-idle-time>
-        <expiration-attributes timeout="0" action="invalidate">
-          <custom-expiry>
-            <class-name>com.gemstone.gemfire.modules.util.SessionCustomExpiry</class-name>
-          </custom-expiry>
-        </expiration-attributes>
-      </entry-idle-time>
-    </region-attributes>
-  </region>
-  -->
-  
-</cache>

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b63d08cb/extensions/gemfire-modules-session/release/conf/cache-server.xml
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/release/conf/cache-server.xml b/extensions/gemfire-modules-session/release/conf/cache-server.xml
deleted file mode 100755
index 6ee2223..0000000
--- a/extensions/gemfire-modules-session/release/conf/cache-server.xml
+++ /dev/null
@@ -1,59 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!DOCTYPE cache PUBLIC
-  "-//GemStone Systems, Inc.//GemFire Declarative Caching 6.5//EN"
-  "http://www.gemstone.com/dtd/cache6_6.dtd">
-  
-<cache>
-
-  <!-- Uncomment the following gateway-hub element to create a gateway hub -->
-  <!--
-  <gateway-hub id="NY" port="11110">
-    <gateway id="LN">
-      <gateway-endpoint id="LN-1" host="localhost" port="22220"/>
-      <gateway-queue disk-store-name="NY_GATEWAY"/>
-    </gateway>
-  </gateway-hub>
-  -->
-
-  <!-- Uncomment the following cache-server element to modify the listen port -->
-  <!--
-  <cache-server port="44444"/>
-  -->
-
-  <!-- Uncomment the following disk-store element to modify the default disk store directory -->
-  <!--
-  <disk-store name="DEFAULT">
-    <disk-dirs>
-      <disk-dir>/path/to/persistent/data</disk-dir>
-    </disk-dirs>
-  </disk-store>
-  -->
-  
-  <!-- Uncomment the following disk-store element to create the NY_GATEWAY disk store
-       (for the gateway-hub element defined above) -->
-  <!--
-  <disk-store name="NY_GATEWAY">
-    <disk-dirs>
-      <disk-dir>/path/to/persistent/data</disk-dir>
-    </disk-dirs>
-  </disk-store>
-  -->
-  
-  <!-- This is the definition of the default session region -->
-  <!--
-  <region name="gemfire_modules_sessions">
-    <region-attributes enable-gateway="false" data-policy="partition" statistics-enabled="true">
-      <entry-idle-time>
-        <expiration-attributes timeout="0" action="invalidate">
-          <custom-expiry>
-            <class-name>com.gemstone.gemfire.modules.util.SessionCustomExpiry</class-name>
-          </custom-expiry>
-        </expiration-attributes>
-      </entry-idle-time>
-      <partition-attributes redundant-copies="1" total-num-buckets="113"/>
-    </region-attributes>
-  </region>
-  -->
-
-</cache>

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b63d08cb/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/SessionCachingFilter.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/SessionCachingFilter.java b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/SessionCachingFilter.java
index bf08d05..7490fdd 100644
--- a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/SessionCachingFilter.java
+++ b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/SessionCachingFilter.java
@@ -1,10 +1,20 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
+/*
+* 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.
+*/
+
 package com.gemstone.gemfire.modules.session.filter;
 
 import com.gemstone.gemfire.modules.session.internal.filter.GemfireHttpSession;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b63d08cb/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/SessionListener.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/SessionListener.java b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/SessionListener.java
index 9726be0..7973bc5 100644
--- a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/SessionListener.java
+++ b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/filter/SessionListener.java
@@ -1,10 +1,20 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
+/*
+* 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.
+*/
+
 package com.gemstone.gemfire.modules.session.filter;
 
 import com.gemstone.gemfire.distributed.DistributedSystemDisconnectedException;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b63d08cb/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/installer/Installer.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/installer/Installer.java b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/installer/Installer.java
index ee773d2..7ba5b34 100644
--- a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/installer/Installer.java
+++ b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/installer/Installer.java
@@ -1,10 +1,19 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
+/*
+* 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.
+*/
 
 package com.gemstone.gemfire.modules.session.installer;
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b63d08cb/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/installer/JarClassLoader.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/installer/JarClassLoader.java b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/installer/JarClassLoader.java
index 1d850bf..ba528ce 100644
--- a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/installer/JarClassLoader.java
+++ b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/installer/JarClassLoader.java
@@ -1,10 +1,20 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
+/*
+* 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.
+*/
+
 package com.gemstone.gemfire.modules.session.installer;
 
 import java.io.Closeable;
@@ -20,9 +30,8 @@ import java.util.jar.JarEntry;
 import java.util.jar.JarFile;
 
 /**
- * Classloader, grabbed from the web, which allows finding classes in jars
- * within jars. This is used to check whether a listener, as found in web.xml,
- * is a ServletContextListener
+ * Classloader, which allows finding classes in jars  within jars. This is used to check
+ * whether a listener, as found in web.xml, is a ServletContextListener
  */
 public class JarClassLoader extends URLClassLoader {
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b63d08cb/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/installer/args/Argument.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/installer/args/Argument.java b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/installer/args/Argument.java
index bb1a73d..1125c1b 100644
--- a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/installer/args/Argument.java
+++ b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/installer/args/Argument.java
@@ -1,10 +1,20 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
+/*
+* 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.
+*/
+
 package com.gemstone.gemfire.modules.session.installer.args;
 
 import java.util.ArrayList;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b63d08cb/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/installer/args/ArgumentHandler.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/installer/args/ArgumentHandler.java b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/installer/args/ArgumentHandler.java
index a165148..97c8108 100644
--- a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/installer/args/ArgumentHandler.java
+++ b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/installer/args/ArgumentHandler.java
@@ -1,10 +1,20 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
+/*
+* 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.
+*/
+
 package com.gemstone.gemfire.modules.session.installer.args;
 
 /**

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b63d08cb/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/installer/args/ArgumentProcessor.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/installer/args/ArgumentProcessor.java b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/installer/args/ArgumentProcessor.java
index 950f2f0..04ecfab 100644
--- a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/installer/args/ArgumentProcessor.java
+++ b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/installer/args/ArgumentProcessor.java
@@ -1,10 +1,20 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
+/*
+* 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.
+*/
+
 package com.gemstone.gemfire.modules.session.installer.args;
 
 import java.util.ArrayList;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b63d08cb/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/installer/args/ArgumentValues.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/installer/args/ArgumentValues.java b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/installer/args/ArgumentValues.java
index 7be926c..cd412da 100644
--- a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/installer/args/ArgumentValues.java
+++ b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/installer/args/ArgumentValues.java
@@ -1,10 +1,20 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
+/*
+* 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.
+*/
+
 package com.gemstone.gemfire.modules.session.installer.args;
 
 import java.util.ArrayList;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b63d08cb/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/installer/args/URLArgumentHandler.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/installer/args/URLArgumentHandler.java b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/installer/args/URLArgumentHandler.java
index f0800d4..bb4b53a 100644
--- a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/installer/args/URLArgumentHandler.java
+++ b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/installer/args/URLArgumentHandler.java
@@ -1,10 +1,20 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
+/*
+* 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.
+*/
+
 package com.gemstone.gemfire.modules.session.installer.args;
 
 import java.io.File;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b63d08cb/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/installer/args/UnknownArgumentHandler.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/installer/args/UnknownArgumentHandler.java b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/installer/args/UnknownArgumentHandler.java
index 1cf0ecc..4d52f62 100644
--- a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/installer/args/UnknownArgumentHandler.java
+++ b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/installer/args/UnknownArgumentHandler.java
@@ -1,3 +1,20 @@
+/*
+ * 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.
+ */
+
 package com.gemstone.gemfire.modules.session.installer.args;
 
 /**

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b63d08cb/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/installer/args/UsageException.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/installer/args/UsageException.java b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/installer/args/UsageException.java
index 1d22dee..0879417 100644
--- a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/installer/args/UsageException.java
+++ b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/installer/args/UsageException.java
@@ -1,10 +1,20 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
+/*
+* 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.
+*/
+
 package com.gemstone.gemfire.modules.session.installer.args;
 
 /**

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b63d08cb/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/common/AbstractSessionCache.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/common/AbstractSessionCache.java b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/common/AbstractSessionCache.java
index bc06465..965a97f 100644
--- a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/common/AbstractSessionCache.java
+++ b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/common/AbstractSessionCache.java
@@ -1,10 +1,20 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
+/*
+* 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.
+*/
+
 package com.gemstone.gemfire.modules.session.internal.common;
 
 import com.gemstone.gemfire.cache.Region;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b63d08cb/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/common/CacheProperty.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/common/CacheProperty.java b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/common/CacheProperty.java
index 5abd0b6..e26281e 100644
--- a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/common/CacheProperty.java
+++ b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/common/CacheProperty.java
@@ -1,10 +1,19 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
+/*
+* 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.
+*/
 
 package com.gemstone.gemfire.modules.session.internal.common;
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b63d08cb/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/common/ClientServerSessionCache.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/common/ClientServerSessionCache.java b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/common/ClientServerSessionCache.java
index a21ea2f..a23888c 100644
--- a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/common/ClientServerSessionCache.java
+++ b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/common/ClientServerSessionCache.java
@@ -1,10 +1,20 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
+/*
+* 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.
+*/
+
 package com.gemstone.gemfire.modules.session.internal.common;
 
 import com.gemstone.gemfire.cache.GemFireCache;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b63d08cb/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/common/PeerToPeerSessionCache.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/common/PeerToPeerSessionCache.java b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/common/PeerToPeerSessionCache.java
index 0139cca..878adaa 100644
--- a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/common/PeerToPeerSessionCache.java
+++ b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/common/PeerToPeerSessionCache.java
@@ -1,10 +1,20 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
+/*
+* 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.
+*/
+
 package com.gemstone.gemfire.modules.session.internal.common;
 
 import com.gemstone.gemfire.cache.Cache;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b63d08cb/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/common/SessionCache.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/common/SessionCache.java b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/common/SessionCache.java
index e0aa6bf..7562dff 100644
--- a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/common/SessionCache.java
+++ b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/common/SessionCache.java
@@ -1,10 +1,19 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
+/*
+* 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.
+*/
 
 package com.gemstone.gemfire.modules.session.internal.common;
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b63d08cb/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/common/SessionExpirationCacheListener.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/common/SessionExpirationCacheListener.java b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/common/SessionExpirationCacheListener.java
index 836f4af..648e711 100644
--- a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/common/SessionExpirationCacheListener.java
+++ b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/common/SessionExpirationCacheListener.java
@@ -1,10 +1,20 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
+/*
+* 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.
+*/
+
 package com.gemstone.gemfire.modules.session.internal.common;
 
 import com.gemstone.gemfire.cache.Declarable;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b63d08cb/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/Constants.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/Constants.java b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/Constants.java
index f62f9db..4ce8733 100644
--- a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/Constants.java
+++ b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/Constants.java
@@ -1,3 +1,19 @@
+/*
+ * 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.
+ */
 
 package com.gemstone.gemfire.modules.session.internal.filter;
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b63d08cb/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/DummySessionManager.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/DummySessionManager.java b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/DummySessionManager.java
index bfa5e57..9628912 100644
--- a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/DummySessionManager.java
+++ b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/DummySessionManager.java
@@ -1,14 +1,19 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
 /*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
+* 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.
+*/
 
 package com.gemstone.gemfire.modules.session.internal.filter;
 
@@ -124,4 +129,4 @@ public class DummySessionManager implements SessionManager {
   private String generateId() {
     return UUID.randomUUID().toString().toUpperCase() + "-GF";
   }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b63d08cb/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/GemfireHttpSession.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/GemfireHttpSession.java b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/GemfireHttpSession.java
index 1f114bc..695a03b 100644
--- a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/GemfireHttpSession.java
+++ b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/GemfireHttpSession.java
@@ -1,10 +1,19 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
+/*
+* 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.
+*/
 
 package com.gemstone.gemfire.modules.session.internal.filter;
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b63d08cb/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/GemfireSessionException.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/GemfireSessionException.java b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/GemfireSessionException.java
index 2a34b5e..3ce81be 100644
--- a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/GemfireSessionException.java
+++ b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/GemfireSessionException.java
@@ -1,14 +1,19 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
 /*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
+* 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.
+*/
 
 package com.gemstone.gemfire.modules.session.internal.filter;
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b63d08cb/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/GemfireSessionManager.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/GemfireSessionManager.java b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/GemfireSessionManager.java
index dd148d2..a3d3c10 100644
--- a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/GemfireSessionManager.java
+++ b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/GemfireSessionManager.java
@@ -1,10 +1,19 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
+/*
+* 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.
+*/
 
 package com.gemstone.gemfire.modules.session.internal.filter;
 
@@ -499,4 +508,4 @@ public class GemfireSessionManager implements SessionManager {
   AbstractCache getCache() {
     return distributedCache;
   }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b63d08cb/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/ListenerEventType.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/ListenerEventType.java b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/ListenerEventType.java
index 0060a89..b040dda 100644
--- a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/ListenerEventType.java
+++ b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/ListenerEventType.java
@@ -1,14 +1,19 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
 /*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
+* 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.
+*/
 
 package com.gemstone.gemfire.modules.session.internal.filter;
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b63d08cb/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/SessionManager.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/SessionManager.java b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/SessionManager.java
index a01c793..9d8996c 100644
--- a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/SessionManager.java
+++ b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/SessionManager.java
@@ -1,10 +1,19 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
+/*
+* 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.
+*/
 
 package com.gemstone.gemfire.modules.session.internal.filter;
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b63d08cb/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/attributes/AbstractDeltaSessionAttributes.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/attributes/AbstractDeltaSessionAttributes.java b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/attributes/AbstractDeltaSessionAttributes.java
index 096e63b..f46495d 100644
--- a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/attributes/AbstractDeltaSessionAttributes.java
+++ b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/attributes/AbstractDeltaSessionAttributes.java
@@ -1,10 +1,20 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
+/*
+* 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.
+*/
+
 package com.gemstone.gemfire.modules.session.internal.filter.attributes;
 
 import com.gemstone.gemfire.DataSerializer;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b63d08cb/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/attributes/AbstractSessionAttributes.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/attributes/AbstractSessionAttributes.java b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/attributes/AbstractSessionAttributes.java
index b5effb4..c4af041 100644
--- a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/attributes/AbstractSessionAttributes.java
+++ b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/attributes/AbstractSessionAttributes.java
@@ -1,10 +1,19 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
+/*
+* 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.
+*/
 
 package com.gemstone.gemfire.modules.session.internal.filter.attributes;
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b63d08cb/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/attributes/DeltaEvent.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/attributes/DeltaEvent.java b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/attributes/DeltaEvent.java
index 455ba59..4c248dd 100644
--- a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/attributes/DeltaEvent.java
+++ b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/attributes/DeltaEvent.java
@@ -1,10 +1,20 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
+/*
+* 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.
+*/
+
 package com.gemstone.gemfire.modules.session.internal.filter.attributes;
 
 import com.gemstone.gemfire.DataSerializable;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b63d08cb/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/attributes/DeltaQueuedSessionAttributes.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/attributes/DeltaQueuedSessionAttributes.java b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/attributes/DeltaQueuedSessionAttributes.java
index 0c8bd57..cb4f673 100644
--- a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/attributes/DeltaQueuedSessionAttributes.java
+++ b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/attributes/DeltaQueuedSessionAttributes.java
@@ -1,10 +1,20 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
+/*
+* 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.
+*/
+
 package com.gemstone.gemfire.modules.session.internal.filter.attributes;
 
 import com.gemstone.gemfire.DataSerializable;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b63d08cb/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/attributes/DeltaSessionAttributes.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/attributes/DeltaSessionAttributes.java b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/attributes/DeltaSessionAttributes.java
index 0c11c46..8cc9866 100644
--- a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/attributes/DeltaSessionAttributes.java
+++ b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/attributes/DeltaSessionAttributes.java
@@ -1,10 +1,20 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
+/*
+* 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.
+*/
+
 package com.gemstone.gemfire.modules.session.internal.filter.attributes;
 
 import com.gemstone.gemfire.DataSerializable;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b63d08cb/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/attributes/ImmediateSessionAttributes.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/attributes/ImmediateSessionAttributes.java b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/attributes/ImmediateSessionAttributes.java
index 8bde765..15936ba 100644
--- a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/attributes/ImmediateSessionAttributes.java
+++ b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/attributes/ImmediateSessionAttributes.java
@@ -1,10 +1,20 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
+/*
+* 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.
+*/
+
 package com.gemstone.gemfire.modules.session.internal.filter.attributes;
 
 import com.gemstone.gemfire.DataSerializable;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b63d08cb/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/attributes/QueuedSessionAttributes.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/attributes/QueuedSessionAttributes.java b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/attributes/QueuedSessionAttributes.java
index 85d19ab..8d20b43 100644
--- a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/attributes/QueuedSessionAttributes.java
+++ b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/attributes/QueuedSessionAttributes.java
@@ -1,10 +1,20 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
+/*
+* 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.
+*/
+
 package com.gemstone.gemfire.modules.session.internal.filter.attributes;
 
 import com.gemstone.gemfire.DataSerializable;


[14/24] incubator-geode git commit: GEODE-14: Adding license headers

Posted by je...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b63d08cb/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/attributes/SessionAttributes.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/attributes/SessionAttributes.java b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/attributes/SessionAttributes.java
index cf16e14..b3b0cef 100644
--- a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/attributes/SessionAttributes.java
+++ b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/attributes/SessionAttributes.java
@@ -1,10 +1,19 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
+/*
+* 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.
+*/
 
 package com.gemstone.gemfire.modules.session.internal.filter.attributes;
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b63d08cb/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/util/NamedThreadFactory.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/util/NamedThreadFactory.java b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/util/NamedThreadFactory.java
index 4771f76..7491cf0 100644
--- a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/util/NamedThreadFactory.java
+++ b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/util/NamedThreadFactory.java
@@ -1,10 +1,19 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
+/*
+* 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.
+*/
 
 package com.gemstone.gemfire.modules.session.internal.filter.util;
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b63d08cb/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/util/ThreadLocalSession.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/util/ThreadLocalSession.java b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/util/ThreadLocalSession.java
index c0bc625..996b1fd 100644
--- a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/util/ThreadLocalSession.java
+++ b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/util/ThreadLocalSession.java
@@ -1,10 +1,20 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
+/*
+* 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.
+*/
+
 package com.gemstone.gemfire.modules.session.internal.filter.util;
 
 import javax.servlet.http.HttpSession;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b63d08cb/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/util/TypeAwareMap.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/util/TypeAwareMap.java b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/util/TypeAwareMap.java
index e65245b..705bafd 100644
--- a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/util/TypeAwareMap.java
+++ b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/filter/util/TypeAwareMap.java
@@ -1,14 +1,19 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
 /*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
+* 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.
+*/
 
 package com.gemstone.gemfire.modules.session.internal.filter.util;
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b63d08cb/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/jmx/SessionStatistics.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/jmx/SessionStatistics.java b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/jmx/SessionStatistics.java
index 0119e06..9f945da 100644
--- a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/jmx/SessionStatistics.java
+++ b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/jmx/SessionStatistics.java
@@ -1,10 +1,19 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
+/*
+* 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.
+*/
 
 package com.gemstone.gemfire.modules.session.internal.jmx;
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b63d08cb/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/jmx/SessionStatisticsMXBean.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/jmx/SessionStatisticsMXBean.java b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/jmx/SessionStatisticsMXBean.java
index a468320..33cfc3e 100644
--- a/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/jmx/SessionStatisticsMXBean.java
+++ b/extensions/gemfire-modules-session/src/main/java/com/gemstone/gemfire/modules/session/internal/jmx/SessionStatisticsMXBean.java
@@ -1,3 +1,19 @@
+/*
+ * 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.
+ */
 
 package com.gemstone.gemfire.modules.session.internal.jmx;
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b63d08cb/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/AbstractListener.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/AbstractListener.java b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/AbstractListener.java
index 94dc07f..0bca895 100644
--- a/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/AbstractListener.java
+++ b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/AbstractListener.java
@@ -1,14 +1,19 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
 /*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
+* 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.
+*/
 
 package com.gemstone.gemfire.modules.session.internal.filter;
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b63d08cb/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/BasicServlet.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/BasicServlet.java b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/BasicServlet.java
index 2c1d7e4..5804317 100644
--- a/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/BasicServlet.java
+++ b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/BasicServlet.java
@@ -1,14 +1,20 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
 /*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
+* 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.
+*/
+
 package com.gemstone.gemfire.modules.session.internal.filter;
 
 import java.io.IOException;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b63d08cb/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/Callback.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/Callback.java b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/Callback.java
index 3fc6600..fa5b64f 100644
--- a/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/Callback.java
+++ b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/Callback.java
@@ -1,6 +1,18 @@
 /*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
+ * 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.
  */
 
 package com.gemstone.gemfire.modules.session.internal.filter;
@@ -11,7 +23,7 @@ import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
 
 /**
- * @author jdeppe
+ * Interface which, when implemented, can be put into a servlet context and executed by the servlet.
  */
 public interface Callback {
   void call(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b63d08cb/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/CallbackServlet.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/CallbackServlet.java b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/CallbackServlet.java
index f9d2971..3050280 100644
--- a/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/CallbackServlet.java
+++ b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/CallbackServlet.java
@@ -1,14 +1,20 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
 /*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
+* 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.
+*/
+
 package com.gemstone.gemfire.modules.session.internal.filter;
 
 import java.io.IOException;
@@ -17,9 +23,6 @@ import javax.servlet.http.HttpServlet;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
-/**
- * @author jdeppe
- */
 public class CallbackServlet extends HttpServlet {
 
   private Callback callback;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b63d08cb/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/CommonTests.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/CommonTests.java b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/CommonTests.java
index b9b182d..4a37d36 100644
--- a/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/CommonTests.java
+++ b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/CommonTests.java
@@ -1,14 +1,20 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
 /*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
+* 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.
+*/
+
 package com.gemstone.gemfire.modules.session.internal.filter;
 
 import com.mockrunner.mock.web.MockHttpServletRequest;
@@ -573,4 +579,4 @@ public abstract class CommonTests extends BasicServletTestCaseAdapter {
     assertTrue("Session ID should be from URL", request.isRequestedSessionIdFromURL());
   }
 
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b63d08cb/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionAttributeListenerImpl.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionAttributeListenerImpl.java b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionAttributeListenerImpl.java
index a374e4d..6d5679a 100644
--- a/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionAttributeListenerImpl.java
+++ b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionAttributeListenerImpl.java
@@ -1,10 +1,19 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
+/*
+* 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.
+*/
 
 package com.gemstone.gemfire.modules.session.internal.filter;
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b63d08cb/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionBindingListenerImpl.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionBindingListenerImpl.java b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionBindingListenerImpl.java
index 2e6ae0c..ce25cb6 100644
--- a/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionBindingListenerImpl.java
+++ b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionBindingListenerImpl.java
@@ -1,14 +1,19 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
 /*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
+* 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.
+*/
 
 package com.gemstone.gemfire.modules.session.internal.filter;
 
@@ -16,9 +21,6 @@ import java.io.Serializable;
 import javax.servlet.http.HttpSessionBindingEvent;
 import javax.servlet.http.HttpSessionBindingListener;
 
-/**
- * @author jdeppe
- */
 public class HttpSessionBindingListenerImpl extends AbstractListener implements
     HttpSessionBindingListener, Serializable {
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b63d08cb/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionListenerImpl.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionListenerImpl.java b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionListenerImpl.java
index a76f463..55510a6 100644
--- a/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionListenerImpl.java
+++ b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionListenerImpl.java
@@ -1,14 +1,19 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
 /*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
+* 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.
+*/
 
 package com.gemstone.gemfire.modules.session.internal.filter;
 
@@ -18,9 +23,6 @@ import javax.servlet.http.HttpSession;
 import javax.servlet.http.HttpSessionEvent;
 import javax.servlet.http.HttpSessionListener;
 
-/**
- * @author jdeppe
- */
 public class HttpSessionListenerImpl extends AbstractListener
     implements HttpSessionListener {
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b63d08cb/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionListenerImpl2.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionListenerImpl2.java b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionListenerImpl2.java
index ea39f65..bccd83f 100644
--- a/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionListenerImpl2.java
+++ b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/HttpSessionListenerImpl2.java
@@ -1,14 +1,19 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
 /*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
+* 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.
+*/
 
 package com.gemstone.gemfire.modules.session.internal.filter;
 
@@ -18,9 +23,6 @@ import javax.servlet.http.HttpSession;
 import javax.servlet.http.HttpSessionEvent;
 import javax.servlet.http.HttpSessionListener;
 
-/**
- * @author jdeppe
- */
 public class HttpSessionListenerImpl2 extends AbstractListener
     implements HttpSessionListener {
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b63d08cb/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/MyServletTester.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/MyServletTester.java b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/MyServletTester.java
index 1ff6e70..09c9536 100644
--- a/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/MyServletTester.java
+++ b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/MyServletTester.java
@@ -1,14 +1,19 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
 /*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
+* 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.
+*/
 
 package com.gemstone.gemfire.modules.session.internal.filter;
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b63d08cb/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/RendezvousManager.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/RendezvousManager.java b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/RendezvousManager.java
index b2cacf8..acb5a1b 100644
--- a/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/RendezvousManager.java
+++ b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/RendezvousManager.java
@@ -1,10 +1,19 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
+/*
+* 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.
+*/
 
 package com.gemstone.gemfire.modules.session.internal.filter;
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b63d08cb/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/ServletRequestAttributeListenerImpl.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/ServletRequestAttributeListenerImpl.java b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/ServletRequestAttributeListenerImpl.java
index 1eea4c0..ab06356 100644
--- a/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/ServletRequestAttributeListenerImpl.java
+++ b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/ServletRequestAttributeListenerImpl.java
@@ -1,14 +1,19 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
 /*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
+* 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.
+*/
 
 package com.gemstone.gemfire.modules.session.internal.filter;
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b63d08cb/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/ServletRequestListenerImpl.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/ServletRequestListenerImpl.java b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/ServletRequestListenerImpl.java
index 0c1dda2..5e007dd 100644
--- a/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/ServletRequestListenerImpl.java
+++ b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/ServletRequestListenerImpl.java
@@ -1,23 +1,25 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
 /*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
+* 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.
+*/
 
 package com.gemstone.gemfire.modules.session.internal.filter;
 
 import javax.servlet.ServletRequestEvent;
 import javax.servlet.ServletRequestListener;
 
-/**
- * @author jdeppe
- */
 public class ServletRequestListenerImpl extends AbstractListener
     implements ServletRequestListener {
 

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b63d08cb/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/SessionReplicationIntegrationJUnitTest.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/SessionReplicationIntegrationJUnitTest.java b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/SessionReplicationIntegrationJUnitTest.java
index 5a4e650..0abd85e 100644
--- a/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/SessionReplicationIntegrationJUnitTest.java
+++ b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/SessionReplicationIntegrationJUnitTest.java
@@ -1,14 +1,20 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
 /*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
+* 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.
+*/
+
 package com.gemstone.gemfire.modules.session.internal.filter;
 
 import java.io.File;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b63d08cb/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/SessionReplicationJUnitTest.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/SessionReplicationJUnitTest.java b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/SessionReplicationJUnitTest.java
index 0a2bafe..ba4cbd9 100644
--- a/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/SessionReplicationJUnitTest.java
+++ b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/SessionReplicationJUnitTest.java
@@ -1,10 +1,20 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
+/*
+* 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.
+*/
+
 package com.gemstone.gemfire.modules.session.internal.filter;
 
 import com.gemstone.gemfire.modules.session.filter.SessionCachingFilter;
@@ -40,4 +50,4 @@ public class SessionReplicationJUnitTest extends CommonTests {
 
     setDoChain(true);
   }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b63d08cb/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/SessionReplicationLocalCacheJUnitTest.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/SessionReplicationLocalCacheJUnitTest.java b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/SessionReplicationLocalCacheJUnitTest.java
index ed853b4..4016c7c 100644
--- a/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/SessionReplicationLocalCacheJUnitTest.java
+++ b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/internal/filter/SessionReplicationLocalCacheJUnitTest.java
@@ -1,10 +1,20 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
+/*
+* 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.
+*/
+
 package com.gemstone.gemfire.modules.session.internal.filter;
 
 import com.gemstone.gemfire.modules.session.filter.SessionCachingFilter;
@@ -41,4 +51,4 @@ public class SessionReplicationLocalCacheJUnitTest extends CommonTests {
 
     setDoChain(true);
   }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b63d08cb/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/junit/ChildFirstClassLoader.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/junit/ChildFirstClassLoader.java b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/junit/ChildFirstClassLoader.java
index 20d0088..dd4441b 100644
--- a/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/junit/ChildFirstClassLoader.java
+++ b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/junit/ChildFirstClassLoader.java
@@ -1,10 +1,20 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
+/*
+* 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.
+*/
+
 package com.gemstone.gemfire.modules.session.junit;
 
 import java.net.URL;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b63d08cb/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/junit/NamedRunner.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/junit/NamedRunner.java b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/junit/NamedRunner.java
index 46283a4..e717c9a 100644
--- a/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/junit/NamedRunner.java
+++ b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/junit/NamedRunner.java
@@ -1,28 +1,21 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
-package com.gemstone.gemfire.modules.session.junit;
+/*
+* 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.
+*/
 
-/**
- * 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.
- */
+package com.gemstone.gemfire.modules.session.junit;
 
 import org.junit.runner.notification.RunNotifier;
 import org.junit.runners.BlockJUnit4ClassRunner;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b63d08cb/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/junit/PerTestClassLoaderRunner.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/junit/PerTestClassLoaderRunner.java b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/junit/PerTestClassLoaderRunner.java
index b5661bf..3e5c998 100644
--- a/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/junit/PerTestClassLoaderRunner.java
+++ b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/junit/PerTestClassLoaderRunner.java
@@ -1,10 +1,20 @@
-/*=========================================================================
- * Copyright (c) 2010-2014 Pivotal Software, Inc. All Rights Reserved.
- * This product is protected by U.S. and international copyright
- * and intellectual property laws. Pivotal products are covered by
- * one or more patents listed at http://www.pivotal.io/patents.
- *=========================================================================
- */
+/*
+* 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.
+*/
+
 package com.gemstone.gemfire.modules.session.junit;
 
 /**

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b63d08cb/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/junit/SeparateClassloaderTestRunner.java
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/junit/SeparateClassloaderTestRunner.java b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/junit/SeparateClassloaderTestRunner.java
index 6e47aa9..4337f5a 100644
--- a/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/junit/SeparateClassloaderTestRunner.java
+++ b/extensions/gemfire-modules-session/src/test/java/com/gemstone/gemfire/modules/session/junit/SeparateClassloaderTestRunner.java
@@ -1,3 +1,20 @@
+/*
+* 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.
+*/
+
 package com.gemstone.gemfire.modules.session.junit;
 
 import org.junit.runners.BlockJUnit4ClassRunner;

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/b63d08cb/gradle/rat.gradle
----------------------------------------------------------------------
diff --git a/gradle/rat.gradle b/gradle/rat.gradle
index 2720bea..bd95546 100644
--- a/gradle/rat.gradle
+++ b/gradle/rat.gradle
@@ -81,6 +81,7 @@ rat {
     'extensions/gemfire-modules/src/test/resources/log4j.properties',
     'extensions/gemfire-modules-tomcat7/src/test/resources/tomcat/conf/tomcat-users.xml',
     'extensions/gemfire-modules-hibernate/src/test/resources/log4j.properties',
+    'extensions/gemfire-modules-session/src/test/resources/log4j.properties',
 
     // these are test files that don't expect the first element to be a comment
     'gemfire-core/src/test/resources/com/gemstone/gemfire/management/internal/configuration/domain/CacheElementJUnitTest.xml',


[20/24] incubator-geode git commit: GEODE-14: Adding session replication assembly module

Posted by je...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/65a03287/extensions/gemfire-modules-assembly/release/3rdparty_license/open_source_licenses-vFabric_GemFire_HTTP_Session_Management_Modules_2.0.txt
----------------------------------------------------------------------
diff --git a/extensions/gemfire-modules-assembly/release/3rdparty_license/open_source_licenses-vFabric_GemFire_HTTP_Session_Management_Modules_2.0.txt b/extensions/gemfire-modules-assembly/release/3rdparty_license/open_source_licenses-vFabric_GemFire_HTTP_Session_Management_Modules_2.0.txt
new file mode 100755
index 0000000..2809c07
--- /dev/null
+++ b/extensions/gemfire-modules-assembly/release/3rdparty_license/open_source_licenses-vFabric_GemFire_HTTP_Session_Management_Modules_2.0.txt
@@ -0,0 +1,1334 @@
+open_source_licenses.txt
+
+vFabric GemFire HTTP Session Management Module 2.0
+
+===========================================================================
+
+The following copyright statements and licenses apply to various open
+source software packages (or portions thereof) that are distributed with
+this VMware Product.
+
+The VMware Product may also include other VMware components, which may
+contain additional open source software packages. One or more such
+open_source_licenses.txt files may therefore accompany this VMware Product.
+
+The VMware Product that includes this file does not necessarily use all the
+open source software packages referred to below and may also only use
+portions of a given package.
+
+===========================================================================
+TABLE OF CONTENTS
+===========================================================================
+
+The following is a listing of the open source components detailed in this
+document. This list is provided for your convenience; please read further if
+you wish to review the copyright notice(s) and the full text of the license
+associated with each component.
+
+
+SECTION 1: BSD-STYLE, MIT-STYLE, OR SIMILAR STYLE LICENSES
+
+   >>> antlr-2.7.3
+   >>> backport-util-concurrent-java_5.0
+   >>> mx4j-2.0.1
+   >>> slf4j-1.5.8
+
+
+
+SECTION 2: Apache License, V2.0
+
+   >>> blowfishj-2.14
+   >>> commons-modeler-2.0
+
+
+
+SECTION 3: Common Development and Distribution License, V1.0
+
+   >>> servlet-api-2.5
+
+
+
+SECTION 4: GNU Lesser General Public License, V2.1
+
+   >>> jgroups-2.10
+   >>> trove-1.1.b3
+
+
+
+APPENDIX. Standard License Files
+
+   >>> Apache License, V2.0
+
+   >>> GNU Lesser General Public License, V2.1
+
+   >>> Common Development and Distribution License, V1.0
+
+
+--------------- SECTION 1:  BSD-STYLE, MIT-STYLE, OR SIMILAR STYLE LICENSES ----------
+
+BSD-STYLE, MIT-STYLE, OR SIMILAR STYLE LICENSES are applicable to the following component(s).
+
+
+>>> antlr-2.7.3
+
+SOFTWARE RIGHTS
+
+ANTLR 1989-2004 Developed by Terence Parr
+Partially supported by University of San Francisco & jGuru.com
+
+We reserve no legal rights to the ANTLR--it is fully in the
+public domain. An individual or company may do whatever
+they wish with source code distributed with ANTLR or the
+code generated by ANTLR, including the incorporation of
+ANTLR, or its output, into commerical software.
+
+We encourage users to develop software with ANTLR. However,
+we do ask that credit is given to us for developing
+ANTLR. By "credit", we mean that if you use ANTLR or
+incorporate any source code into one of your programs
+(commercial product, research project, or otherwise) that
+you acknowledge this fact somewhere in the documentation,
+research report, etc... If you like ANTLR and have
+developed a nice tool with the output, please mention that
+you developed it using ANTLR. In addition, we ask that the
+headers remain intact in our source code. As long as these
+guidelines are kept, we expect to continue enhancing this
+system and expect to make other tools available as they are
+completed.
+
+The primary ANTLR guy:
+
+Terence Parr
+parrt@cs.usfca.edu
+parrt@antlr.org
+
+
+>>> backport-util-concurrent-java_5.0
+
+License
+This software is released to the public domain, in the spirit of the original code written by Doug Lea. The code can be used for any purpose, modified, and redistributed without acknowledgment. No warranty is provided, either express or implied.
+
+
+>>> mx4j-2.0.1
+
+The MX4J License, Version 1.0
+
+Copyright (c) 2001-2004 by the MX4J contributors.  All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+         1. Redistributions of source code must retain the above copyright
+            notice, this list of conditions and the following disclaimer.
+
+         2. Redistributions in binary form must reproduce the above copyright
+            notice, this list of conditions and the following disclaimer in
+            the documentation and/or other materials provided with the
+            distribution.
+
+         3. The end-user documentation included with the redistribution,
+            if any, must include the following acknowledgment:
+               "This product includes software developed by the
+                MX4J project (http://mx4j.sourceforge.net)."
+            Alternately, this acknowledgment may appear in the software itself,
+            if and wherever such third-party acknowledgments normally appear.
+
+         4. The name "MX4J" must not be used to endorse or promote
+            products derived from this software without prior written
+            permission.
+            For written permission, please contact
+            biorn_steedom [at] users [dot] sourceforge [dot] net
+
+         5. Products derived from this software may not be called "MX4J",
+            nor may "MX4J" appear in their name, without prior written
+            permission of Simone Bordet.
+
+THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED.  IN NO EVENT SHALL THE MX4J CONTRIBUTORS
+BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
+
+This software consists of voluntary contributions made by many
+individuals on behalf of the MX4J project.  For more information on
+MX4J, please see
+the MX4J website.
+
+
+>>> slf4j-1.5.8
+
+Copyright (c) 2004-2008 QOS.ch
+All rights reserved.
+
+Permission is hereby granted, free  of charge, to any person obtaining
+a  copy  of this  software  and  associated  documentation files  (the
+"Software"), to  deal in  the Software without  restriction, including
+without limitation  the rights to  use, copy, modify,  merge, publish,
+distribute,  sublicense, and/or sell  copies of  the Software,  and to
+permit persons to whom the Software  is furnished to do so, subject to
+the following conditions:
+
+The  above  copyright  notice  and  this permission  notice  shall  be
+included in all copies or substantial portions of the Software.
+
+THE  SOFTWARE IS  PROVIDED  "AS  IS", WITHOUT  WARRANTY  OF ANY  KIND,
+EXPRESS OR  IMPLIED, INCLUDING  BUT NOT LIMITED  TO THE  WARRANTIES OF
+MERCHANTABILITY,    FITNESS    FOR    A   PARTICULAR    PURPOSE    AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE,  ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+
+--------------- SECTION 2: Apache License, V2.0 ----------
+
+Apache License, V2.0 are applicable to the following component(s).
+
+
+>>> blowfishj-2.14
+
+Copyright 2004 Markus Hahn 
+
+Licensed 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.
+
+
+>>> commons-modeler-2.0
+
+This product includes software developed by
+The Apache Software Foundation (http://www.apache.org/).
+
+
+--------------- SECTION 3: Common Development and Distribution License, V1.0 ----------
+
+Common Development and Distribution License, V1.0 are applicable to the following component(s).
+
+
+>>> servlet-api-2.5
+
+The contents of this file are subject to the terms 
+of the Common Development and Distribution License 
+(the "License"). You may not use this file except 
+in compliance with the License. 
+ 
+You can obtain a copy of the license at 
+glassfish/bootstrap/legal/CDDLv1.0.txt or 
+https://glassfish.dev.java.net/public/CDDLv1.0.html. 
+See the License for the specific language governing 
+permissions and limitations under the License. 
+ 
+When distributing Covered Code, include this CDDL 
+HEADER in each file and include the License file at 
+glassfish/bootstrap/legal/CDDLv1.0.txt. If applicable, 
+add the following below this CDDL HEADER, with the 
+fields enclosed by brackets "[]" replaced with your 
+own identifying information: Portions Copyright [yyyy] 
+[name of copyright owner] 
+ 
+Copyright 2005 Sun Microsystems, Inc. All rights reserved. 
+ 
+Portions Copyright Apache Software Foundation.
+
+
+--------------- SECTION 4: GNU Lesser General Public License, V2.1 ----------
+
+GNU Lesser General Public License, V2.1 are applicable to the following component(s).
+
+
+>>> jgroups-2.10
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+
+>>> trove-1.1.b3
+
+The Trove library is licensed under the Lesser GNU Public License,
+which is included with the distribution in a file called LICENSE.txt.
+
+The PrimeFinder and HashFunctions classes in Trove are subject to the
+following license restrictions:
+
+Copyright (c) 1999 CERN - European Organization for Nuclear Research.
+
+Permission to use, copy, modify, distribute and sell this software and
+its documentation for any purpose is hereby granted without fee,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation. CERN makes no representations about the
+suitability of this software for any purpose. It is provided "as is"
+without expressed or implied warranty.
+
+
+=============== APPENDIX. Standard License Files ============== 
+
+
+
+--------------- SECTION 1: Apache License, V2.0 -----------
+
+Apache License 
+
+Version 2.0, January 2004 
+http://www.apache.org/licenses/ 
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 
+
+1. Definitions.
+
+"License" shall mean the terms and conditions for use, reproduction,
+and distribution as defined by Sections 1 through 9 of this document.
+
+"Licensor" shall mean the copyright owner or entity authorized by the
+copyright owner that is granting the License.  
+
+"Legal Entity" shall mean the union of the acting entity and all other
+entities that control, are controlled by, or are under common control
+with that entity. For the purposes of this definition, "control" means
+(i) the power, direct or indirect, to cause the direction or management
+of such entity, whether by contract or otherwise, or (ii) ownership
+of fifty percent (50%) or more of the outstanding shares, or (iii)
+beneficial ownership of such entity.
+
+"You" (or "Your") shall mean an individual or Legal Entity exercising
+permissions granted by this License.  
+
+"Source" form shall mean the preferred form for making modifications,
+including but not limited to software source code, documentation source,
+and configuration files.
+
+"Object" form shall mean any form resulting from mechanical transformation
+or translation of a Source form, including but not limited to compiled
+object code, generated documentation, and conversions to other media
+types.  
+
+"Work" shall mean the work of authorship, whether in Source or
+Object form, made available under the License, as indicated by a copyright
+notice that is included in or attached to the work (an example is provided
+in the Appendix below).  
+
+"Derivative Works" shall mean any work, whether in Source or Object form,
+that is based on (or derived from) the Work and for which the editorial
+revisions, annotations, elaborations, or other modifications represent,
+as a whole, an original work of authorship. For the purposes of this
+License, Derivative Works shall not include works that remain separable
+from, or merely link (or bind by name) to the interfaces of, the Work
+and Derivative Works thereof.
+
+"Contribution" shall mean any work of authorship, including the
+original version of the Work and any modifications or additions to
+that Work or Derivative Works thereof, that is intentionally submitted
+to Licensor for inclusion in the Work by the copyright owner or by an
+individual or Legal Entity authorized to submit on behalf of the copyright
+owner. For the purposes of this definition, "submitted" means any form of
+electronic, verbal, or written communication sent to the Licensor or its
+representatives, including but not limited to communication on electronic
+mailing lists, source code control systems, and issue tracking systems
+that are managed by, or on behalf of, the Licensor for the purpose of
+discussing and improving the Work, but excluding communication that is
+conspicuously marked or otherwise designated in writing by the copyright
+owner as "Not a Contribution."
+
+"Contributor" shall mean Licensor and any individual or Legal Entity
+on behalf of whom a Contribution has been received by Licensor and
+subsequently incorporated within the Work.
+
+2. Grant of Copyright License.
+Subject to the terms and conditions of this License, each Contributor
+hereby grants to You a perpetual, worldwide, non-exclusive, no-charge,
+royalty-free, irrevocable copyright license to reproduce, prepare
+Derivative Works of, publicly display, publicly perform, sublicense, and
+distribute the Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License.
+Subject to the terms and conditions of this License, each Contributor
+hereby grants to You a perpetual, worldwide, non-exclusive, no-charge,
+royalty- free, irrevocable (except as stated in this section) patent
+license to make, have made, use, offer to sell, sell, import, and
+otherwise transfer the Work, where such license applies only to those
+patent claims licensable by such Contributor that are necessarily
+infringed by their Contribution(s) alone or by combination of
+their Contribution(s) with the Work to which such Contribution(s)
+was submitted. If You institute patent litigation against any entity
+(including a cross-claim or counterclaim in a lawsuit) alleging that the
+Work or a Contribution incorporated within the Work constitutes direct
+or contributory patent infringement, then any patent licenses granted
+to You under this License for that Work shall terminate as of the date
+such litigation is filed.
+
+4. Redistribution.
+You may reproduce and distribute copies of the Work or Derivative Works
+thereof in any medium, with or without modifications, and in Source or
+Object form, provided that You meet the following conditions:
+
+  a. You must give any other recipients of the Work or Derivative Works
+     a copy of this License; and
+
+  b. You must cause any modified files to carry prominent notices stating
+     that You changed the files; and
+
+  c. You must retain, in the Source form of any Derivative Works that
+     You distribute, all copyright, patent, trademark, and attribution
+     notices from the Source form of the Work, excluding those notices
+     that do not pertain to any part of the Derivative Works; and
+
+  d. If the Work includes a "NOTICE" text file as part of its
+     distribution, then any Derivative Works that You distribute must
+     include a readable copy of the attribution notices contained
+     within such NOTICE file, excluding those notices that do not
+     pertain to any part of the Derivative Works, in at least one of
+     the following places: within a NOTICE text file distributed as part
+     of the Derivative Works; within the Source form or documentation,
+     if provided along with the Derivative Works; or, within a display
+     generated by the Derivative Works, if and wherever such third-party
+     notices normally appear. The contents of the NOTICE file are for
+     informational purposes only and do not modify the License. You
+     may add Your own attribution notices within Derivative Works that
+     You distribute, alongside or as an addendum to the NOTICE text
+     from the Work, provided that such additional attribution notices
+     cannot be construed as modifying the License.  You may add Your own
+     copyright statement to Your modifications and may provide additional
+     or different license terms and conditions for use, reproduction, or
+     distribution of Your modifications, or for any such Derivative Works
+     as a whole, provided Your use, reproduction, and distribution of the
+     Work otherwise complies with the conditions stated in this License.
+
+5. Submission of Contributions.
+Unless You explicitly state otherwise, any Contribution intentionally
+submitted for inclusion in the Work by You to the Licensor shall be
+under the terms and conditions of this License, without any additional
+terms or conditions.  Notwithstanding the above, nothing herein shall
+supersede or modify the terms of any separate license agreement you may
+have executed with Licensor regarding such Contributions.
+
+6. Trademarks.
+This License does not grant permission to use the trade names, trademarks,
+service marks, or product names of the Licensor, except as required for
+reasonable and customary use in describing the origin of the Work and
+reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty.
+Unless required by applicable law or agreed to in writing, Licensor
+provides the Work (and each Contributor provides its Contributions) on
+an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+express or implied, including, without limitation, any warranties or
+conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR
+A PARTICULAR PURPOSE. You are solely responsible for determining the
+appropriateness of using or redistributing the Work and assume any risks
+associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability.
+In no event and under no legal theory, whether in tort (including
+negligence), contract, or otherwise, unless required by applicable law
+(such as deliberate and grossly negligent acts) or agreed to in writing,
+shall any Contributor be liable to You for damages, including any direct,
+indirect, special, incidental, or consequential damages of any character
+arising as a result of this License or out of the use or inability to
+use the Work (including but not limited to damages for loss of goodwill,
+work stoppage, computer failure or malfunction, or any and all other
+commercial damages or losses), even if such Contributor has been advised
+of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability.
+While redistributing the Work or Derivative Works thereof, You may
+choose to offer, and charge a fee for, acceptance of support, warranty,
+indemnity, or other liability obligations and/or rights consistent with
+this License. However, in accepting such obligations, You may act only
+on Your own behalf and on Your sole responsibility, not on behalf of
+any other Contributor, and only if You agree to indemnify, defend, and
+hold each Contributor harmless for any liability incurred by, or claims
+asserted against, such Contributor by reason of your accepting any such
+warranty or additional liability.
+
+END OF TERMS AND CONDITIONS 
+
+
+
+--------------- SECTION 2: GNU Lesser General Public License, V2.1 -----------
+
+		  GNU LESSER GENERAL PUBLIC LICENSE
+		       Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+ 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL.  It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+  This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it.  You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+  When we speak of free software, we are referring to freedom of use,
+not price.  Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+  To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights.  These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+  For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you.  You must make sure that they, too, receive or can get the source
+code.  If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it.  And you must show them these terms so they know their rights.
+
+  We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+  To protect each distributor, we want to make it very clear that
+there is no warranty for the free library.  Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+
+  Finally, software patents pose a constant threat to the existence of
+any free program.  We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder.  Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+  Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License.  This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License.  We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+  When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library.  The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom.  The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+  We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License.  It also provides other free software developers Less
+of an advantage over competing non-free programs.  These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries.  However, the Lesser license provides advantages in certain
+special circumstances.
+
+  For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard.  To achieve this, non-free programs must be
+allowed to use the library.  A more frequent case is that a free
+library does the same job as widely used non-free libraries.  In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+  In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software.  For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+  Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.  Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library".  The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+
+		  GNU LESSER GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+  A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+  The "Library", below, refers to any such software library or work
+which has been distributed under these terms.  A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language.  (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+  "Source code" for a work means the preferred form of the work for
+making modifications to it.  For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+  Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it).  Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+  1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+  You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+  2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) The modified work must itself be a software library.
+
+    b) You must cause the files modified to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    c) You must cause the whole of the work to be licensed at no
+    charge to all third parties under the terms of this License.
+
+    d) If a facility in the modified Library refers to a function or a
+    table of data to be supplied by an application program that uses
+    the facility, other than as an argument passed when the facility
+    is invoked, then you must make a good faith effort to ensure that,
+    in the event an application does not supply such function or
+    table, the facility still operates, and performs whatever part of
+    its purpose remains meaningful.
+
+    (For example, a function in a library to compute square roots has
+    a purpose that is entirely well-defined independent of the
+    application.  Therefore, Subsection 2d requires that any
+    application-supplied function or table used by this function must
+    be optional: if the application does not supply it, the square
+    root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library.  To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License.  (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.)  Do not make any other change in
+these notices.
+
+  Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+  This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+  4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+  If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library".  Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+  However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library".  The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+  When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library.  The
+threshold for this to be true is not precisely defined by law.
+
+  If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work.  (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+  Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+  6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+  You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License.  You must supply a copy of this License.  If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License.  Also, you must do one
+of these things:
+
+    a) Accompany the work with the complete corresponding
+    machine-readable source code for the Library including whatever
+    changes were used in the work (which must be distributed under
+    Sections 1 and 2 above); and, if the work is an executable linked
+    with the Library, with the complete machine-readable "work that
+    uses the Library", as object code and/or source code, so that the
+    user can modify the Library and then relink to produce a modified
+    executable containing the modified Library.  (It is understood
+    that the user who changes the contents of definitions files in the
+    Library will not necessarily be able to recompile the application
+    to use the modified definitions.)
+
+    b) Use a suitable shared library mechanism for linking with the
+    Library.  A suitable mechanism is one that (1) uses at run time a
+    copy of the library already present on the user's computer system,
+    rather than copying library functions into the executable, and (2)
+    will operate properly with a modified version of the library, if
+    the user installs one, as long as the modified version is
+    interface-compatible with the version that the work was made with.
+
+    c) Accompany the work with a written offer, valid for at
+    least three years, to give the same user the materials
+    specified in Subsection 6a, above, for a charge no more
+    than the cost of performing this distribution.
+
+    d) If distribution of the work is made by offering access to copy
+    from a designated place, offer equivalent access to copy the above
+    specified materials from the same place.
+
+    e) Verify that the user has already received a copy of these
+    materials or that you have already sent this user a copy.
+
+  For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it.  However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+  It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system.  Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+  7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+    a) Accompany the combined library with a copy of the same work
+    based on the Library, uncombined with any other library
+    facilities.  This must be distributed under the terms of the
+    Sections above.
+
+    b) Give prominent notice with the combined library of the fact
+    that part of it is a work based on the Library, and explaining
+    where to find the accompanying uncombined form of the same work.
+
+  8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License.  Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License.  However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+  9. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Library or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+  10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+
+  11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded.  In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+  13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation.  If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+  14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission.  For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this.  Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+			    NO WARRANTY
+
+  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
+
+           How to Apply These Terms to Your New Libraries
+
+  If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change.  You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+  To apply these terms, attach the following notices to the library.  It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the library's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the
+  library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+  <signature of Ty Coon>, 1 April 1990
+  Ty Coon, President of Vice
+
+That's all there is to it!
+
+
+
+
+--------------- SECTION 3: Common Development and Distribution License, V1.0 -----------
+
+COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
+
+1. Definitions.
+
+1.1. "Contributor" means each individual or entity that creates or
+contributes to the creation of Modifications.
+
+1.2. "Contributor Version" means the combination of the Original Software,
+prior Modifications used by a Contributor (if any), and the Modifications
+made by that particular Contributor.
+
+1.3. "Covered Software" means (a) the Original Software, or (b)
+Modifications, or (c) the combination of files containing Original
+Software with files containing Modifications, in each case including
+portions thereof.
+
+1.4. "Executable" means the Covered Software in any form other than
+Source Code.
+
+1.5. "Initial Developer" means the individual or entity that first makes
+Original Software available under this License.
+
+1.6. "Larger Work" means a work which combines Covered Software or
+portions thereof with code not governed by the terms of this License.
+
+1.7. "License" means this document.
+
+1.8. "Licensable" means having the right to grant, to the maximum extent
+possible, whether at the time of the initial grant or subsequently
+acquired, any and all of the rights conveyed herein.
+
+1.9. "Modifications" means the Source Code and Executable form of any
+of the following:
+
+    A. Any file that results from an addition to, deletion from or
+    modification of the contents of a file containing Original Software
+    or previous Modifications;
+
+    B. Any new file that contains any part of the Original Software or
+    previous Modification; or
+
+    C. Any new file that is contributed or otherwise made available
+    under the terms of this License.
+
+1.10. "Original Software" means the Source Code and Executable form of
+computer software code that is originally released under this License.
+
+1.11. "Patent Claims" means any patent claim(s), now owned or hereafter
+acquired, including without limitation, method, process, and apparatus
+claims, in any patent Licensable by grantor.
+
+1.12. "Source Code" means (a) the common form of computer software code
+in which modifications are made and (b) associated documentation included
+in or with such code.
+
+1.13. "You" (or "Your") means an individual or a legal entity exercising
+rights under, and complying with all of the terms of, this License. For
+legal entities, "You" includes any entity which controls, is controlled
+by, or is under common control with You. For purposes of this definition,
+"control" means (a) the power, direct or indirect, to cause the direction
+or management of such entity, whether by contract or otherwise, or (b)
+ownership of more than fifty percent (50%) of the outstanding shares or
+beneficial ownership of such entity.
+
+2. License Grants. 
+
+2.1. The Initial Developer Grant.
+
+Conditioned upon Your compliance with Section 3.1 below and subject to
+third party intellectual property claims, the Initial Developer hereby
+grants You a world-wide, royalty-free, non-exclusive license:
+
+    (a) under intellectual property rights (other than patent or
+    trademark) Licensable by Initial Developer, to use, reproduce, modify,
+    display, perform, sublicense and distribute the Original Software
+    (or portions thereof), with or without Modifications, and/or as part
+    of a Larger Work; and
+
+    (b) under Patent Claims infringed by the making, using or selling
+    of Original Software, to make, have made, use, practice, sell, and
+    offer for sale, and/or otherwise dispose of the Original Software
+    (or portions thereof).
+
+    (c) The licenses granted in Sections 2.1(a) and (b) are effective
+    on the date Initial Developer first distributes or otherwise makes
+    the Original Software available to a third party under the terms of
+    this License.
+
+    (d) Notwithstanding Section 2.1(b) above, no patent license is
+    granted: (1) for code that You delete from the Original Software,
+    or (2) for infringements caused by: (i) the modification of the
+    Original Software, or (ii) the combination of the Original Software
+    with other software or devices.
+
+2.2. Contributor Grant.
+
+Conditioned upon Your compliance with Section 3.1 below and subject to
+third party intellectual property claims, each Contributor hereby grants
+You a world-wide, royalty-free, non-exclusive license:
+
+    (a) under intellectual property rights (other than patent or
+    trademark) Licensable by Contributor to use, reproduce, modify,
+    display, perform, sublicense and distribute the Modifications created
+    by such Contributor (or portions thereof), either on an unmodified
+    basis, with other Modifications, as Covered Software and/or as part
+    of a Larger Work; and
+
+    (b) under Patent Claims infringed by the making, using, or selling
+    of Modifications made by that Contributor either alone and/or
+    in combination with its Contributor Version (or portions of such
+    combination), to make, use, sell, offer for sale, have made, and/or
+    otherwise dispose of: (1) Modifications made by that Contributor
+    (or portions thereof); and (2) the combination of Modifications
+    made by that Contributor with its Contributor Version (or portions
+    of such combination).
+
+    (c) The licenses granted in Sections 2.2(a) and 2.2(b) are effective
+    on the date Contributor first distributes or otherwise makes the
+    Modifications available to a third party.
+
+    (d) Notwithstanding Section 2.2(b) above, no patent license is
+    granted: (1) for any code that Contributor has deleted from the
+    Contributor Version; (2) for infringements caused by: (i) third
+    party modifications of Contributor Version, or (ii) the combination
+    of Modifications made by that Contributor with other software
+    (except as part of the Contributor Version) or other devices; or (3)
+    under Patent Claims infringed by Covered Software in the absence of
+    Modifications made by that Contributor.
+
+3. Distribution Obligations.
+
+3.1. Availability of Source Code.
+
+Any Covered Software that You distribute or otherwise make available
+in Executable form must also be made available in Source Code form and
+that Source Code form must be distributed only under the terms of this
+License. You must include a copy of this License with every copy of the
+Source Code form of the Covered Software You distribute or otherwise make
+available. You must inform recipients of any such Covered Software in
+Executable form as to how they can obtain such Covered Software in Source
+Code form in a reasonable manner on or through a medium customarily used
+for software exchange.
+
+3.2. Modifications.
+
+The Modifications that You create or to which You contribute are governed
+by the terms of this License. You represent that You believe Your
+Modifications are Your original creation(s) and/or You have sufficient
+rights to grant the rights conveyed by this License.
+
+3.3. Required Notices.
+
+You must include a notice in each of Your Modifications that identifies
+You as the Contributor of the Modification.  You may not remove or alter
+any copyright, patent or trademark notices contained within the Covered
+Software, or any notices of licensing or any descriptive text giving
+attribution to any Contributor or the Initial Developer.
+
+3.4. Application of Additional Terms.
+
+You may not offer or impose any terms on any Covered Software in Source
+Code form that alters or restricts the applicable version of this License
+or the recipients' rights hereunder. You may choose to offer, and to
+charge a fee for, warranty, support, indemnity or liability obligations to
+one or more recipients of Covered Software.  However, you may do so only
+on Your own behalf, and not on behalf of the Initial Developer or any
+Contributor. You must make it absolutely clear that any such warranty,
+support, indemnity or liability obligation is offered by You alone, and
+You hereby agree to indemnify the Initial Developer and every Contributor
+for any liability incurred by the Initial Developer or such Contributor
+as a result of warranty, support, indemnity or liability terms You offer.
+
+3.5. Distribution of Executable Versions.
+
+You may distribute the Executable form of the Covered Software under the
+terms of this License or under the terms of a license of Your choice,
+which may contain terms different from this License, provided that You are
+in compliance with the terms of this License and that the license for the
+Executable form does not attempt to limit or alter the recipient's rights
+in the Source Code form from the rights set forth in this License. If
+You distribute the Covered Software in Executable form under a different
+license, You must make it absolutely clear that any terms which differ
+from this License are offered by You alone, not by the Initial Developer
+or Contributor. You hereby agree to indemnify the Initial Developer and
+every Contributor for any liability incurred by the Initial Developer
+or such Contributor as a result of any such terms You offer.
+
+3.6. Larger Works.
+
+You may create a Larger Work by combining Covered Software with other code
+not governed by the terms of this License and distribute the Larger Work
+as a single product. In such a case, You must make sure the requirements
+of this License are fulfilled for the Covered Software.
+
+4. Versions of the License. 
+
+4.1. New Versions.
+
+Sun Microsystems, Inc. is the initial license steward and may publish
+revised and/or new versions of this License from time to time. Each
+version will be given a distinguishing version number. Except as provided
+in Section 4.3, no one other than the license steward has the right to
+modify this License.
+
+4.2. Effect of New Versions.
+
+You may always continue to use, distribute or otherwise make the Covered
+Software available under the terms of the version of the License under
+which You originally received the Covered Software. If the Initial
+Developer includes a notice in the Original Software prohibiting it
+from being distributed or otherwise made available under any subsequent
+version of the License, You must distribute and make the Covered Software
+available under the terms of the version of the License under which You
+originally received the Covered Software. Otherwise, You may also choose
+to use, distribute or otherwise make the Covered Software available
+under the terms of any subsequent version of the License published by
+the license steward.
+
+4.3. Modified Versions.
+
+When You are an Initial Developer and You want to create a new license
+for Your Original Software, You may create and use a modified version of
+this License if You: (a) rename the license and remove any references
+to the name of the license steward (except to note that the license
+differs from this License); and (b) otherwise make it clear that the
+license contains terms which differ from this License.
+
+5. DISCLAIMER OF WARRANTY.
+
+COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+WITHOUT LIMITATION, WARRANTIES THAT THE COVERED SOFTWARE IS FREE OF
+DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE
+ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED SOFTWARE
+IS WITH YOU. SHOULD ANY COVERED SOFTWARE PROVE DEFECTIVE IN ANY RESPECT,
+YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST
+OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF
+WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY
+COVERED SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
+
+6. TERMINATION. 
+
+6.1. This License and the rights granted hereunder will terminate
+automatically if You fail to comply with terms herein and fail to cure
+such breach within 30 days of becoming aware of the breach. Provisions
+which, by their nature, must remain in effect beyond the termination of
+this License shall survive.
+
+6.2. If You assert a patent infringement claim (excluding declaratory
+judgment actions) against Initial Developer or a Contributor (the
+Initial Developer or Contributor against whom You assert such claim is
+referred to as "Participant") alleging that the Participant Software
+(meaning the Contributor Version where the Participant is a Contributor
+or the Original Software where the Participant is the Initial Developer)
+directly or indirectly infringes any patent, then any and all rights
+granted directly or indirectly to You by such Participant, the Initial
+Developer (if the Initial Developer is not the Participant) and all
+Contributors under Sections 2.1 and/or 2.2 of this License shall, upon 60
+days notice from Participant terminate prospectively and automatically
+at the expiration of such 60 day notice period, unless if within such
+60 day period You withdraw Your claim with respect to the Participant
+Software against such Participant either unilaterally or pursuant to a
+written agreement with Participant.
+
+6.3. In the event of termination under Sections 6.1 or 6.2 above, all end
+user licenses that have been validly granted by You or any distributor
+hereunder prior to termination (excluding licenses granted to You by
+any distributor) shall survive termination.
+
+7. LIMITATION OF LIABILITY.
+
+UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING
+NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL DEVELOPER, ANY
+OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED SOFTWARE, OR ANY SUPPLIER
+OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL,
+INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT
+LIMITATION, DAMAGES FOR LOST PROFITS, LOSS OF GOODWILL, WORK STOPPAGE,
+COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES
+OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY
+OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY
+FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH PARTY'S NEGLIGENCE TO
+THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS
+DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL
+DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
+
+8. U.S. GOVERNMENT END USERS.
+
+The Covered Software is a "commercial item," as that term is defined
+in 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer
+software" (as that term is defined at 48 C.F.R.  252.227-7014(a)(1)) and
+"commercial computer software documentation" as such terms are used in
+48 C.F.R. 12.212 (Sept.  1995). Consistent with 48 C.F.R. 12.212 and 48
+C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End
+Users acquire Covered Software with only those rights set forth herein.
+This U.S. Government Rights clause is in lieu of, and supersedes, any
+other FAR, DFAR, or other clause or provision that addresses Government
+rights in computer software under this License.
+
+9. MISCELLANEOUS.
+
+This License represents the complete agreement concerning subject matter
+hereof. If any provision of this License is held to be unenforceable,
+such provision shall be reformed only to the extent necessary to make it
+enforceable. This License shall be governed by the law of the jurisdiction
+specified in a notice contained within the Original Software (except to
+the extent applicable law, if any, provides otherwise), excluding such
+jurisdiction's conflict-of-law provisions. Any litigation relating to
+this License shall be subject to the jurisdiction of the courts located
+in the jurisdiction and venue specified in a notice contained within
+the Original Software, with the losing party responsible for costs,
+including, without limitation, court costs and reasonable attorneys'
+fees and expenses. The application of the United Nations Convention on
+Contracts for the International Sale of Goods is expressly excluded. Any
+law or regulation which provides that the language of a contract shall
+be construed against the drafter shall not apply to this License.
+You agree that You alone are responsible for compliance with the United
+States export administration regulations (and the export control laws and
+regulation of any other countries) when You use, distribute or otherwise
+make available any Covered Software.
+
+10. RESPONSIBILITY FOR CLAIMS.
+
+As between Initial Developer and the Contributors, each party is
+responsible for claims and damages arising, directly or indirectly, out
+of its utilization of rights under this License and You agree to work
+with Initial Developer and Contributors to distribute such responsibility
+on an equitable basis. Nothing herein is intended or shall be deemed to
+constitute any admission of liability.
+
+
+
+===========================================================================
+
+To the extent any open source components are licensed under the
+GPL and/or LGPL, or other similar licenses that require the
+source code and/or modifications to source code to be made
+available (as would be noted above), you may obtain a copy of
+the source code corresponding to the binaries for such open
+source components and modifications thereto, if any, (the
+"Source Files"), by downloading the Source Files from VMware's website at
+http://www.vmware.com/download/open_source.html, or by sending a request, with
+your name and address to: VMware, Inc., 3401 Hillview Avenue,
+Palo Alto, CA 94304,United States of America or email info@vmware.com.  All such
+requests should clearly specify:  OPEN SOURCE FILES REQUEST,
+Attention General Counsel. VMware shall mail a copy of the
+Source Files to you on a CD or equivalent physical medium.  This
+offer to obtain a copy of the Source Files is valid for three
+years from the date you acquired this Software product. Alternatively, 
+the Source Files may accompany the VMware product.
+
+[GFEHTTP20KP082911]