fix warnings in contrib, docs, osgi, persistence and slf4j

This commit is contained in:
Roland Kuhn 2015-01-30 18:34:03 +01:00
parent 82b8238a9c
commit a029a90502
17 changed files with 116 additions and 89 deletions

View file

@ -4,13 +4,19 @@
package docs.persistence
import akka.actor.{ Actor, ActorSystem, Props }
import akka.actor.{ Actor, ActorRef, ActorSystem, Props }
import akka.persistence._
import com.typesafe.config.ConfigFactory
import scala.concurrent.duration._
import scala.language.postfixOps
trait PersistenceDocSpec {
object PersistenceDocSpec {
trait SomeOtherMessage
val persistentActor: ActorRef = ???
val config =
"""
//#auto-update-interval
@ -21,13 +27,7 @@ trait PersistenceDocSpec {
//#auto-update
"""
trait SomeOtherMessage
implicit val system: ActorSystem
import system._
new AnyRef {
object Recovery {
trait MyPersistentActor1 extends PersistentActor {
//#recover-on-start-disabled
override def preStart() = ()
@ -45,7 +45,6 @@ trait PersistenceDocSpec {
//#recover-on-start-custom
}
val persistentActor = system.deadLetters
//#recover-explicit
persistentActor ! Recover()
//#recover-explicit
@ -69,7 +68,7 @@ trait PersistenceDocSpec {
}
}
new AnyRef {
object NoRecovery {
trait MyPersistentActor1 extends PersistentActor {
//#recover-fully-disabled
override def preStart() = self ! Recover(toSequenceNr = 0L)
@ -77,7 +76,7 @@ trait PersistenceDocSpec {
}
}
new AnyRef {
object PersistenceId {
trait PersistentActorMethods {
//#persistence-id
def persistenceId: String
@ -101,7 +100,7 @@ trait PersistenceDocSpec {
}
}
new AnyRef {
object AtLeastOnce {
//#at-least-once-example
import akka.actor.{ Actor, ActorPath }
import akka.persistence.AtLeastOnceDelivery
@ -145,7 +144,7 @@ trait PersistenceDocSpec {
//#at-least-once-example
}
new AnyRef {
object SaveSnapshot {
class MyPersistentActor extends PersistentActor {
override def persistenceId = "my-stable-persistence-id"
@ -164,7 +163,7 @@ trait PersistenceDocSpec {
}
}
new AnyRef {
object OfferSnapshot {
class MyPersistentActor extends PersistentActor {
override def persistenceId = "my-stable-persistence-id"
@ -183,8 +182,6 @@ trait PersistenceDocSpec {
import akka.actor.Props
val persistentActor = system.actorOf(Props[MyPersistentActor])
//#snapshot-criteria
persistentActor ! Recover(fromSnapshot = SnapshotSelectionCriteria(
maxSequenceNr = 457L,
@ -192,9 +189,7 @@ trait PersistenceDocSpec {
//#snapshot-criteria
}
new AnyRef {
val persistentActor = system.actorOf(Props[MyPersistentActor]())
object PersistAsync {
//#persist-async
class MyPersistentActor extends PersistentActor {
@ -228,9 +223,8 @@ trait PersistenceDocSpec {
//#persist-async
}
new AnyRef {
val persistentActor = system.actorOf(Props[MyPersistentActor]())
object Defer {
//#defer
class MyPersistentActor extends PersistentActor {
@ -268,9 +262,12 @@ trait PersistenceDocSpec {
//#defer-caller
}
new AnyRef {
object View {
import akka.actor.Props
val system: ActorSystem = ???
//#view
class MyView extends PersistentView {
override def persistenceId: String = "some-persistence-id"