Commits

Andy Moncsek committed 4d05daa

initial nosql demo commit

Comments (0)

Files changed (36)

+<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>
+    <parent>
+        <groupId>org.jacp.jee</groupId>
+        <artifactId>JEE7-websocket</artifactId>
+        <version>1.0</version>
+    </parent>
+    <artifactId>Domain-NOSQL</artifactId>
+    <dependencies>
+        <!-- JPA api -->
+        <dependency>
+            <groupId>org.eclipse.persistence</groupId>
+            <artifactId>javax.persistence</artifactId>
+            <version>${javax.persistence.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.eclipse.persistence</groupId>
+            <artifactId>org.eclipse.persistence.jpa</artifactId>
+            <version>2.5.0-SNAPSHOT</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.eclipse.persistence</groupId>
+            <artifactId>org.eclipse.persistence.nosql</artifactId>
+            <version>2.5.0-SNAPSHOT</version>
+            <scope>provided</scope>
+        </dependency>
+    </dependencies>
+
+</project>

Domain-NOSQL/src/main/java/org/jacp/jee/nosql/constants/Constants.java

+package org.jacp.jee.nosql.constants;
+
+public class Constants {
+    /**
+     * Name of the persistence unit as referenced in the persistence.xml
+     * deployment descriptor file.
+     */
+    public static final String PU = "mongo-example";
+}

Domain-NOSQL/src/main/java/org/jacp/jee/nosql/entity/Tweet.java

+/*
+ * Copyright (c) 2013, Andy Moncsek, inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are permitted provided
+ * that the following conditions are met:
+ *
+ *    Redistributions of source code must retain the above copyright notice, this list of conditions and the
+ *    following disclaimer.
+ *
+ *    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.
+ *
+ *    Neither the name of Andy Moncsek, inc. nor the names of its contributors may be used to endorse or
+ *    promote products derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS 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 COPYRIGHT OWNER OR 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.
+ */
+
+package org.jacp.jee.nosql.entity;
+
+import org.eclipse.persistence.nosql.annotations.DataFormatType;
+import org.eclipse.persistence.nosql.annotations.NoSql;
+
+import javax.persistence.Basic;
+import javax.persistence.Embeddable;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * Created with IntelliJ IDEA.
+ * User: Andy Moncsek
+ * Date: 11.03.13
+ * Time: 09:14
+ * To change this template use File | Settings | File Templates.
+ */
+@Embeddable
+@NoSql(dataFormat = DataFormatType.MAPPED)
+public class Tweet implements Serializable, Comparable<Tweet> {
+    @Temporal(TemporalType.DATE)
+    private Date created_at;
+    @Basic
+    private String from_user;
+    @Basic
+    private String profile_image_url;
+    @Basic
+    private String text;
+
+    public Tweet() {
+
+    }
+
+    public Tweet(Date created_at, String from_user, String profile_image_url, String text) {
+        this.created_at = created_at;
+        this.from_user = from_user;
+        this.profile_image_url = profile_image_url;
+        this.text = text;
+    }
+
+    public Date getCreated_at() {
+        return created_at;
+    }
+
+    public void setCreated_at(Date created_at) {
+        this.created_at = created_at;
+    }
+
+    public String getFrom_user() {
+        return from_user;
+    }
+
+    public void setFrom_user(String from_user) {
+        this.from_user = from_user;
+    }
+
+    public String getProfile_image_url() {
+        return profile_image_url;
+    }
+
+    public void setProfile_image_url(String profile_image_url) {
+        this.profile_image_url = profile_image_url;
+    }
+
+    public String getText() {
+        return text;
+    }
+
+    public void setText(String text) {
+        this.text = text;
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) return true;
+        if (o == null || getClass() != o.getClass()) return false;
+
+        Tweet tweet = (Tweet) o;
+
+        if (created_at != null ? !created_at.equals(tweet.created_at) : tweet.created_at != null) return false;
+        if (from_user != null ? !from_user.equals(tweet.from_user) : tweet.from_user != null) return false;
+        if (profile_image_url != null ? !profile_image_url.equals(tweet.profile_image_url) : tweet.profile_image_url != null)
+            return false;
+        return !(text != null ? !text.equals(tweet.text) : tweet.text != null);
+
+    }
+
+    @Override
+    public int hashCode() {
+        int result = created_at != null ? created_at.hashCode() : 0;
+        result = 31 * result + (from_user != null ? from_user.hashCode() : 0);
+        result = 31 * result + (profile_image_url != null ? profile_image_url.hashCode() : 0);
+        result = 31 * result + (text != null ? text.hashCode() : 0);
+        return result;
+    }
+
+    @Override
+    public int compareTo(Tweet o) {
+        return this.created_at.compareTo(o.getCreated_at());
+    }
+}

Domain-NOSQL/src/main/java/org/jacp/jee/nosql/entity/TweetQuery.java

+/*
+ * Copyright (c) 2013, Andy Moncsek, inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are permitted provided
+ * that the following conditions are met:
+ *
+ *    Redistributions of source code must retain the above copyright notice, this list of conditions and the
+ *    following disclaimer.
+ *
+ *    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.
+ *
+ *    Neither the name of Andy Moncsek, inc. nor the names of its contributors may be used to endorse or
+ *    promote products derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS 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 COPYRIGHT OWNER OR 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.
+ */
+
+package org.jacp.jee.nosql.entity;
+
+import org.eclipse.persistence.nosql.annotations.DataFormatType;
+import org.eclipse.persistence.nosql.annotations.NoSql;
+
+import javax.persistence.Basic;
+import javax.persistence.Embeddable;
+import javax.persistence.NamedQueries;
+import javax.persistence.NamedQuery;
+import java.io.Serializable;
+
+/**
+ * Created with IntelliJ IDEA.
+ * User: ady
+ * Date: 18.03.13
+ * Time: 20:55
+ * To change this template use File | Settings | File Templates.
+ */
+@Embeddable
+@NoSql(dataFormat = DataFormatType.MAPPED)
+@NamedQueries({@NamedQuery(name = "TweetQuery.getAllTweetQueries", query = "Select t from TwitterResult t ")})
+public class TweetQuery implements Serializable {
+    @Basic
+    private String query;
+
+    public TweetQuery(String query) {
+        this.query = query;
+    }
+
+    public TweetQuery() {
+    }
+
+    public String getQuery() {
+        return query;
+    }
+
+    public void setQuery(String query) {
+        this.query = query;
+    }
+}

Domain-NOSQL/src/main/java/org/jacp/jee/nosql/entity/TwitterResult.java

+package org.jacp.jee.nosql.entity;
+
+import org.eclipse.persistence.nosql.annotations.DataFormatType;
+import org.eclipse.persistence.nosql.annotations.Field;
+import org.eclipse.persistence.nosql.annotations.NoSql;
+
+import javax.persistence.*;
+import javax.xml.bind.annotation.XmlRootElement;
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * Created with IntelliJ IDEA.
+ * User: Andy Moncsek
+ * Date: 11.03.13
+ * Time: 09:13
+ * To change this template use File | Settings | File Templates.
+ */
+@Entity
+@NamedQueries({@NamedQuery(name = "TwitterResult.getAll", query = "Select t from TwitterResult t"), @NamedQuery(name = "TwitterResult.getAllByTweetQuery", query = "SELECT c FROM TwitterResult c WHERE c.tweetQuery = :query"),@NamedQuery(name = "TwitterResult.getAllTweetQueries", query = "Select DISTINCT t.tweetQuery from TwitterResult t")})
+@NoSql(dataFormat = DataFormatType.MAPPED)
+public class TwitterResult implements Serializable {
+    @Id
+    @GeneratedValue
+    @Field(name = "_id")
+    private String id;
+    /* Optimistic locking is supported. */
+    @Version
+    private long version;
+
+    @Embedded
+    private TweetQuery tweetQuery;
+    @Basic
+    private String max_id;
+    @ElementCollection
+    private List<Tweet> results;
+
+
+    public String getMax_id() {
+        return max_id;
+    }
+
+    public void setMax_id(String max_id) {
+        this.max_id = max_id;
+    }
+
+    public List<Tweet> getResults() {
+        return results;
+    }
+
+    public void setResults(List<Tweet> results) {
+        this.results = results;
+    }
+
+
+}

Domain-NOSQL/src/main/resources/META-INF/persistence.xml

+<?xml version="1.0" encoding="UTF-8"?>
+<persistence xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+             version="2.0"
+             xmlns="http://java.sun.com/xml/ns/persistence"
+             xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
+
+
+    <persistence-unit name="mongo-example" transaction-type="JTA">
+        <exclude-unlisted-classes>false</exclude-unlisted-classes>
+        <properties>
+            <property name="eclipselink.target-database" value="org.eclipse.persistence.nosql.adapters.mongo.MongoPlatform"/>
+            <property name="eclipselink.nosql.connection-spec" value="org.eclipse.persistence.nosql.adapters.mongo.MongoConnectionSpec"/>
+            <property name="eclipselink.nosql.property.mongo.port" value="27017, 27017"/>
+            <property name="eclipselink.nosql.property.mongo.host" value="192.168.32.128, 192.168.32.129"/>
+            <property name="eclipselink.nosql.property.mongo.db" value="mydb"/>
+            <property name="eclipselink.logging.level" value="FINEST"/>
+        </properties>
+    </persistence-unit>
+</persistence>

Domain/src/main/java/org/jacp/jee/App.java

