tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fm...@apache.org
Subject svn commit: r1127488 - in /tuscany/sca-java-2.x/trunk/modules/binding-comet-runtime: ./ src/main/java/org/apache/tuscany/sca/binding/comet/runtime/ src/main/java/org/apache/tuscany/sca/binding/comet/runtime/handler/ src/main/java/org/apache/tuscany/sca...
Date Wed, 25 May 2011 12:15:37 GMT
Author: fmoga
Date: Wed May 25 12:15:36 2011
New Revision: 1127488

URL: http://svn.apache.org/viewvc?rev=1127488&view=rev
Log:
Upgrade to atmosphere-jersey 0.7.1. Change REST Path for CometComponentContext.js to avoid
mapping exception caused by new jersey version.

Modified:
    tuscany/sca-java-2.x/trunk/modules/binding-comet-runtime/pom.xml
    tuscany/sca-java-2.x/trunk/modules/binding-comet-runtime/src/main/java/org/apache/tuscany/sca/binding/comet/runtime/ServletFactory.java
    tuscany/sca-java-2.x/trunk/modules/binding-comet-runtime/src/main/java/org/apache/tuscany/sca/binding/comet/runtime/handler/CometBindingHandler.java
    tuscany/sca-java-2.x/trunk/modules/binding-comet-runtime/src/main/java/org/apache/tuscany/sca/binding/comet/runtime/javascript/JavascriptResource.java
    tuscany/sca-java-2.x/trunk/modules/binding-comet-runtime/src/main/resources/cometComponentContext.js

Modified: tuscany/sca-java-2.x/trunk/modules/binding-comet-runtime/pom.xml
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/binding-comet-runtime/pom.xml?rev=1127488&r1=1127487&r2=1127488&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/binding-comet-runtime/pom.xml (original)
+++ tuscany/sca-java-2.x/trunk/modules/binding-comet-runtime/pom.xml Wed May 25 12:15:36 2011
@@ -40,16 +40,6 @@
 			<scope>provided</scope>
 		</dependency>
 		<dependency>
-			<groupId>org.atmosphere</groupId>
-			<artifactId>atmosphere-commons</artifactId>
-			<version>0.6.1</version>
-		</dependency>
-		<dependency>
-			<groupId>org.atmosphere</groupId>
-			<artifactId>atmosphere-runtime</artifactId>
-			<version>0.6.1</version>
-		</dependency>
-		<dependency>
 			<groupId>com.google.code.gson</groupId>
 			<artifactId>gson</artifactId>
 			<version>1.4</version>
@@ -68,6 +58,12 @@
 			<scope>test</scope>
         </dependency>
 
+        <dependency>
+        	<groupId>org.atmosphere</groupId>
+        	<artifactId>atmosphere-jersey</artifactId>
+        	<version>0.7.1</version>
+        	<scope>compile</scope>
+        </dependency>
 	</dependencies>
 
 	<repositories>
@@ -81,6 +77,16 @@
 				<enabled>true</enabled>
 			</releases>
 		</repository>
-	</repositories>
+		<repository>
+			<id>oss-sonatype-repository</id>
+			<url>https://oss.sonatype.org/content/repositories/releases/</url>
+			<snapshots>
+				<enabled>true</enabled>
+			</snapshots>
+			<releases>
+				<enabled>true</enabled>
+			</releases>
+		</repository>
+</repositories>
 
 </project>

