|
|
|
Jeanfrancois Arcand
|
Salut,
I know Viktor wanted to help, but anybody is welcome to take a look at the lift code under: * /trunk/sandbox/lift/ Under that filder, there is a src folder that needs to be placed under your normal lift workspace: /trunk/lift/lift The diff is also attached here. Ya this is probably a stupid mistake ... the idea here is to replace Jetty's Continuation with Atmosphere. You have the right to laugh :-) A+ --jeanfrancois diff --git a/examples/example/pom.xml b/examples/example/pom.xml index e46f3c7..9227aba 100644 --- a/examples/example/pom.xml +++ b/examples/example/pom.xml @@ -14,6 +14,11 @@ <dependencies> <dependency> + <groupId>org.atmosphere</groupId> + <artifactId>atmosphere-portable-runtime</artifactId> + <version>0.4-SNAPSHOT</version> + </dependency> + <dependency> <groupId>com.h2database</groupId> <artifactId>h2</artifactId> <version>1.0.79</version> diff --git a/examples/example/src/main/webapp/WEB-INF/web.xml b/examples/example/src/main/webapp/WEB-INF/web.xml index 215dc17..be8e348 100644 --- a/examples/example/src/main/webapp/WEB-INF/web.xml +++ b/examples/example/src/main/webapp/WEB-INF/web.xml @@ -5,20 +5,21 @@ "http://java.sun.com/dtd/web-app_2_3.dtd"> <web-app> - <filter> - <filter-name>LiftFilter</filter-name> - <display-name>Lift Filter</display-name> - <description>The Filter that intercepts lift calls</description> - <filter-class>net.liftweb.http.LiftFilter</filter-class> - </filter> - - - <filter-mapping> - <filter-name>LiftFilter</filter-name> - <url-pattern>/*</url-pattern> - </filter-mapping> - - <welcome-file-list> - <welcome-file>index.html</welcome-file> - </welcome-file-list> + <servlet> + <description>AtmosphereServlet</description> + <servlet-name>AtmosphereServlet</servlet-name> + <servlet-class>org.atmosphere.cpr.MeteorServlet</servlet-class> + <!-- Uncomment if you want to use Servlet 3.0 Async Support + <async-supported>true</async-supported> + --> + <init-param> + <param-name>org.atmosphere.filter</param-name> + <param-value>net.liftweb.http.LiftFilter</param-value> + </init-param> + <load-on-startup>0</load-on-startup> + </servlet> + <servlet-mapping> + <servlet-name>AtmosphereServlet</servlet-name> + <url-pattern>/*</url-pattern> + </servlet-mapping> </web-app> diff --git a/lift/pom.xml b/lift/pom.xml old mode 100644 new mode 100755 diff --git a/lift/src/main/resources/i18n/lift-core_en_AU.properties b/lift/src/main/resources/i18n/lift-core_en_AU.properties old mode 100644 new mode 100755 diff --git a/lift/src/main/resources/i18n/lift-core_en_US.properties b/lift/src/main/resources/i18n/lift-core_en_US.properties old mode 100644 new mode 100755 diff --git a/lift/src/main/resources/i18n/lift-core_pl.properties b/lift/src/main/resources/i18n/lift-core_pl.properties old mode 100644 new mode 100755 diff --git a/lift/src/main/resources/toserve/jquery-1.3.2.js b/lift/src/main/resources/toserve/jquery-1.3.2.js old mode 100644 new mode 100755 diff --git a/lift/src/main/resources/toserve/json2.js b/lift/src/main/resources/toserve/json2.js old mode 100644 new mode 100755 diff --git a/lift/src/main/resources/toserve/yui/connection.js b/lift/src/main/resources/toserve/yui/connection.js old mode 100644 new mode 100755 diff --git a/lift/src/main/resources/toserve/yui/dom.js b/lift/src/main/resources/toserve/yui/dom.js old mode 100644 new mode 100755 diff --git a/lift/src/main/resources/toserve/yui/event.js b/lift/src/main/resources/toserve/yui/event.js old mode 100644 new mode 100755 diff --git a/lift/src/main/resources/toserve/yui/json.js b/lift/src/main/resources/toserve/yui/json.js old mode 100644 new mode 100755 diff --git a/lift/src/main/resources/toserve/yui/yahoo.js b/lift/src/main/resources/toserve/yui/yahoo.js old mode 100644 new mode 100755 diff --git a/lift/src/main/scala/net/liftweb/builtin/snippet/A.scala b/lift/src/main/scala/net/liftweb/builtin/snippet/A.scala old mode 100644 new mode 100755 diff --git a/lift/src/main/scala/net/liftweb/builtin/snippet/CSS.scala b/lift/src/main/scala/net/liftweb/builtin/snippet/CSS.scala old mode 100644 new mode 100755 diff --git a/lift/src/main/scala/net/liftweb/builtin/snippet/Children.scala b/lift/src/main/scala/net/liftweb/builtin/snippet/Children.scala old mode 100644 new mode 100755 diff --git a/lift/src/main/scala/net/liftweb/builtin/snippet/Comet.scala b/lift/src/main/scala/net/liftweb/builtin/snippet/Comet.scala old mode 100644 new mode 100755 diff --git a/lift/src/main/scala/net/liftweb/builtin/snippet/Embed.scala b/lift/src/main/scala/net/liftweb/builtin/snippet/Embed.scala old mode 100644 new mode 100755 diff --git a/lift/src/main/scala/net/liftweb/builtin/snippet/Form.scala b/lift/src/main/scala/net/liftweb/builtin/snippet/Form.scala old mode 100644 new mode 100755 diff --git a/lift/src/main/scala/net/liftweb/builtin/snippet/Group.scala b/lift/src/main/scala/net/liftweb/builtin/snippet/Group.scala old mode 100644 new mode 100755 diff --git a/lift/src/main/scala/net/liftweb/builtin/snippet/Ignore.scala b/lift/src/main/scala/net/liftweb/builtin/snippet/Ignore.scala old mode 100644 new mode 100755 diff --git a/lift/src/main/scala/net/liftweb/builtin/snippet/Loc.scala b/lift/src/main/scala/net/liftweb/builtin/snippet/Loc.scala old mode 100644 new mode 100755 diff --git a/lift/src/main/scala/net/liftweb/builtin/snippet/Menu.scala b/lift/src/main/scala/net/liftweb/builtin/snippet/Menu.scala old mode 100644 new mode 100755 diff --git a/lift/src/main/scala/net/liftweb/builtin/snippet/Msg.scala b/lift/src/main/scala/net/liftweb/builtin/snippet/Msg.scala old mode 100644 new mode 100755 diff --git a/lift/src/main/scala/net/liftweb/builtin/snippet/Msgs.scala b/lift/src/main/scala/net/liftweb/builtin/snippet/Msgs.scala old mode 100644 new mode 100755 diff --git a/lift/src/main/scala/net/liftweb/builtin/snippet/SkipDocType.scala b/lift/src/main/scala/net/liftweb/builtin/snippet/SkipDocType.scala old mode 100644 new mode 100755 diff --git a/lift/src/main/scala/net/liftweb/builtin/snippet/Surround.scala b/lift/src/main/scala/net/liftweb/builtin/snippet/Surround.scala old mode 100644 new mode 100755 diff --git a/lift/src/main/scala/net/liftweb/builtin/snippet/Tail.scala b/lift/src/main/scala/net/liftweb/builtin/snippet/Tail.scala old mode 100644 new mode 100755 diff --git a/lift/src/main/scala/net/liftweb/builtin/snippet/TestCond.scala b/lift/src/main/scala/net/liftweb/builtin/snippet/TestCond.scala old mode 100644 new mode 100755 diff --git a/lift/src/main/scala/net/liftweb/builtin/snippet/VersionInfo.scala b/lift/src/main/scala/net/liftweb/builtin/snippet/VersionInfo.scala old mode 100644 new mode 100755 diff --git a/lift/src/main/scala/net/liftweb/builtin/snippet/WithParam.scala b/lift/src/main/scala/net/liftweb/builtin/snippet/WithParam.scala old mode 100644 new mode 100755 diff --git a/lift/src/main/scala/net/liftweb/http/CometActor.scala b/lift/src/main/scala/net/liftweb/http/CometActor.scala old mode 100644 new mode 100755 diff --git a/lift/src/main/scala/net/liftweb/http/Factory.scala b/lift/src/main/scala/net/liftweb/http/Factory.scala old mode 100644 new mode 100755 diff --git a/lift/src/main/scala/net/liftweb/http/HttpResponse.scala b/lift/src/main/scala/net/liftweb/http/HttpResponse.scala old mode 100644 new mode 100755 diff --git a/lift/src/main/scala/net/liftweb/http/LiftRules.scala b/lift/src/main/scala/net/liftweb/http/LiftRules.scala old mode 100644 new mode 100755 diff --git a/lift/src/main/scala/net/liftweb/http/LiftServlet.scala b/lift/src/main/scala/net/liftweb/http/LiftServlet.scala old mode 100644 new mode 100755 diff --git a/lift/src/main/scala/net/liftweb/http/LiftSession.scala b/lift/src/main/scala/net/liftweb/http/LiftSession.scala old mode 100644 new mode 100755 diff --git a/lift/src/main/scala/net/liftweb/http/Req.scala b/lift/src/main/scala/net/liftweb/http/Req.scala old mode 100644 new mode 100755 diff --git a/lift/src/main/scala/net/liftweb/http/RequestType.scala b/lift/src/main/scala/net/liftweb/http/RequestType.scala old mode 100644 new mode 100755 diff --git a/lift/src/main/scala/net/liftweb/http/ResourceServer.scala b/lift/src/main/scala/net/liftweb/http/ResourceServer.scala old mode 100644 new mode 100755 diff --git a/lift/src/main/scala/net/liftweb/http/ResponseShortcutException.scala b/lift/src/main/scala/net/liftweb/http/ResponseShortcutException.scala old mode 100644 new mode 100755 diff --git a/lift/src/main/scala/net/liftweb/http/S.scala b/lift/src/main/scala/net/liftweb/http/S.scala old mode 100644 new mode 100755 diff --git a/lift/src/main/scala/net/liftweb/http/SHtml.scala b/lift/src/main/scala/net/liftweb/http/SHtml.scala old mode 100644 new mode 100755 diff --git a/lift/src/main/scala/net/liftweb/http/SimpleController.scala b/lift/src/main/scala/net/liftweb/http/SimpleController.scala old mode 100644 new mode 100755 diff --git a/lift/src/main/scala/net/liftweb/http/Stateful.scala b/lift/src/main/scala/net/liftweb/http/Stateful.scala old mode 100644 new mode 100755 diff --git a/lift/src/main/scala/net/liftweb/http/Vars.scala b/lift/src/main/scala/net/liftweb/http/Vars.scala old mode 100644 new mode 100755 diff --git a/lift/src/main/scala/net/liftweb/http/auth/Authentication.scala b/lift/src/main/scala/net/liftweb/http/auth/Authentication.scala old mode 100644 new mode 100755 diff --git a/lift/src/main/scala/net/liftweb/http/auth/Role.scala b/lift/src/main/scala/net/liftweb/http/auth/Role.scala old mode 100644 new mode 100755 diff --git a/lift/src/main/scala/net/liftweb/http/js/ScriptRenderer.scala b/lift/src/main/scala/net/liftweb/http/js/ScriptRenderer.scala old mode 100644 new mode 100755 diff --git a/lift/src/main/scala/net/liftweb/http/js/XML2Js.scala b/lift/src/main/scala/net/liftweb/http/js/XML2Js.scala old mode 100644 new mode 100755 diff --git a/lift/src/main/scala/net/liftweb/http/provider/HTTPContext.scala b/lift/src/main/scala/net/liftweb/http/provider/HTTPContext.scala old mode 100644 new mode 100755 diff --git a/lift/src/main/scala/net/liftweb/http/provider/HTTPCookie.scala b/lift/src/main/scala/net/liftweb/http/provider/HTTPCookie.scala old mode 100644 new mode 100755 diff --git a/lift/src/main/scala/net/liftweb/http/provider/HTTPParam.scala b/lift/src/main/scala/net/liftweb/http/provider/HTTPParam.scala old mode 100644 new mode 100755 diff --git a/lift/src/main/scala/net/liftweb/http/provider/HTTPProvider.scala b/lift/src/main/scala/net/liftweb/http/provider/HTTPProvider.scala old mode 100644 new mode 100755 diff --git a/lift/src/main/scala/net/liftweb/http/provider/HTTPRequest.scala b/lift/src/main/scala/net/liftweb/http/provider/HTTPRequest.scala old mode 100644 new mode 100755 diff --git a/lift/src/main/scala/net/liftweb/http/provider/HTTPResponse.scala b/lift/src/main/scala/net/liftweb/http/provider/HTTPResponse.scala old mode 100644 new mode 100755 diff --git a/lift/src/main/scala/net/liftweb/http/provider/HTTPSession.scala b/lift/src/main/scala/net/liftweb/http/provider/HTTPSession.scala old mode 100644 new mode 100755 diff --git a/lift/src/main/scala/net/liftweb/http/provider/servlet/HTTPRequestServlet.scala b/lift/src/main/scala/net/liftweb/http/provider/servlet/HTTPRequestServlet.scala old mode 100644 new mode 100755 index d033334..e501a51 --- a/lift/src/main/scala/net/liftweb/http/provider/servlet/HTTPRequestServlet.scala +++ b/lift/src/main/scala/net/liftweb/http/provider/servlet/HTTPRequestServlet.scala @@ -14,13 +14,12 @@ class HTTPRequestServlet(req: HttpServletRequest) extends HTTPRequest { private val (hasContinuations_?, contSupport, getContinuation, getObject, setObject, suspend, resume) = { try { - val cc = Class.forName("org.mortbay.util.ajax.ContinuationSupport") - val meth = cc.getMethod("getContinuation", classOf[HTTPRequest], classOf[AnyRef]) - val cci = Class.forName("org.mortbay.util.ajax.Continuation") - val getObj = cci.getMethod("getObject") - val setObj = cci.getMethod("setObject", classOf[AnyRef]) - val suspend = cci.getMethod("suspend", _root_.java.lang.Long.TYPE) - val resume = cci.getMethod("resume") + val cc = Class.forName("org.atmosphere.cpr.Meteor") + val meth = cc.getMethod("build", classOf[HttpServletRequest]) + val getObj = cc.getMethod("attachement") + val setObj = cc.getMethod("attach", classOf[AnyRef]) + val suspend = cc.getMethod("suspend", _root_.java.lang.Long.TYPE) + val resume = cc.getMethod("resume") (true, (cc), (meth), (getObj), (setObj), (suspend), resume) } catch { case e => (false, null, null, null, null, null, null) @@ -117,7 +116,7 @@ class HTTPRequestServlet(req: HttpServletRequest) extends HTTPRequest { if (!hasContinuations_?) None else if (Props.inGAE) None else { - val cont = getContinuation.invoke(contSupport, req, LiftRules) + val cont = getContinuation.invoke(contSupport, req) val ret = getObject.invoke(cont) try { setObject.invoke(cont, null) @@ -128,13 +127,14 @@ class HTTPRequestServlet(req: HttpServletRequest) extends HTTPRequest { } } + class RetryRequest(msg: String) extends Exception(msg) def suspend(timeout: Long): Nothing = { try { - val cont = getContinuation.invoke(contSupport, req, LiftRules) + val cont = getContinuation.invoke(contSupport, req) Log.trace("About to suspend continuation") suspend.invoke(cont, new _root_.java.lang.Long(timeout)) - throw new Exception("Bail") + throw new RetryRequest("Suspending") } catch { case e: _root_.java.lang.reflect.InvocationTargetException if e.getCause.getClass.getName.endsWith("RetryRequest") => throw e.getCause @@ -142,7 +142,7 @@ class HTTPRequestServlet(req: HttpServletRequest) extends HTTPRequest { } def resume(what: AnyRef) { - val cont = getContinuation.invoke(contSupport, req, LiftRules) + val cont = getContinuation.invoke(contSupport, req) setObject.invoke(cont, what) resume.invoke(cont) } diff --git a/lift/src/main/scala/net/liftweb/http/provider/servlet/HTTPResponseServlet.scala b/lift/src/main/scala/net/liftweb/http/provider/servlet/HTTPResponseServlet.scala old mode 100644 new mode 100755 diff --git a/lift/src/main/scala/net/liftweb/http/provider/servlet/HTTPServletContext.scala b/lift/src/main/scala/net/liftweb/http/provider/servlet/HTTPServletContext.scala old mode 100644 new mode 100755 diff --git a/lift/src/main/scala/net/liftweb/http/provider/servlet/HTTPServletSession.scala b/lift/src/main/scala/net/liftweb/http/provider/servlet/HTTPServletSession.scala old mode 100644 new mode 100755 diff --git a/lift/src/main/scala/net/liftweb/http/provider/servlet/ServletFilterProvider.scala b/lift/src/main/scala/net/liftweb/http/provider/servlet/ServletFilterProvider.scala old mode 100644 new mode 100755 diff --git a/lift/src/main/scala/net/liftweb/http/rest/XMLApiHelper.scala b/lift/src/main/scala/net/liftweb/http/rest/XMLApiHelper.scala old mode 100644 new mode 100755 diff --git a/lift/src/main/scala/net/liftweb/sitemap/Loc.scala b/lift/src/main/scala/net/liftweb/sitemap/Loc.scala old mode 100644 new mode 100755 diff --git a/lift/src/main/scala/net/liftweb/sitemap/Menu.scala b/lift/src/main/scala/net/liftweb/sitemap/Menu.scala old mode 100644 new mode 100755 diff --git a/lift/src/main/scala/net/liftweb/sitemap/SiteMap.scala b/lift/src/main/scala/net/liftweb/sitemap/SiteMap.scala old mode 100644 new mode 100755 diff --git a/lift/src/main/scala/net/liftweb/sitemap/XmlMenu.scala b/lift/src/main/scala/net/liftweb/sitemap/XmlMenu.scala old mode 100644 new mode 100755 diff --git a/lift/src/test/scala/bootstrap/liftweb/Boot.scala b/lift/src/test/scala/bootstrap/liftweb/Boot.scala old mode 100644 new mode 100755 diff --git a/lift/src/test/scala/net/liftweb/webapptest/JettyTestServer.scala b/lift/src/test/scala/net/liftweb/webapptest/JettyTestServer.scala old mode 100644 new mode 100755 diff --git a/lift/src/test/scala/net/liftweb/webapptest/ToHeadUsages.scala b/lift/src/test/scala/net/liftweb/webapptest/ToHeadUsages.scala old mode 100644 new mode 100755 diff --git a/lift/src/test/scala/net/liftweb/webapptest/controller/.keep b/lift/src/test/scala/net/liftweb/webapptest/controller/.keep old mode 100644 new mode 100755 diff --git a/lift/src/test/scala/net/liftweb/webapptest/model/.keep b/lift/src/test/scala/net/liftweb/webapptest/model/.keep old mode 100644 new mode 100755 diff --git a/lift/src/test/scala/net/liftweb/webapptest/snippet/.keep b/lift/src/test/scala/net/liftweb/webapptest/snippet/.keep old mode 100644 new mode 100755 diff --git a/lift/src/test/scala/net/liftweb/webapptest/snippet/HeadTestSnippet.scala b/lift/src/test/scala/net/liftweb/webapptest/snippet/HeadTestSnippet.scala old mode 100644 new mode 100755 diff --git a/lift/src/test/scala/net/liftweb/webapptest/snippet/HelloWorld.scala b/lift/src/test/scala/net/liftweb/webapptest/snippet/HelloWorld.scala old mode 100644 new mode 100755 diff --git a/lift/src/test/scala/net/liftweb/webapptest/view/.keep b/lift/src/test/scala/net/liftweb/webapptest/view/.keep old mode 100644 new mode 100755 diff --git a/lift/src/test/webapp/WEB-INF/web.xml b/lift/src/test/webapp/WEB-INF/web.xml old mode 100644 new mode 100755 diff --git a/lift/src/test/webapp/basicDiv.html b/lift/src/test/webapp/basicDiv.html old mode 100644 new mode 100755 diff --git a/lift/src/test/webapp/body_no_head.html b/lift/src/test/webapp/body_no_head.html old mode 100644 new mode 100755 diff --git a/lift/src/test/webapp/h1.html b/lift/src/test/webapp/h1.html old mode 100644 new mode 100755 diff --git a/lift/src/test/webapp/htmlFragmentWithHead.html b/lift/src/test/webapp/htmlFragmentWithHead.html old mode 100644 new mode 100755 diff --git a/lift/src/test/webapp/htmlSnippetWithHead.html b/lift/src/test/webapp/htmlSnippetWithHead.html old mode 100644 new mode 100755 diff --git a/lift/src/test/webapp/index.html b/lift/src/test/webapp/index.html old mode 100644 new mode 100755 diff --git a/lift/src/test/webapp/non_html.html b/lift/src/test/webapp/non_html.html old mode 100644 new mode 100755 diff --git a/lift/src/test/webapp/templates-hidden/default.html b/lift/src/test/webapp/templates-hidden/default.html old mode 100644 new mode 100755 --------------------------------------------------------------------- To unsubscribe, e-mail: [hidden email] For additional commands, e-mail: [hidden email] |
||||||||||||||||
|
Viktor Klang
|
Salut!
How "workable" is the solution you attached? On Mon, Oct 19, 2009 at 10:02 PM, Jeanfrancois Arcand <[hidden email]> wrote: Salut, -- Viktor Klang Blog: klangism.blogspot.com Twttr: viktorklang Wave: [hidden email] Code: github.com/viktorklang AKKA Committer - akkasource.org Lift Committer - liftweb.com Atmosphere Committer - atmosphere.dev.java.net SoftPub founder: http://groups.google.com/group/softpub |
|
Jeanfrancois Arcand
|
Viktor Klang wrote: > Salut! > > How "workable" is the solution you attached? It just won't suspend properly the request because the code thinks Comet is not enabled. So it fall back to use polling. A+ --Jeanfrancois > > On Mon, Oct 19, 2009 at 10:02 PM, Jeanfrancois Arcand > <[hidden email] <mailto:[hidden email]>> wrote: > > Salut, > > I know Viktor wanted to help, but anybody is welcome to take a look > at the lift code under: > > * /trunk/sandbox/lift/ > > Under that filder, there is a src folder that needs to be placed > under your normal lift workspace: > > /trunk/lift/lift > > The diff is also attached here. Ya this is probably a stupid mistake > ... the idea here is to replace Jetty's Continuation with Atmosphere. > > You have the right to laugh :-) > > A+ > > --jeanfrancois > > diff --git a/examples/example/pom.xml b/examples/example/pom.xml > index e46f3c7..9227aba 100644 > --- a/examples/example/pom.xml > +++ b/examples/example/pom.xml > @@ -14,6 +14,11 @@ > > <dependencies> > <dependency> > + <groupId>org.atmosphere</groupId> > + <artifactId>atmosphere-portable-runtime</artifactId> > + <version>0.4-SNAPSHOT</version> > + </dependency> > + <dependency> > <groupId>com.h2database</groupId> > <artifactId>h2</artifactId> > <version>1.0.79</version> > diff --git a/examples/example/src/main/webapp/WEB-INF/web.xml > b/examples/example/src/main/webapp/WEB-INF/web.xml > index 215dc17..be8e348 100644 > --- a/examples/example/src/main/webapp/WEB-INF/web.xml > +++ b/examples/example/src/main/webapp/WEB-INF/web.xml > @@ -5,20 +5,21 @@ > "http://java.sun.com/dtd/web-app_2_3.dtd"> > > <web-app> > - <filter> > - <filter-name>LiftFilter</filter-name> > - <display-name>Lift Filter</display-name> > - <description>The Filter that intercepts lift calls</description> > - <filter-class>net.liftweb.http.LiftFilter</filter-class> > - </filter> > - > - > - <filter-mapping> > - <filter-name>LiftFilter</filter-name> > - <url-pattern>/*</url-pattern> > - </filter-mapping> > - > - <welcome-file-list> > - <welcome-file>index.html</welcome-file> > - </welcome-file-list> > + <servlet> > + <description>AtmosphereServlet</description> > + <servlet-name>AtmosphereServlet</servlet-name> > + <servlet-class>org.atmosphere.cpr.MeteorServlet</servlet-class> > + <!-- Uncomment if you want to use Servlet 3.0 Async Support > + <async-supported>true</async-supported> > + --> > + <init-param> > + <param-name>org.atmosphere.filter</param-name> > + <param-value>net.liftweb.http.LiftFilter</param-value> > + </init-param> > + <load-on-startup>0</load-on-startup> > + </servlet> > + <servlet-mapping> > + <servlet-name>AtmosphereServlet</servlet-name> > + <url-pattern>/*</url-pattern> > + </servlet-mapping> > </web-app> > diff --git a/lift/pom.xml b/lift/pom.xml > old mode 100644 > new mode 100755 > diff --git a/lift/src/main/resources/i18n/lift-core_en_AU.properties > b/lift/src/main/resources/i18n/lift-core_en_AU.properties > old mode 100644 > new mode 100755 > diff --git a/lift/src/main/resources/i18n/lift-core_en_US.properties > b/lift/src/main/resources/i18n/lift-core_en_US.properties > old mode 100644 > new mode 100755 > diff --git a/lift/src/main/resources/i18n/lift-core_pl.properties > b/lift/src/main/resources/i18n/lift-core_pl.properties > old mode 100644 > new mode 100755 > diff --git a/lift/src/main/resources/toserve/jquery-1.3.2.js > b/lift/src/main/resources/toserve/jquery-1.3.2.js > old mode 100644 > new mode 100755 > diff --git a/lift/src/main/resources/toserve/json2.js > b/lift/src/main/resources/toserve/json2.js > old mode 100644 > new mode 100755 > diff --git a/lift/src/main/resources/toserve/yui/connection.js > b/lift/src/main/resources/toserve/yui/connection.js > old mode 100644 > new mode 100755 > diff --git a/lift/src/main/resources/toserve/yui/dom.js > b/lift/src/main/resources/toserve/yui/dom.js > old mode 100644 > new mode 100755 > diff --git a/lift/src/main/resources/toserve/yui/event.js > b/lift/src/main/resources/toserve/yui/event.js > old mode 100644 > new mode 100755 > diff --git a/lift/src/main/resources/toserve/yui/json.js > b/lift/src/main/resources/toserve/yui/json.js > old mode 100644 > new mode 100755 > diff --git a/lift/src/main/resources/toserve/yui/yahoo.js > b/lift/src/main/resources/toserve/yui/yahoo.js > old mode 100644 > new mode 100755 > diff --git a/lift/src/main/scala/net/liftweb/builtin/snippet/A.scala > b/lift/src/main/scala/net/liftweb/builtin/snippet/A.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/builtin/snippet/CSS.scala > b/lift/src/main/scala/net/liftweb/builtin/snippet/CSS.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/builtin/snippet/Children.scala > b/lift/src/main/scala/net/liftweb/builtin/snippet/Children.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/builtin/snippet/Comet.scala > b/lift/src/main/scala/net/liftweb/builtin/snippet/Comet.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/builtin/snippet/Embed.scala > b/lift/src/main/scala/net/liftweb/builtin/snippet/Embed.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/builtin/snippet/Form.scala > b/lift/src/main/scala/net/liftweb/builtin/snippet/Form.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/builtin/snippet/Group.scala > b/lift/src/main/scala/net/liftweb/builtin/snippet/Group.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/builtin/snippet/Ignore.scala > b/lift/src/main/scala/net/liftweb/builtin/snippet/Ignore.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/builtin/snippet/Loc.scala > b/lift/src/main/scala/net/liftweb/builtin/snippet/Loc.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/builtin/snippet/Menu.scala > b/lift/src/main/scala/net/liftweb/builtin/snippet/Menu.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/builtin/snippet/Msg.scala > b/lift/src/main/scala/net/liftweb/builtin/snippet/Msg.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/builtin/snippet/Msgs.scala > b/lift/src/main/scala/net/liftweb/builtin/snippet/Msgs.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/builtin/snippet/SkipDocType.scala > b/lift/src/main/scala/net/liftweb/builtin/snippet/SkipDocType.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/builtin/snippet/Surround.scala > b/lift/src/main/scala/net/liftweb/builtin/snippet/Surround.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/builtin/snippet/Tail.scala > b/lift/src/main/scala/net/liftweb/builtin/snippet/Tail.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/builtin/snippet/TestCond.scala > b/lift/src/main/scala/net/liftweb/builtin/snippet/TestCond.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/builtin/snippet/VersionInfo.scala > b/lift/src/main/scala/net/liftweb/builtin/snippet/VersionInfo.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/builtin/snippet/WithParam.scala > b/lift/src/main/scala/net/liftweb/builtin/snippet/WithParam.scala > old mode 100644 > new mode 100755 > diff --git a/lift/src/main/scala/net/liftweb/http/CometActor.scala > b/lift/src/main/scala/net/liftweb/http/CometActor.scala > old mode 100644 > new mode 100755 > diff --git a/lift/src/main/scala/net/liftweb/http/Factory.scala > b/lift/src/main/scala/net/liftweb/http/Factory.scala > old mode 100644 > new mode 100755 > diff --git a/lift/src/main/scala/net/liftweb/http/HttpResponse.scala > b/lift/src/main/scala/net/liftweb/http/HttpResponse.scala > old mode 100644 > new mode 100755 > diff --git a/lift/src/main/scala/net/liftweb/http/LiftRules.scala > b/lift/src/main/scala/net/liftweb/http/LiftRules.scala > old mode 100644 > new mode 100755 > diff --git a/lift/src/main/scala/net/liftweb/http/LiftServlet.scala > b/lift/src/main/scala/net/liftweb/http/LiftServlet.scala > old mode 100644 > new mode 100755 > diff --git a/lift/src/main/scala/net/liftweb/http/LiftSession.scala > b/lift/src/main/scala/net/liftweb/http/LiftSession.scala > old mode 100644 > new mode 100755 > diff --git a/lift/src/main/scala/net/liftweb/http/Req.scala > b/lift/src/main/scala/net/liftweb/http/Req.scala > old mode 100644 > new mode 100755 > diff --git a/lift/src/main/scala/net/liftweb/http/RequestType.scala > b/lift/src/main/scala/net/liftweb/http/RequestType.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/http/ResourceServer.scala > b/lift/src/main/scala/net/liftweb/http/ResourceServer.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/http/ResponseShortcutException.scala > b/lift/src/main/scala/net/liftweb/http/ResponseShortcutException.scala > old mode 100644 > new mode 100755 > diff --git a/lift/src/main/scala/net/liftweb/http/S.scala > b/lift/src/main/scala/net/liftweb/http/S.scala > old mode 100644 > new mode 100755 > diff --git a/lift/src/main/scala/net/liftweb/http/SHtml.scala > b/lift/src/main/scala/net/liftweb/http/SHtml.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/http/SimpleController.scala > b/lift/src/main/scala/net/liftweb/http/SimpleController.scala > old mode 100644 > new mode 100755 > diff --git a/lift/src/main/scala/net/liftweb/http/Stateful.scala > b/lift/src/main/scala/net/liftweb/http/Stateful.scala > old mode 100644 > new mode 100755 > diff --git a/lift/src/main/scala/net/liftweb/http/Vars.scala > b/lift/src/main/scala/net/liftweb/http/Vars.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/http/auth/Authentication.scala > b/lift/src/main/scala/net/liftweb/http/auth/Authentication.scala > old mode 100644 > new mode 100755 > diff --git a/lift/src/main/scala/net/liftweb/http/auth/Role.scala > b/lift/src/main/scala/net/liftweb/http/auth/Role.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/http/js/ScriptRenderer.scala > b/lift/src/main/scala/net/liftweb/http/js/ScriptRenderer.scala > old mode 100644 > new mode 100755 > diff --git a/lift/src/main/scala/net/liftweb/http/js/XML2Js.scala > b/lift/src/main/scala/net/liftweb/http/js/XML2Js.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/http/provider/HTTPContext.scala > b/lift/src/main/scala/net/liftweb/http/provider/HTTPContext.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/http/provider/HTTPCookie.scala > b/lift/src/main/scala/net/liftweb/http/provider/HTTPCookie.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/http/provider/HTTPParam.scala > b/lift/src/main/scala/net/liftweb/http/provider/HTTPParam.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/http/provider/HTTPProvider.scala > b/lift/src/main/scala/net/liftweb/http/provider/HTTPProvider.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/http/provider/HTTPRequest.scala > b/lift/src/main/scala/net/liftweb/http/provider/HTTPRequest.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/http/provider/HTTPResponse.scala > b/lift/src/main/scala/net/liftweb/http/provider/HTTPResponse.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/http/provider/HTTPSession.scala > b/lift/src/main/scala/net/liftweb/http/provider/HTTPSession.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/http/provider/servlet/HTTPRequestServlet.scala > b/lift/src/main/scala/net/liftweb/http/provider/servlet/HTTPRequestServlet.scala > old mode 100644 > new mode 100755 > index d033334..e501a51 > --- > a/lift/src/main/scala/net/liftweb/http/provider/servlet/HTTPRequestServlet.scala > +++ > b/lift/src/main/scala/net/liftweb/http/provider/servlet/HTTPRequestServlet.scala > @@ -14,13 +14,12 @@ class HTTPRequestServlet(req: > HttpServletRequest) extends HTTPRequest { > > private val (hasContinuations_?, contSupport, getContinuation, > getObject, setObject, suspend, resume) = { > try { > - val cc = > Class.forName("org.mortbay.util.ajax.ContinuationSupport") > - val meth = cc.getMethod("getContinuation", > classOf[HTTPRequest], classOf[AnyRef]) > - val cci = Class.forName("org.mortbay.util.ajax.Continuation") > - val getObj = cci.getMethod("getObject") > - val setObj = cci.getMethod("setObject", classOf[AnyRef]) > - val suspend = cci.getMethod("suspend", > _root_.java.lang.Long.TYPE) > - val resume = cci.getMethod("resume") > + val cc = Class.forName("org.atmosphere.cpr.Meteor") > + val meth = cc.getMethod("build", classOf[HttpServletRequest]) > + val getObj = cc.getMethod("attachement") > + val setObj = cc.getMethod("attach", classOf[AnyRef]) > + val suspend = cc.getMethod("suspend", _root_.java.lang.Long.TYPE) > + val resume = cc.getMethod("resume") > (true, (cc), (meth), (getObj), (setObj), (suspend), resume) > } catch { > case e => (false, null, null, null, null, null, null) > @@ -117,7 +116,7 @@ class HTTPRequestServlet(req: > HttpServletRequest) extends HTTPRequest { > if (!hasContinuations_?) None > else if (Props.inGAE) None > else { > - val cont = getContinuation.invoke(contSupport, req, LiftRules) > + val cont = getContinuation.invoke(contSupport, req) > val ret = getObject.invoke(cont) > try { > setObject.invoke(cont, null) > @@ -128,13 +127,14 @@ class HTTPRequestServlet(req: > HttpServletRequest) extends HTTPRequest { > } > } > > + class RetryRequest(msg: String) extends Exception(msg) > > def suspend(timeout: Long): Nothing = { > try { > - val cont = getContinuation.invoke(contSupport, req, LiftRules) > + val cont = getContinuation.invoke(contSupport, req) > Log.trace("About to suspend continuation") > suspend.invoke(cont, new _root_.java.lang.Long(timeout)) > - throw new Exception("Bail") > + throw new RetryRequest("Suspending") > } catch { > case e: _root_.java.lang.reflect.InvocationTargetException if > e.getCause.getClass.getName.endsWith("RetryRequest") => > throw e.getCause > @@ -142,7 +142,7 @@ class HTTPRequestServlet(req: > HttpServletRequest) extends HTTPRequest { > } > > def resume(what: AnyRef) { > - val cont = getContinuation.invoke(contSupport, req, LiftRules) > + val cont = getContinuation.invoke(contSupport, req) > setObject.invoke(cont, what) > resume.invoke(cont) > } > diff --git > a/lift/src/main/scala/net/liftweb/http/provider/servlet/HTTPResponseServlet.scala > b/lift/src/main/scala/net/liftweb/http/provider/servlet/HTTPResponseServlet.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/http/provider/servlet/HTTPServletContext.scala > b/lift/src/main/scala/net/liftweb/http/provider/servlet/HTTPServletContext.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/http/provider/servlet/HTTPServletSession.scala > b/lift/src/main/scala/net/liftweb/http/provider/servlet/HTTPServletSession.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/http/provider/servlet/ServletFilterProvider.scala > b/lift/src/main/scala/net/liftweb/http/provider/servlet/ServletFilterProvider.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/http/rest/XMLApiHelper.scala > b/lift/src/main/scala/net/liftweb/http/rest/XMLApiHelper.scala > old mode 100644 > new mode 100755 > diff --git a/lift/src/main/scala/net/liftweb/sitemap/Loc.scala > b/lift/src/main/scala/net/liftweb/sitemap/Loc.scala > old mode 100644 > new mode 100755 > diff --git a/lift/src/main/scala/net/liftweb/sitemap/Menu.scala > b/lift/src/main/scala/net/liftweb/sitemap/Menu.scala > old mode 100644 > new mode 100755 > diff --git a/lift/src/main/scala/net/liftweb/sitemap/SiteMap.scala > b/lift/src/main/scala/net/liftweb/sitemap/SiteMap.scala > old mode 100644 > new mode 100755 > diff --git a/lift/src/main/scala/net/liftweb/sitemap/XmlMenu.scala > b/lift/src/main/scala/net/liftweb/sitemap/XmlMenu.scala > old mode 100644 > new mode 100755 > diff --git a/lift/src/test/scala/bootstrap/liftweb/Boot.scala > b/lift/src/test/scala/bootstrap/liftweb/Boot.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/test/scala/net/liftweb/webapptest/JettyTestServer.scala > b/lift/src/test/scala/net/liftweb/webapptest/JettyTestServer.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/test/scala/net/liftweb/webapptest/ToHeadUsages.scala > b/lift/src/test/scala/net/liftweb/webapptest/ToHeadUsages.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/test/scala/net/liftweb/webapptest/controller/.keep > b/lift/src/test/scala/net/liftweb/webapptest/controller/.keep > old mode 100644 > new mode 100755 > diff --git a/lift/src/test/scala/net/liftweb/webapptest/model/.keep > b/lift/src/test/scala/net/liftweb/webapptest/model/.keep > old mode 100644 > new mode 100755 > diff --git > a/lift/src/test/scala/net/liftweb/webapptest/snippet/.keep > b/lift/src/test/scala/net/liftweb/webapptest/snippet/.keep > old mode 100644 > new mode 100755 > diff --git > a/lift/src/test/scala/net/liftweb/webapptest/snippet/HeadTestSnippet.scala > b/lift/src/test/scala/net/liftweb/webapptest/snippet/HeadTestSnippet.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/test/scala/net/liftweb/webapptest/snippet/HelloWorld.scala > b/lift/src/test/scala/net/liftweb/webapptest/snippet/HelloWorld.scala > old mode 100644 > new mode 100755 > diff --git a/lift/src/test/scala/net/liftweb/webapptest/view/.keep > b/lift/src/test/scala/net/liftweb/webapptest/view/.keep > old mode 100644 > new mode 100755 > diff --git a/lift/src/test/webapp/WEB-INF/web.xml > b/lift/src/test/webapp/WEB-INF/web.xml > old mode 100644 > new mode 100755 > diff --git a/lift/src/test/webapp/basicDiv.html > b/lift/src/test/webapp/basicDiv.html > old mode 100644 > new mode 100755 > diff --git a/lift/src/test/webapp/body_no_head.html > b/lift/src/test/webapp/body_no_head.html > old mode 100644 > new mode 100755 > diff --git a/lift/src/test/webapp/h1.html b/lift/src/test/webapp/h1.html > old mode 100644 > new mode 100755 > diff --git a/lift/src/test/webapp/htmlFragmentWithHead.html > b/lift/src/test/webapp/htmlFragmentWithHead.html > old mode 100644 > new mode 100755 > diff --git a/lift/src/test/webapp/htmlSnippetWithHead.html > b/lift/src/test/webapp/htmlSnippetWithHead.html > old mode 100644 > new mode 100755 > diff --git a/lift/src/test/webapp/index.html > b/lift/src/test/webapp/index.html > old mode 100644 > new mode 100755 > diff --git a/lift/src/test/webapp/non_html.html > b/lift/src/test/webapp/non_html.html > old mode 100644 > new mode 100755 > diff --git a/lift/src/test/webapp/templates-hidden/default.html > b/lift/src/test/webapp/templates-hidden/default.html > old mode 100644 > new mode 100755 > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [hidden email] > <mailto:[hidden email]> > For additional commands, e-mail: [hidden email] > <mailto:[hidden email]> > > > > > -- > Viktor Klang > > Blog: klangism.blogspot.com <http://klangism.blogspot.com> > Twttr: viktorklang > Wave: [hidden email] <mailto:[hidden email]> > Code: github.com/viktorklang <http://github.com/viktorklang> > > AKKA Committer - akkasource.org <http://akkasource.org> > Lift Committer - liftweb.com <http://liftweb.com> > Atmosphere Committer - atmosphere.dev.java.net > <http://atmosphere.dev.java.net> > SoftPub founder: http://groups.google.com/group/softpub --------------------------------------------------------------------- To unsubscribe, e-mail: [hidden email] For additional commands, e-mail: [hidden email] |
||||||||||||||||
|
Viktor Klang
|
On Tue, Oct 20, 2009 at 9:11 PM, Jeanfrancois Arcand <[hidden email]> wrote:
I'll try to have a look at it. However, I am unsure of the servlet-mapping for /* I was thinking of mapping Atmosphere for /atmosphere/* and then in Lift do a re-write from /comet/* and dispatch (via RequestDispatcher) to /atmosphere/* But I am unsure on how intrusive that'd be in the Lift code. A+ -- Viktor Klang Blog: klangism.blogspot.com Twttr: viktorklang Wave: [hidden email] Code: github.com/viktorklang AKKA Committer - akkasource.org Lift Committer - liftweb.com Atmosphere Committer - atmosphere.dev.java.net SoftPub founder: http://groups.google.com/group/softpub |
||||||||||||||||
|
Jeanfrancois Arcand
|
Salut,
Viktor Klang wrote: > > > On Tue, Oct 20, 2009 at 9:11 PM, Jeanfrancois Arcand > <[hidden email] <mailto:[hidden email]>> wrote: > > > > Viktor Klang wrote: > > Salut! > > How "workable" is the solution you attached? > > > It just won't suspend properly the request because the code thinks > Comet is not enabled. So it fall back to use polling. > > > I'll try to have a look at it. > However, I am unsure of the servlet-mapping for /* > I was thinking of mapping Atmosphere for /atmosphere/* > and then in Lift do a re-write from /comet/* and dispatch (via > RequestDispatcher) to /atmosphere/* So you would leave the Lift code intact, and have a second Servlet handling the suspend/resume/broadcast operations? Sound like a good idea.... > > But I am unsure on how intrusive that'd be in the Lift code. Right. Actually I will try to take a look again once I'm sure there is no issue with v3 and Eduardo's sample. So far no luck. A+ -- Jeanfrancois > > > A+ > > --Jeanfrancois > > > On Mon, Oct 19, 2009 at 10:02 PM, Jeanfrancois Arcand > <[hidden email] > <mailto:[hidden email]> > <mailto:[hidden email] > <mailto:[hidden email]>>> wrote: > > Salut, > > I know Viktor wanted to help, but anybody is welcome to take > a look > at the lift code under: > > * /trunk/sandbox/lift/ > > Under that filder, there is a src folder that needs to be placed > under your normal lift workspace: > > /trunk/lift/lift > > The diff is also attached here. Ya this is probably a stupid > mistake > ... the idea here is to replace Jetty's Continuation with > Atmosphere. > > You have the right to laugh :-) > > A+ > > --jeanfrancois > > diff --git a/examples/example/pom.xml b/examples/example/pom.xml > index e46f3c7..9227aba 100644 > --- a/examples/example/pom.xml > +++ b/examples/example/pom.xml > @@ -14,6 +14,11 @@ > > <dependencies> > <dependency> > + <groupId>org.atmosphere</groupId> > + <artifactId>atmosphere-portable-runtime</artifactId> > + <version>0.4-SNAPSHOT</version> > + </dependency> > + <dependency> > <groupId>com.h2database</groupId> > <artifactId>h2</artifactId> > <version>1.0.79</version> > diff --git a/examples/example/src/main/webapp/WEB-INF/web.xml > b/examples/example/src/main/webapp/WEB-INF/web.xml > index 215dc17..be8e348 100644 > --- a/examples/example/src/main/webapp/WEB-INF/web.xml > +++ b/examples/example/src/main/webapp/WEB-INF/web.xml > @@ -5,20 +5,21 @@ > "http://java.sun.com/dtd/web-app_2_3.dtd"> > > <web-app> > - <filter> > - <filter-name>LiftFilter</filter-name> > - <display-name>Lift Filter</display-name> > - <description>The Filter that intercepts lift > calls</description> > - <filter-class>net.liftweb.http.LiftFilter</filter-class> > - </filter> > - > - > - <filter-mapping> > - <filter-name>LiftFilter</filter-name> > - <url-pattern>/*</url-pattern> > - </filter-mapping> > - > - <welcome-file-list> > - <welcome-file>index.html</welcome-file> > - </welcome-file-list> > + <servlet> > + <description>AtmosphereServlet</description> > + <servlet-name>AtmosphereServlet</servlet-name> > + > <servlet-class>org.atmosphere.cpr.MeteorServlet</servlet-class> > + <!-- Uncomment if you want to use Servlet 3.0 Async > Support > + <async-supported>true</async-supported> > + --> > + <init-param> > + <param-name>org.atmosphere.filter</param-name> > + > <param-value>net.liftweb.http.LiftFilter</param-value> > + </init-param> > + <load-on-startup>0</load-on-startup> > + </servlet> > + <servlet-mapping> > + <servlet-name>AtmosphereServlet</servlet-name> > + <url-pattern>/*</url-pattern> > + </servlet-mapping> > </web-app> > diff --git a/lift/pom.xml b/lift/pom.xml > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/resources/i18n/lift-core_en_AU.properties > b/lift/src/main/resources/i18n/lift-core_en_AU.properties > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/resources/i18n/lift-core_en_US.properties > b/lift/src/main/resources/i18n/lift-core_en_US.properties > old mode 100644 > new mode 100755 > diff --git a/lift/src/main/resources/i18n/lift-core_pl.properties > b/lift/src/main/resources/i18n/lift-core_pl.properties > old mode 100644 > new mode 100755 > diff --git a/lift/src/main/resources/toserve/jquery-1.3.2.js > b/lift/src/main/resources/toserve/jquery-1.3.2.js > old mode 100644 > new mode 100755 > diff --git a/lift/src/main/resources/toserve/json2.js > b/lift/src/main/resources/toserve/json2.js > old mode 100644 > new mode 100755 > diff --git a/lift/src/main/resources/toserve/yui/connection.js > b/lift/src/main/resources/toserve/yui/connection.js > old mode 100644 > new mode 100755 > diff --git a/lift/src/main/resources/toserve/yui/dom.js > b/lift/src/main/resources/toserve/yui/dom.js > old mode 100644 > new mode 100755 > diff --git a/lift/src/main/resources/toserve/yui/event.js > b/lift/src/main/resources/toserve/yui/event.js > old mode 100644 > new mode 100755 > diff --git a/lift/src/main/resources/toserve/yui/json.js > b/lift/src/main/resources/toserve/yui/json.js > old mode 100644 > new mode 100755 > diff --git a/lift/src/main/resources/toserve/yui/yahoo.js > b/lift/src/main/resources/toserve/yui/yahoo.js > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/builtin/snippet/A.scala > b/lift/src/main/scala/net/liftweb/builtin/snippet/A.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/builtin/snippet/CSS.scala > b/lift/src/main/scala/net/liftweb/builtin/snippet/CSS.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/builtin/snippet/Children.scala > b/lift/src/main/scala/net/liftweb/builtin/snippet/Children.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/builtin/snippet/Comet.scala > b/lift/src/main/scala/net/liftweb/builtin/snippet/Comet.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/builtin/snippet/Embed.scala > b/lift/src/main/scala/net/liftweb/builtin/snippet/Embed.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/builtin/snippet/Form.scala > b/lift/src/main/scala/net/liftweb/builtin/snippet/Form.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/builtin/snippet/Group.scala > b/lift/src/main/scala/net/liftweb/builtin/snippet/Group.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/builtin/snippet/Ignore.scala > b/lift/src/main/scala/net/liftweb/builtin/snippet/Ignore.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/builtin/snippet/Loc.scala > b/lift/src/main/scala/net/liftweb/builtin/snippet/Loc.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/builtin/snippet/Menu.scala > b/lift/src/main/scala/net/liftweb/builtin/snippet/Menu.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/builtin/snippet/Msg.scala > b/lift/src/main/scala/net/liftweb/builtin/snippet/Msg.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/builtin/snippet/Msgs.scala > b/lift/src/main/scala/net/liftweb/builtin/snippet/Msgs.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/scala/net/liftweb/builtin/snippet/SkipDocType.scala > > b/lift/src/main/scala/net/liftweb/builtin/snippet/SkipDocType.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/builtin/snippet/Surround.scala > b/lift/src/main/scala/net/liftweb/builtin/snippet/Surround.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/builtin/snippet/Tail.scala > b/lift/src/main/scala/net/liftweb/builtin/snippet/Tail.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/builtin/snippet/TestCond.scala > b/lift/src/main/scala/net/liftweb/builtin/snippet/TestCond.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/scala/net/liftweb/builtin/snippet/VersionInfo.scala > > b/lift/src/main/scala/net/liftweb/builtin/snippet/VersionInfo.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/builtin/snippet/WithParam.scala > b/lift/src/main/scala/net/liftweb/builtin/snippet/WithParam.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/http/CometActor.scala > b/lift/src/main/scala/net/liftweb/http/CometActor.scala > old mode 100644 > new mode 100755 > diff --git a/lift/src/main/scala/net/liftweb/http/Factory.scala > b/lift/src/main/scala/net/liftweb/http/Factory.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/http/HttpResponse.scala > b/lift/src/main/scala/net/liftweb/http/HttpResponse.scala > old mode 100644 > new mode 100755 > diff --git a/lift/src/main/scala/net/liftweb/http/LiftRules.scala > b/lift/src/main/scala/net/liftweb/http/LiftRules.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/http/LiftServlet.scala > b/lift/src/main/scala/net/liftweb/http/LiftServlet.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/http/LiftSession.scala > b/lift/src/main/scala/net/liftweb/http/LiftSession.scala > old mode 100644 > new mode 100755 > diff --git a/lift/src/main/scala/net/liftweb/http/Req.scala > b/lift/src/main/scala/net/liftweb/http/Req.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/http/RequestType.scala > b/lift/src/main/scala/net/liftweb/http/RequestType.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/http/ResourceServer.scala > b/lift/src/main/scala/net/liftweb/http/ResourceServer.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/scala/net/liftweb/http/ResponseShortcutException.scala > > b/lift/src/main/scala/net/liftweb/http/ResponseShortcutException.scala > old mode 100644 > new mode 100755 > diff --git a/lift/src/main/scala/net/liftweb/http/S.scala > b/lift/src/main/scala/net/liftweb/http/S.scala > old mode 100644 > new mode 100755 > diff --git a/lift/src/main/scala/net/liftweb/http/SHtml.scala > b/lift/src/main/scala/net/liftweb/http/SHtml.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/http/SimpleController.scala > b/lift/src/main/scala/net/liftweb/http/SimpleController.scala > old mode 100644 > new mode 100755 > diff --git a/lift/src/main/scala/net/liftweb/http/Stateful.scala > b/lift/src/main/scala/net/liftweb/http/Stateful.scala > old mode 100644 > new mode 100755 > diff --git a/lift/src/main/scala/net/liftweb/http/Vars.scala > b/lift/src/main/scala/net/liftweb/http/Vars.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/http/auth/Authentication.scala > b/lift/src/main/scala/net/liftweb/http/auth/Authentication.scala > old mode 100644 > new mode 100755 > diff --git a/lift/src/main/scala/net/liftweb/http/auth/Role.scala > b/lift/src/main/scala/net/liftweb/http/auth/Role.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/http/js/ScriptRenderer.scala > b/lift/src/main/scala/net/liftweb/http/js/ScriptRenderer.scala > old mode 100644 > new mode 100755 > diff --git a/lift/src/main/scala/net/liftweb/http/js/XML2Js.scala > b/lift/src/main/scala/net/liftweb/http/js/XML2Js.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/http/provider/HTTPContext.scala > b/lift/src/main/scala/net/liftweb/http/provider/HTTPContext.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/http/provider/HTTPCookie.scala > b/lift/src/main/scala/net/liftweb/http/provider/HTTPCookie.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/http/provider/HTTPParam.scala > b/lift/src/main/scala/net/liftweb/http/provider/HTTPParam.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/scala/net/liftweb/http/provider/HTTPProvider.scala > > b/lift/src/main/scala/net/liftweb/http/provider/HTTPProvider.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/http/provider/HTTPRequest.scala > b/lift/src/main/scala/net/liftweb/http/provider/HTTPRequest.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/scala/net/liftweb/http/provider/HTTPResponse.scala > > b/lift/src/main/scala/net/liftweb/http/provider/HTTPResponse.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/http/provider/HTTPSession.scala > b/lift/src/main/scala/net/liftweb/http/provider/HTTPSession.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/scala/net/liftweb/http/provider/servlet/HTTPRequestServlet.scala > > b/lift/src/main/scala/net/liftweb/http/provider/servlet/HTTPRequestServlet.scala > old mode 100644 > new mode 100755 > index d033334..e501a51 > --- > > a/lift/src/main/scala/net/liftweb/http/provider/servlet/HTTPRequestServlet.scala > +++ > > b/lift/src/main/scala/net/liftweb/http/provider/servlet/HTTPRequestServlet.scala > @@ -14,13 +14,12 @@ class HTTPRequestServlet(req: > HttpServletRequest) extends HTTPRequest { > > private val (hasContinuations_?, contSupport, getContinuation, > getObject, setObject, suspend, resume) = { > try { > - val cc = > Class.forName("org.mortbay.util.ajax.ContinuationSupport") > - val meth = cc.getMethod("getContinuation", > classOf[HTTPRequest], classOf[AnyRef]) > - val cci = > Class.forName("org.mortbay.util.ajax.Continuation") > - val getObj = cci.getMethod("getObject") > - val setObj = cci.getMethod("setObject", classOf[AnyRef]) > - val suspend = cci.getMethod("suspend", > _root_.java.lang.Long.TYPE) > - val resume = cci.getMethod("resume") > + val cc = Class.forName("org.atmosphere.cpr.Meteor") > + val meth = cc.getMethod("build", > classOf[HttpServletRequest]) > + val getObj = cc.getMethod("attachement") > + val setObj = cc.getMethod("attach", classOf[AnyRef]) > + val suspend = cc.getMethod("suspend", > _root_.java.lang.Long.TYPE) > + val resume = cc.getMethod("resume") > (true, (cc), (meth), (getObj), (setObj), (suspend), resume) > } catch { > case e => (false, null, null, null, null, null, null) > @@ -117,7 +116,7 @@ class HTTPRequestServlet(req: > HttpServletRequest) extends HTTPRequest { > if (!hasContinuations_?) None > else if (Props.inGAE) None > else { > - val cont = getContinuation.invoke(contSupport, req, > LiftRules) > + val cont = getContinuation.invoke(contSupport, req) > val ret = getObject.invoke(cont) > try { > setObject.invoke(cont, null) > @@ -128,13 +127,14 @@ class HTTPRequestServlet(req: > HttpServletRequest) extends HTTPRequest { > } > } > > + class RetryRequest(msg: String) extends Exception(msg) > > def suspend(timeout: Long): Nothing = { > try { > - val cont = getContinuation.invoke(contSupport, req, > LiftRules) > + val cont = getContinuation.invoke(contSupport, req) > Log.trace("About to suspend continuation") > suspend.invoke(cont, new _root_.java.lang.Long(timeout)) > - throw new Exception("Bail") > + throw new RetryRequest("Suspending") > } catch { > case e: > _root_.java.lang.reflect.InvocationTargetException if > e.getCause.getClass.getName.endsWith("RetryRequest") => > throw e.getCause > @@ -142,7 +142,7 @@ class HTTPRequestServlet(req: > HttpServletRequest) extends HTTPRequest { > } > > def resume(what: AnyRef) { > - val cont = getContinuation.invoke(contSupport, req, > LiftRules) > + val cont = getContinuation.invoke(contSupport, req) > setObject.invoke(cont, what) > resume.invoke(cont) > } > diff --git > > a/lift/src/main/scala/net/liftweb/http/provider/servlet/HTTPResponseServlet.scala > > b/lift/src/main/scala/net/liftweb/http/provider/servlet/HTTPResponseServlet.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/scala/net/liftweb/http/provider/servlet/HTTPServletContext.scala > > b/lift/src/main/scala/net/liftweb/http/provider/servlet/HTTPServletContext.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/scala/net/liftweb/http/provider/servlet/HTTPServletSession.scala > > b/lift/src/main/scala/net/liftweb/http/provider/servlet/HTTPServletSession.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/scala/net/liftweb/http/provider/servlet/ServletFilterProvider.scala > > b/lift/src/main/scala/net/liftweb/http/provider/servlet/ServletFilterProvider.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/http/rest/XMLApiHelper.scala > b/lift/src/main/scala/net/liftweb/http/rest/XMLApiHelper.scala > old mode 100644 > new mode 100755 > diff --git a/lift/src/main/scala/net/liftweb/sitemap/Loc.scala > b/lift/src/main/scala/net/liftweb/sitemap/Loc.scala > old mode 100644 > new mode 100755 > diff --git a/lift/src/main/scala/net/liftweb/sitemap/Menu.scala > b/lift/src/main/scala/net/liftweb/sitemap/Menu.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/sitemap/SiteMap.scala > b/lift/src/main/scala/net/liftweb/sitemap/SiteMap.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/sitemap/XmlMenu.scala > b/lift/src/main/scala/net/liftweb/sitemap/XmlMenu.scala > old mode 100644 > new mode 100755 > diff --git a/lift/src/test/scala/bootstrap/liftweb/Boot.scala > b/lift/src/test/scala/bootstrap/liftweb/Boot.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/test/scala/net/liftweb/webapptest/JettyTestServer.scala > > b/lift/src/test/scala/net/liftweb/webapptest/JettyTestServer.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/test/scala/net/liftweb/webapptest/ToHeadUsages.scala > b/lift/src/test/scala/net/liftweb/webapptest/ToHeadUsages.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/test/scala/net/liftweb/webapptest/controller/.keep > b/lift/src/test/scala/net/liftweb/webapptest/controller/.keep > old mode 100644 > new mode 100755 > diff --git > a/lift/src/test/scala/net/liftweb/webapptest/model/.keep > b/lift/src/test/scala/net/liftweb/webapptest/model/.keep > old mode 100644 > new mode 100755 > diff --git > a/lift/src/test/scala/net/liftweb/webapptest/snippet/.keep > b/lift/src/test/scala/net/liftweb/webapptest/snippet/.keep > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/test/scala/net/liftweb/webapptest/snippet/HeadTestSnippet.scala > > b/lift/src/test/scala/net/liftweb/webapptest/snippet/HeadTestSnippet.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/test/scala/net/liftweb/webapptest/snippet/HelloWorld.scala > > b/lift/src/test/scala/net/liftweb/webapptest/snippet/HelloWorld.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/test/scala/net/liftweb/webapptest/view/.keep > b/lift/src/test/scala/net/liftweb/webapptest/view/.keep > old mode 100644 > new mode 100755 > diff --git a/lift/src/test/webapp/WEB-INF/web.xml > b/lift/src/test/webapp/WEB-INF/web.xml > old mode 100644 > new mode 100755 > diff --git a/lift/src/test/webapp/basicDiv.html > b/lift/src/test/webapp/basicDiv.html > old mode 100644 > new mode 100755 > diff --git a/lift/src/test/webapp/body_no_head.html > b/lift/src/test/webapp/body_no_head.html > old mode 100644 > new mode 100755 > diff --git a/lift/src/test/webapp/h1.html > b/lift/src/test/webapp/h1.html > old mode 100644 > new mode 100755 > diff --git a/lift/src/test/webapp/htmlFragmentWithHead.html > b/lift/src/test/webapp/htmlFragmentWithHead.html > old mode 100644 > new mode 100755 > diff --git a/lift/src/test/webapp/htmlSnippetWithHead.html > b/lift/src/test/webapp/htmlSnippetWithHead.html > old mode 100644 > new mode 100755 > diff --git a/lift/src/test/webapp/index.html > b/lift/src/test/webapp/index.html > old mode 100644 > new mode 100755 > diff --git a/lift/src/test/webapp/non_html.html > b/lift/src/test/webapp/non_html.html > old mode 100644 > new mode 100755 > diff --git a/lift/src/test/webapp/templates-hidden/default.html > b/lift/src/test/webapp/templates-hidden/default.html > old mode 100644 > new mode 100755 > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: > [hidden email] > <mailto:[hidden email]> > <mailto:[hidden email] > <mailto:[hidden email]>> > > For additional commands, e-mail: > [hidden email] > <mailto:[hidden email]> > <mailto:[hidden email] > <mailto:[hidden email]>> > > > > > -- > Viktor Klang > > Blog: klangism.blogspot.com <http://klangism.blogspot.com> > <http://klangism.blogspot.com> > Twttr: viktorklang > Wave: [hidden email] > <mailto:[hidden email]> > <mailto:[hidden email] > <mailto:[hidden email]>> > Code: github.com/viktorklang <http://github.com/viktorklang> > <http://github.com/viktorklang> > > AKKA Committer - akkasource.org <http://akkasource.org> > <http://akkasource.org> > Lift Committer - liftweb.com <http://liftweb.com> > <http://liftweb.com> > Atmosphere Committer - atmosphere.dev.java.net > <http://atmosphere.dev.java.net> <http://atmosphere.dev.java.net> > > SoftPub founder: http://groups.google.com/group/softpub > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [hidden email] > <mailto:[hidden email]> > For additional commands, e-mail: [hidden email] > <mailto:[hidden email]> > > > > > -- > Viktor Klang > > Blog: klangism.blogspot.com <http://klangism.blogspot.com> > Twttr: viktorklang > Wave: [hidden email] <mailto:[hidden email]> > Code: github.com/viktorklang <http://github.com/viktorklang> > > AKKA Committer - akkasource.org <http://akkasource.org> > Lift Committer - liftweb.com <http://liftweb.com> > Atmosphere Committer - atmosphere.dev.java.net > <http://atmosphere.dev.java.net> > SoftPub founder: http://groups.google.com/group/softpub --------------------------------------------------------------------- To unsubscribe, e-mail: [hidden email] For additional commands, e-mail: [hidden email] |
||||||||||||||||
|
Viktor Klang
|
On Tue, Oct 20, 2009 at 10:46 PM, Jeanfrancois Arcand <[hidden email]> wrote: Salut, Yeah, I think that's the way to go, but we'd have to slightly alter lift to do a pass-thru for requests to /comet_request/* Also, we'd need to make sure that the Comet-requests are processed within a Lift scope. I've done some testing with your path, and the problem seems to stem from : def suspend(timeout: Long): Unit = { try { //val cont = getContinuation.invoke(contSupport, req, LiftRules) val cont = getContinuation.invoke(contSupport, req) Log.trace("About to suspend continuation") suspend.invoke(cont, new _root_.java.lang.Long(timeout)) //throw new Exception("Bail") <---- THIS WAS CAUSING PROBLEMS IN ATMOSPHERE SERVLET } catch { case e: _root_.java.lang.reflect.InvocationTargetException if e.getCause.getClass.getName.endsWith("RetryRequest") => throw e.getCause } } But, the problem is that suspend.invoke really doesn't suspend the request... As witnessed by this log (produced in a second or so): INFO - Service request (GET) / took 38 Milliseconds INFO - Service request (GET) /comet_request/bs9sdnlig4wg/cometAjax.js took 2 Milliseconds INFO - Service request (GET) /comet_request/28954930251/bs9sdnlig4wg took 0 Milliseconds INFO - Service request (GET) /comet_request/73163087952/bs9sdnlig4wg took 0 Milliseconds INFO - Service request (GET) /comet_request/66483942731/bs9sdnlig4wg took 0 Milliseconds INFO - Service request (GET) /comet_request/86189166654/bs9sdnlig4wg took 1 Milliseconds INFO - Created session 1xz0p155jhbeb IP: {0:0:0:0:0:0:0:1%0} UserAgent: {{Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3}} INFO - At Tue Oct 20 22:47:33 CEST 2009 Serviced / in 31ms Headers: List((Expires,Tue, 20 Oct 2009 20:47:33 UTC), (Cache-Control,no-cache; private; no-store; must-revalidate; max-stale=0; post-check=0; pre-check=0; max-age=0), (Pragma,no-cache)) INFO - Service request (GET) / took 36 Milliseconds INFO - Service request (GET) /ajax_request/liftAjax.js;jsessionid=1xz0p155jhbeb took 1 Milliseconds INFO - Service request (GET) /comet_request/1xz0p155jhbeb/cometAjax.js;jsessionid=1xz0p155jhbeb took 3 Milliseconds INFO - Service request (GET) /comet_request/31650122441/1xz0p155jhbeb took 1 Milliseconds INFO - Service request (GET) /comet_request/57514114625/1xz0p155jhbeb took 0 Milliseconds INFO - Service request (GET) /comet_request/63001515294/1xz0p155jhbeb took 0 Milliseconds INFO - Service request (GET) /comet_request/21383720665/1xz0p155jhbeb took 0 Milliseconds INFO - Created session ri1fmd1lj7fa IP: {0:0:0:0:0:0:0:1%0} UserAgent: {{Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3}} INFO - At Tue Oct 20 22:47:35 CEST 2009 Serviced / in 94ms Headers: List((Expires,Tue, 20 Oct 2009 20:47:35 UTC), (Cache-Control,no-cache; private; no-store; must-revalidate; max-stale=0; post-check=0; pre-check=0; max-age=0), (Pragma,no-cache)) INFO - Service request (GET) / took 103 Milliseconds INFO - Service request (GET) /comet_request/64396500471/1xz0p155jhbeb took 7 Milliseconds INFO - Service request (GET) /ajax_request/liftAjax.js;jsessionid=ri1fmd1lj7fa took 3 Milliseconds INFO - Service request (GET) /comet_request/ri1fmd1lj7fa/cometAjax.js;jsessionid=ri1fmd1lj7fa took 3 Milliseconds INFO - Service request (GET) /comet_request/9262273156/lt4bgwhxm7e3 took 8 Milliseconds INFO - Created session lt4bgwhxm7e3 IP: {0:0:0:0:0:0:0:1%0} UserAgent: {{Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3}} INFO - At Tue Oct 20 22:47:35 CEST 2009 Serviced / in 58ms Headers: List((Expires,Tue, 20 Oct 2009 20:47:35 UTC), (Cache-Control,no-cache; private; no-store; must-revalidate; max-stale=0; post-check=0; pre-check=0; max-age=0), (Pragma,no-cache)) INFO - Service request (GET) / took 64 Milliseconds INFO - Service request (GET) /comet_request/lt4bgwhxm7e3/cometAjax.js took 1 Milliseconds INFO - Service request (GET) /comet_request/91990826045/lt4bgwhxm7e3 took 0 Milliseconds INFO - Service request (GET) /comet_request/21686905246/lt4bgwhxm7e3 took 1 Milliseconds INFO - Service request (GET) /comet_request/39679899428/lt4bgwhxm7e3 took 0 Milliseconds INFO - Service request (GET) /comet_request/55195243874/lt4bgwhxm7e3 took 0 Milliseconds INFO - Created session pp5rj8hzj80b IP: {0:0:0:0:0:0:0:1%0} UserAgent: {{Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3}} INFO - At Tue Oct 20 22:47:36 CEST 2009 Serviced / in 34ms Headers: List((Expires,Tue, 20 Oct 2009 20:47:36 UTC), (Cache-Control,no-cache; private; no-store; must-revalidate; max-stale=0; post-check=0; pre-check=0; max-age=0), (Pragma,no-cache)) INFO - Service request (GET) / took 38 Milliseconds INFO - Service request (GET) /ajax_request/liftAjax.js;jsessionid=pp5rj8hzj80b took 2 Milliseconds INFO - Service request (GET) /comet_request/pp5rj8hzj80b/cometAjax.js;jsessionid=pp5rj8hzj80b took 2 Milliseconds INFO - Service request (GET) /comet_request/41677184720/pp5rj8hzj80b took 0 Milliseconds INFO - Service request (GET) /comet_request/18878051896/pp5rj8hzj80b took 1 Milliseconds INFO - Service request (GET) /comet_request/22615005092/pp5rj8hzj80b took 1 Milliseconds ^C2009-10-20 22:47:36.914::INFO: Shutdown hook executing 2009-10-20 22:47:37.483::INFO: Shutdown hook complete
-- Viktor Klang | "How do you shoot the Devil in the back? | What if you miss?" - Verbal Kint Blog: klangism.blogspot.com Twttr: viktorklang Code: github.com/viktorklang |
||||||||||||||||
|
Jeanfrancois Arcand
|
Viktor Klang wrote: > > > On Tue, Oct 20, 2009 at 10:46 PM, Jeanfrancois Arcand > <[hidden email] <mailto:[hidden email]>> wrote: > > Salut, > > Viktor Klang wrote: > > > > On Tue, Oct 20, 2009 at 9:11 PM, Jeanfrancois Arcand > <[hidden email] > <mailto:[hidden email]> > <mailto:[hidden email] > <mailto:[hidden email]>>> wrote: > > > > Viktor Klang wrote: > > Salut! > > How "workable" is the solution you attached? > > > It just won't suspend properly the request because the code > thinks > Comet is not enabled. So it fall back to use polling. > > > I'll try to have a look at it. > However, I am unsure of the servlet-mapping for /* > I was thinking of mapping Atmosphere for /atmosphere/* > and then in Lift do a re-write from /comet/* and dispatch (via > RequestDispatcher) to /atmosphere/* > > > So you would leave the Lift code intact, and have a second Servlet > handling the suspend/resume/broadcast operations? Sound like a good > idea.... > > > Yeah, I think that's the way to go, but we'd have to slightly alter lift > to do a pass-thru for requests to /comet_request/* > > Also, we'd need to make sure that the Comet-requests are processed > within a Lift scope. > > > I've done some testing with your path, and the problem seems to stem from : > > def suspend(timeout: Long): Unit = { > try { > //val cont = getContinuation.invoke(contSupport, req, LiftRules) > val cont = getContinuation.invoke(contSupport, req) > Log.trace("About to suspend continuation") > suspend.invoke(cont, new _root_.java.lang.Long(timeout)) > > //throw new Exception("Bail") <---- THIS WAS CAUSING PROBLEMS IN > ATMOSPHERE SERVLET > } catch { > case e: _root_.java.lang.reflect.InvocationTargetException if > e.getCause.getClass.getName.endsWith("RetryRequest") => > throw e.getCause > } > } > > But, the problem is that suspend.invoke really doesn't suspend the > request... > > As witnessed by this log (produced in a second or so): > We need to throw the exception but catch it in the LIftServlet. Like you said if we don't catch it if doesn't work, but if we don't throw it is not better as Lift by default is using Jetty, which throw a (stupid) exception. A+ > INFO - Service request (GET) / took 38 Milliseconds > INFO - Service request (GET) /comet_request/bs9sdnlig4wg/cometAjax.js > took 2 Milliseconds > INFO - Service request (GET) /comet_request/28954930251/bs9sdnlig4wg > took 0 Milliseconds > INFO - Service request (GET) /comet_request/73163087952/bs9sdnlig4wg > took 0 Milliseconds > INFO - Service request (GET) /comet_request/66483942731/bs9sdnlig4wg > took 0 Milliseconds > INFO - Service request (GET) /comet_request/86189166654/bs9sdnlig4wg > took 1 Milliseconds > INFO - Created session 1xz0p155jhbeb IP: {0:0:0:0:0:0:0:1%0} UserAgent: > {{Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1.3) > Gecko/20090824 Firefox/3.5.3}} > INFO - At Tue Oct 20 22:47:33 CEST 2009 Serviced / in 31ms Headers: > List((Expires,Tue, 20 Oct 2009 20:47:33 UTC), (Cache-Control,no-cache; > private; no-store; must-revalidate; max-stale=0; post-check=0; > pre-check=0; max-age=0), (Pragma,no-cache)) > INFO - Service request (GET) / took 36 Milliseconds > INFO - Service request (GET) > /ajax_request/liftAjax.js;jsessionid=1xz0p155jhbeb took 1 Milliseconds > INFO - Service request (GET) > /comet_request/1xz0p155jhbeb/cometAjax.js;jsessionid=1xz0p155jhbeb took > 3 Milliseconds > INFO - Service request (GET) /comet_request/31650122441/1xz0p155jhbeb > took 1 Milliseconds > INFO - Service request (GET) /comet_request/57514114625/1xz0p155jhbeb > took 0 Milliseconds > INFO - Service request (GET) /comet_request/63001515294/1xz0p155jhbeb > took 0 Milliseconds > INFO - Service request (GET) /comet_request/21383720665/1xz0p155jhbeb > took 0 Milliseconds > INFO - Created session ri1fmd1lj7fa IP: {0:0:0:0:0:0:0:1%0} UserAgent: > {{Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1.3) > Gecko/20090824 Firefox/3.5.3}} > INFO - At Tue Oct 20 22:47:35 CEST 2009 Serviced / in 94ms Headers: > List((Expires,Tue, 20 Oct 2009 20:47:35 UTC), (Cache-Control,no-cache; > private; no-store; must-revalidate; max-stale=0; post-check=0; > pre-check=0; max-age=0), (Pragma,no-cache)) > INFO - Service request (GET) / took 103 Milliseconds > INFO - Service request (GET) /comet_request/64396500471/1xz0p155jhbeb > took 7 Milliseconds > INFO - Service request (GET) > /ajax_request/liftAjax.js;jsessionid=ri1fmd1lj7fa took 3 Milliseconds > INFO - Service request (GET) > /comet_request/ri1fmd1lj7fa/cometAjax.js;jsessionid=ri1fmd1lj7fa took 3 > Milliseconds > INFO - Service request (GET) /comet_request/9262273156/lt4bgwhxm7e3 took > 8 Milliseconds > INFO - Created session lt4bgwhxm7e3 IP: {0:0:0:0:0:0:0:1%0} UserAgent: > {{Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1.3) > Gecko/20090824 Firefox/3.5.3}} > INFO - At Tue Oct 20 22:47:35 CEST 2009 Serviced / in 58ms Headers: > List((Expires,Tue, 20 Oct 2009 20:47:35 UTC), (Cache-Control,no-cache; > private; no-store; must-revalidate; max-stale=0; post-check=0; > pre-check=0; max-age=0), (Pragma,no-cache)) > INFO - Service request (GET) / took 64 Milliseconds > INFO - Service request (GET) /comet_request/lt4bgwhxm7e3/cometAjax.js > took 1 Milliseconds > INFO - Service request (GET) /comet_request/91990826045/lt4bgwhxm7e3 > took 0 Milliseconds > INFO - Service request (GET) /comet_request/21686905246/lt4bgwhxm7e3 > took 1 Milliseconds > INFO - Service request (GET) /comet_request/39679899428/lt4bgwhxm7e3 > took 0 Milliseconds > INFO - Service request (GET) /comet_request/55195243874/lt4bgwhxm7e3 > took 0 Milliseconds > INFO - Created session pp5rj8hzj80b IP: {0:0:0:0:0:0:0:1%0} UserAgent: > {{Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1.3) > Gecko/20090824 Firefox/3.5.3}} > INFO - At Tue Oct 20 22:47:36 CEST 2009 Serviced / in 34ms Headers: > List((Expires,Tue, 20 Oct 2009 20:47:36 UTC), (Cache-Control,no-cache; > private; no-store; must-revalidate; max-stale=0; post-check=0; > pre-check=0; max-age=0), (Pragma,no-cache)) > INFO - Service request (GET) / took 38 Milliseconds > INFO - Service request (GET) > /ajax_request/liftAjax.js;jsessionid=pp5rj8hzj80b took 2 Milliseconds > INFO - Service request (GET) > /comet_request/pp5rj8hzj80b/cometAjax.js;jsessionid=pp5rj8hzj80b took 2 > Milliseconds > INFO - Service request (GET) /comet_request/41677184720/pp5rj8hzj80b > took 0 Milliseconds > INFO - Service request (GET) /comet_request/18878051896/pp5rj8hzj80b > took 1 Milliseconds > INFO - Service request (GET) /comet_request/22615005092/pp5rj8hzj80b > took 1 Milliseconds > ^C2009-10-20 22:47:36.914::INFO: Shutdown hook executing > 2009-10-20 22:47:37.483::INFO: Shutdown hook complete > > > > > > But I am unsure on how intrusive that'd be in the Lift code. > > > Right. Actually I will try to take a look again once I'm sure there > is no issue with v3 and Eduardo's sample. So far no luck. > > A+ > > -- Jeanfrancois > > > > > > A+ > > --Jeanfrancois > > > On Mon, Oct 19, 2009 at 10:02 PM, Jeanfrancois Arcand > <[hidden email] > <mailto:[hidden email]> > <mailto:[hidden email] > <mailto:[hidden email]>> > <mailto:[hidden email] > <mailto:[hidden email]> > <mailto:[hidden email] > <mailto:[hidden email]>>>> wrote: > > Salut, > > I know Viktor wanted to help, but anybody is welcome > to take > a look > at the lift code under: > > * /trunk/sandbox/lift/ > > Under that filder, there is a src folder that needs to > be placed > under your normal lift workspace: > > /trunk/lift/lift > > The diff is also attached here. Ya this is probably a > stupid > mistake > ... the idea here is to replace Jetty's Continuation with > Atmosphere. > > You have the right to laugh :-) > > A+ > > --jeanfrancois > > diff --git a/examples/example/pom.xml > b/examples/example/pom.xml > index e46f3c7..9227aba 100644 > --- a/examples/example/pom.xml > +++ b/examples/example/pom.xml > @@ -14,6 +14,11 @@ > > <dependencies> > <dependency> > + <groupId>org.atmosphere</groupId> > + > <artifactId>atmosphere-portable-runtime</artifactId> > + <version>0.4-SNAPSHOT</version> > + </dependency> > + <dependency> > <groupId>com.h2database</groupId> > <artifactId>h2</artifactId> > <version>1.0.79</version> > diff --git > a/examples/example/src/main/webapp/WEB-INF/web.xml > b/examples/example/src/main/webapp/WEB-INF/web.xml > index 215dc17..be8e348 100644 > --- a/examples/example/src/main/webapp/WEB-INF/web.xml > +++ b/examples/example/src/main/webapp/WEB-INF/web.xml > @@ -5,20 +5,21 @@ > "http://java.sun.com/dtd/web-app_2_3.dtd"> > > <web-app> > - <filter> > - <filter-name>LiftFilter</filter-name> > - <display-name>Lift Filter</display-name> > - <description>The Filter that intercepts lift > calls</description> > - > <filter-class>net.liftweb.http.LiftFilter</filter-class> > - </filter> > - > - > - <filter-mapping> > - <filter-name>LiftFilter</filter-name> > - <url-pattern>/*</url-pattern> > - </filter-mapping> > - > - <welcome-file-list> > - <welcome-file>index.html</welcome-file> > - </welcome-file-list> > + <servlet> > + <description>AtmosphereServlet</description> > + <servlet-name>AtmosphereServlet</servlet-name> > + > <servlet-class>org.atmosphere.cpr.MeteorServlet</servlet-class> > + <!-- Uncomment if you want to use Servlet 3.0 > Async > Support > + <async-supported>true</async-supported> > + --> > + <init-param> > + > <param-name>org.atmosphere.filter</param-name> > + > <param-value>net.liftweb.http.LiftFilter</param-value> > + </init-param> > + <load-on-startup>0</load-on-startup> > + </servlet> > + <servlet-mapping> > + <servlet-name>AtmosphereServlet</servlet-name> > + <url-pattern>/*</url-pattern> > + </servlet-mapping> > </web-app> > diff --git a/lift/pom.xml b/lift/pom.xml > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/resources/i18n/lift-core_en_AU.properties > b/lift/src/main/resources/i18n/lift-core_en_AU.properties > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/resources/i18n/lift-core_en_US.properties > b/lift/src/main/resources/i18n/lift-core_en_US.properties > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/resources/i18n/lift-core_pl.properties > b/lift/src/main/resources/i18n/lift-core_pl.properties > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/resources/toserve/jquery-1.3.2.js > b/lift/src/main/resources/toserve/jquery-1.3.2.js > old mode 100644 > new mode 100755 > diff --git a/lift/src/main/resources/toserve/json2.js > b/lift/src/main/resources/toserve/json2.js > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/resources/toserve/yui/connection.js > b/lift/src/main/resources/toserve/yui/connection.js > old mode 100644 > new mode 100755 > diff --git a/lift/src/main/resources/toserve/yui/dom.js > b/lift/src/main/resources/toserve/yui/dom.js > old mode 100644 > new mode 100755 > diff --git a/lift/src/main/resources/toserve/yui/event.js > b/lift/src/main/resources/toserve/yui/event.js > old mode 100644 > new mode 100755 > diff --git a/lift/src/main/resources/toserve/yui/json.js > b/lift/src/main/resources/toserve/yui/json.js > old mode 100644 > new mode 100755 > diff --git a/lift/src/main/resources/toserve/yui/yahoo.js > b/lift/src/main/resources/toserve/yui/yahoo.js > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/builtin/snippet/A.scala > b/lift/src/main/scala/net/liftweb/builtin/snippet/A.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/scala/net/liftweb/builtin/snippet/CSS.scala > > b/lift/src/main/scala/net/liftweb/builtin/snippet/CSS.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/scala/net/liftweb/builtin/snippet/Children.scala > > b/lift/src/main/scala/net/liftweb/builtin/snippet/Children.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/scala/net/liftweb/builtin/snippet/Comet.scala > > b/lift/src/main/scala/net/liftweb/builtin/snippet/Comet.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/scala/net/liftweb/builtin/snippet/Embed.scala > > b/lift/src/main/scala/net/liftweb/builtin/snippet/Embed.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/scala/net/liftweb/builtin/snippet/Form.scala > > b/lift/src/main/scala/net/liftweb/builtin/snippet/Form.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/scala/net/liftweb/builtin/snippet/Group.scala > > b/lift/src/main/scala/net/liftweb/builtin/snippet/Group.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/scala/net/liftweb/builtin/snippet/Ignore.scala > > b/lift/src/main/scala/net/liftweb/builtin/snippet/Ignore.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/scala/net/liftweb/builtin/snippet/Loc.scala > > b/lift/src/main/scala/net/liftweb/builtin/snippet/Loc.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/scala/net/liftweb/builtin/snippet/Menu.scala > > b/lift/src/main/scala/net/liftweb/builtin/snippet/Menu.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/scala/net/liftweb/builtin/snippet/Msg.scala > > b/lift/src/main/scala/net/liftweb/builtin/snippet/Msg.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/scala/net/liftweb/builtin/snippet/Msgs.scala > > b/lift/src/main/scala/net/liftweb/builtin/snippet/Msgs.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/scala/net/liftweb/builtin/snippet/SkipDocType.scala > > b/lift/src/main/scala/net/liftweb/builtin/snippet/SkipDocType.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/scala/net/liftweb/builtin/snippet/Surround.scala > > b/lift/src/main/scala/net/liftweb/builtin/snippet/Surround.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/scala/net/liftweb/builtin/snippet/Tail.scala > > b/lift/src/main/scala/net/liftweb/builtin/snippet/Tail.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/scala/net/liftweb/builtin/snippet/TestCond.scala > > b/lift/src/main/scala/net/liftweb/builtin/snippet/TestCond.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/scala/net/liftweb/builtin/snippet/VersionInfo.scala > > b/lift/src/main/scala/net/liftweb/builtin/snippet/VersionInfo.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/scala/net/liftweb/builtin/snippet/WithParam.scala > > b/lift/src/main/scala/net/liftweb/builtin/snippet/WithParam.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/http/CometActor.scala > b/lift/src/main/scala/net/liftweb/http/CometActor.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/http/Factory.scala > b/lift/src/main/scala/net/liftweb/http/Factory.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/http/HttpResponse.scala > b/lift/src/main/scala/net/liftweb/http/HttpResponse.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/http/LiftRules.scala > b/lift/src/main/scala/net/liftweb/http/LiftRules.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/http/LiftServlet.scala > b/lift/src/main/scala/net/liftweb/http/LiftServlet.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/http/LiftSession.scala > b/lift/src/main/scala/net/liftweb/http/LiftSession.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/http/Req.scala > b/lift/src/main/scala/net/liftweb/http/Req.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/http/RequestType.scala > b/lift/src/main/scala/net/liftweb/http/RequestType.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/scala/net/liftweb/http/ResourceServer.scala > > b/lift/src/main/scala/net/liftweb/http/ResourceServer.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/scala/net/liftweb/http/ResponseShortcutException.scala > > b/lift/src/main/scala/net/liftweb/http/ResponseShortcutException.scala > old mode 100644 > new mode 100755 > diff --git a/lift/src/main/scala/net/liftweb/http/S.scala > b/lift/src/main/scala/net/liftweb/http/S.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/http/SHtml.scala > b/lift/src/main/scala/net/liftweb/http/SHtml.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/scala/net/liftweb/http/SimpleController.scala > > b/lift/src/main/scala/net/liftweb/http/SimpleController.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/http/Stateful.scala > b/lift/src/main/scala/net/liftweb/http/Stateful.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/http/Vars.scala > b/lift/src/main/scala/net/liftweb/http/Vars.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/scala/net/liftweb/http/auth/Authentication.scala > > b/lift/src/main/scala/net/liftweb/http/auth/Authentication.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/http/auth/Role.scala > b/lift/src/main/scala/net/liftweb/http/auth/Role.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/scala/net/liftweb/http/js/ScriptRenderer.scala > > b/lift/src/main/scala/net/liftweb/http/js/ScriptRenderer.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/http/js/XML2Js.scala > b/lift/src/main/scala/net/liftweb/http/js/XML2Js.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/scala/net/liftweb/http/provider/HTTPContext.scala > > b/lift/src/main/scala/net/liftweb/http/provider/HTTPContext.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/scala/net/liftweb/http/provider/HTTPCookie.scala > > b/lift/src/main/scala/net/liftweb/http/provider/HTTPCookie.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/scala/net/liftweb/http/provider/HTTPParam.scala > > b/lift/src/main/scala/net/liftweb/http/provider/HTTPParam.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/scala/net/liftweb/http/provider/HTTPProvider.scala > > b/lift/src/main/scala/net/liftweb/http/provider/HTTPProvider.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/scala/net/liftweb/http/provider/HTTPRequest.scala > > b/lift/src/main/scala/net/liftweb/http/provider/HTTPRequest.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/scala/net/liftweb/http/provider/HTTPResponse.scala > > b/lift/src/main/scala/net/liftweb/http/provider/HTTPResponse.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/scala/net/liftweb/http/provider/HTTPSession.scala > > b/lift/src/main/scala/net/liftweb/http/provider/HTTPSession.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/scala/net/liftweb/http/provider/servlet/HTTPRequestServlet.scala > > b/lift/src/main/scala/net/liftweb/http/provider/servlet/HTTPRequestServlet.scala > old mode 100644 > new mode 100755 > index d033334..e501a51 > --- > > a/lift/src/main/scala/net/liftweb/http/provider/servlet/HTTPRequestServlet.scala > +++ > > b/lift/src/main/scala/net/liftweb/http/provider/servlet/HTTPRequestServlet.scala > @@ -14,13 +14,12 @@ class HTTPRequestServlet(req: > HttpServletRequest) extends HTTPRequest { > > private val (hasContinuations_?, contSupport, > getContinuation, > getObject, setObject, suspend, resume) = { > try { > - val cc = > Class.forName("org.mortbay.util.ajax.ContinuationSupport") > - val meth = cc.getMethod("getContinuation", > classOf[HTTPRequest], classOf[AnyRef]) > - val cci = > Class.forName("org.mortbay.util.ajax.Continuation") > - val getObj = cci.getMethod("getObject") > - val setObj = cci.getMethod("setObject", > classOf[AnyRef]) > - val suspend = cci.getMethod("suspend", > _root_.java.lang.Long.TYPE) > - val resume = cci.getMethod("resume") > + val cc = Class.forName("org.atmosphere.cpr.Meteor") > + val meth = cc.getMethod("build", > classOf[HttpServletRequest]) > + val getObj = cc.getMethod("attachement") > + val setObj = cc.getMethod("attach", > classOf[AnyRef]) > + val suspend = cc.getMethod("suspend", > _root_.java.lang.Long.TYPE) > + val resume = cc.getMethod("resume") > (true, (cc), (meth), (getObj), (setObj), > (suspend), resume) > } catch { > case e => (false, null, null, null, null, null, > null) > @@ -117,7 +116,7 @@ class HTTPRequestServlet(req: > HttpServletRequest) extends HTTPRequest { > if (!hasContinuations_?) None > else if (Props.inGAE) None > else { > - val cont = getContinuation.invoke(contSupport, req, > LiftRules) > + val cont = getContinuation.invoke(contSupport, req) > val ret = getObject.invoke(cont) > try { > setObject.invoke(cont, null) > @@ -128,13 +127,14 @@ class HTTPRequestServlet(req: > HttpServletRequest) extends HTTPRequest { > } > } > > + class RetryRequest(msg: String) extends Exception(msg) > > def suspend(timeout: Long): Nothing = { > try { > - val cont = getContinuation.invoke(contSupport, req, > LiftRules) > + val cont = getContinuation.invoke(contSupport, req) > Log.trace("About to suspend continuation") > suspend.invoke(cont, new > _root_.java.lang.Long(timeout)) > - throw new Exception("Bail") > + throw new RetryRequest("Suspending") > } catch { > case e: > _root_.java.lang.reflect.InvocationTargetException if > e.getCause.getClass.getName.endsWith("RetryRequest") => > throw e.getCause > @@ -142,7 +142,7 @@ class HTTPRequestServlet(req: > HttpServletRequest) extends HTTPRequest { > } > > def resume(what: AnyRef) { > - val cont = getContinuation.invoke(contSupport, req, > LiftRules) > + val cont = getContinuation.invoke(contSupport, req) > setObject.invoke(cont, what) > resume.invoke(cont) > } > diff --git > > a/lift/src/main/scala/net/liftweb/http/provider/servlet/HTTPResponseServlet.scala > > b/lift/src/main/scala/net/liftweb/http/provider/servlet/HTTPResponseServlet.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/scala/net/liftweb/http/provider/servlet/HTTPServletContext.scala > > b/lift/src/main/scala/net/liftweb/http/provider/servlet/HTTPServletContext.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/scala/net/liftweb/http/provider/servlet/HTTPServletSession.scala > > b/lift/src/main/scala/net/liftweb/http/provider/servlet/HTTPServletSession.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/scala/net/liftweb/http/provider/servlet/ServletFilterProvider.scala > > b/lift/src/main/scala/net/liftweb/http/provider/servlet/ServletFilterProvider.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/scala/net/liftweb/http/rest/XMLApiHelper.scala > > b/lift/src/main/scala/net/liftweb/http/rest/XMLApiHelper.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/sitemap/Loc.scala > b/lift/src/main/scala/net/liftweb/sitemap/Loc.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/sitemap/Menu.scala > b/lift/src/main/scala/net/liftweb/sitemap/Menu.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/sitemap/SiteMap.scala > b/lift/src/main/scala/net/liftweb/sitemap/SiteMap.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/sitemap/XmlMenu.scala > b/lift/src/main/scala/net/liftweb/sitemap/XmlMenu.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/test/scala/bootstrap/liftweb/Boot.scala > b/lift/src/test/scala/bootstrap/liftweb/Boot.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/test/scala/net/liftweb/webapptest/JettyTestServer.scala > > b/lift/src/test/scala/net/liftweb/webapptest/JettyTestServer.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/test/scala/net/liftweb/webapptest/ToHeadUsages.scala > > b/lift/src/test/scala/net/liftweb/webapptest/ToHeadUsages.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/test/scala/net/liftweb/webapptest/controller/.keep > > b/lift/src/test/scala/net/liftweb/webapptest/controller/.keep > old mode 100644 > new mode 100755 > diff --git > a/lift/src/test/scala/net/liftweb/webapptest/model/.keep > b/lift/src/test/scala/net/liftweb/webapptest/model/.keep > old mode 100644 > new mode 100755 > diff --git > a/lift/src/test/scala/net/liftweb/webapptest/snippet/.keep > b/lift/src/test/scala/net/liftweb/webapptest/snippet/.keep > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/test/scala/net/liftweb/webapptest/snippet/HeadTestSnippet.scala > > b/lift/src/test/scala/net/liftweb/webapptest/snippet/HeadTestSnippet.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/test/scala/net/liftweb/webapptest/snippet/HelloWorld.scala > > b/lift/src/test/scala/net/liftweb/webapptest/snippet/HelloWorld.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/test/scala/net/liftweb/webapptest/view/.keep > b/lift/src/test/scala/net/liftweb/webapptest/view/.keep > old mode 100644 > new mode 100755 > diff --git a/lift/src/test/webapp/WEB-INF/web.xml > b/lift/src/test/webapp/WEB-INF/web.xml > old mode 100644 > new mode 100755 > diff --git a/lift/src/test/webapp/basicDiv.html > b/lift/src/test/webapp/basicDiv.html > old mode 100644 > new mode 100755 > diff --git a/lift/src/test/webapp/body_no_head.html > b/lift/src/test/webapp/body_no_head.html > old mode 100644 > new mode 100755 > diff --git a/lift/src/test/webapp/h1.html > b/lift/src/test/webapp/h1.html > old mode 100644 > new mode 100755 > diff --git > a/lift/src/test/webapp/htmlFragmentWithHead.html > b/lift/src/test/webapp/htmlFragmentWithHead.html > old mode 100644 > new mode 100755 > diff --git a/lift/src/test/webapp/htmlSnippetWithHead.html > b/lift/src/test/webapp/htmlSnippetWithHead.html > old mode 100644 > new mode 100755 > diff --git a/lift/src/test/webapp/index.html > b/lift/src/test/webapp/index.html > old mode 100644 > new mode 100755 > diff --git a/lift/src/test/webapp/non_html.html > b/lift/src/test/webapp/non_html.html > old mode 100644 > new mode 100755 > diff --git > a/lift/src/test/webapp/templates-hidden/default.html > b/lift/src/test/webapp/templates-hidden/default.html > old mode 100644 > new mode 100755 > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: > [hidden email] > <mailto:[hidden email]> > <mailto:[hidden email] > <mailto:[hidden email]>> > <mailto:[hidden email] > <mailto:[hidden email]> > <mailto:[hidden email] > <mailto:[hidden email]>>> > > For additional commands, e-mail: > [hidden email] > <mailto:[hidden email]> > <mailto:[hidden email] > <mailto:[hidden email]>> > <mailto:[hidden email] > <mailto:[hidden email]> > <mailto:[hidden email] > <mailto:[hidden email]>>> > > > > > -- Viktor Klang > > Blog: klangism.blogspot.com > <http://klangism.blogspot.com> <http://klangism.blogspot.com> > <http://klangism.blogspot.com> > Twttr: viktorklang > Wave: [hidden email] > <mailto:[hidden email]> > <mailto:[hidden email] > <mailto:[hidden email]>> > <mailto:[hidden email] > <mailto:[hidden email]> > <mailto:[hidden email] > <mailto:[hidden email]>>> > Code: github.com/viktorklang > <http://github.com/viktorklang> <http://github.com/viktorklang> > <http://github.com/viktorklang> > > AKKA Committer - akkasource.org <http://akkasource.org> > <http://akkasource.org> > <http://akkasource.org> > Lift Committer - liftweb.com <http://liftweb.com> > <http://liftweb.com> > <http://liftweb.com> > Atmosphere Committer - atmosphere.dev.java.net > <http://atmosphere.dev.java.net> > <http://atmosphere.dev.java.net> > <http://atmosphere.dev.java.net> > > > SoftPub founder: http://groups.google.com/group/softpub > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: > [hidden email] > <mailto:[hidden email]> > <mailto:[hidden email] > <mailto:[hidden email]>> > For additional commands, e-mail: > [hidden email] > <mailto:[hidden email]> > <mailto:[hidden email] > <mailto:[hidden email]>> > > > > > -- > Viktor Klang > > Blog: klangism.blogspot.com <http://klangism.blogspot.com> > <http://klangism.blogspot.com> > Twttr: viktorklang > Wave: [hidden email] > <mailto:[hidden email]> > <mailto:[hidden email] > <mailto:[hidden email]>> > Code: github.com/viktorklang <http://github.com/viktorklang> > <http://github.com/viktorklang> > > AKKA Committer - akkasource.org <http://akkasource.org> > <http://akkasource.org> > Lift Committer - liftweb.com <http://liftweb.com> > <http://liftweb.com> > Atmosphere Committer - atmosphere.dev.java.net > <http://atmosphere.dev.java.net> <http://atmosphere.dev.java.net> > SoftPub founder: http://groups.google.com/group/softpub > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [hidden email] > <mailto:[hidden email]> > For additional commands, e-mail: [hidden email] > <mailto:[hidden email]> > > > > > -- > Viktor Klang > | "How do you shoot the Devil in the back? > | What if you miss?" - Verbal Kint > > Blog: klangism.blogspot.com <http://klangism.blogspot.com> > Twttr: viktorklang > Code: github.com/viktorklang <http://github.com/viktorklang> --------------------------------------------------------------------- To unsubscribe, e-mail: [hidden email] For additional commands, e-mail: [hidden email] |
||||||||||||||||
|
Viktor Klang
|
On Tue, Oct 20, 2009 at 11:04 PM, Jeanfrancois Arcand <[hidden email]> wrote:
Yeah, it's a tough call. Where do you think is the best place to catch the exception? Also, so far all Lift-code is executed within the grasp of the LiftFilter, and we're not passing control back to the AtmosphereServlet, so do we need to catch the exception in the AtmosphereServlet? (assuming we continue with the current approach) A+ -- Viktor Klang | "How do you shoot the Devil in the back? | What if you miss?" - Verbal Kint Blog: klangism.blogspot.com Twttr: viktorklang Code: github.com/viktorklang |
||||||||||||||||
|
Jeanfrancois Arcand
|
Viktor Klang wrote: > > > On Tue, Oct 20, 2009 at 11:04 PM, Jeanfrancois Arcand > <[hidden email] <mailto:[hidden email]>> wrote: > > > > Viktor Klang wrote: > > > > On Tue, Oct 20, 2009 at 10:46 PM, Jeanfrancois Arcand > <[hidden email] > <mailto:[hidden email]> > <mailto:[hidden email] > <mailto:[hidden email]>>> wrote: > > Salut, > > Viktor Klang wrote: > > > > On Tue, Oct 20, 2009 at 9:11 PM, Jeanfrancois Arcand > <[hidden email] > <mailto:[hidden email]> > <mailto:[hidden email] > <mailto:[hidden email]>> > <mailto:[hidden email] > <mailto:[hidden email]> > <mailto:[hidden email] > <mailto:[hidden email]>>>> wrote: > > > > Viktor Klang wrote: > > Salut! > > How "workable" is the solution you attached? > > > It just won't suspend properly the request because the > code > thinks > Comet is not enabled. So it fall back to use polling. > > > I'll try to have a look at it. > However, I am unsure of the servlet-mapping for /* > I was thinking of mapping Atmosphere for /atmosphere/* > and then in Lift do a re-write from /comet/* and dispatch > (via > RequestDispatcher) to /atmosphere/* > > > So you would leave the Lift code intact, and have a second > Servlet > handling the suspend/resume/broadcast operations? Sound like > a good > idea.... > > > Yeah, I think that's the way to go, but we'd have to slightly > alter lift to do a pass-thru for requests to /comet_request/* > > Also, we'd need to make sure that the Comet-requests are > processed within a Lift scope. > > I've done some testing with your path, and the problem seems to > stem from : > > def suspend(timeout: Long): Unit = { > try { > //val cont = getContinuation.invoke(contSupport, req, > LiftRules) > val cont = getContinuation.invoke(contSupport, req) > Log.trace("About to suspend continuation") > suspend.invoke(cont, new _root_.java.lang.Long(timeout)) > //throw new Exception("Bail") <---- THIS WAS CAUSING > PROBLEMS IN ATMOSPHERE SERVLET > } catch { > case e: _root_.java.lang.reflect.InvocationTargetException > if e.getCause.getClass.getName.endsWith("RetryRequest") => > throw e.getCause > } > } > > But, the problem is that suspend.invoke really doesn't suspend > the request... > > As witnessed by this log (produced in a second or so): > > > We need to throw the exception but catch it in the LIftServlet. Like > you said if we don't catch it if doesn't work, but if we don't throw > it is not better as Lift by default is using Jetty, which throw a > (stupid) exception. > > > Yeah, it's a tough call. Where do you think is the best place to catch > the exception? > Also, so far all Lift-code is executed within the grasp of the > LiftFilter, and we're not passing control back to the AtmosphereServlet, > so do we need to catch the exception in the AtmosphereServlet? No because AtmosphereServlet cannot determine the exception type. I think the current implementation with Meteor is almost working...except we need to remove throwing on the exception. If you comment out the exception, the Lift code will thinks Comet is not supported. My idea was to modify the code (big failure last time I did try) in order to make sure Comet is always considered supported. Gives me a couple of hours and I will remind what I did properly :-) Thanks for the help!!! A+ -jeanfrancois > > (assuming we continue with the current approach) > > > > > A+ > > > INFO - Service request (GET) / took 38 Milliseconds > INFO - Service request (GET) > /comet_request/bs9sdnlig4wg/cometAjax.js took 2 Milliseconds > INFO - Service request (GET) > /comet_request/28954930251/bs9sdnlig4wg took 0 Milliseconds > INFO - Service request (GET) > /comet_request/73163087952/bs9sdnlig4wg took 0 Milliseconds > INFO - Service request (GET) > /comet_request/66483942731/bs9sdnlig4wg took 0 Milliseconds > INFO - Service request (GET) > /comet_request/86189166654/bs9sdnlig4wg took 1 Milliseconds > INFO - Created session 1xz0p155jhbeb IP: {0:0:0:0:0:0:0:1%0} > UserAgent: {{Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; > en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3}} > INFO - At Tue Oct 20 22:47:33 CEST 2009 Serviced / in 31ms > Headers: List((Expires,Tue, 20 Oct 2009 20:47:33 UTC), > (Cache-Control,no-cache; private; no-store; must-revalidate; > max-stale=0; post-check=0; pre-check=0; max-age=0), > (Pragma,no-cache)) > INFO - Service request (GET) / took 36 Milliseconds > INFO - Service request (GET) > /ajax_request/liftAjax.js;jsessionid=1xz0p155jhbeb took 1 > Milliseconds > INFO - Service request (GET) > /comet_request/1xz0p155jhbeb/cometAjax.js;jsessionid=1xz0p155jhbeb > took 3 Milliseconds > INFO - Service request (GET) > /comet_request/31650122441/1xz0p155jhbeb took 1 Milliseconds > INFO - Service request (GET) > /comet_request/57514114625/1xz0p155jhbeb took 0 Milliseconds > INFO - Service request (GET) > /comet_request/63001515294/1xz0p155jhbeb took 0 Milliseconds > INFO - Service request (GET) > /comet_request/21383720665/1xz0p155jhbeb took 0 Milliseconds > INFO - Created session ri1fmd1lj7fa IP: {0:0:0:0:0:0:0:1%0} > UserAgent: {{Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; > en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3}} > INFO - At Tue Oct 20 22:47:35 CEST 2009 Serviced / in 94ms > Headers: List((Expires,Tue, 20 Oct 2009 20:47:35 UTC), > (Cache-Control,no-cache; private; no-store; must-revalidate; > max-stale=0; post-check=0; pre-check=0; max-age=0), > (Pragma,no-cache)) > INFO - Service request (GET) / took 103 Milliseconds > INFO - Service request (GET) > /comet_request/64396500471/1xz0p155jhbeb took 7 Milliseconds > INFO - Service request (GET) > /ajax_request/liftAjax.js;jsessionid=ri1fmd1lj7fa took 3 > Milliseconds > INFO - Service request (GET) > /comet_request/ri1fmd1lj7fa/cometAjax.js;jsessionid=ri1fmd1lj7fa > took 3 Milliseconds > INFO - Service request (GET) > /comet_request/9262273156/lt4bgwhxm7e3 took 8 Milliseconds > INFO - Created session lt4bgwhxm7e3 IP: {0:0:0:0:0:0:0:1%0} > UserAgent: {{Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; > en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3}} > INFO - At Tue Oct 20 22:47:35 CEST 2009 Serviced / in 58ms > Headers: List((Expires,Tue, 20 Oct 2009 20:47:35 UTC), > (Cache-Control,no-cache; private; no-store; must-revalidate; > max-stale=0; post-check=0; pre-check=0; max-age=0), > (Pragma,no-cache)) > INFO - Service request (GET) / took 64 Milliseconds > INFO - Service request (GET) > /comet_request/lt4bgwhxm7e3/cometAjax.js took 1 Milliseconds > INFO - Service request (GET) > /comet_request/91990826045/lt4bgwhxm7e3 took 0 Milliseconds > INFO - Service request (GET) > /comet_request/21686905246/lt4bgwhxm7e3 took 1 Milliseconds > INFO - Service request (GET) > /comet_request/39679899428/lt4bgwhxm7e3 took 0 Milliseconds > INFO - Service request (GET) > /comet_request/55195243874/lt4bgwhxm7e3 took 0 Milliseconds > INFO - Created session pp5rj8hzj80b IP: {0:0:0:0:0:0:0:1%0} > UserAgent: {{Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; > en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3}} > INFO - At Tue Oct 20 22:47:36 CEST 2009 Serviced / in 34ms > Headers: List((Expires,Tue, 20 Oct 2009 20:47:36 UTC), > (Cache-Control,no-cache; private; no-store; must-revalidate; > max-stale=0; post-check=0; pre-check=0; max-age=0), > (Pragma,no-cache)) > INFO - Service request (GET) / took 38 Milliseconds > INFO - Service request (GET) > /ajax_request/liftAjax.js;jsessionid=pp5rj8hzj80b took 2 > Milliseconds > INFO - Service request (GET) > /comet_request/pp5rj8hzj80b/cometAjax.js;jsessionid=pp5rj8hzj80b > took 2 Milliseconds > INFO - Service request (GET) > /comet_request/41677184720/pp5rj8hzj80b took 0 Milliseconds > INFO - Service request (GET) > /comet_request/18878051896/pp5rj8hzj80b took 1 Milliseconds > INFO - Service request (GET) > /comet_request/22615005092/pp5rj8hzj80b took 1 Milliseconds > ^C2009-10-20 22:47:36.914::INFO: Shutdown hook executing > 2009-10-20 22:47:37.483::INFO: Shutdown hook complete > > > > > > But I am unsure on how intrusive that'd be in the Lift code. > > > Right. Actually I will try to take a look again once I'm sure > there > is no issue with v3 and Eduardo's sample. So far no luck. > > A+ > > -- Jeanfrancois > > > > > > A+ > > --Jeanfrancois > > > On Mon, Oct 19, 2009 at 10:02 PM, Jeanfrancois Arcand > <[hidden email] > <mailto:[hidden email]> > <mailto:[hidden email] > <mailto:[hidden email]>> > <mailto:[hidden email] > <mailto:[hidden email]> > <mailto:[hidden email] > <mailto:[hidden email]>>> > <mailto:[hidden email] > <mailto:[hidden email]> > <mailto:[hidden email] > <mailto:[hidden email]>> > <mailto:[hidden email] > <mailto:[hidden email]> > <mailto:[hidden email] > <mailto:[hidden email]>>>>> wrote: > > Salut, > > I know Viktor wanted to help, but anybody is > welcome > to take > a look > at the lift code under: > > * /trunk/sandbox/lift/ > > Under that filder, there is a src folder that > needs to > be placed > under your normal lift workspace: > > /trunk/lift/lift > > The diff is also attached here. Ya this is > probably a > stupid > mistake > ... the idea here is to replace Jetty's > Continuation with > Atmosphere. > > You have the right to laugh :-) > > A+ > > --jeanfrancois > > diff --git a/examples/example/pom.xml > b/examples/example/pom.xml > index e46f3c7..9227aba 100644 > --- a/examples/example/pom.xml > +++ b/examples/example/pom.xml > @@ -14,6 +14,11 @@ > > <dependencies> > <dependency> > + <groupId>org.atmosphere</groupId> > + > <artifactId>atmosphere-portable-runtime</artifactId> > + <version>0.4-SNAPSHOT</version> > + </dependency> > + <dependency> > <groupId>com.h2database</groupId> > <artifactId>h2</artifactId> > <version>1.0.79</version> > diff --git > a/examples/example/src/main/webapp/WEB-INF/web.xml > b/examples/example/src/main/webapp/WEB-INF/web.xml > index 215dc17..be8e348 100644 > --- > a/examples/example/src/main/webapp/WEB-INF/web.xml > +++ > b/examples/example/src/main/webapp/WEB-INF/web.xml > @@ -5,20 +5,21 @@ > "http://java.sun.com/dtd/web-app_2_3.dtd"> > > <web-app> > - <filter> > - <filter-name>LiftFilter</filter-name> > - <display-name>Lift Filter</display-name> > - <description>The Filter that intercepts lift > calls</description> > - > <filter-class>net.liftweb.http.LiftFilter</filter-class> > - </filter> > - > - > - <filter-mapping> > - <filter-name>LiftFilter</filter-name> > - <url-pattern>/*</url-pattern> > - </filter-mapping> > - > - <welcome-file-list> > - <welcome-file>index.html</welcome-file> > - </welcome-file-list> > + <servlet> > + > <description>AtmosphereServlet</description> > + > <servlet-name>AtmosphereServlet</servlet-name> > + > <servlet-class>org.atmosphere.cpr.MeteorServlet</servlet-class> > + <!-- Uncomment if you want to use > Servlet 3.0 > Async > Support > + <async-supported>true</async-supported> > + --> > + <init-param> > + > <param-name>org.atmosphere.filter</param-name> > + > <param-value>net.liftweb.http.LiftFilter</param-value> > + </init-param> > + <load-on-startup>0</load-on-startup> > + </servlet> > + <servlet-mapping> > + > <servlet-name>AtmosphereServlet</servlet-name> > + <url-pattern>/*</url-pattern> > + </servlet-mapping> > </web-app> > diff --git a/lift/pom.xml b/lift/pom.xml > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/resources/i18n/lift-core_en_AU.properties > > b/lift/src/main/resources/i18n/lift-core_en_AU.properties > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/resources/i18n/lift-core_en_US.properties > > b/lift/src/main/resources/i18n/lift-core_en_US.properties > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/resources/i18n/lift-core_pl.properties > > b/lift/src/main/resources/i18n/lift-core_pl.properties > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/resources/toserve/jquery-1.3.2.js > b/lift/src/main/resources/toserve/jquery-1.3.2.js > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/resources/toserve/json2.js > b/lift/src/main/resources/toserve/json2.js > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/resources/toserve/yui/connection.js > b/lift/src/main/resources/toserve/yui/connection.js > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/resources/toserve/yui/dom.js > b/lift/src/main/resources/toserve/yui/dom.js > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/resources/toserve/yui/event.js > b/lift/src/main/resources/toserve/yui/event.js > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/resources/toserve/yui/json.js > b/lift/src/main/resources/toserve/yui/json.js > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/resources/toserve/yui/yahoo.js > b/lift/src/main/resources/toserve/yui/yahoo.js > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/scala/net/liftweb/builtin/snippet/A.scala > > b/lift/src/main/scala/net/liftweb/builtin/snippet/A.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/scala/net/liftweb/builtin/snippet/CSS.scala > > b/lift/src/main/scala/net/liftweb/builtin/snippet/CSS.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/scala/net/liftweb/builtin/snippet/Children.scala > > b/lift/src/main/scala/net/liftweb/builtin/snippet/Children.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/scala/net/liftweb/builtin/snippet/Comet.scala > > b/lift/src/main/scala/net/liftweb/builtin/snippet/Comet.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/scala/net/liftweb/builtin/snippet/Embed.scala > > b/lift/src/main/scala/net/liftweb/builtin/snippet/Embed.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/scala/net/liftweb/builtin/snippet/Form.scala > > b/lift/src/main/scala/net/liftweb/builtin/snippet/Form.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/scala/net/liftweb/builtin/snippet/Group.scala > > b/lift/src/main/scala/net/liftweb/builtin/snippet/Group.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/scala/net/liftweb/builtin/snippet/Ignore.scala > > b/lift/src/main/scala/net/liftweb/builtin/snippet/Ignore.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/scala/net/liftweb/builtin/snippet/Loc.scala > > b/lift/src/main/scala/net/liftweb/builtin/snippet/Loc.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/scala/net/liftweb/builtin/snippet/Menu.scala > > b/lift/src/main/scala/net/liftweb/builtin/snippet/Menu.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/scala/net/liftweb/builtin/snippet/Msg.scala > > b/lift/src/main/scala/net/liftweb/builtin/snippet/Msg.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/scala/net/liftweb/builtin/snippet/Msgs.scala > > b/lift/src/main/scala/net/liftweb/builtin/snippet/Msgs.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/scala/net/liftweb/builtin/snippet/SkipDocType.scala > > b/lift/src/main/scala/net/liftweb/builtin/snippet/SkipDocType.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/scala/net/liftweb/builtin/snippet/Surround.scala > > b/lift/src/main/scala/net/liftweb/builtin/snippet/Surround.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/scala/net/liftweb/builtin/snippet/Tail.scala > > b/lift/src/main/scala/net/liftweb/builtin/snippet/Tail.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/scala/net/liftweb/builtin/snippet/TestCond.scala > > b/lift/src/main/scala/net/liftweb/builtin/snippet/TestCond.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/scala/net/liftweb/builtin/snippet/VersionInfo.scala > > b/lift/src/main/scala/net/liftweb/builtin/snippet/VersionInfo.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/scala/net/liftweb/builtin/snippet/WithParam.scala > > b/lift/src/main/scala/net/liftweb/builtin/snippet/WithParam.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/scala/net/liftweb/http/CometActor.scala > > b/lift/src/main/scala/net/liftweb/http/CometActor.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/http/Factory.scala > > b/lift/src/main/scala/net/liftweb/http/Factory.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/scala/net/liftweb/http/HttpResponse.scala > > b/lift/src/main/scala/net/liftweb/http/HttpResponse.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/http/LiftRules.scala > > b/lift/src/main/scala/net/liftweb/http/LiftRules.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/scala/net/liftweb/http/LiftServlet.scala > > b/lift/src/main/scala/net/liftweb/http/LiftServlet.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/scala/net/liftweb/http/LiftSession.scala > > b/lift/src/main/scala/net/liftweb/http/LiftSession.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/http/Req.scala > b/lift/src/main/scala/net/liftweb/http/Req.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/scala/net/liftweb/http/RequestType.scala > > b/lift/src/main/scala/net/liftweb/http/RequestType.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/scala/net/liftweb/http/ResourceServer.scala > > b/lift/src/main/scala/net/liftweb/http/ResourceServer.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/scala/net/liftweb/http/ResponseShortcutException.scala > > b/lift/src/main/scala/net/liftweb/http/ResponseShortcutException.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/http/S.scala > b/lift/src/main/scala/net/liftweb/http/S.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/http/SHtml.scala > b/lift/src/main/scala/net/liftweb/http/SHtml.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/scala/net/liftweb/http/SimpleController.scala > > b/lift/src/main/scala/net/liftweb/http/SimpleController.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/http/Stateful.scala > > b/lift/src/main/scala/net/liftweb/http/Stateful.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/http/Vars.scala > b/lift/src/main/scala/net/liftweb/http/Vars.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/scala/net/liftweb/http/auth/Authentication.scala > > b/lift/src/main/scala/net/liftweb/http/auth/Authentication.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/http/auth/Role.scala > > b/lift/src/main/scala/net/liftweb/http/auth/Role.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/scala/net/liftweb/http/js/ScriptRenderer.scala > > b/lift/src/main/scala/net/liftweb/http/js/ScriptRenderer.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/http/js/XML2Js.scala > > b/lift/src/main/scala/net/liftweb/http/js/XML2Js.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/scala/net/liftweb/http/provider/HTTPContext.scala > > b/lift/src/main/scala/net/liftweb/http/provider/HTTPContext.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/scala/net/liftweb/http/provider/HTTPCookie.scala > > b/lift/src/main/scala/net/liftweb/http/provider/HTTPCookie.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/scala/net/liftweb/http/provider/HTTPParam.scala > > b/lift/src/main/scala/net/liftweb/http/provider/HTTPParam.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/scala/net/liftweb/http/provider/HTTPProvider.scala > > b/lift/src/main/scala/net/liftweb/http/provider/HTTPProvider.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/scala/net/liftweb/http/provider/HTTPRequest.scala > > b/lift/src/main/scala/net/liftweb/http/provider/HTTPRequest.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/scala/net/liftweb/http/provider/HTTPResponse.scala > > b/lift/src/main/scala/net/liftweb/http/provider/HTTPResponse.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/scala/net/liftweb/http/provider/HTTPSession.scala > > b/lift/src/main/scala/net/liftweb/http/provider/HTTPSession.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/scala/net/liftweb/http/provider/servlet/HTTPRequestServlet.scala > > b/lift/src/main/scala/net/liftweb/http/provider/servlet/HTTPRequestServlet.scala > old mode 100644 > new mode 100755 > index d033334..e501a51 > --- > > a/lift/src/main/scala/net/liftweb/http/provider/servlet/HTTPRequestServlet.scala > +++ > > b/lift/src/main/scala/net/liftweb/http/provider/servlet/HTTPRequestServlet.scala > @@ -14,13 +14,12 @@ class HTTPRequestServlet(req: > HttpServletRequest) extends HTTPRequest { > > private val (hasContinuations_?, contSupport, > getContinuation, > getObject, setObject, suspend, resume) = { > try { > - val cc = > > Class.forName("org.mortbay.util.ajax.ContinuationSupport") > - val meth = cc.getMethod("getContinuation", > classOf[HTTPRequest], classOf[AnyRef]) > - val cci = > Class.forName("org.mortbay.util.ajax.Continuation") > - val getObj = cci.getMethod("getObject") > - val setObj = cci.getMethod("setObject", > classOf[AnyRef]) > - val suspend = cci.getMethod("suspend", > _root_.java.lang.Long.TYPE) > - val resume = cci.getMethod("resume") > + val cc = > Class.forName("org.atmosphere.cpr.Meteor") > + val meth = cc.getMethod("build", > classOf[HttpServletRequest]) > + val getObj = cc.getMethod("attachement") > + val setObj = cc.getMethod("attach", > classOf[AnyRef]) > + val suspend = cc.getMethod("suspend", > _root_.java.lang.Long.TYPE) > + val resume = cc.getMethod("resume") > (true, (cc), (meth), (getObj), (setObj), > (suspend), resume) > } catch { > case e => (false, null, null, null, null, > null, > null) > @@ -117,7 +116,7 @@ class HTTPRequestServlet(req: > HttpServletRequest) extends HTTPRequest { > if (!hasContinuations_?) None > else if (Props.inGAE) None > else { > - val cont = > getContinuation.invoke(contSupport, req, > LiftRules) > + val cont = > getContinuation.invoke(contSupport, req) > val ret = getObject.invoke(cont) > try { > setObject.invoke(cont, null) > @@ -128,13 +127,14 @@ class HTTPRequestServlet(req: > HttpServletRequest) extends HTTPRequest { > } > } > > + class RetryRequest(msg: String) extends > Exception(msg) > > def suspend(timeout: Long): Nothing = { > try { > - val cont = > getContinuation.invoke(contSupport, req, > LiftRules) > + val cont = > getContinuation.invoke(contSupport, req) > Log.trace("About to suspend continuation") > suspend.invoke(cont, new > _root_.java.lang.Long(timeout)) > - throw new Exception("Bail") > + throw new RetryRequest("Suspending") > } catch { > case e: > _root_.java.lang.reflect.InvocationTargetException if > > e.getCause.getClass.getName.endsWith("RetryRequest") => > throw e.getCause > @@ -142,7 +142,7 @@ class HTTPRequestServlet(req: > HttpServletRequest) extends HTTPRequest { > } > > def resume(what: AnyRef) { > - val cont = > getContinuation.invoke(contSupport, req, > LiftRules) > + val cont = > getContinuation.invoke(contSupport, req) > setObject.invoke(cont, what) > resume.invoke(cont) > } > diff --git > > a/lift/src/main/scala/net/liftweb/http/provider/servlet/HTTPResponseServlet.scala > > b/lift/src/main/scala/net/liftweb/http/provider/servlet/HTTPResponseServlet.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/scala/net/liftweb/http/provider/servlet/HTTPServletContext.scala > > b/lift/src/main/scala/net/liftweb/http/provider/servlet/HTTPServletContext.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/scala/net/liftweb/http/provider/servlet/HTTPServletSession.scala > > b/lift/src/main/scala/net/liftweb/http/provider/servlet/HTTPServletSession.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/scala/net/liftweb/http/provider/servlet/ServletFilterProvider.scala > > b/lift/src/main/scala/net/liftweb/http/provider/servlet/ServletFilterProvider.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/scala/net/liftweb/http/rest/XMLApiHelper.scala > > b/lift/src/main/scala/net/liftweb/http/rest/XMLApiHelper.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/sitemap/Loc.scala > b/lift/src/main/scala/net/liftweb/sitemap/Loc.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/main/scala/net/liftweb/sitemap/Menu.scala > > b/lift/src/main/scala/net/liftweb/sitemap/Menu.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/scala/net/liftweb/sitemap/SiteMap.scala > > b/lift/src/main/scala/net/liftweb/sitemap/SiteMap.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/main/scala/net/liftweb/sitemap/XmlMenu.scala > > b/lift/src/main/scala/net/liftweb/sitemap/XmlMenu.scala > old mode 100644 > new mode 100755 > diff --git > a/lift/src/test/scala/bootstrap/liftweb/Boot.scala > b/lift/src/test/scala/bootstrap/liftweb/Boot.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/test/scala/net/liftweb/webapptest/JettyTestServer.scala > > b/lift/src/test/scala/net/liftweb/webapptest/JettyTestServer.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/test/scala/net/liftweb/webapptest/ToHeadUsages.scala > > b/lift/src/test/scala/net/liftweb/webapptest/ToHeadUsages.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/test/scala/net/liftweb/webapptest/controller/.keep > > b/lift/src/test/scala/net/liftweb/webapptest/controller/.keep > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/test/scala/net/liftweb/webapptest/model/.keep > > b/lift/src/test/scala/net/liftweb/webapptest/model/.keep > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/test/scala/net/liftweb/webapptest/snippet/.keep > > b/lift/src/test/scala/net/liftweb/webapptest/snippet/.keep > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/test/scala/net/liftweb/webapptest/snippet/HeadTestSnippet.scala > > b/lift/src/test/scala/net/liftweb/webapptest/snippet/HeadTestSnippet.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/test/scala/net/liftweb/webapptest/snippet/HelloWorld.scala > > b/lift/src/test/scala/net/liftweb/webapptest/snippet/HelloWorld.scala > old mode 100644 > new mode 100755 > diff --git > > a/lift/src/test/scala/net/liftweb/webapptest/view/.keep > > b/lift/src/test/scala/net/liftweb/webapptest/view/.keep > old mode 100644 > new mode 100755 > diff --git a/lift/src/test/webapp/WEB-INF/web.xml > b/lift/src/test/webapp/WEB-INF/web.xml > old mode 100644 > new mode 100755 > diff --git a/lift/src/test/webapp/basicDiv.html > b/lift/src/test/webapp/basicDiv.html > old mode 100644 > new mode 100755 > diff --git a/lift/src/test/webapp/body_no_head.html > b/lift/src/test/webapp/body_no_head.html > old mode 100644 > new mode 100755 > diff --git a/lift/src/test/webapp/h1.html > b/lift/src/test/webapp/h1.html > old mode 100644 > new mode 100755 > diff --git > a/lift/src/test/webapp/htmlFragmentWithHead.html > b/lift/src/test/webapp/htmlFragmentWithHead.html > old mode 100644 > new mode 100755 > diff --git > a/lift/src/test/webapp/htmlSnippetWithHead.html > b/lift/src/test/webapp/htmlSnippetWithHead.html > old mode 100644 > new mode 100755 > diff --git a/lift/src/test/webapp/index.html > b/lift/src/test/webapp/index.html > old mode 100644 > new mode 100755 > diff --git a/lift/src/test/webapp/non_html.html > b/lift/src/test/webapp/non_html.html > old mode 100644 > new mode 100755 > diff --git > a/lift/src/test/webapp/templates-hidden/default.html > > b/lift/src/test/webapp/templates-hidden/default.html > old mode 100644 > new mode 100755 > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: > [hidden email] > <mailto:[hidden email]> > <mailto:[hidden email] > <mailto:[hidden email]>> > <mailto:[hidden email] > <mailto:[hidden email]> > <mailto:[hidden email] > <mailto:[hidden email]>>> > > <mailto:[hidden email] > <mailto:[hidden email]> > <mailto:[hidden email] > <mailto:[hidden email]>> > <mailto:[hidden email] > <mailto:[hidden email]> > <mailto:[hidden email] > <mailto:[hidden email]>>>> > > For additional commands, e-mail: > [hidden email] > <mailto:[hidden email]> > <mailto:[hidden email] > <mailto:[hidden email]>> > <mailto:[hidden email] > <mailto:[hidden email]> > <mailto:[hidden email] > <mailto:[hidden email]>>> > <mailto:[hidden email] > <mailto:[hidden email]> > <mailto:[hidden email] > <mailto:[hidden email]>> > <mailto:[hidden email] > <mailto:[hidden email]> > <mailto:[hidden email] > <mailto:[hidden email]>>>> > > > > > -- Viktor Klang > > Blog: klangism.blogspot.com > <http://klangism.blogspot.com> > <http://klangism.blogspot.com> <http://klangism.blogspot.com> > <http://klangism.blogspot.com> > Twttr: viktorklang > Wave: [hidden email] > <mailto:[hidden email]> > <mailto:[hidden email] > <mailto:[hidden email]>> > <mailto:[hidden email] > <mailto:[hidden email]> > <mailto:[hidden email] > <mailto:[hidden email]>>> > <mailto:[hidden email] > <mailto:[hidden email]> > <mailto:[hidden email] > <mailto:[hidden email]>> > <mailto:[hidden email] > <mailto:[hidden email]> > <mailto:[hidden email] > <mailto:[hidden email]>>>> > Code: github.com/viktorklang > <http://github.com/viktorklang> > <http://github.com/viktorklang> > <http://github.com/viktorklang> > <http://github.com/viktorklang> > > AKKA Committer - akkasource.org > <http://akkasource.org> <http://akkasource.org> > <http://akkasource.org> > <http://akkasource.org> > Lift Committer - liftweb.com <http://liftweb.com> > <http://liftweb.com> > <http://liftweb.com> > <http://liftweb.com> > Atmosphere Committer - atmosphere.dev.java.net > <http://atmosphere.dev.java.net> > <http://atmosphere.dev.java.net> > <http://atmosphere.dev.java.net> > <http://atmosphere.dev.java.net> > > > SoftPub founder: > http://groups.google.com/group/softpub > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: > [hidden email] > <mailto:[hidden email]> > <mailto:[hidden email] > <mailto:[hidden email]>> > <mailto:[hidden email] > <mailto:[hidden email]> > <mailto:[hidden email] > <mailto:[hidden email]>>> > For additional commands, e-mail: > [hidden email] > <mailto:[hidden email]> > <mailto:[hidden email] > <mailto:[hidden email]>> > <mailto:[hidden email] > <mailto:[hidden email]> > <mailto:[hidden email] > <mailto:[hidden email]>>> > > > > > -- Viktor Klang > > Blog: klangism.blogspot.com > <http://klangism.blogspot.com> <http://klangism.blogspot.com> > <http://klangism.blogspot.com> > Twttr: viktorklang > Wave: [hidden email] > <mailto:[hidden email]> > <mailto:[hidden email] > <mailto:[hidden email]>> > <mailto:[hidden email] > <mailto:[hidden email]> > <mailto:[hidden email] > <mailto:[hidden email]>>> > Code: github.com/viktorklang > <http://github.com/viktorklang> <http://github.com/viktorklang> > <http://github.com/viktorklang> > > AKKA Committer - akkasource.org <http://akkasource.org> > <http://akkasource.org> > <http://akkasource.org> > Lift Committer - liftweb.com <http://liftweb.com> > <http://liftweb.com> > <http://liftweb.com> > Atmosphere Committer - atmosphere.dev.java.net > <http://atmosphere.dev.java.net> > <http://atmosphere.dev.java.net> > <http://atmosphere.dev.java.net> > SoftPub founder: http://groups.google.com/group/softpub > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: > [hidden email] > <mailto:[hidden email]> > <mailto:[hidden email] > <mailto:[hidden email]>> > For additional commands, e-mail: > [hidden email] > <mailto:[hidden email]> > <mailto:[hidden email] > <mailto:[hidden email]>> > > > > > -- > Viktor Klang > | "How do you shoot the Devil in the back? > | What if you miss?" - Verbal Kint > > Blog: klangism.blogspot.com <http://klangism.blogspot.com> > <http://klangism.blogspot.com> > Twttr: viktorklang > > Code: github.com/viktorklang <http://github.com/viktorklang> > <http://github.com/viktorklang> > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [hidden email] > <mailto:[hidden email]> > For additional commands, e-mail: [hidden email] > <mailto:[hidden email]> > > > > > -- > Viktor Klang > | "How do you shoot the Devil in the back? > | What if you miss?" - Verbal Kint > > Blog: klangism.blogspot.com <http://klangism.blogspot.com> > Twttr: viktorklang > Code: github.com/viktorklang <http://github.com/viktorklang> --------------------------------------------------------------------- To unsubscribe, e-mail: [hidden email] For additional commands, e-mail: [hidden email] |
||||||||||||||||
|
Viktor Klang
|
Salut!
What I did was to remove the exception, and then change the signature from Nothing to Unit (all the way up the chain) but the problem is that the request is not suspended. :/ BRs -- Viktor Klang | "How do you shoot the Devil in the back? | What if you miss?" - Verbal Kint Blog: klangism.blogspot.com Twttr: viktorklang Code: github.com/viktorklang |
||||||||||||||||
|
Jeanfrancois Arcand
|
Salut
Viktor Klang wrote: > Salut! > > What I did was to remove the exception, and then change the signature > from Nothing to Unit (all the way up the chain) but the problem is that > the request is not suspended. :/ Can you commit so I can try? I'm curious :-) A+ -- Jeanfrancois > > BRs > -- > Viktor Klang > | "How do you shoot the Devil in the back? > | What if you miss?" - Verbal Kint > > Blog: klangism.blogspot.com <http://klangism.blogspot.com> > Twttr: viktorklang > Code: github.com/viktorklang <http://github.com/viktorklang> --------------------------------------------------------------------- To unsubscribe, e-mail: [hidden email] For additional commands, e-mail: [hidden email] |
||||||||||||||||
|
Viktor Klang
|
On Wed, Oct 21, 2009 at 4:48 PM, Jeanfrancois Arcand <[hidden email]> wrote: Salut I'll see if I have time tonight, worst case I'll email a diff :)
-- Viktor Klang | "A complex system that works is invariably | found to have evolved from a simple system | that worked." - John Gall Blog: klangism.blogspot.com Twttr: viktorklang Code: github.com/viktorklang |
||||||||||||||||
|
Viktor Klang
|
Salut!
Here's the diff of this stab at the problem, however, it is as we discussed earlier. Happy reading ;) diff --git a/examples/example/src/main/webapp/WEB-INF/web.xml b/examples/example/src/main/webapp/WEB-INF/web.xml index 215dc17..ce82a52 100644 --- a/examples/example/src/main/webapp/WEB-INF/web.xml +++ b/examples/example/src/main/webapp/WEB-INF/web.xml @@ -1,24 +1,37 @@ <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE web-app - PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" - "http://java.sun.com/dtd/web-app_2_3.dtd"> +PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" +"http://java.sun.com/dtd/web-app_2_3.dtd"> <web-app> - <filter> - <filter-name>LiftFilter</filter-name> - <display-name>Lift Filter</display-name> - <description>The Filter that intercepts lift calls</description> - <filter-class>net.liftweb.http.LiftFilter</filter-class> - </filter> - +<!--filter> + <filter-name>LiftFilter</filter-name> + <display-name>Lift Filter</display-name> + <description>The Filter that intercepts lift calls</description> + <filter-class>net.liftweb.http.LiftFilter</filter-class> +</filter> + - <filter-mapping> - <filter-name>LiftFilter</filter-name> - <url-pattern>/*</url-pattern> - </filter-mapping> - - <welcome-file-list> - <welcome-file>index.html</welcome-file> - </welcome-file-list> +<filter-mapping> + <filter-name>LiftFilter</filter-name> + <url-pattern>/*</url-pattern> +</filter-mapping--> +<servlet> + <description>AtmosphereServlet</description> + <servlet-name>AtmosphereServlet</servlet-name> + <servlet-class>org.atmosphere.cpr.MeteorServlet</servlet-class> + <!-- Uncomment if you want to use Servlet 3.0 Async Support + <async-supported>true</async-supported> + --> + <init-param> + <param-name>org.atmosphere.filter</param-name> + <param-value>net.liftweb.http.LiftFilter</param-value> + </init-param> + <load-on-startup>0</load-on-startup> + </servlet> + <servlet-mapping> + <servlet-name>AtmosphereServlet</servlet-name> + <url-pattern>/*</url-pattern> + </servlet-mapping> </web-app> diff --git a/lift/pom.xml b/lift/pom.xml index deb4ad0..d0ebb74 100644 --- a/lift/pom.xml +++ b/lift/pom.xml @@ -73,6 +73,11 @@ <version>1.1</version> </dependency> <dependency> + <groupId>org.atmosphere</groupId> + <artifactId>atmosphere-portable-runtime</artifactId> + <version>0.4-SNAPSHOT</version> + </dependency> + <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>5.1.6</version> diff --git a/lift/src/main/scala/net/liftweb/http/LiftRules.scala b/lift/src/main/scala/net/liftweb/http/LiftRules.scala index 2b1ec2e..35ada1e 100644 --- a/lift/src/main/scala/net/liftweb/http/LiftRules.scala +++ b/lift/src/main/scala/net/liftweb/http/LiftRules.scala @@ -445,7 +445,7 @@ object LiftRules extends Factory { * Execute a continuation. For Jetty the Jetty specific exception will be thrown * and the container will manage it. */ - def doContinuation(req: HTTPRequest, timeout: Long): Nothing = req suspend timeout + def doContinuation(req: HTTPRequest, timeout: Long): Unit = req suspend timeout /** * Check to see if continuations are supported diff --git a/lift/src/main/scala/net/liftweb/http/LiftServlet.scala b/lift/src/main/scala/net/liftweb/http/LiftServlet.scala index dcc7bab..5f785e7 100644 --- a/lift/src/main/scala/net/liftweb/http/LiftServlet.scala +++ b/lift/src/main/scala/net/liftweb/http/LiftServlet.scala @@ -349,7 +349,7 @@ class LiftServlet { private lazy val cometTimeout: Long = (LiftRules.cometRequestTimeout openOr 120) * 1000L - private def setupContinuation(request: Req, session: LiftSession, actors: List[(CometActor, Long)]): Nothing = { + private def setupContinuation(request: Req, session: LiftSession, actors: List[(CometActor, Long)]): Unit = { val cont = new ContinuationActor(request, session, actors, answers => LiftRules.resumeRequest( (request, S.init(request, session) @@ -376,7 +376,7 @@ class LiftServlet { else LiftRules.checkContinuations(requestState.request) match { case Some(null) => setupContinuation(requestState, sessionActor, actors) - + None //<--- What goes here, Full(CometResponse) ? case _ => handleNonContinuationComet(requestState, sessionActor, actors) } diff --git a/lift/src/main/scala/net/liftweb/http/provider/HTTPRequest.scala b/lift/src/main/scala/net/liftweb/http/provider/HTTPRequest.scala index 52f6dd5..c7e1ca3 100644 --- a/lift/src/main/scala/net/liftweb/http/provider/HTTPRequest.scala +++ b/lift/src/main/scala/net/liftweb/http/provider/HTTPRequest.scala @@ -162,7 +162,7 @@ trait HTTPRequest { /** * Suspend the curent request and resume it after a given timeout */ - def suspend(timeout: Long): Nothing + def suspend(timeout: Long): Unit /** * Resume this request diff --git a/lift/src/main/scala/net/liftweb/http/provider/servlet/HTTPRequestServlet.scala b/lift/src/main/scala/net/liftweb/http/provider/servlet/HTTPRequestServlet.sca index 47664eb..ade76f0 100644 --- a/lift/src/main/scala/net/liftweb/http/provider/servlet/HTTPRequestServlet.scala +++ b/lift/src/main/scala/net/liftweb/http/provider/servlet/HTTPRequestServlet.scala @@ -14,16 +14,27 @@ class HTTPRequestServlet(val req: HttpServletRequest) extends HTTPRequest { private val (hasContinuations_?, contSupport, getContinuation, getObject, setObject, suspend, resume) = { try { - val cc = Class.forName("org.mortbay.util.ajax.ContinuationSupport") - val meth = cc.getMethod("getContinuation", classOf[HTTPRequest], classOf[AnyRef]) - val cci = Class.forName("org.mortbay.util.ajax.Continuation") - val getObj = cci.getMethod("getObject") - val setObj = cci.getMethod("setObject", classOf[AnyRef]) - val suspend = cci.getMethod("suspend", _root_.java.lang.Long.TYPE) - val resume = cci.getMethod("resume") +// val cc = Class.forName("org.mortbay.util.ajax.ContinuationSupport") +// val meth = cc.getMethod("getContinuation", classOf[HTTPRequest], classOf[AnyRef]) +// val cci = Class.forName("org.mortbay.util.ajax.Continuation") +// val getObj = cci.getMethod("getObject") +// val setObj = cci.getMethod("setObject", classOf[AnyRef]) +// val suspend = cci.getMethod("suspend", _root_.java.lang.Long.TYPE) +// val resume = cci.getMethod("resume") + + val cc = Class.forName("org.atmosphere.cpr.Meteor") + val meth = cc.getMethod("build", classOf[HttpServletRequest]) + val getObj = cc.getMethod("attachement") + val setObj = cc.getMethod("attach", classOf[AnyRef]) + val suspend = cc.getMethod("suspend", _root_.java.lang.Long.TYPE) + val resume = cc.getMethod("resume") + (true, (cc), (meth), (getObj), (setObj), (suspend), resume) } catch { - case e => (false, null, null, null, null, null, null) + case e => { + Log.warn(e) + (false, null, null, null, null, null, null) + } } } @@ -117,7 +128,8 @@ class HTTPRequestServlet(val req: HttpServletRequest) extends HTTPRequest { if (!hasContinuations_?) None else if (Props.inGAE) None else { - val cont = getContinuation.invoke(contSupport, req, LiftRules) + //val cont = getContinuation.invoke(contSupport, req, LiftRules) + val cont = getContinuation.invoke(contSupport, req) val ret = getObject.invoke(cont) try { setObject.invoke(cont, null) @@ -129,12 +141,14 @@ class HTTPRequestServlet(val req: HttpServletRequest) extends HTTPRequest { } - def suspend(timeout: Long): Nothing = { + def suspend(timeout: Long): Unit = { try { - val cont = getContinuation.invoke(contSupport, req, LiftRules) + //val cont = getContinuation.invoke(contSupport, req, LiftRules) + val cont = getContinuation.invoke(contSupport, req) Log.trace("About to suspend continuation") suspend.invoke(cont, new _root_.java.lang.Long(timeout)) - throw new Exception("Bail") + +// throw new Exception("Bail") } catch { case e: _root_.java.lang.reflect.InvocationTargetException if e.getCause.getClass.getName.endsWith("RetryRequest") => throw e.getCause @@ -142,7 +156,8 @@ class HTTPRequestServlet(val req: HttpServletRequest) extends HTTPRequest { } def resume(what: AnyRef) { - val cont = getContinuation.invoke(contSupport, req, LiftRules) + //val cont = getContinuation.invoke(contSupport, req, LiftRules) + val cont = getContinuation.invoke(contSupport, req) setObject.invoke(cont, what) resume.invoke(cont) } diff --git a/lift/src/test/webapp/WEB-INF/web.xml b/lift/src/test/webapp/WEB-INF/web.xml index 6774710..ce82a52 100644 --- a/lift/src/test/webapp/WEB-INF/web.xml +++ b/lift/src/test/webapp/WEB-INF/web.xml @@ -5,7 +5,7 @@ PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd"> <web-app> -<filter> +<!--filter> <filter-name>LiftFilter</filter-name> <display-name>Lift Filter</display-name> <description>The Filter that intercepts lift calls</description> @@ -16,6 +16,22 @@ PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" <filter-mapping> <filter-name>LiftFilter</filter-name> <url-pattern>/*</url-pattern> -</filter-mapping> - +</filter-mapping--> +<servlet> + <description>AtmosphereServlet</description> + <servlet-name>AtmosphereServlet</servlet-name> + <servlet-class>org.atmosphere.cpr.MeteorServlet</servlet-class> + <!-- Uncomment if you want to use Servlet 3.0 Async Support + <async-supported>true</async-supported> + --> + <init-param> + <param-name>org.atmosphere.filter</param-name> + <param-value>net.liftweb.http.LiftFilter</param-value> + </init-param> + <load-on-startup>0</load-on-startup> + </servlet> + <servlet-mapping> + <servlet-name>AtmosphereServlet</servlet-name> + <url-pattern>/*</url-pattern> + </servlet-mapping> </web-app> |
||||||||||||||||
| Free Embeddable Forum Powered by Nabble | Help |