Merge pull request #27504 from akka/wip-deprecate-persistent-fsm-patriknw
Deprecate PersistentFSM (for validation)
This commit is contained in:
commit
c1eb0719da
4 changed files with 16 additions and 0 deletions
|
|
@ -62,6 +62,7 @@ private[akka] class SnapshotAfter(config: Config) extends Extension {
|
|||
* State Data is constructed based on domain events, according to user's implementation of applyEvent function.
|
||||
*
|
||||
*/
|
||||
@deprecated("Use EventSourcedBehavior", "2.6.0")
|
||||
trait PersistentFSM[S <: FSMState, D, E] extends PersistentActor with PersistentFSMBase[S, D, E] with ActorLogging {
|
||||
import akka.persistence.fsm.PersistentFSM._
|
||||
|
||||
|
|
@ -178,6 +179,7 @@ trait PersistentFSM[S <: FSMState, D, E] extends PersistentActor with Persistent
|
|||
}
|
||||
}
|
||||
|
||||
@deprecated("Use EventSourcedBehavior", "2.6.0")
|
||||
object PersistentFSM {
|
||||
|
||||
/**
|
||||
|
|
@ -484,6 +486,7 @@ object PersistentFSM {
|
|||
* Persistent Finite State Machine actor abstract base class.
|
||||
*
|
||||
*/
|
||||
@deprecated("Use EventSourcedBehavior", "2.6.0")
|
||||
abstract class AbstractPersistentFSM[S <: FSMState, D, E]
|
||||
extends AbstractPersistentFSMBase[S, D, E]
|
||||
with PersistentFSM[S, D, E] {
|
||||
|
|
@ -521,6 +524,7 @@ abstract class AbstractPersistentFSM[S <: FSMState, D, E]
|
|||
*
|
||||
*/
|
||||
@silent("deprecated")
|
||||
@deprecated("Use EventSourcedBehavior", "2.6.0")
|
||||
abstract class AbstractPersistentLoggingFSM[S <: FSMState, D, E]
|
||||
extends AbstractPersistentFSM[S, D, E]
|
||||
with LoggingPersistentFSM[S, D, E]
|
||||
|
|
|
|||
|
|
@ -95,6 +95,7 @@ import scala.concurrent.duration.FiniteDuration
|
|||
* </pre>
|
||||
*
|
||||
*/
|
||||
@deprecated("Use EventSourcedBehavior", "2.6.0")
|
||||
trait PersistentFSMBase[S, D, E] extends Actor with Listeners with ActorLogging {
|
||||
|
||||
import akka.persistence.fsm.PersistentFSM._
|
||||
|
|
@ -627,6 +628,7 @@ trait PersistentFSMBase[S, D, E] extends Actor with Listeners with ActorLogging
|
|||
* debug logging capabilities (analogous to [[akka.event.LoggingReceive]]).
|
||||
*
|
||||
*/
|
||||
@deprecated("Use EventSourcedBehavior", "2.6.0")
|
||||
trait LoggingPersistentFSM[S, D, E] extends PersistentFSMBase[S, D, E] { this: Actor =>
|
||||
|
||||
import akka.persistence.fsm.PersistentFSM._
|
||||
|
|
@ -696,6 +698,7 @@ trait LoggingPersistentFSM[S, D, E] extends PersistentFSMBase[S, D, E] { this: A
|
|||
* Java API: compatible with lambda expressions
|
||||
*
|
||||
*/
|
||||
@deprecated("Use EventSourcedBehavior", "2.6.0")
|
||||
object AbstractPersistentFSMBase {
|
||||
|
||||
/**
|
||||
|
|
@ -715,6 +718,7 @@ object AbstractPersistentFSMBase {
|
|||
* Finite State Machine actor abstract base class.
|
||||
*
|
||||
*/
|
||||
@deprecated("Use EventSourcedBehavior", "2.6.0")
|
||||
abstract class AbstractPersistentFSMBase[S, D, E] extends PersistentFSMBase[S, D, E] {
|
||||
import akka.persistence.fsm.japi.pf.FSMStateFunctionBuilder
|
||||
import akka.persistence.fsm.japi.pf.FSMStopBuilder
|
||||
|
|
|
|||
|
|
@ -11,14 +11,18 @@ import akka.persistence.fsm.PersistentFSM.{ PersistentFSMSnapshot, StateChangeEv
|
|||
import akka.persistence.serialization.{ MessageFormats => mf }
|
||||
import akka.serialization._
|
||||
import akka.protobuf._
|
||||
|
||||
import scala.collection.immutable
|
||||
import scala.collection.immutable.VectorBuilder
|
||||
import scala.concurrent.duration
|
||||
import akka.actor.Actor
|
||||
import akka.util.ccompat._
|
||||
|
||||
import scala.concurrent.duration.Duration
|
||||
import java.io.NotSerializableException
|
||||
|
||||
import com.github.ghik.silencer.silent
|
||||
|
||||
/**
|
||||
* Marker trait for all protobuf-serializable messages in `akka.persistence`.
|
||||
*/
|
||||
|
|
@ -125,6 +129,7 @@ class MessageSerializer(val system: ExtendedActorSystem) extends BaseSerializer
|
|||
AtLeastOnceDeliverySnapshot(atLeastOnceDeliverySnapshot.getCurrentDeliveryId, unconfirmedDeliveries.result())
|
||||
}
|
||||
|
||||
@silent("deprecated")
|
||||
def stateChange(persistentStateChange: mf.PersistentStateChangeEvent): StateChangeEvent = {
|
||||
StateChangeEvent(
|
||||
persistentStateChange.getStateIdentifier,
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import akka.actor.{ ActorSystem, _ }
|
|||
import akka.persistence._
|
||||
import akka.persistence.fsm.PersistentFSM._
|
||||
import akka.testkit._
|
||||
import com.github.ghik.silencer.silent
|
||||
import com.typesafe.config.{ Config, ConfigFactory }
|
||||
import org.apache.commons.io.FileUtils
|
||||
|
||||
|
|
@ -17,6 +18,7 @@ import scala.concurrent.duration._
|
|||
import scala.language.postfixOps
|
||||
import scala.reflect.ClassTag
|
||||
|
||||
@silent("deprecated")
|
||||
abstract class PersistentFSMSpec(config: Config) extends PersistenceSpec(config) with ImplicitSender {
|
||||
import PersistentFSMSpec._
|
||||
|
||||
|
|
@ -398,6 +400,7 @@ abstract class PersistentFSMSpec(config: Config) extends PersistenceSpec(config)
|
|||
}
|
||||
}
|
||||
|
||||
@silent("deprecated")
|
||||
object PersistentFSMSpec {
|
||||
//#customer-states
|
||||
sealed trait UserState extends FSMState
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue