Skip to content

Commit ba7c69d

Browse files
committed
reverted update of Scala lang module
Signed-off-by: Joern Bernhardt <jb@campudus.com>
1 parent b1cb025 commit ba7c69d

File tree

6 files changed

+8
-22
lines changed

6 files changed

+8
-22
lines changed

gradle.properties

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ pullInDeps=true
2020
produceJar=false
2121

2222
# The version of the Scala module
23-
scalaLangModVersion=1.0.0-RC1
23+
scalaLangModVersion=0.3.0
2424

2525
# The version of Scala to use
2626
scalaVersion=2.10.2
@@ -29,7 +29,7 @@ scalaVersion=2.10.2
2929
gradleVersion=1.11
3030

3131
# The version of Vert.x
32-
vertxVersion=2.1RC1
32+
vertxVersion=2.1RC3
3333

3434
# The version of Vert.x test tools
3535
toolsVersion=2.0.2-final

src/main/resources/langs.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
scala=io.vertx~lang-scala~1.0.0-RC1:org.vertx.scala.platform.impl.ScalaVerticleFactory
1+
scala=io.vertx~lang-scala~0.3.0:org.vertx.scala.platform.impl.ScalaVerticleFactory
22
.scala=scala

src/main/scala/io/vertx/asyncsql/database/ConnectionHandler.scala

+2-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import org.vertx.scala.mods.replies._
1212
import org.vertx.scala.core.Vertx
1313
import org.vertx.scala.platform.Container
1414
import io.vertx.asyncsql.Starter
15-
import org.vertx.scala.mods.ScalaBusMod.Receive
1615

1716
trait ConnectionHandler extends ScalaBusMod {
1817
val verticle: Starter
@@ -30,7 +29,7 @@ trait ConnectionHandler extends ScalaBusMod {
3029
def statementDelimiter: String = ";"
3130

3231
import org.vertx.scala.core.eventbus._
33-
override def receive: Receive = (msg: Message[JsonObject]) => {
32+
override def receive(msg: Message[JsonObject]) = {
3433
case "select" => select(msg.body)
3534
case "insert" => insert(msg.body)
3635
case "prepared" => AsyncReply(sendWithPool(prepared(msg.body)))
@@ -44,9 +43,9 @@ trait ConnectionHandler extends ScalaBusMod {
4443
protected def escapeString(str: String): String = "'" + str.replace("'", "''") + "'"
4544

4645
protected def escapeValue(v: Any): String = v match {
46+
case null => "NULL"
4747
case x: Int => x.toString
4848
case x: Boolean => x.toString
49-
case null => "NULL"
5049
case x => escapeString(x.toString)
5150
}
5251

src/main/scala/io/vertx/asyncsql/database/pool/AsyncConnectionPool.scala

+1-3
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,9 @@ import com.github.mauricio.async.db.{ Configuration, Connection }
88
import io.vertx.asyncsql.Starter
99
import org.vertx.scala.core.VertxExecutionContext
1010

11-
trait AsyncConnectionPool {
11+
trait AsyncConnectionPool extends VertxExecutionContext {
1212

1313
val maxPoolSize: Int
14-
val verticle: Starter
15-
implicit val executionContext = VertxExecutionContext.fromVertxAccess(verticle)
1614

1715
private var poolSize: Int = 0
1816
private val availableConnections: Queue[Connection] = Queue.empty
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,12 @@
11
package io.vertx.asyncsql.database.pool
22

3-
import scala.concurrent.{ ExecutionContext, Future }
4-
import com.github.mauricio.async.db.{ Configuration, Connection }
3+
import com.github.mauricio.async.db.Configuration
54
import com.github.mauricio.async.db.mysql.MySQLConnection
6-
import com.github.mauricio.async.db.postgresql.PostgreSQLConnection
75
import io.netty.channel.EventLoop
8-
import org.vertx.scala.core.VertxExecutionContext
9-
import org.vertx.scala.core.Vertx
10-
import org.vertx.scala.platform.Verticle
116
import io.vertx.asyncsql.Starter
127

138
class MySqlAsyncConnectionPool(val verticle: Starter, config: Configuration, eventLoop: EventLoop, val maxPoolSize: Int) extends AsyncConnectionPool {
149

15-
implicit val executionContext = VertxExecutionContext.fromVertxAccess(verticle)
16-
verticle.
17-
1810
override def create() = new MySQLConnection(configuration = config, group = eventLoop).connect
1911

2012
}

src/main/scala/io/vertx/asyncsql/database/pool/PostgreSqlAsyncConnectionPool.scala

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
package io.vertx.asyncsql.database.pool
22

3-
import scala.concurrent.{ ExecutionContext, Future }
4-
import com.github.mauricio.async.db.{ Configuration, Connection }
3+
import com.github.mauricio.async.db.Configuration
54
import com.github.mauricio.async.db.postgresql.PostgreSQLConnection
65
import io.netty.channel.EventLoop
7-
import org.vertx.scala.core.VertxExecutionContext
8-
import org.vertx.scala.platform.Verticle
96
import io.vertx.asyncsql.Starter
107

118
class PostgreSqlAsyncConnectionPool(val verticle: Starter, config: Configuration, eventLoop: EventLoop, val maxPoolSize: Int) extends AsyncConnectionPool {

0 commit comments

Comments
 (0)