Commits

unknown  committed 5643e91

update to websocket 12b

  • Participants
  • Parent commits 787679c

Comments (0)

Files changed (6)

 .classpath
 .settings/
 .loadpath
+*.iml
 
 # External tool builders
 .externalToolBuilders/

File WebClient/pom.xml

 			<layout>default</layout>
 		</repository>
   </repositories>
-  
+    <properties>
+    <websocket-api.version>1.0-b12</websocket-api.version>
+    </properties>
   <dependencies>
       <dependency>
 		<groupId>javax</groupId>
 		<version>${project.version}</version>
 	</dependency>
 	<dependency>
-        <groupId>javax.net.websocket</groupId>
-        <artifactId>javax.net.websocket-api</artifactId>
-        <version>1.0-b08</version>
+        <groupId>javax.websocket</groupId>
+        <artifactId>javax.websocket-api</artifactId>
+        <version>${websocket-api.version}</version>
     </dependency>
 	
 	      
 		<artifactId>primefaces</artifactId>
 		<version>2.2.1</version>
 	</dependency>
-<!--         <dependency>
-		<groupId>javax.net.websocket</groupId>
-		<artifactId>javax.net.websocket-api</artifactId>
-		<version>1.0-SNAPSHOT</version>
-	</dependency>   -->
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <version>3.8.1</version>
-      <scope>test</scope>
-    </dependency>
+
   </dependencies>
   <build>
     <finalName>WebClient</finalName>

File WebClient/src/main/java/org/jacp/beans/SimpleWebsocket.java

 package org.jacp.beans;
 
 import javax.websocket.Session;
-import javax.websocket.WebSocketEndpoint;
 import javax.websocket.WebSocketMessage;
