simple ehcache server
diff --git a/jetty-ehcache-sessions/pom.xml b/jetty-ehcache-sessions/pom.xml
new file mode 100644
index 0000000..b8fade0
--- /dev/null
+++ b/jetty-ehcache-sessions/pom.xml
@@ -0,0 +1,135 @@
+<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">
+ <parent>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-project</artifactId>
+ <version>7.5.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>jetty-ehcache-sessions</artifactId>
+ <properties>
+ <jetty-version>${project.version}</jetty-version>
+ <junit4-version>${junit-version}</junit4-version>
+ <bundle-symbolic-name>${project.groupId}.mongodb</bundle-symbolic-name> </properties>
+ <build>
+ <defaultGoal>install</defaultGoal>
+ <plugins>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.6</source>
+ <target>1.6</target>
+ <verbose>false</verbose>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <configuration>
+ <instructions>
+ <Import-Package>javax.servlet.*;version="[2.5,3.0)",org.eclipse.jetty.server.session.jmx;version="[7.5,8)";resolution:=optional,,org.eclipse.jetty.*;version="[7.5,8)",*</Import-Package>
+ </instructions>
+ </configuration>
+ <extensions>true</extensions>
+ <executions>
+ <execution>
+ <goals>
+ <goal>manifest</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>artifact-jar</id>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <archive>
+ <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
+ </archive>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>copy</id>
+ <phase>generate-resources</phase>
+ <goals>
+ <goal>copy</goal>
+ </goals>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>net.sf.ehcache</groupId>
+ <artifactId>ehcache-server</artifactId>
+ <version>1.0.0</version>
+ <type>war</type>
+ <overWrite>true</overWrite>
+ <outputDirectory>${project.build.directory}</outputDirectory>
+ <destFileName>ehcache-server.war</destFileName>
+ </artifactItem>
+ </artifactItems>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-server</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>${junit4-version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-jmx</artifactId>
+ <version>${project.version}</version>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>net.sf.ehcache</groupId>
+ <artifactId>ehcache-core</artifactId>
+ <version>2.4.4</version>
+ <type>jar</type>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.jetty.toolchain</groupId>
+ <artifactId>jetty-test-helper</artifactId>
+ <version>1.6</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>1.5.8</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ <version>1.5.8</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse.jetty.tests</groupId>
+ <artifactId>test-sessions-common</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+</project>
diff --git a/jetty-ehcache-sessions/src/test/java/org/eclipse/jetty/nosql/ehcache/EhcacheServer.java b/jetty-ehcache-sessions/src/test/java/org/eclipse/jetty/nosql/ehcache/EhcacheServer.java
new file mode 100644
index 0000000..f7f2a5c
--- /dev/null
+++ b/jetty-ehcache-sessions/src/test/java/org/eclipse/jetty/nosql/ehcache/EhcacheServer.java
@@ -0,0 +1,69 @@
+package org.eclipse.jetty.nosql.ehcache;
+
+import java.net.URI;
+
+import org.eclipse.jetty.server.Connector;
+import org.eclipse.jetty.server.Server;
+import org.eclipse.jetty.server.nio.SelectChannelConnector;
+import org.eclipse.jetty.toolchain.test.MavenTestingUtils;
+import org.eclipse.jetty.webapp.WebAppContext;
+
+public class EhcacheServer
+{
+ private Server _server;
+ private int _port;
+ private String _host;
+ private String _path;
+
+ public EhcacheServer()
+ {
+
+ }
+
+ public void start() throws Exception
+ {
+ _server = new Server();
+
+ Connector connector = new SelectChannelConnector();
+ _server.setConnectors(new Connector[] { connector });
+
+ String war = MavenTestingUtils.getTargetFile("ehcache-server.war").getAbsolutePath();
+
+ WebAppContext webapp = new WebAppContext();
+ webapp.setWar(war);
+ webapp.setParentLoaderPriority(true);
+ _server.setHandler(webapp);
+
+ _server.start();
+
+ _port = connector.getLocalPort();
+ _host = connector.getHost();
+ if (_host == null)
+ {
+ _host = "localhost";
+ }
+ _path = webapp.getContextPath();
+ }
+
+
+ public void stop() throws Exception
+ {
+ _server.stop();
+
+ _server = null;
+ }
+
+ public URI getURI() throws Exception
+ {
+ return new URI("http://" + _host + ":" + _port + _path);
+
+ }
+
+ public static void main(String[] args) throws Exception
+ {
+ EhcacheServer cacheServer = new EhcacheServer();
+ cacheServer.start();
+
+ System.out.println(cacheServer.getURI());
+ }
+}