Modified: tuscany/sca-java-2.x/trunk/modules/binding-comet-runtime/src/main/java/org/apache/tuscany/sca/binding/comet/runtime/ServletFactory.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/binding-comet-runtime/src/main/java/org/apache/tuscany/sca/binding/comet/runtime/ServletFactory.java?rev=1127488&r1=1127487&r2=1127488&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/binding-comet-runtime/src/main/java/org/apache/tuscany/sca/binding/comet/runtime/ServletFactory.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/binding-comet-runtime/src/main/java/org/apache/tuscany/sca/binding/comet/runtime/ServletFactory.java
Wed May 25 12:15:36 2011
@@ -66,7 +66,7 @@ public final class ServletFactory {
 	/**
 	 * Path where Javascript toolkit will be exposed.
 	 */
-	public static final String JS_PATH = "/org.apache.tuscany.sca.cometComponentContext.js/*";
+	public static final String JS_PATH = "/tuscany-comet-js/*";
 
 	/**
 	 * The servlet that is exposing the comet services.

Modified: tuscany/sca-java-2.x/trunk/modules/binding-comet-runtime/src/main/java/org/apache/tuscany/sca/binding/comet/runtime/handler/CometBindingHandler.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/binding-comet-runtime/src/main/java/org/apache/tuscany/sca/binding/comet/runtime/handler/CometBindingHandler.java?rev=1127488&r1=1127487&r2=1127488&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/binding-comet-runtime/src/main/java/org/apache/tuscany/sca/binding/comet/runtime/handler/CometBindingHandler.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/binding-comet-runtime/src/main/java/org/apache/tuscany/sca/binding/comet/runtime/handler/CometBindingHandler.java
Wed May 25 12:15:36 2011
@@ -22,6 +22,7 @@ package org.apache.tuscany.sca.binding.c
 import java.lang.reflect.InvocationTargetException;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.concurrent.TimeUnit;
 
 import javax.servlet.ServletContext;
 import javax.servlet.http.HttpServletRequest;
@@ -45,13 +46,11 @@ import org.apache.tuscany.sca.interfaced
 import org.apache.tuscany.sca.interfacedef.Operation;
 import org.apache.tuscany.sca.invocation.Message;
 import org.apache.tuscany.sca.runtime.RuntimeEndpoint;
-import org.atmosphere.cache.SessionBroadcasterCache;
 import org.atmosphere.cpr.Broadcaster;
-import org.atmosphere.cpr.DefaultBroadcaster;
-import org.atmosphere.cpr.DefaultBroadcasterFactory;
+import org.atmosphere.cpr.BroadcasterLifeCyclePolicy.ATMOSPHERE_RESOURCE_POLICY;
+import org.atmosphere.cpr.BroadcasterLifeCyclePolicy.Builder;
 import org.atmosphere.jersey.JerseyBroadcaster;
 import org.atmosphere.jersey.SuspendResponse;
-import org.atmosphere.jersey.util.JerseyBroadcasterUtil;
 
 import com.sun.jersey.spi.container.servlet.PerSession;
 
@@ -101,6 +100,8 @@ public class CometBindingHandler {
 		System.out.println("-- connect -- Session Id: " + request.getSession().getId());
 		if (broadcaster == null) {
 			broadcaster = new JerseyBroadcaster();
+//			broadcaster.setBroadcasterLifeCyclePolicy(new Builder().policy(ATMOSPHERE_RESOURCE_POLICY.IDLE_DESTROY)
+//					.idleTimeInMS(5000).build());
 			context = (CometComponentContext) sc.getAttribute(ServletFactory.COMET_COMPONENT_CONTEXT_KEY);
 		}
 		CometComponentContext.broadcasters.put(request.getSession().getId(), broadcaster);
@@ -127,7 +128,7 @@ public class CometBindingHandler {
 	@POST
 	@Path("/{service}/{method}")
 	public void handleRequest(@PathParam("service") final String service, @PathParam("method")
final String method,
-			@FormParam("callback") final String callbackMethod, @FormParam("params") final String
jsonData)
+			@FormParam("callbackMethod") final String callbackMethod, @FormParam("params") final String
jsonData)
 			throws InvocationTargetException {
 		System.out.println("-- handleRequest -- Session Id: " + request.getSession().getId());
 		final String url = "/" + service + "/" + method;

Modified: tuscany/sca-java-2.x/trunk/modules/binding-comet-runtime/src/main/java/org/apache/tuscany/sca/binding/comet/runtime/javascript/JavascriptResource.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/binding-comet-runtime/src/main/java/org/apache/tuscany/sca/binding/comet/runtime/javascript/JavascriptResource.java?rev=1127488&r1=1127487&r2=1127488&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/binding-comet-runtime/src/main/java/org/apache/tuscany/sca/binding/comet/runtime/javascript/JavascriptResource.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/binding-comet-runtime/src/main/java/org/apache/tuscany/sca/binding/comet/runtime/javascript/JavascriptResource.java
Wed May 25 12:15:36 2011
@@ -46,6 +46,7 @@ public class JavascriptResource {
      * @return InputStream containing the Javascript code.
      */
     @GET
+    @Path("/org.apache.tuscany.sca.CometComponentContext.js")
     public InputStream getJavascript() {
         InputStream stream = null;
         // add dependencies in the specified order

Modified: tuscany/sca-java-2.x/trunk/modules/binding-comet-runtime/src/main/resources/cometComponentContext.js
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/binding-comet-runtime/src/main/resources/cometComponentContext.js?rev=1127488&r1=1127487&r2=1127488&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/binding-comet-runtime/src/main/resources/cometComponentContext.js
(original)
+++ tuscany/sca-java-2.x/trunk/modules/binding-comet-runtime/src/main/resources/cometComponentContext.js
Wed May 25 12:15:36 2011
@@ -36,7 +36,7 @@ this.TuscanyComet = {
 				null, 
 				$.atmosphere.request = {
 					method : 'POST',
-					data : 'callback=' + callbackMethod.name + '&params=' + params 
+					data : 'callbackMethod=' + callbackMethod.name + '&params=' + params 
 				});
 	},
 	callback : function(response) {



Mime
View raw message