+import javax.websocket.server.DefaultServerConfiguration;
+import javax.websocket.server.WebSocketEndpoint;
 
 
-
-
-
-
-
-
-
-
-
-@WebSocketEndpoint("/echo")
+@WebSocketEndpoint(value = "/echo", configuration=DefaultServerConfiguration.class)
 public class SimpleWebsocket {
 	@WebSocketMessage
     public String sayHello(String name, Session session) {

File WebClient/src/main/java/org/jacp/beans/WebSocketWithMessageHandler.java

 
 import java.io.IOException;
 import java.io.Serializable;
+import java.util.Set;
 
 import javax.annotation.PostConstruct;
 import javax.annotation.Resource;
 import javax.ejb.Singleton;
 import javax.websocket.MessageHandler;
 import javax.websocket.Session;
-import javax.websocket.WebSocketEndpoint;
+
 import javax.websocket.WebSocketOpen;
+import javax.websocket.server.DefaultServerConfiguration;
+import javax.websocket.server.WebSocketEndpoint;
 
 import org.jacp.beans.ejb.SimpleStateless;
 import org.jacp.jee.api.MessageEJBInterface;
 
 
 @Singleton(mappedName="WebSocketWithMessageHandler")
-@WebSocketEndpoint("/handler")
+@WebSocketEndpoint(value = "/handler", configuration = DefaultServerConfiguration.class)
 public class WebSocketWithMessageHandler implements Serializable{
     @EJB(name = "SimpleMessagingBean")
     private MessageEJBInterface bean;
 		    session.getRemote().sendString("Hello: " + simpleStateless.sayHello());
 		} catch (IOException e) {
 		    // TODO Auto-generated catch block
-		    e.printStackTrace();
+		   ;e.printStackTrace();
 		}
 
 	    }

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

+<?xml version="1.0" encoding="UTF-8"?>
+<web-app 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_2_5.xsd"
+           version="2.5">
+
+</web-app>
 <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/xsd/maven-4.0.0.xsd">
-	<modelVersion>4.0.0</modelVersion>
-	<groupId>org.jacp.jee</groupId>
-	<artifactId>JEE7-websocket</artifactId>
-	<version>1.0</version>
-	<packaging>pom</packaging>
-	<description>Root pom.xml for all other submodules</description>
-	<modules> 		
-	    <module>Domain</module> 		
-	    <module>EJBClient</module> 		
-	    <module>EJB</module> 		
-	    <module>WebClient</module> 		
-	    <module>EAR</module> 	
-    </modules> 
-	<properties> 		
-		<javax.persistence.version>2.0.0</javax.persistence.version> 
-		<jee.version>6.0</jee.version>
-	</properties>
-<dependencyManagement> 		
-    <dependencies> 			
-        <dependency> 				
-            <groupId>${project.groupId}</groupId> 				
-            <artifactId>Domain</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>EJB</artifactId> 				
-            <version>${project.version}</version> 				
-            <type>ejb</type> 			
-        </dependency> 			
- 			
-        <dependency> 				
-            <groupId>${project.groupId}</groupId> 				
-            <artifactId>WebClient</artifactId> 				
-            <version>${project.version}</version> 				
-            <type>war</type> 			
-        </dependency> 			
-        <dependency> 				
-            <groupId>${project.groupId}</groupId> 				
-            <artifactId>EAR</artifactId> 				
-            <version>${project.version}</version> 				
-            <type>ear</type> 			
-        </dependency> 		
-      </dependencies> 	
-    </dependencyManagement> 
-	<build>
-		<plugins>
-			<plugin>
-         		<artifactId>maven-compiler-plugin</artifactId>
-				<configuration>
-					<source>1.7</source>
-					<target>1.7</target>
-				</configuration>
-			</plugin>
-		</plugins>
-		<pluginManagement> 		
-		    <plugins> 			
-		        <plugin> 				
-		            <artifactId>maven-compiler-plugin</artifactId> 				
-		            <version>2.5.1</version> 			
-		        </plugin> 			
-		        <plugin> 				
-		            <artifactId>maven-surefire-plugin</artifactId> 				
-		            <version>2.7.2</version> 			
-		        </plugin> 			
-		        <plugin> 				
-		            <artifactId>maven-jar-plugin</artifactId> 				
-		            <version>2.3.2</version> 			
-		            </plugin> 			
-		        <plugin> 				
-		            <artifactId>maven-ejb-plugin</artifactId> 				
-		            <version>2.3</version> 			
-		        </plugin> 			
-		        <plugin> 				
-		            <artifactId>maven-war-plugin</artifactId> 				
-		            <version>2.1.1</version> 			
-		        </plugin> 		
-		      </plugins> 		
-		  </pluginManagement> 
-	</build>
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.jacp.jee</groupId>
+    <artifactId>JEE7-websocket</artifactId>
+    <version>1.0</version>
+    <packaging>pom</packaging>
+    <description>Root pom.xml for all other submodules</description>
+    <repositories>
+        <repository>
+            <id>java.net-promoted</id>
+            <url>https://maven.java.net/content/groups/promoted/</url>
+        </repository>
+    </repositories>
+    <profiles>
+        <profile>
+            <id>all</id>
+            <modules>
+                <module>Domain</module>
+                <module>EJBClient</module>
+                <module>EJB</module>
+                <module>WebClient</module>
+                <module>EAR</module>
+            </modules>
+        </profile>
+    </profiles>
+    <modules>
+        <module>Domain</module>
+        <module>EJBClient</module>
+        <module>EJB</module>
+        <module>WebClient</module>
+        <module>EAR</module>
+    </modules>
+    <properties>
+        <javax.persistence.version>2.0.0</javax.persistence.version>
+        <jee.version>6.0</jee.version>
+    </properties>
+    <dependencyManagement>
+        <dependencies>
+            <dependency>
+                <groupId>${project.groupId}</groupId>
+                <artifactId>Domain</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>EJB</artifactId>
+                <version>${project.version}</version>
+                <type>ejb</type>
+            </dependency>
+
+            <dependency>
+                <groupId>${project.groupId}</groupId>
+                <artifactId>WebClient</artifactId>
+                <version>${project.version}</version>
+                <type>war</type>
+            </dependency>
+            <dependency>
+                <groupId>${project.groupId}</groupId>
+                <artifactId>EAR</artifactId>
+                <version>${project.version}</version>
+                <type>ear</type>
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
+    <dependencies>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>3.8.1</version>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+    <build>
+        <plugins>
+            <plugin>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <configuration>
+                    <source>1.7</source>
+                    <target>1.7</target>
+                </configuration>
+            </plugin>
+        </plugins>
+        <pluginManagement>
+            <plugins>
+                <plugin>
+                    <artifactId>maven-compiler-plugin</artifactId>
+                    <version>2.5.1</version>
+                </plugin>
+                <plugin>
+                    <artifactId>maven-surefire-plugin</artifactId>
+                    <version>2.7.2</version>
+                </plugin>
+                <plugin>
+                    <artifactId>maven-jar-plugin</artifactId>
+                    <version>2.3.2</version>
+                </plugin>
+                <plugin>
+                    <artifactId>maven-ejb-plugin</artifactId>
+                    <version>2.3</version>
+                </plugin>
+                <plugin>
+                    <artifactId>maven-war-plugin</artifactId>
+                    <version>2.1.1</version>
+                </plugin>
+            </plugins>
+        </pluginManagement>
+    </build>
 </project>