#22903 Fix code snippeds
* move scala and java sources out of paradox sources * replace relative paths with $code$ and $akka$ * fix broken includes
This commit is contained in:
parent
7bee495749
commit
81df4ff417
384 changed files with 1609 additions and 1602 deletions
|
|
@ -1,30 +0,0 @@
|
|||
package docs.faq
|
||||
|
||||
import akka.actor.Actor
|
||||
|
||||
//#exhaustiveness-check
|
||||
object MyActor {
|
||||
// these are the messages we accept
|
||||
sealed abstract trait Message
|
||||
final case class FooMessage(foo: String) extends Message
|
||||
final case class BarMessage(bar: Int) extends Message
|
||||
|
||||
// these are the replies we send
|
||||
sealed abstract trait Reply
|
||||
final case class BazMessage(baz: String) extends Reply
|
||||
}
|
||||
|
||||
class MyActor extends Actor {
|
||||
import MyActor._
|
||||
def receive = {
|
||||
case message: Message => message match {
|
||||
case BarMessage(bar) => sender() ! BazMessage("Got " + bar)
|
||||
// warning here:
|
||||
// "match may not be exhaustive. It would fail on the following input: FooMessage(_)"
|
||||
//#exhaustiveness-check
|
||||
case FooMessage(_) => // avoid the warning in our build logs
|
||||
//#exhaustiveness-check
|
||||
}
|
||||
}
|
||||
}
|
||||
//#exhaustiveness-check
|
||||
|
|
@ -79,7 +79,7 @@ exhaustiveness.
|
|||
Here is an example where the compiler will warn you that the match in
|
||||
receive isn't exhaustive:
|
||||
|
||||
@@snip [Faq.scala](code/docs/faq/Faq.scala) { #exhaustiveness-check }
|
||||
@@snip [Faq.scala]($code$/scala/docs/faq/Faq.scala) { #exhaustiveness-check }
|
||||
|
||||
## Remoting
|
||||
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ dynamic in this way. ActorRefs may safely be exposed to other bundles.
|
|||
To bootstrap Akka inside an OSGi environment, you can use the `akka.osgi.ActorSystemActivator` class
|
||||
to conveniently set up the ActorSystem.
|
||||
|
||||
@@snip [Activator.scala]../../../../../akka-osgi/src/test/scala/docs/osgi/Activator.scala) { #Activator }
|
||||
@@snip [Activator.scala]($akka$/akka-osgi/src/test/scala/docs/osgi/Activator.scala) { #Activator }
|
||||
|
||||
The goal here is to map the OSGi lifecycle more directly to the Akka lifecycle. The `ActorSystemActivator` creates
|
||||
the actor system with a class loader that finds resources (`application.conf` and `reference.conf` files) and classes
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue