Skip to content
This repository
Browse code

Fixed ScalaDocs. Added infinite timeout to Async

  • Loading branch information...
commit 0541765d8ef714be43253029608776673b994dcb 1 parent 02397ca
David Pollak authored March 14, 2012
1  .gitignore
@@ -7,6 +7,7 @@ syntax: glob
7 7
 *.off
8 8
 *.old
9 9
 .DS_Store
  10
+.cache
10 11
 
11 12
 # logs
12 13
 derby.log
2  core/common/src/main/scala/net/liftweb/common/Box.scala
@@ -286,7 +286,7 @@ sealed abstract class Box[+A] extends Product {
286 286
    *
287 287
    * @param f the predicate used to test value.
288 288
    *
289  
-   * @returns a Box
  289
+   * @return a Box
290 290
    */
291 291
   def filterNot(f: A => Boolean): Box[A] = filter(a => !f(a))
292 292
 
2  core/util/src/main/scala/net/liftweb/util/BasicTypesHelpers.scala
@@ -64,7 +64,7 @@ trait BasicTypesHelpers { self: StringHelpers with ControlHelpers =>
64 64
   class Boolean2(b: => Boolean) {
65 65
     /**
66 66
      * Ternary operator.
67  
-     * @returns a BooleanSome containing the specified value
  67
+     * @return a BooleanSome containing the specified value
68 68
      * if the decorated boolean is true, or a BooleanNone otherwise.
69 69
      */
70 70
     def ? [A](first: => A): BooleanOption[A] = {
2  core/util/src/main/scala/net/liftweb/util/SoftReferenceCache.scala
@@ -146,7 +146,7 @@ class SoftReferenceCache[K, V](cacheSize: Int) {
146 146
   /**
147 147
    * Removes the cache entry mapped with this key
148 148
    *
149  
-   * @returns the value removed
  149
+   * @return the value removed
150 150
    */
151 151
   def remove(key: Any): Box[V] = {
152 152
     lock(writeLock) {
2  core/util/src/main/scala/net/liftweb/util/TimeHelpers.scala
@@ -252,7 +252,7 @@ trait TimeHelpers { self: ControlHelpers =>
252 252
 
253 253
   /** This class adds a noTime method the Date class, in order to get at Date object starting at 00:00 */
254 254
   class DateExtension(date: Date) {
255  
-    /** @returns a Date object starting at 00:00 from date */
  255
+    /** @return a Date object starting at 00:00 from date */
256 256
     def noTime = {
257 257
       val calendar = Calendar.getInstance
258 258
       calendar.set(Calendar.HOUR_OF_DAY, 0)
2  persistence/mapper/src/main/scala/net/liftweb/mapper/MetaMapper.scala
@@ -382,7 +382,7 @@ trait MetaMapper[A<:Mapper[A]] extends BaseMetaMapper with Mapper[A] {
382 382
    * @param conn -- the SuperConnection to be used for calculating the query
383 383
    * @param by -- the varg of QueryParams
384 384
    *
385  
-   * @returns a Tuple of the Query String, Start (offset), MaxRows (limit), and the list of all query parameters
  385
+   * @return a Tuple of the Query String, Start (offset), MaxRows (limit), and the list of all query parameters
386 386
    * including and synthetic query parameters
387 387
    */
388 388
   def buildSelectString(fields: Seq[SelectableField], conn: SuperConnection, by: QueryParam[A]*):
2  persistence/mapper/src/main/scala/net/liftweb/mapper/Schemifier.scala
@@ -197,7 +197,7 @@ object Schemifier extends Loggable {
197 197
    * @param connection Database connection.
198 198
    * @param makeSql Factory for SQL command.
199 199
    *
200  
-   * @returns SQL command.
  200
+   * @return SQL command.
201 201
    */
202 202
   private def maybeWrite(performWrite: Boolean, logFunc: (=> AnyRef) => Unit, connection: SuperConnection) (makeSql: () => String) : String ={
203 203
     val ct = makeSql()
14  web/webkit/src/main/scala/net/liftweb/http/LiftScreen.scala
@@ -706,7 +706,7 @@ trait AbstractScreen extends Factory {
706 706
    * @param defaultValue the starting value of the field (call-by-name)
707 707
    * @param stuff the filters, validators and attributes
708 708
    *
709  
-   * @returns a newly minted Field
  709
+   * @return a newly minted Field
710 710
    */
711 711
   protected def password(name: => String, defaultValue: => String, stuff: FilterOrValidate[String]*): Field {type ValueType = String} = {
712 712
     val eAttr = grabParams(stuff)
@@ -725,7 +725,7 @@ trait AbstractScreen extends Factory {
725 725
    * @param defaultValue the starting value of the field (call-by-name)
726 726
    * @param stuff the filters, validators and attributes
727 727
    *
728  
-   * @returns a newly minted Field
  728
+   * @return a newly minted Field
729 729
    */
730 730
   protected def text(name: => String, defaultValue: => String, stuff: FilterOrValidate[String]*): Field {type ValueType = String} = {
731 731
     val eAttr = grabParams(stuff)
@@ -746,7 +746,7 @@ trait AbstractScreen extends Factory {
746 746
    *
747 747
    * @param stuff - a list of filters and validations for the field
748 748
    *
749  
-   * @returns a newly minted Field{type ValueType = String}
  749
+   * @return a newly minted Field{type ValueType = String}
750 750
    */
751 751
   protected def textarea(name: => String, defaultValue: => String, stuff: FilterOrValidate[String]*): Field {type ValueType = String} =
752 752
     textarea(name, defaultValue, 5, 80, stuff: _*)
@@ -762,7 +762,7 @@ trait AbstractScreen extends Factory {
762 762
    *
763 763
    * @param stuff - a list of filters and validations for the field
764 764
    *
765  
-   * @returns a newly minted Field{type ValueType = String}
  765
+   * @return a newly minted Field{type ValueType = String}
766 766
    */
767 767
   protected def textarea(name: => String, defaultValue: => String, rows: Int, cols: Int, stuff: FilterOrValidate[String]*):
768 768
   Field {type ValueType = String} = {
@@ -790,7 +790,7 @@ trait AbstractScreen extends Factory {
790 790
    * @param stuff - a list of filters and validations for the field
791 791
    * @param f a PairStringPromoter (a wrapper around a function) that converts T => display String
792 792
    *
793  
-   * @returns a newly minted Field{type ValueType = String}
  793
+   * @return a newly minted Field{type ValueType = String}
794 794
    */
795 795
   protected def select[T](name: => String, default: => T, choices: => Seq[T], stuff: FilterOrValidate[T]*)
796 796
                          (implicit f: SHtml.PairStringPromoter[T]): Field {type ValueType = T; type OtherValueType = Seq[T]}
@@ -815,7 +815,7 @@ trait AbstractScreen extends Factory {
815 815
    * @param stuff - a list of filters and validations for the field
816 816
    * @param f a PairStringPromoter (a wrapper around a function) that converts T => display String
817 817
    *
818  
-   * @returns a newly minted Field{type ValueType = String}
  818
+   * @return a newly minted Field{type ValueType = String}
819 819
    */
820 820
   protected def multiselect[T](name: => String, default: => Seq[T], choices: => Seq[T], stuff: FilterOrValidate[Seq[T]]*)
821 821
                               (implicit f: SHtml.PairStringPromoter[T]): Field {type ValueType = Seq[T]; type OtherValueType = Seq[T]}
@@ -855,7 +855,7 @@ trait AbstractScreen extends Factory {
855 855
    * @param stuff - a list of filters and validations for the field
856 856
    * @param f a PairStringPromoter (a wrapper around a function) that converts T => display String
857 857
    *
858  
-   * @returns a newly minted Field{type ValueType = String}
  858
+   * @return a newly minted Field{type ValueType = String}
859 859
    */
860 860
   protected def radio(name: => String, default: => String, choices: => Seq[String], stuff: FilterOrValidate[String]*):
861 861
   Field {type ValueType = String; type OtherValueType = Seq[String]} = {
2  web/webkit/src/main/scala/net/liftweb/http/LiftSession.scala
@@ -1000,7 +1000,7 @@ class LiftSession(private[http] val _contextPath: String, val uniqueId: String,
1000 1000
    * @param path -- the ParsePath that led to this page
1001 1001
    * @param code -- the HTTP response code (usually 200)
1002 1002
    *
1003  
-   * @returns a Box of LiftResponse with all the proper page rewriting
  1003
+   * @return a Box of LiftResponse with all the proper page rewriting
1004 1004
    */
1005 1005
   def processTemplate(template: Box[NodeSeq], request: Req, path: ParsePath, code: Int): Box[LiftResponse] = {
1006 1006
     overrideResponseCode.doWith(Empty) {
2  web/webkit/src/main/scala/net/liftweb/http/provider/HTTPSession.scala
@@ -45,7 +45,7 @@ trait HTTPSession {
45 45
   def unlink(liftSession: LiftSession)
46 46
 
47 47
   /**
48  
-   * @returns - the maximim interval in seconds between client request and the time when
  48
+   * @return - the maximim interval in seconds between client request and the time when
49 49
    *            the session will be terminated
50 50
    *
51 51
    */
16  web/webkit/src/main/scala/net/liftweb/http/provider/servlet/containers/Servlet30AsyncProvider.scala
@@ -82,6 +82,8 @@ object Servlet30AsyncProvider extends AsyncProviderMeta {
82 82
 class Servlet30AsyncProvider(req: HTTPRequest) extends ServletAsyncProvider with Loggable {
83 83
   private var asyncCtx: Object = null
84 84
 
  85
+  type SetTimeout = {def setTimeout(timeout: Long): Unit;}
  86
+  
85 87
   import Servlet30AsyncProvider._
86 88
 
87 89
   private lazy val servletReq = (req.asInstanceOf[HTTPRequestServlet]).req
@@ -93,6 +95,12 @@ class Servlet30AsyncProvider(req: HTTPRequest) extends ServletAsyncProvider with
93 95
 
94 96
   def suspend(timeout: Long): RetryState.Value = {
95 97
     asyncCtx = startAsync.invoke(servletReq)
  98
+    try {
  99
+    	val st = asyncCtx.asInstanceOf[SetTimeout];
  100
+    	st.setTimeout(0l)
  101
+    } catch {
  102
+    case e: Exception => logger.error("Servlet 3.0 Async: Failed to set timeout", e)
  103
+    }
96 104
     logger.trace("Servlet 3.0 suspend")
97 105
     RetryState.SUSPENDED
98 106
   }
@@ -102,8 +110,12 @@ class Servlet30AsyncProvider(req: HTTPRequest) extends ServletAsyncProvider with
102 110
     val httpRes = getResponse.invoke(asyncCtx).asInstanceOf[javax.servlet.http.HttpServletResponse]
103 111
     val httpResponse = new HTTPResponseServlet(httpRes)
104 112
     val liftServlet = req.provider.liftServlet
105  
-    liftServlet.sendResponse(what._2, httpResponse, what._1)
106  
-    complete.invoke(asyncCtx)
  113
+    try {
  114
+    	liftServlet.sendResponse(what._2, httpResponse, what._1)
  115
+    	complete.invoke(asyncCtx)
  116
+    } catch {
  117
+    case e: Exception => logger.error("Servlet 3.0 Async: Couldn't resume thread", e)
  118
+    }
107 119
     logger.trace("Servlet 3.0 resume")
108 120
     true
109 121
   }
2  web/webkit/src/main/scala/net/liftweb/mockweb/MockWeb.scala
@@ -25,7 +25,7 @@ import http.{LiftRules,LiftSession,Req,S}
25 25
 import util.ThreadGlobal
26 26
 import util.Helpers._
27 27
 import http.provider.servlet.HTTPRequestServlet
28  
-import mocks.MockHttpServletRequest
  28
+import net.liftweb.mocks.MockHttpServletRequest
29 29
 
30 30
 import scala.xml.{MetaData,Null}
31 31
 
4  web/webkit/src/main/scala/net/liftweb/sitemap/SiteMap.scala
@@ -134,7 +134,7 @@ sealed class SiteMapSingleton {
134 134
    * @param pf the partial function (pattern match) to test against the Menu, if it matches, apply it which causes menu mutation.
135 135
    * @param or the function to apply if none of the patterns match
136 136
    *
137  
-   * @returns a function which will apply the changes to a SiteMap
  137
+   * @return a function which will apply the changes to a SiteMap
138 138
    */
139 139
   def sitemapMutator(pf: PartialFunction[Menu, List[Menu]])(or: SiteMap => SiteMap): SiteMap => SiteMap = 
140 140
     (sm: SiteMap) => {
@@ -167,7 +167,7 @@ sealed class SiteMapSingleton {
167 167
    *
168 168
    * @param pf the partial function (pattern match) to test against the Menu, if it matches, apply it which causes menu mutation.
169 169
    *
170  
-   * @returns a function which will apply the changes to a SiteMap
  170
+   * @return a function which will apply the changes to a SiteMap
171 171
    */
172 172
   def simpleSitemapMutator(pf: PartialFunction[Menu, List[Menu]]) = sitemapMutator(pf)(s => s)
173 173
 

0 notes on commit 0541765

Please sign in to comment.
Something went wrong with that request. Please try again.