-
Notifications
You must be signed in to change notification settings - Fork 186
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #357 from websudos/release/streams
Release/streams: Improving support for Reactive Streams.
- Loading branch information
Showing
31 changed files
with
332 additions
and
144 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
resolvers ++= Seq( | ||
"Sonatype snapshots" at "http://oss.sonatype.org/content/repositories/snapshots/", | ||
"jgit-repo" at "http://download.eclipse.org/jgit/maven", | ||
"Twitter Repo" at "http://maven.twttr.com/", | ||
"sonatype-releases" at "https://oss.sonatype.org/content/repositories/releases/", | ||
Resolver.bintrayRepo("websudos", "oss-releases"), | ||
Resolver.url("scoverage-bintray", url("https://dl.bintray.com/sksamuel/sbt-plugins/"))(Resolver.ivyStylePatterns) | ||
) | ||
|
||
addSbtPlugin("com.earldouglas" % "xsbt-web-plugin" % "2.0.4") |
File renamed without changes.
22 changes: 22 additions & 0 deletions
22
phantom-container-test/src/main/scala/com/websudos/phantom/JettyLauncher$.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.websudos.phantom.server; | ||
|
||
object JettyLauncher { | ||
lazy val port = if (System.getenv("PORT") != null) System.getenv("PORT") else "8900" | ||
|
||
private[this] val started = new AtomicBoolean(false) | ||
|
||
def startEmbeddedJetty() { | ||
if (started.compareAndSet(false, true)) { | ||
val server = new Server(port.toInt) | ||
val context = new WebAppContext() | ||
context setContextPath "/" | ||
context.setResourceBase("src/main/webapp") | ||
context.setInitParameter(ScalatraListener.LifeCycleKey, "com.websudos.phantom.server.ScalatraBootstrap") | ||
context.addEventListener(new ScalatraListener) | ||
context.addServlet(classOf[DefaultServlet], "/") | ||
|
||
server.setHandler(context) | ||
server.start() | ||
} | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
phantom-dsl/src/test/scala/com/websudos/phantom/DateTimeSerializer.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package com.websudos.phantom | ||
|
||
import java.util.UUID | ||
|
||
import com.websudos.phantom.dsl._ | ||
import net.liftweb.json.JsonAST.{JString, JValue} | ||
import net.liftweb.json.{Formats, MappingException, Serializer, TypeInfo} | ||
|
||
import scala.util.control.NonFatal | ||
|
||
class DateTimeSerializer extends Serializer[DateTime] { | ||
private val Class = classOf[UUID] | ||
|
||
def deserialize(implicit format: Formats): PartialFunction[(TypeInfo, JValue), DateTime] = { | ||
case (TypeInfo(Class, _), json) => json match { | ||
case JString(value) => try { | ||
DateTimeIsPrimitive.fromString(value) | ||
} catch { | ||
case NonFatal(err) => { | ||
val exception = new MappingException(s"Couldn't extract an UUID from $value") | ||
exception.initCause(err) | ||
throw exception | ||
} | ||
} | ||
case x => throw new MappingException("Can't convert " + x + " to UUID") | ||
} | ||
} | ||
|
||
def serialize(implicit format: Formats): PartialFunction[Any, JValue] = { | ||
case x: DateTime => JString(DateTimeIsPrimitive.asCql(x)) | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.