Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'release/0.0.7'

  • Loading branch information...
commit 0eb4d8dfaee9d700a03700bde0d918dba9252586 2 parents 6c258a7 + fe068f9
@codahale codahale authored
View
2  project/build.properties
@@ -3,6 +3,6 @@
project.organization=com.yammer
project.name=dropwizard
sbt.version=0.7.7
-project.version=0.0.6
+project.version=0.0.7
build.scala.versions=2.8.1 2.9.0
project.initialize=false
View
13 project/build/DropwizardProject.scala
@@ -12,6 +12,13 @@ class DropwizardProject(info: ProjectInfo) extends DefaultProject(info)
override def packageToPublishActions = super.packageToPublishActions ++ Seq(packageSrc)
/**
+ * Always compile with deprecation alerts, full type explanations for errors,
+ * full unchecked errors, and optimizations.
+ */
+ override def compileOptions = super.compileOptions ++
+ Seq(Deprecation, ExplainTypes, Unchecked, Optimise)
+
+ /**
* Publish via maven-sbt.
*/
lazy val publishTo = Resolver.sftp("repo.codahale.com",
@@ -35,13 +42,13 @@ class DropwizardProject(info: ProjectInfo) extends DefaultProject(info)
/**
* Jersey Dependencies
*/
- val jerseyScala = "com.codahale" %% "jersey-scala" % "0.1.5"
+ val jerseyScala = "com.codahale" %% "jersey-scala" % "0.1.6"
/**
* Misc Dependencies
*/
- val fig = "com.codahale" %% "fig" % "1.1.2"
- val jerkson = "com.codahale" %% "jerkson" % "0.2.1"
+ val fig = "com.codahale" %% "fig" % "1.1.4"
+ val jerkson = "com.codahale" %% "jerkson" % "0.2.2"
val metricsVersion = "2.0.0-BETA13"
val metricsCore = "com.yammer.metrics" %% "metrics-core" % metricsVersion
val metricsServlet = "com.yammer.metrics" %% "metrics-servlet" % metricsVersion
View
8 src/main/scala/com/yammer/dropwizard/Environment.scala
@@ -9,13 +9,15 @@ import javax.servlet.{Servlet, Filter}
import com.sun.jersey.core.reflection.MethodList
import javax.ws.rs.{Path, HttpMethod}
import org.eclipse.jetty.servlet.{ServletHolder, FilterHolder}
-import com.yammer.dropwizard.jetty.NonblockingServletHolder
+import org.eclipse.jetty.util.component.LifeCycle
+import com.yammer.dropwizard.jetty.{JettyManaged, NonblockingServletHolder}
class Environment extends Logging {
private[dropwizard] var resources = Set.empty[Object]
private[dropwizard] var healthChecks = Set.empty[HealthCheck]
private[dropwizard] var providers = Set.empty[Object]
private[dropwizard] var managedObjects = IndexedSeq.empty[Managed]
+ private[dropwizard] var jettyObjects = IndexedSeq.empty[LifeCycle]
private[dropwizard] var filters = Map.empty[String, FilterHolder]
private[dropwizard] var servlets = Map.empty[String, ServletHolder]
@@ -49,6 +51,10 @@ class Environment extends Logging {
managedObjects ++= IndexedSeq(managedObject)
}
+ def manage(jettyObject: LifeCycle) {
+ jettyObjects ++= IndexedSeq(jettyObject)
+ }
+
def addFilter[T <: Filter](filter: T,
pathSpec: String,
params: Map[String, String] = Map.empty) {
View
1  src/main/scala/com/yammer/dropwizard/cli/ManagedCommand.scala
@@ -10,6 +10,7 @@ trait ManagedCommand extends ConfiguredCommand {
val aggregate = new AggregateLifeCycle
val env = new Environment
service.configure(config, env)
+ env.jettyObjects.foreach(aggregate.addBean)
env.managedObjects.map {new JettyManaged(_)}.foreach(aggregate.addBean)
aggregate.start()
try {
View
6 src/main/scala/com/yammer/dropwizard/cli/ServerCommand.scala
@@ -22,11 +22,15 @@ class ServerCommand(service: Service) extends ConfiguredCommand {
service.configure(config, env)
env.healthChecks.foreach(HealthChecks.register)
HealthChecks.register(new DeadlockHealthCheck)
- env.addServlet(new ServletContainer(new JerseyConfig(env)), "/*")
+
+ env.addServlet(new ServletContainer(new JerseyConfig(env)), "/*", initOrder = Int.MaxValue)
val server = ServerFactory.provideServer(config, env.servlets, env.filters)
+ env.jettyObjects.foreach(server.addBean)
env.managedObjects.map { new JettyManaged(_) }.foreach(server.addBean)
+
+
log.info("Starting %s", service.name)
service.banner.foreach {s => log.info("\n%s\n", s)}
Please sign in to comment.
Something went wrong with that request. Please try again.