-package org.jacp.jee;
-
-/**
- * Hello world!
- */
-public class App {
-    public static void main(String[] args) {
-        System.out.println("Hello World!");
-    }
-}
+<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>
+    <parent>
+        <groupId>org.jacp.jee</groupId>
+        <artifactId>JEE7-websocket</artifactId>
+        <version>1.0</version>
+    </parent>
+    <artifactId>EAR-NOSQL</artifactId>
+    <packaging>ear</packaging>
+    <name>EAR-NOSQL</name>
+    <build>
+        <plugins>
+
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-ear-plugin</artifactId>
+                <version>2.8</version>
+                <configuration>
+                    <version>6</version>
+                    <modules>
+                        <jarModule>
+                            <groupId>${project.groupId}</groupId>
+                            <artifactId>Domain-NOSQL</artifactId>
+                            <bundleDir>/lib</bundleDir>
+                        </jarModule>
+                        <jarModule>
+                            <groupId>org.eclipse.persistence</groupId>
+                            <artifactId>org.eclipse.persistence.nosql</artifactId>
+                            <bundleDir>/lib</bundleDir>
+                        </jarModule>
+                        <jarModule>
+                            <groupId>org.mongodb</groupId>
+                            <artifactId>mongo-java-driver</artifactId>
+                            <bundleDir>/lib</bundleDir>
+                        </jarModule>
+                        <jarModule>
+                            <groupId>com.google.code.gson</groupId>
+                            <artifactId>gson</artifactId>
+                            <bundleDir>/lib</bundleDir>
+                        </jarModule>
+						<jarModule>
+                            <groupId>${project.groupId}</groupId>
+                            <artifactId>EJBClient-NOSQL</artifactId>
+                            <bundleDir>/lib</bundleDir>
+                        </jarModule>
+                        <ejbModule>
+                            <groupId>${project.groupId}</groupId>
+                            <artifactId>EJB-NOSQL</artifactId>
+                        </ejbModule>
+                        <webModule>
+                            <groupId>${project.groupId}</groupId>
+                            <artifactId>WebClient-NOSQL</artifactId>
+                        </webModule>
+                    </modules>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+    <dependencies>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>Domain-NOSQL</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+		<dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>EJB-NOSQL</artifactId>
+            <version>${project.version}</version>
+			<type>ejb</type>
+        </dependency>
+	    <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>EJBClient-NOSQL</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>WebClient-NOSQL</artifactId>
+            <version>${project.version}</version>
+            <type>war</type>
+        </dependency>
+        <dependency>
+            <groupId>com.google.code.gson</groupId>
+            <artifactId>gson</artifactId>
+            <version>${gson.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.eclipse.persistence</groupId>
+            <artifactId>org.eclipse.persistence.nosql</artifactId>
+            <version>2.5.0-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.mongodb</groupId>
+            <artifactId>mongo-java-driver</artifactId>
+            <version>${mongodb.version}</version>
+        </dependency>
+    </dependencies>
+</project>

EAR-NOSQL/src/main/application/META-INF/glassfish-resources.xml

+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE resources PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Resource Definitions //EN"
+        "http://glassfish.org/dtds/glassfish-resources_1_5.dtd">
+<resources>
+
+    <jdbc-resource jndi-name="jdbc/messageDS" pool-name="jdbc/newsAppDSPool"/>
+
+    <jdbc-connection-pool name="jdbc/newsAppDSPool" datasource-classname="org.apache.derby.jdbc.EmbeddedDataSource"
+                          max-pool-size="5" pool-resize-quantity="1" res-type="javax.sql.DataSource"
+                          statement-timeout-in-seconds="60" steady-pool-size="0">
+        <property name="dataBaseName" value="NewsDB"/>
+        <property name="User" value="APP"/>
+        <property name="Password" value="APP"/>
+        <property name="connectionAttributes" value=";create=true"/>
+        <property name="driverType" value="4"/>
+    </jdbc-connection-pool>
+
+</resources>

EAR-NOSQL/src/main/java/org/jacp/jee/App.java

+package org.jacp.jee;
+
+/**
+ * Hello world!
+ */
+public class App {
+    public static void main(String[] args) {
+        System.out.println("Hello World!");
+    }
+}

EAR-NOSQL/src/test/java/org/jacp/jee/AppTest.java

+package org.jacp.jee;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+/**
+ * Unit test for simple App.
+ */
+public class AppTest
+        extends TestCase {
+    /**
+     * Create the test case
+     *
+     * @param testName name of the test case
+     */
+    public AppTest(String testName) {
+        super(testName);
+    }
+
+    /**
+     * @return the suite of tests being tested
+     */
+    public static Test suite() {
+        return new TestSuite(AppTest.class);
+    }
+
+    /**
+     * Rigourous Test :-)
+     */
+    public void testApp() {
+        assertTrue(true);
+    }
+}
+<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>
+    <parent>
+        <groupId>org.jacp.jee</groupId>
+        <artifactId>JEE7-websocket</artifactId>
+        <version>1.0</version>
+    </parent>
+    <name>EJB-NOSQL</name>
+    <artifactId>EJB-NOSQL</artifactId>
+    <packaging>ejb</packaging>
+    <build>
+        <plugins>
+            <plugin>
+                <artifactId>maven-ejb-plugin</artifactId>
+                <configuration>
+                    <ejbVersion>3.1</ejbVersion>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+    <dependencies>
+        <dependency>
+            <groupId>javax</groupId>
+            <artifactId>javaee-api</artifactId>
+            <version>${jee.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>Domain-NOSQL</artifactId>
+            <version>${project.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>EJBClient-NOSQL</artifactId>
+            <version>${project.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>com.google.code.gson</groupId>
+            <artifactId>gson</artifactId>
+            <version>${gson.version}</version>
+            <scope>provided</scope>
+        </dependency>
+    </dependencies>
+</project>

EJB-NOSQL/src/main/java/org/jacp/jee/beans/TwitterRepository.java

+/*
+ * Copyright (c) 2013, Andy Moncsek, inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are permitted provided
+ * that the following conditions are met:
+ *
+ *    Redistributions of source code must retain the above copyright notice, this list of conditions and the
+ *    following disclaimer.
+ *
+ *    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.
+ *
+ *    Neither the name of Andy Moncsek, inc. nor the names of its contributors may be used to endorse or
+ *    promote products derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS 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 COPYRIGHT OWNER OR 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.
+ */
+
+package org.jacp.jee.beans;
+
+import org.jacp.jee.api.TwitterRepositoryRemote;
+import org.jacp.jee.nosql.entity.TweetQuery;
+import org.jacp.jee.nosql.entity.TwitterResult;
+
+import javax.ejb.Remote;
+import javax.ejb.Stateless;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+import javax.persistence.TypedQuery;
+import java.util.List;
+
+/**
+ * Created with IntelliJ IDEA.
+ * User: ady
+ * Date: 18.03.13
+ * Time: 21:30
+ * To change this template use File | Settings | File Templates.
+ */
+@Stateless(mappedName = "TwitterRepository")
+@Remote(TwitterRepositoryRemote.class)
+public class TwitterRepository implements TwitterRepositoryRemote {
+    @PersistenceContext(unitName = "mongo-example")
+    private EntityManager em;
+
+    @Override
+    public List<TweetQuery> getAllAvailableTweetQueries() {
+        TypedQuery<TweetQuery> query =
+                em.createNamedQuery("TwitterResult.getAllTweetQueries", TweetQuery.class);
+        return query.getResultList();
+    }
+
+    @Override
+    public List<TwitterResult> getTwitterResultsByQuery(TweetQuery tQuery){
+        TypedQuery<TwitterResult> query =
+                em.createNamedQuery("TwitterResult.getAllByTweetQuery", TwitterResult.class);
+        query.setParameter("query",query);
+        return query.getResultList();
+    }
+
+    @Override
+    public List<TwitterResult> getAllTwitterResults(){
+        TypedQuery<TwitterResult> query =
+                em.createNamedQuery("TwitterResult.getAll", TwitterResult.class);
+        return query.getResultList();
+    }
+
+    @Override
+    public void save(TwitterResult result) {
+        em.persist(result);
+    }
+}

EJB-NOSQL/src/main/java/org/jacp/jee/beans/TwitterScheduer.java

+package org.jacp.jee.beans;
+
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+import org.jacp.jee.api.TwitterRepositoryRemote;
+import org.jacp.jee.nosql.entity.TwitterResult;
+
+import javax.ejb.*;
+import javax.ejb.Timer;
+import javax.inject.Named;
+import javax.ws.rs.client.Client;
+import javax.ws.rs.client.ClientBuilder;
+import javax.ws.rs.client.Entity;
+import javax.ws.rs.client.WebTarget;
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.net.URLConnection;
+import java.util.*;
+
+/**
+ * Created with IntelliJ IDEA.
+ * User: ady
+ * Date: 20.03.13
+ * Time: 11:12
+ * To change this template use File | Settings | File Templates.
+ */
+@Singleton(mappedName = "TwitterScheduer")
+@Startup
+@Local
+@Named
+public class TwitterScheduer {
+    @EJB(mappedName = "TwitterRepository")
+    private TwitterRepositoryRemote repo;
+    List<String> list = new ArrayList<>(Arrays.asList("glassfish", "gf_jersey", "websockets", "java","javafx","oracle"));
+    private Gson parser = new GsonBuilder()
+            .setDateFormat("EEE, dd MMM yyyy HH:mm:ss zzz").create();
+    @Schedule(hour = "*", minute = "*", second = "*/2")
+    public void sendTweets() {
+        getFeedbackDataAndSave();
+
+    }
+
+    @Asynchronous
+    public void getFeedbackDataAndSave() {
+        for(String query : list) {
+            String message = getFeedData(query);
+            TwitterResult result=  parser.fromJson(message, TwitterResult.class);
+            repo.save(result);
+            System.out.println(message);
+        }
+    }
+
+
+
+
+    private String getFeedData(String input) {
+        StringBuilder sb = new StringBuilder();
+        String searchURL = "http://search.twitter.com/search.json?q=" + input + "&rpp=5&include_entities=true" +
+                "&with_twitter_user_id=true&result_type=mixed";
+        try {
+            URL twitter = new URL(searchURL);
+            URLConnection yc;
+
+            yc = twitter.openConnection();
+
+
+            BufferedReader in = new BufferedReader(
+                    new InputStreamReader(
+                            yc.getInputStream()));
+            String inputLine;
+
+            while ((inputLine = in.readLine()) != null) {
+                sb.append(inputLine);
+
+            }
+            in.close();
+
+            return sb.toString();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        return "Error in getting data from the feeds ";
+    }
+}

EJB-NOSQL/src/test/java/org/jacp/jee/AppTest.java

+package org.jacp.jee;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+/**
+ * Unit test for simple App.
+ */
+public class AppTest
+        extends TestCase {
+    /**
+     * Create the test case
+     *
+     * @param testName name of the test case
+     */
+    public AppTest(String testName) {
+        super(testName);
+    }
+
+    /**
+     * @return the suite of tests being tested
+     */
+    public static Test suite() {
+        return new TestSuite(AppTest.class);
+    }
+
+    /**
+     * Rigourous Test :-)
+     */
+    public void testApp() {
+        assertTrue(true);
+    }
+}

EJBClient-NOSQL/pom.xml

+<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>
+    <parent>
+        <groupId>org.jacp.jee</groupId>
+        <artifactId>JEE7-websocket</artifactId>
+        <version>1.0</version>
+    </parent>
+    <artifactId>EJBClient-NOSQL</artifactId>
+    <name>EJBClient-NOSQL</name>
+    <dependencies>
+        <!-- JEE api -->
+        <dependency>
+            <groupId>javax</groupId>
+            <artifactId>javaee-api</artifactId>
+            <version>${jee.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <!-- Project specific dependencies -->
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>Domain-NOSQL</artifactId>
+            <version>${project.version}</version>
+            <scope>provided</scope>
+        </dependency>
+    </dependencies>
+
+</project>

EJBClient-NOSQL/src/main/java/META-INF/MANIFEST.MF

+Manifest-Version: 1.0
+Class-Path: 
+

EJBClient-NOSQL/src/main/java/org/jacp/jee/App.java

+package org.jacp.jee;
+
+/**
+ * Hello world!
+ */
+public class App {
+    public static void main(String[] args) {
+        System.out.println("Hello World!");
+    }
+}

EJBClient-NOSQL/src/main/java/org/jacp/jee/api/TwitterRepositoryRemote.java

+package org.jacp.jee.api;
+
+import org.jacp.jee.nosql.entity.TweetQuery;
+import org.jacp.jee.nosql.entity.TwitterResult;
+
+import java.util.List;
+
+/**
+ * Created with IntelliJ IDEA.
+ * User: ady
+ * Date: 20.03.13
+ * Time: 10:57
+ * To change this template use File | Settings | File Templates.
+ */
+public interface TwitterRepositoryRemote {
+    List<TweetQuery> getAllAvailableTweetQueries();
+
+    List<TwitterResult> getTwitterResultsByQuery(TweetQuery tQuery);
+
+    List<TwitterResult> getAllTwitterResults();
+
+    void save(TwitterResult result);
+}

JacpFXSSETwitterClient/pom.xml

             <version>${jersey.version}</version>
             <scope>compile</scope>
         </dependency>
+        <dependency>
+            <groupId>com.google.code.gson</groupId>
+            <artifactId>gson</artifactId>
+            <version>${gson.version}</version>
+        </dependency>
     </dependencies>
 </project>

JacpFXSSETwitterClient/src/main/java/org/jacp/twitter/callbacks/SSEEndpoint.java

 import com.google.gson.GsonBuilder;
 import javafx.event.Event;
 import org.glassfish.jersey.SslConfigurator;
+import org.glassfish.jersey.media.sse.EventListener;
 import org.glassfish.jersey.media.sse.EventSource;
 import org.glassfish.jersey.media.sse.InboundEvent;
 import org.jacp.api.action.IAction;
 
     private URI getURI() {
         try {
-            return new URI("http", null, "localhost", 8080, "/WebClient-SSE/twittersse", null, null);
+            //return new URI("http", null, "192.168.32.130", 80, "/WebClient-SSE/twittersse", null, null);
+           return new URI("http", null, "localhost", 8080, "/WebClient-SSE/twittersse", null, null);
         } catch (URISyntaxException e) {
             e.printStackTrace();
             return null;
             <version>2.4</version>
             <classifier>jdk15</classifier>
         </dependency>
+        <dependency>
+            <groupId>com.google.code.gson</groupId>
+            <artifactId>gson</artifactId>
+            <version>${gson.version}</version>
+        </dependency>
     </dependencies>
 
 </project>

WebClient-NOSQL/pom.xml

+<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>
+    <parent>
+        <groupId>org.jacp.jee</groupId>
+        <artifactId>JEE7-websocket</artifactId>
+        <version>1.0</version>
+    </parent>
+    <artifactId>WebClient-NOSQL</artifactId>
+    <packaging>war</packaging>
+    <dependencies>
+        <dependency>
+            <groupId>javax</groupId>
+            <artifactId>javaee-api</artifactId>
+            <version>${jee.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>Domain-NOSQL</artifactId>
+            <version>${project.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>EJBClient-NOSQL</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+		<dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>EJB-NOSQL</artifactId>
+            <version>${project.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.glassfish.jersey.core</groupId>
+            <artifactId>jersey-client</artifactId>
+            <version>${jersey.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.glassfish.jersey.containers</groupId>
+            <artifactId>jersey-container-servlet</artifactId>
+            <version>${jersey.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.glassfish.jersey.media</groupId>
+            <artifactId>jersey-media-sse</artifactId>
+            <version>${jersey.version}</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>net.sf.json-lib</groupId>
+            <artifactId>json-lib</artifactId>
+            <version>2.4</version>
+            <classifier>jdk15</classifier>
+        </dependency>
+    </dependencies>
+</project>

WebClient-NOSQL/src/main/java/org/jacp/beans/TwitterAccessBean.java

+package org.jacp.beans;
+
+import org.jacp.jee.api.TwitterRepositoryRemote;
+import org.jacp.jee.nosql.entity.TweetQuery;
+import org.jacp.jee.nosql.entity.TwitterResult;
+
+import javax.ejb.EJB;
+import javax.ejb.Stateless;
+import java.util.List;
+
+/**
+ * Created with IntelliJ IDEA.
+ * User: ady
+ * Date: 20.03.13
+ * Time: 16:06
+ * To change this template use File | Settings | File Templates.
+ */
+@Stateless(mappedName = "TwitterAccessBean")
+public class TwitterAccessBean {
+    @EJB(mappedName = "TwitterRepository")
+    private TwitterRepositoryRemote repo;
+
+    List<TweetQuery> getAllAvailableTweetQueries(){
+        return repo.getAllAvailableTweetQueries();
+    }
+
+    List<TwitterResult> getTwitterResultsByQuery(TweetQuery tQuery){
+        return repo.getTwitterResultsByQuery(tQuery);
+    }
+
+    List<TwitterResult> getAllTwitterResults(){
+        return repo.getAllTwitterResults();
+    }
+}

WebClient-NOSQL/src/main/webapp/WEB-INF/beans.xml

+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+
+    Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved.
+
+    The contents of this file are subject to the terms of either the GNU
+    General Public License Version 2 only ("GPL") or the Common Development
+    and Distribution License("CDDL") (collectively, the "License").  You
+    may not use this file except in compliance with the License.  You can
+    obtain a copy of the License at
+    http://glassfish.java.net/public/CDDL+GPL_1_1.html
+    or packager/legal/LICENSE.txt.  See the License for the specific
+    language governing permissions and limitations under the License.
+
+    When distributing the software, include this License Header Notice in each
+    file and include the License file at packager/legal/LICENSE.txt.
+
+    GPL Classpath Exception:
+    Oracle designates this particular file as subject to the "Classpath"
+    exception as provided by Oracle in the GPL Version 2 section of the License
+    file that accompanied this code.
+
+    Modifications:
+    If applicable, add the following below the License Header, with the fields
+    enclosed by brackets [] replaced by your own identifying information:
+    "Portions Copyright [year] [name of copyright owner]"
+
+    Contributor(s):
+    If you wish your version of this file to be governed by only the CDDL or
+    only the GPL Version 2, indicate your decision by adding "[Contributor]
+    elects to include this software in this distribution under the [CDDL or GPL
+    Version 2] license."  If you don't indicate a single choice of license, a
+    recipient has the option to distribute your version of this file under
+    either the CDDL, the GPL Version 2 or to extend the choice of license to
+    its licensees as provided above.  However, if you add GPL Version 2 code
+    and therefore, elected the GPL Version 2 license, then the option applies
+    only if the new code is made subject to such option by the copyright
+    holder.
+
+-->
+<beans/>

WebClient-NOSQL/src/main/webapp/WEB-INF/glassfish-web.xml

+<!DOCTYPE glassfish-web-app PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Servlet 3.0//EN"
+        "http://glassfish.org/dtds/glassfish-web-app_3_0-1.dtd">
+<glassfish-web-app error-url="">
+    <context-root>/WebClient-SSE</context-root>
+    <class-loader delegate="true"/>
+    <jsp-config>
+        <property name="keepgenerated" value="true">
+            <description>Keep a copy of the generated servlet class' java code.</description>
+        </property>
+    </jsp-config>
+</glassfish-web-app>

WebClient-NOSQL/src/main/webapp/WEB-INF/web.xml

+<?xml version="1.0" encoding="UTF-8"?>
+<web-app version="3.0"
+         xmlns="http://java.sun.com/xml/ns/javaee"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
+
+    <display-name>WebClient-NOSQL</display-name>
+    <distributable />
+    <welcome-file-list>
+        <welcome-file>index.jsp</welcome-file>
+    </welcome-file-list>
+
+</web-app>

WebClient-NOSQL/src/main/webapp/index.jsp

+<%-- 
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common Development
+ * and Distribution License("CDDL") (collectively, the "License").  You
+ * may not use this file except in compliance with the License.  You can
+ * obtain a copy of the License at
+ * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html
+ * or packager/legal/LICENSE.txt.  See the License for the specific
+ * language governing permissions and limitations under the License.
+ *
+ * When distributing the software, include this License Header Notice in each
+ * file and include the License file at packager/legal/LICENSE.txt.
+ *
+ * GPL Classpath Exception:
+ * Oracle designates this particular file as subject to the "Classpath"
+ * exception as provided by Oracle in the GPL Version 2 section of the License
+ * file that accompanied this code.
+ *
+ * Modifications:
+ * If applicable, add the following below the License Header, with the fields
+ * enclosed by brackets [] replaced by your own identifying information:
+ * "Portions Copyright [year] [name of copyright owner]"
+ *
+ * Contributor(s):
+ * If you wish your version of this file to be governed by only the CDDL or
+ * only the GPL Version 2, indicate your decision by adding "[Contributor]
+ * elects to include this software in this distribution under the [CDDL or GPL
+ * Version 2] license."  If you don't indicate a single choice of license, a
+ * recipient has the option to distribute your version of this file under
+ * either the CDDL, the GPL Version 2 or to extend the choice of license to
+ * its licensees as provided above.  However, if you add GPL Version 2 code
+ * and therefore, elected the GPL Version 2 license, then the option applies
+ * only if the new code is made subject to such option by the copyright
+ * holder.
+ */
+--%>
+
+<%@page contentType="text/html" pageEncoding="UTF-8" %>
+<!DOCTYPE html>
+<html>
+<head>
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+    <title>Hello WebSocket</title>
+
+    <script language="javascript" type="text/javascript">
+        var wsUri = "ws://localhost:8080/WebClient-Websocket/echo";
+        var websocket = new WebSocket(wsUri);
+        websocket.onopen = function (evt) {
+            onOpen(evt)
+        };
+        websocket.onmessage = function (evt) {
+            onMessage(evt)
+        };
+        websocket.onerror = function (evt) {
+            onError(evt)
+        };
+
+        function init() {
+            output = document.getElementById("output");
+        }
+
+        function say_hello() {
+            websocket.send(nameField.value);
+            writeToScreen("SENT: " + nameField.value);
+        }
+
+        function onOpen(evt) {
+            writeToScreen('<span style="color: red;">CONNECTED:</span>: ');
+        }
+
+        function onMessage(evt) {
+            writeToScreen('<span style="color: red;">RECEIVED:</span>: ' + evt.data);
+        }
+
+        function onError(evt) {
+            writeToScreen('<span style="color: red;">ERROR:</span> ' + evt.data);
+        }
+
+        function writeToScreen(message) {
+            var pre = document.createElement("p");
+            pre.style.wordWrap = "break-word";
+            pre.innerHTML = message;
+            output.appendChild(pre);
+        }
+
+        window.addEventListener("load", init, false);
+    </script>
+</head>
+<body>
+<h1>Getting Started with WebSocket!!</h1>
+
+<div style="text-align: center;">
+    <form action="">
+        <input onclick="say_hello()" value="Say Hello" type="button">
+        <input id="nameField" name="name" value="WebSocket" type="text"><br>
+    </form>
+</div>
+<div id="output"></div>
+</body>
+</html>

WebClient-NOSQL/src/main/webapp/indexHandler.jsp

+<%-- 
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common Development
+ * and Distribution License("CDDL") (collectively, the "License").  You
+ * may not use this file except in compliance with the License.  You can
+ * obtain a copy of the License at
+ * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html
+ * or packager/legal/LICENSE.txt.  See the License for the specific
+ * language governing permissions and limitations under the License.
+ *
+ * When distributing the software, include this License Header Notice in each
+ * file and include the License file at packager/legal/LICENSE.txt.
+ *
+ * GPL Classpath Exception:
+ * Oracle designates this particular file as subject to the "Classpath"
+ * exception as provided by Oracle in the GPL Version 2 section of the License
+ * file that accompanied this code.
+ *
+ * Modifications:
+ * If applicable, add the following below the License Header, with the fields
+ * enclosed by brackets [] replaced by your own identifying information:
+ * "Portions Copyright [year] [name of copyright owner]"
+ *
+ * Contributor(s):
+ * If you wish your version of this file to be governed by only the CDDL or
+ * only the GPL Version 2, indicate your decision by adding "[Contributor]
+ * elects to include this software in this distribution under the [CDDL or GPL
+ * Version 2] license."  If you don't indicate a single choice of license, a
+ * recipient has the option to distribute your version of this file under
+ * either the CDDL, the GPL Version 2 or to extend the choice of license to
+ * its licensees as provided above.  However, if you add GPL Version 2 code
+ * and therefore, elected the GPL Version 2 license, then the option applies
+ * only if the new code is made subject to such option by the copyright
+ * holder.
+ */
+--%>
+
+<%@page contentType="text/html" pageEncoding="UTF-8" %>
+<!DOCTYPE html>
+<html>
+<head>
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+    <title>Hello WebSocket</title>
+
+    <script language="javascript" type="text/javascript">
+        var wsUri = "ws://localhost:8080/WebClient-Websocket/handler";
+        var websocket = new WebSocket(wsUri);
+        websocket.onopen = function (evt) {
+            onOpen(evt)
+        };
+        websocket.onmessage = function (evt) {
+            onMessage(evt)
+        };
+        websocket.onerror = function (evt) {
+            onError(evt)
+        };
+
+        function init() {
+            output = document.getElementById("output");
+        }
+
+        function say_hello() {
+            websocket.send(nameField.value);
+            writeToScreen("SENT: " + nameField.value);
+        }
+
+        function onOpen(evt) {
+            writeToScreen('<span style="color: red;">CONNECTED:</span>: ');
+        }
+
+        function onMessage(evt) {
+            writeToScreen('<span style="color: red;">RECEIVED:</span>: ' + evt.data);
+        }
+
+        function onError(evt) {
+            writeToScreen('<span style="color: red;">ERROR:</span> ' + evt.data);
+        }
+
+        function writeToScreen(message) {
+            var pre = document.createElement("p");
+            pre.style.wordWrap = "break-word";
+            pre.innerHTML = message;
+            output.appendChild(pre);
+        }
+
+        window.addEventListener("load", init, false);
+    </script>
+</head>
+<body>
+<h1>Getting Started with WebSocket!!</h1>
+
+<div style="text-align: center;">
+    <form action="">
+        <input onclick="say_hello()" value="Say Hello" type="button">
+        <input id="nameField" name="name" value="WebSocket" type="text"><br>
+    </form>
+</div>
+<div id="output"></div>
+</body>
+</html>

WebClient-SSE/src/main/webapp/WEB-INF/web.xml

          xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
 
     <display-name>WebClient-SSE</display-name>
-
+    <distributable />
     <servlet>
         <servlet-name>Jersey application</servlet-name>
         <servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet-class>

WebClient-Websocket/src/main/java/org/jacp/beans/SimpleWebsocket.java

         StringBuffer buffer = new StringBuffer("sessions: ");
         for (Session s : sessions) {
             buffer.append(s.hashCode()).append(",");
-            if (!s.getId().equals(session.getId())) s.getBasicRemote().sendText("hello from an other session: " + name);
+            if (!s.getId().equals(session.getId())) s.getBasicRemote().sendText("hello from an other session: " + name+" current users:"+sessions.size()+" "+session.getRequestURI().toString() );
         }
 //        List<ClientMessage> result = bean.findAll();
         String returnVal = "<ul>";

WebClient-Websocket/src/main/webapp/WEB-INF/web.xml

          xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
          version="3.0">
     <display-name>WebClient-Websocket</display-name>
+    <distributable />
     <welcome-file-list>
         <welcome-file>index.jsp</welcome-file>
     </welcome-file-list>
-<!--    <ejb-ref>
-        <ejb-ref-name>org.jacp.beans.websocket.twitter.ChatEndpoint/chatBean</ejb-ref-name>
-        <ejb-ref-type>Session</ejb-ref-type>
-        <remote>org.jacp.jee.api.ChatUserBeanInterface</remote>
-        <ejb-link>../EJB-1.0.jar#ChatUserBean</ejb-link>
-    </ejb-ref>-->
+
 </web-app>

WebClient-Websocket/src/main/webapp/index.jsp

  * holder.
  */
 --%>
-
+<%@page import="java.util.Enumeration"%>
+<%@ page import="java.net.InetAddress" %>
 <%@page contentType="text/html" pageEncoding="UTF-8" %>
 <!DOCTYPE html>
 <html>
     <title>Hello WebSocket</title>
 
     <script language="javascript" type="text/javascript">
-        var wsUri = "ws://localhost:8080/WebClient-Websocket/echo";
+        var wsUri = "ws://192.168.32.130/WebClient-Websocket/echo";
         var websocket = new WebSocket(wsUri);
         websocket.onopen = function (evt) {
             onOpen(evt)
     </script>
 </head>
 <body>
-<h1>Getting Started with WebSocket!!</h1>
+<%String ip = "";
+    InetAddress inetAddress = InetAddress.getLocalHost();
+    ip = inetAddress.getHostAddress();
+    out.println("Server Host Name :: "+inetAddress.getHostName());%><br>
+<%out.println("Server IP Address :: "+ip);%>
+<%
+    if (request.getParameter("sessionName") != null && request.getParameter("sessionValue") != null) {
+        HttpSession httpSession = request.getSession();
+        httpSession.setAttribute(request.getParameter("sessionName"), request.getParameter("sessionValue"));
+    }
+%>
+
+<form action="index.jsp" method="POST">
+
+    your session name : <input type="text" name="sessionName" /> <br />
+    your session value : <input type="text" name="sessionValue" /> <br />
+    <input type="submit" />
+
+</form>
+
+<h1>Your Sessions</h1>
+
+<%
+    Enumeration sessionNames = session.getAttributeNames();
+    while (sessionNames.hasMoreElements()) {
+        String mySessionName = sessionNames.nextElement().toString();
+        String mySession = request.getSession().getAttribute(mySessionName).toString();
+        out.print(mySessionName+ " --> "+mySession + " <br />");
+    }
+%>
 
 <div style="text-align: center;">
     <form action="">

WebClient-Websocket/src/main/webapp/index2.html

+<%--
+  ~ Copyright (c) 2013, Andy Moncsek, inc.
+  ~ All rights reserved.
+  ~
+  ~ Redistribution and use in source and binary forms, with or without modification, are permitted provided
+  ~ that the following conditions are met:
+  ~
+  ~    Redistributions of source code must retain the above copyright notice, this list of conditions and the
+  ~    following disclaimer.
+  ~
+  ~    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.
+  ~
+  ~    Neither the name of Andy Moncsek, inc. nor the names of its contributors may be used to endorse or
+  ~    promote products derived from this software without specific prior written permission.
+  ~
+  ~ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS 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 COPYRIGHT OWNER OR 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.
+  --%>
+
+<%@page contentType="text/html" pageEncoding="UTF-8" %>
+<!DOCTYPE html>
+<html>
+<head>
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+    <title>Hello WebSocket</title>
+
+    <script language="javascript" type="text/javascript">
+        var wsUri = "ws://192.168.32.129:28080/WebClient-Websocket/echo";
+        var websocket = new WebSocket(wsUri);
+        websocket.onopen = function (evt) {
+            onOpen(evt)
+        };
+        websocket.onmessage = function (evt) {
+            onMessage(evt)
+        };
+        websocket.onerror = function (evt) {
+            onError(evt)
+        };
+
+        function init() {
+            output = document.getElementById("output");
+        }
+
+        function say_hello() {
+            websocket.send(nameField.value);
+            writeToScreen("SENT: " + nameField.value);
+        }
+
+        function onOpen(evt) {
+            writeToScreen('<span style="color: red;">CONNECTED:</span>: ');
+        }
+
+        function onMessage(evt) {
+            writeToScreen('<span style="color: red;">RECEIVED:</span>: ' + evt.data);
+        }
+
+        function onError(evt) {
+            writeToScreen('<span style="color: red;">ERROR:</span> ' + evt.data);
+        }
+
+        function writeToScreen(message) {
+            var pre = document.createElement("p");
+            pre.style.wordWrap = "break-word";
+            pre.innerHTML = message;
+            output.appendChild(pre);
+        }
+
+        window.addEventListener("load", init, false);
+    </script>
+</head>
+<body>
+<h1>Getting Started with WebSocket!!</h1>
+
+<div style="text-align: center;">
+    <form action="">
+        <input onclick="say_hello()" value="Say Hello" type="button">
+        <input id="nameField" name="name" value="WebSocket" type="text"><br>
+    </form>
+</div>
+<div id="output"></div>
+</body>
+</html>

WebClient-Websocket/src/main/webapp/index3.html

+<%--
+  ~ Copyright (c) 2013, Andy Moncsek, inc.
+  ~ All rights reserved.
+  ~
+  ~ Redistribution and use in source and binary forms, with or without modification, are permitted provided
+  ~ that the following conditions are met:
+  ~
+  ~    Redistributions of source code must retain the above copyright notice, this list of conditions and the
+  ~    following disclaimer.
+  ~
+  ~    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.
+  ~
+  ~    Neither the name of Andy Moncsek, inc. nor the names of its contributors may be used to endorse or
+  ~    promote products derived from this software without specific prior written permission.
+  ~
+  ~ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS 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 COPYRIGHT OWNER OR 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.
+  --%>
+
+<%@page contentType="text/html" pageEncoding="UTF-8" %>
+<!DOCTYPE html>
+<html>
+<head>
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+    <title>Hello WebSocket</title>
+
+    <script language="javascript" type="text/javascript">
+        var wsUri = "ws://192.168.32.128:28080/WebClient-Websocket/echo";
+        var websocket = new WebSocket(wsUri);
+        websocket.onopen = function (evt) {
+            onOpen(evt)
+        };
+        websocket.onmessage = function (evt) {
+            onMessage(evt)
+        };
+        websocket.onerror = function (evt) {
+            onError(evt)
+        };
+
+        function init() {
+            output = document.getElementById("output");
+        }
+
+        function say_hello() {
+            websocket.send(nameField.value);
+            writeToScreen("SENT: " + nameField.value);
+        }
+
+        function onOpen(evt) {
+            writeToScreen('<span style="color: red;">CONNECTED:</span>: ');
+        }
+
+        function onMessage(evt) {
+            writeToScreen('<span style="color: red;">RECEIVED:</span>: ' + evt.data);
+        }
+
+        function onError(evt) {
+            writeToScreen('<span style="color: red;">ERROR:</span> ' + evt.data);
+        }
+
+        function writeToScreen(message) {
+            var pre = document.createElement("p");
+            pre.style.wordWrap = "break-word";
+            pre.innerHTML = message;
+            output.appendChild(pre);
+        }
+
+        window.addEventListener("load", init, false);
+    </script>
+</head>
+<body>
+<h1>Getting Started with WebSocket!!</h1>
+
+<div style="text-align: center;">
+    <form action="">
+        <input onclick="say_hello()" value="Say Hello" type="button">
+        <input id="nameField" name="name" value="WebSocket" type="text"><br>
+    </form>
+</div>
+<div id="output"></div>
+</body>
+</html>
             <url>http://repository.primefaces.org</url>
             <layout>default</layout>
         </repository>
+        <repository>
+            <id>EclipseLink</id>
+            <url>http://download.eclipse.org/rt/eclipselink/maven.repo</url>
+        </repository>
     </repositories>
     <profiles>
         <profile>
             <id>all</id>
             <modules>
                 <module>Domain</module>
+                <module>Domain-NOSQL</module>
                 <module>EJBClient</module>
+                <module>EJBClient-NOSQL</module>
                 <module>EJB</module>
+                <module>EJB-NOSQL</module>
                 <module>WebClient-Websocket</module>
                 <module>WebClient-SSE</module>
+                <module>WebClient-NOSQL</module>
                 <module>EAR-Websocket</module>
                 <module>EAR-SSE</module>
+                <module>EAR-NOSQL</module>
                 <module>JavaClient</module>
                 <module>JacpFXWebsocketChatClient</module>
 				<module>JacpFXSSETwitterClient</module>
 				<module>JacpFXSSETwitterClient</module>
             </modules>
         </profile>
+        <profile>
+            <id>nosql</id>
+            <modules>
+                <module>Domain-NOSQL</module>
+                <module>EJBClient-NOSQL</module>
+                <module>EJB-NOSQL</module>
+                <module>WebClient-NOSQL</module>
+                <module>EAR-NOSQL</module>
+                <module>JavaClient</module>
+                <module>JacpFXSSETwitterClient</module>
+            </modules>
+        </profile>
     </profiles>
     <modules>
         <module>Domain</module>
+        <module>Domain-NOSQL</module>
         <module>EJBClient</module>
+        <module>EJBClient-NOSQL</module>
         <module>EJB</module>
+        <module>EJB-NOSQL</module>
         <module>WebClient-Websocket</module>
         <module>WebClient-SSE</module>
+        <module>WebClient-NOSQL</module>
         <module>EAR-Websocket</module>
         <module>EAR-SSE</module>
+        <module>EAR-NOSQL</module>
         <module>JavaClient</module>
         <module>JacpFXWebsocketChatClient</module>
 		<module>JacpFXSSETwitterClient</module>
         <jacp.version>1.2</jacp.version>
         <spring.version>3.1.1.RELEASE</spring.version>
         <primefaces.version>3.6-SNAPSHOT</primefaces.version>
+        <gson.version>2.2.2</gson.version>
+        <commons-lang.version>2.6</commons-lang.version>
+        <CDI.version>1.1-PRD</CDI.version>
+        <mongodb.version>2.10.1</mongodb.version>
     </properties>
     <dependencyManagement>
         <dependencies>
             </dependency>
             <dependency>
                 <groupId>${project.groupId}</groupId>
+                <artifactId>Domain-NOSQL</artifactId>
+                <version>${project.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>${project.groupId}</groupId>
                 <artifactId>EJBClient</artifactId>
                 <version>${project.version}</version>
             </dependency>
             <dependency>
                 <groupId>${project.groupId}</groupId>
+                <artifactId>EJBClient-NOSQL</artifactId>
+                <version>${project.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>${project.groupId}</groupId>
                 <artifactId>EJB</artifactId>
                 <version>${project.version}</version>
                 <type>ejb</type>
             </dependency>
             <dependency>
                 <groupId>${project.groupId}</groupId>
+                <artifactId>EJB-NOSQL</artifactId>
+                <version>${project.version}</version>
+                <type>ejb</type>
+            </dependency>
+            <dependency>
+                <groupId>${project.groupId}</groupId>
                 <artifactId>WebClient-Websocket</artifactId>
                 <version>${project.version}</version>
                 <type>war</type>
             </dependency>
             <dependency>
                 <groupId>${project.groupId}</groupId>
+                <artifactId>WebClient-NOSQL</artifactId>
+                <version>${project.version}</version>
+                <type>war</type>
+            </dependency>
+            <dependency>
+                <groupId>${project.groupId}</groupId>
                 <artifactId>EAR-Websocket</artifactId>
                 <version>${project.version}</version>
                 <type>ear</type>
             </dependency>
             <dependency>
                 <groupId>${project.groupId}</groupId>
+                <artifactId>EAR-NOSQL</artifactId>
+                <version>${project.version}</version>
+                <type>ear</type>
+            </dependency>
+            <dependency>
+                <groupId>${project.groupId}</groupId>
                 <artifactId>JavaClient</artifactId>
                 <version>${project.version}</version>
                 <type>jar</type>
         <dependency>
             <groupId>javax.enterprise</groupId>
             <artifactId>cdi-api</artifactId>
-            <version>1.1-PRD</version>
+            <version>${CDI.version}</version>
+            <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>commons-lang</groupId>
             <artifactId>commons-lang</artifactId>
-            <version>2.6</version>
-        </dependency>
-        <dependency>
-            <groupId>com.google.code.gson</groupId>
-            <artifactId>gson</artifactId>
-            <version>2.2.2</version>
+            <version>${commons-lang.version}</version>
         </dependency>
     </dependencies>
     <build>