├── akka-docs ├── .history ├── _sphinx │ ├── pygments │ │ ├── styles │ │ │ └── __init__.py │ │ └── setup.py │ ├── static │ │ ├── akka.png │ │ ├── logo.png │ │ ├── favicon.ico │ │ └── akka-intellij-code-style.jar │ └── themes │ │ └── akka │ │ ├── theme.conf │ │ └── static │ │ ├── pdf-icon.png │ │ ├── watermark.png │ │ ├── logo-small.png │ │ ├── pdf-java-icon.png │ │ ├── pdf-scala-icon.png │ │ ├── contentsFix.js │ │ ├── scrollTo.js │ │ ├── highlightCode.js │ │ ├── akka_icon_reverse.svg │ │ └── akka_icon_full_color.svg ├── rst │ ├── images │ │ ├── more.png │ │ ├── phi1.png │ │ ├── phi2.png │ │ ├── phi3.png │ │ ├── build-path.png │ │ ├── pi-formula.png │ │ ├── quickfix.png │ │ ├── run-config.png │ │ ├── camel-pubsub.png │ │ ├── example-code.png │ │ ├── actor_lifecycle.png │ │ ├── camel-pubsub2.png │ │ ├── clojure-trees.png │ │ ├── import-project.png │ │ ├── member-states.png │ │ ├── member-states.drawing │ │ ├── diagnostics-window.png │ │ ├── association_lifecycle.png │ │ ├── circuit-breaker-states.png │ │ ├── akka-remote-testconductor.png │ │ ├── install-beta2-updatesite.png │ │ ├── faulttolerancesample-normal-flow.png │ │ ├── faulttolerancesample-failure-flow.png │ │ ├── benchmark-akka-sample-trading-throughput.png │ │ └── circuit-breaker-states.dot │ ├── general │ │ ├── ActorPath.png │ │ ├── guardians.png │ │ ├── RemoteDeployment.png │ │ └── index.rst │ ├── index.rst │ ├── java │ │ ├── index-futures.rst │ │ ├── lambda-index-actors.rst │ │ ├── index-utilities.rst │ │ ├── index-actors.rst │ │ ├── index-network.rst │ │ └── code │ │ │ └── docs │ │ │ ├── camel │ │ │ ├── Orders.java │ │ │ ├── Producer1.java │ │ │ ├── FirstProducer.java │ │ │ ├── ResponseReceiver.java │ │ │ ├── OnewaySender.java │ │ │ ├── MyActor.java │ │ │ ├── CustomRouteBuilder.java │ │ │ ├── RequestBodyActor.java │ │ │ ├── Forwarder.java │ │ │ ├── Consumer2.java │ │ │ ├── CustomRouteTestBase.java │ │ │ ├── Consumer1.java │ │ │ ├── MyEndpoint.java │ │ │ ├── Responder.java │ │ │ ├── Consumer3.java │ │ │ └── OnRouteResponseTestBase.java │ │ │ ├── agent │ │ │ └── AgentDocJavaSpec.scala │ │ │ ├── dispatcher │ │ │ └── MyUnboundedJMessageQueueSemantics.java │ │ │ ├── pattern │ │ │ └── JavaTemplate.java │ │ │ ├── actor │ │ │ ├── MyBoundedUntypedActor.java │ │ │ ├── FirstUntypedActor.java │ │ │ ├── MyUntypedActor.java │ │ │ └── ImmutableMessage.java │ │ │ └── io │ │ │ └── japi │ │ │ └── Watcher.java │ ├── scala │ │ ├── index-futures.rst │ │ ├── index-utilities.rst │ │ ├── index-network.rst │ │ ├── index-actors.rst │ │ ├── testkit-example.rst │ │ └── code │ │ │ └── docs │ │ │ └── pattern │ │ │ └── ScalaTemplate.scala │ ├── additional │ │ ├── index.rst │ │ ├── language-bindings.rst │ │ ├── code │ │ │ └── docs │ │ │ │ ├── osgi │ │ │ │ ├── blueprint.xml │ │ │ │ └── Activator.scala │ │ │ │ └── faq │ │ │ │ └── Faq.scala │ │ ├── books.rst │ │ └── http.rst │ ├── project │ │ ├── index.rst │ │ ├── migration-guide-2.0.x-2.1.x.rst │ │ ├── migration-guide-2.1.x-2.2.x.rst │ │ ├── migration-guide-1.3.x-2.0.x.rst │ │ ├── migration-guides.rst │ │ └── sponsors.rst │ ├── intro │ │ ├── index-java.rst │ │ └── index-scala.rst │ ├── dev │ │ └── index.rst │ ├── scala.rst │ ├── java.rst │ └── common │ │ └── code │ │ └── docs │ │ └── duration │ │ ├── Sample.scala │ │ └── Java.java └── build.sbt ├── project ├── build.properties ├── GitHub.scala ├── CommandLineOptions.scala ├── MiMa.scala ├── RootSettings.scala ├── ValidatePullRequest.scala └── plugins.sbt ├── scripts ├── line_count.sh ├── compile_etags_file.sh ├── remove_trailing_whitespace.sh ├── show-serializer.sh ├── dos_to_unix.sh ├── convert_tabs_to_spaces.sh └── multi-node-log-replace.sh ├── akka-camel ├── src │ ├── test │ │ ├── scala │ │ │ └── application.conf │ │ ├── java │ │ │ └── akka │ │ │ │ └── camel │ │ │ │ ├── SampleUntypedReplyingProducer.java │ │ │ │ ├── SampleUntypedForwardingProducer.java │ │ │ │ └── SampleUntypedConsumer.java │ │ └── resources │ │ │ └── logback-test.xml │ └── main │ │ └── scala │ │ └── akka │ │ ├── camel │ │ ├── ActorNotRegisteredException.scala │ │ ├── CamelSupport.scala │ │ └── ContextProvider.scala │ │ └── package.scala └── build.sbt ├── akka-kernel ├── src │ └── main │ │ └── dist │ │ ├── deploy │ │ └── README │ │ ├── bin │ │ ├── jmxsh-R5.jar │ │ ├── akka.bat │ │ └── akka │ │ ├── LICENSES │ │ └── config │ │ └── application.conf └── build.sbt ├── akka-samples ├── akka-docs-java-lambda │ ├── project │ │ └── build.properties │ ├── build.sbt │ └── src │ │ └── test │ │ └── java │ │ └── docs │ │ └── actor │ │ └── MyActor.java ├── akka-sample-camel-java │ ├── project │ │ └── build.properties │ ├── tutorial │ │ ├── camel-custom-route.png │ │ ├── camel-async-interact.png │ │ └── camel-async-sequence.png │ ├── .gitignore │ ├── activator.properties │ ├── src │ │ └── main │ │ │ └── java │ │ │ └── sample │ │ │ └── camel │ │ │ ├── route │ │ │ ├── RouteProducer.java │ │ │ ├── CustomRouteBuilder.java │ │ │ ├── CustomRouteSample.java │ │ │ └── RouteConsumer.java │ │ │ ├── quartz │ │ │ ├── QuartzSample.java │ │ │ └── MyQuartzActor.java │ │ │ └── http │ │ │ ├── HttpConsumer.java │ │ │ ├── HttpSample.java │ │ │ └── HttpTransformer.java │ ├── build.sbt │ └── LICENSE ├── akka-sample-fsm-scala │ ├── project │ │ └── build.properties │ ├── build.sbt │ ├── activator.properties │ └── LICENSE ├── akka-sample-main-java │ ├── project │ │ └── build.properties │ ├── src │ │ └── main │ │ │ ├── resources │ │ │ └── application.conf │ │ │ └── java │ │ │ └── sample │ │ │ └── hello │ │ │ ├── Main.java │ │ │ ├── Greeter.java │ │ │ └── HelloWorld.java │ ├── build.sbt │ ├── activator.properties │ ├── LICENSE │ └── pom.xml ├── akka-sample-main-scala │ ├── project │ │ └── build.properties │ ├── src │ │ └── main │ │ │ ├── resources │ │ │ └── application.conf │ │ │ └── scala │ │ │ └── sample │ │ │ └── hello │ │ │ ├── Main.scala │ │ │ ├── Greeter.scala │ │ │ ├── HelloWorld.scala │ │ │ └── Main2.scala │ ├── build.sbt │ ├── activator.properties │ └── LICENSE ├── akka-docs-udp-multicast │ ├── project │ │ └── build.properties │ └── build.sbt ├── akka-sample-camel-scala │ ├── project │ │ └── build.properties │ ├── tutorial │ │ ├── camel-async-interact.png │ │ ├── camel-async-sequence.png │ │ └── camel-custom-route.png │ ├── .gitignore │ ├── activator.properties │ ├── LICENSE │ ├── build.sbt │ └── src │ │ └── main │ │ └── scala │ │ └── sample │ │ └── camel │ │ └── QuartzExample.scala ├── akka-sample-cluster-java │ ├── project │ │ ├── build.properties │ │ └── plugins.sbt │ ├── .gitignore │ ├── activator.properties │ ├── LICENSE │ └── src │ │ └── main │ │ ├── resources │ │ ├── stats1.conf │ │ ├── stats2.conf │ │ ├── application.conf │ │ └── factorial.conf │ │ └── java │ │ └── sample │ │ └── cluster │ │ ├── factorial │ │ ├── FactorialApp.java │ │ └── FactorialResult.java │ │ ├── transformation │ │ ├── TransformationApp.java │ │ └── TransformationBackendMain.java │ │ └── stats │ │ ├── StatsSampleClientMain.java │ │ ├── StatsSampleOneMasterClientMain.java │ │ └── StatsWorker.java ├── akka-sample-cluster-scala │ ├── project │ │ ├── build.properties │ │ └── plugins.sbt │ ├── .gitignore │ ├── src │ │ └── main │ │ │ ├── scala │ │ │ └── sample │ │ │ │ └── cluster │ │ │ │ ├── stats │ │ │ │ ├── StatsMessages.scala │ │ │ │ └── StatsWorker.scala │ │ │ │ ├── transformation │ │ │ │ ├── TransformationMessages.scala │ │ │ │ └── TransformationApp.scala │ │ │ │ ├── factorial │ │ │ │ └── FactorialApp.scala │ │ │ │ └── simple │ │ │ │ └── SimpleClusterApp.scala │ │ │ └── resources │ │ │ ├── stats1.conf │ │ │ ├── stats2.conf │ │ │ └── application.conf │ ├── activator.properties │ └── LICENSE ├── akka-sample-fsm-java-lambda │ ├── project │ │ └── build.properties │ ├── activator.properties │ ├── LICENSE │ └── build.sbt ├── akka-sample-hello-kernel │ ├── project │ │ ├── build.properties │ │ └── plugins.sbt │ ├── LICENSE │ ├── build.sbt │ ├── README.md │ └── src │ │ └── main │ │ └── scala │ │ └── sample │ │ └── kernel │ │ └── hello │ │ └── HelloKernel.scala ├── akka-sample-remote-java │ ├── project │ │ └── build.properties │ ├── src │ │ └── main │ │ │ └── resources │ │ │ ├── remotelookup.conf │ │ │ ├── calculator.conf │ │ │ ├── common.conf │ │ │ └── remotecreation.conf │ ├── .gitignore │ ├── activator.properties │ ├── build.sbt │ └── LICENSE ├── akka-sample-remote-scala │ ├── project │ │ └── build.properties │ ├── src │ │ └── main │ │ │ ├── resources │ │ │ ├── remotelookup.conf │ │ │ ├── calculator.conf │ │ │ ├── common.conf │ │ │ └── remotecreation.conf │ │ │ └── scala │ │ │ └── sample │ │ │ └── remote │ │ │ ├── benchmark │ │ │ └── Receiver.scala │ │ │ └── calculator │ │ │ ├── CreationActor.scala │ │ │ ├── CalculatorActor.scala │ │ │ └── MathOp.scala │ ├── .gitignore │ ├── activator.properties │ ├── build.sbt │ └── LICENSE ├── akka-sample-main-java-lambda │ ├── project │ │ └── build.properties │ ├── src │ │ └── main │ │ │ ├── resources │ │ │ └── application.conf │ │ │ └── java │ │ │ └── sample │ │ │ └── hello │ │ │ ├── Main.java │ │ │ ├── Greeter.java │ │ │ ├── HelloWorld.java │ │ │ └── Main2.java │ ├── build.sbt │ ├── activator.properties │ └── LICENSE ├── akka-sample-multi-node-scala │ ├── project │ │ ├── build.properties │ │ └── plugins.sbt │ ├── activator.properties │ ├── LICENSE │ └── src │ │ └── test │ │ └── scala │ │ └── sample │ │ └── multinode │ │ └── STMultiNodeSpec.scala ├── akka-sample-persistence-java │ ├── project │ │ └── build.properties │ ├── .gitignore │ ├── build.sbt │ ├── activator.properties │ ├── src │ │ └── main │ │ │ └── resources │ │ │ └── application.conf │ └── LICENSE ├── akka-sample-persistence-scala │ ├── project │ │ └── build.properties │ ├── .gitignore │ ├── activator.properties │ ├── build.sbt │ ├── src │ │ └── main │ │ │ └── resources │ │ │ └── application.conf │ └── LICENSE ├── akka-sample-persistence-java-lambda │ ├── project │ │ └── build.properties │ ├── .gitignore │ ├── activator.properties │ ├── build.sbt │ ├── src │ │ └── main │ │ │ └── resources │ │ │ └── application.conf │ └── LICENSE ├── akka-sample-supervision-java-lambda │ ├── project │ │ └── build.properties │ ├── activator.properties │ ├── LICENSE │ └── build.sbt └── akka-sample-osgi-dining-hakkers │ ├── assembly-dist │ └── src │ │ └── main │ │ ├── distribution │ │ ├── VERSION │ │ ├── lib │ │ │ └── readme.txt │ │ └── etc │ │ │ ├── readme.txt │ │ │ └── org.apache.karaf.features.cfg │ │ └── resources │ │ └── etc │ │ └── readme.txt │ ├── LICENSE │ ├── karaf.sh │ ├── core │ └── src │ │ └── main │ │ ├── scala │ │ └── akka │ │ │ └── sample │ │ │ └── osgi │ │ │ └── serialization │ │ │ └── DiningHakkerSerializer.scala │ │ └── resources │ │ └── application.conf │ └── api │ ├── src │ └── main │ │ └── scala │ │ └── akka │ │ └── sample │ │ └── osgi │ │ └── api │ │ └── DiningHakkersService.scala │ └── pom.xml ├── akka-contrib ├── docs │ ├── throttler.png │ ├── ReliableProxy.png │ └── jul.rst └── src │ └── test │ └── resources │ └── reference.conf ├── akka-actor-tests ├── src │ └── test │ │ ├── resources │ │ └── reference.conf │ │ ├── scala │ │ └── akka │ │ │ ├── japi │ │ │ └── JavaAPITest.scala │ │ │ ├── actor │ │ │ ├── JavaAPISpec.scala │ │ │ └── Supervisor.scala │ │ │ ├── util │ │ │ ├── JavaDurationSpec.scala │ │ │ └── LineNumberSpecCodeForScala.scala │ │ │ └── Messages.scala │ │ └── java │ │ └── akka │ │ ├── actor │ │ ├── NonStaticCreator.java │ │ ├── TestAnnotation.java │ │ ├── JavaAPITestActor.java │ │ └── NonPublicClass.java │ │ └── util │ │ └── JavaDuration.java └── build.sbt ├── akka-remote ├── src │ ├── test │ │ ├── resources │ │ │ ├── keystore │ │ │ ├── truststore │ │ │ └── reference.conf │ │ ├── protobuf │ │ │ └── ProtobufProtocol.proto │ │ └── scala │ │ │ └── akka │ │ │ └── remote │ │ │ ├── RemoteActorMailboxSpec.scala │ │ │ ├── SerializeCreatorsVerificationSpec.scala │ │ │ ├── SerializationChecksPlainRemotingSpec.scala │ │ │ └── serialization │ │ │ └── ProtobufSerializerSpec.scala │ └── main │ │ ├── scala │ │ └── akka │ │ │ └── remote │ │ │ └── security │ │ │ └── provider │ │ │ └── SeedSize.scala │ │ └── protobuf │ │ └── ContainerFormats.proto └── build.sbt ├── akka-cluster ├── src │ └── test │ │ ├── resources │ │ └── reference.conf │ │ └── scala │ │ └── akka │ │ └── cluster │ │ ├── SerializeCreatorsVerificationSpec.scala │ │ ├── TestMember.scala │ │ └── SerializationChecksSpec.scala └── build.sbt ├── akka-remote-tests ├── src │ └── test │ │ ├── resources │ │ └── reference.conf │ │ └── scala │ │ └── akka │ │ └── remote │ │ ├── SerializationChecksSpec.scala │ │ ├── testkit │ │ └── STMultiNodeSpec.scala │ │ └── QuietReporter.scala └── build.sbt ├── akka-cluster-metrics ├── src │ └── test │ │ └── resources │ │ └── reference.conf └── build.sbt ├── akka-bench-jmh ├── build.sbt └── src │ └── main │ └── scala │ └── akka │ └── persistence │ └── Common.scala ├── akka-actor ├── src │ └── main │ │ ├── scala │ │ └── akka │ │ │ ├── io │ │ │ ├── DnsProvider.scala │ │ │ ├── InetAddressDnsProvider.scala │ │ │ ├── UdpConnectedManager.scala │ │ │ └── IO.scala │ │ │ ├── util │ │ │ ├── Unsafe.java │ │ │ ├── BoxedType.scala │ │ │ └── ClassLoaderObjectInputStream.scala │ │ │ ├── actor │ │ │ └── package.scala │ │ │ ├── serialization │ │ │ └── SerializationExtension.scala │ │ │ └── japi │ │ │ └── pf │ │ │ └── CaseStatements.scala │ │ └── java │ │ └── akka │ │ ├── japi │ │ └── JAPI.java │ │ ├── pattern │ │ ├── AbstractCircuitBreaker.java │ │ └── AbstractPromiseActorRef.java │ │ ├── actor │ │ └── AbstractActorRef.java │ │ └── dispatch │ │ ├── AbstractMailbox.java │ │ └── AbstractMessageDispatcher.java └── build.sbt ├── akka-typed ├── build.sbt └── src │ └── test │ └── resources │ └── reference.conf ├── akka-testkit ├── src │ ├── test │ │ ├── scala │ │ │ └── akka │ │ │ │ └── testkit │ │ │ │ ├── TestTags.scala │ │ │ │ ├── TestActorsSpec.scala │ │ │ │ ├── ImplicitSenderSpec.scala │ │ │ │ ├── DefaultTimeoutSpec.scala │ │ │ │ └── metrics │ │ │ │ └── AveragingGauge.scala │ │ └── java │ │ │ └── akka │ │ │ └── testkit │ │ │ └── TestActorRefJavaCompile.java │ └── main │ │ └── scala │ │ └── akka │ │ └── testkit │ │ └── TestActors.scala └── build.sbt ├── akka-multi-node-testkit └── build.sbt ├── atmos └── src │ └── main │ └── resources │ └── reference.conf ├── akka-slf4j └── build.sbt ├── akka-agent ├── build.sbt └── src │ └── main │ └── resources │ └── reference.conf ├── akka-osgi ├── build.sbt └── src │ └── test │ ├── scala │ └── akka │ │ └── osgi │ │ └── test │ │ └── PingPong.scala │ └── resources │ └── logback-test.xml ├── akka-persistence-tck ├── src │ ├── test │ │ └── scala │ │ │ └── akka │ │ │ └── persistence │ │ │ ├── journal │ │ │ └── leveldb │ │ │ │ ├── LeveldbJournalJavaSpec.scala │ │ │ │ ├── LeveldbJournalNativeSpec.scala │ │ │ │ └── LeveldbJournalNativePerfSpec.scala │ │ │ ├── japi │ │ │ └── JavaJournalSpecSpec.scala │ │ │ ├── snapshot │ │ │ └── local │ │ │ │ └── LocalSnapshotStoreSpec.scala │ │ │ └── PluginCleanup.scala │ └── main │ │ └── scala │ │ └── akka │ │ └── persistence │ │ └── japi │ │ ├── journal │ │ └── JavaJournalSpec.scala │ │ └── snapshot │ │ └── JavaSnapshotStoreSpec.scala └── build.sbt ├── akka-persistence ├── src │ └── main │ │ └── scala │ │ └── akka │ │ └── persistence │ │ ├── package.scala │ │ ├── Protocol.scala │ │ ├── serialization │ │ └── package.scala │ │ └── journal │ │ ├── WriteJournalBase.scala │ │ └── japi │ │ ├── SyncWriteJournal.scala │ │ └── AsyncWriteJournal.scala └── build.sbt ├── src └── main │ └── ls │ └── 2.0.json ├── README.textile └── LICENSE /akka-docs/.history: -------------------------------------------------------------------------------- 1 | exit 2 | -------------------------------------------------------------------------------- /akka-docs/_sphinx/pygments/styles/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /project/build.properties: -------------------------------------------------------------------------------- 1 | sbt.version=0.13.7 2 | -------------------------------------------------------------------------------- /scripts/line_count.sh: -------------------------------------------------------------------------------- 1 | wc -l `find . -name \*.scala -print` -------------------------------------------------------------------------------- /scripts/compile_etags_file.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | sctags.bat -E -R . -f TAGS 3 | -------------------------------------------------------------------------------- /akka-camel/src/test/scala/application.conf: -------------------------------------------------------------------------------- 1 | akka{ 2 | loglevel = "ERROR" 3 | } -------------------------------------------------------------------------------- /akka-kernel/src/main/dist/deploy/README: -------------------------------------------------------------------------------- 1 | Place application jars in this directory -------------------------------------------------------------------------------- /akka-samples/akka-docs-java-lambda/project/build.properties: -------------------------------------------------------------------------------- 1 | sbt.version=0.13.7 2 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-camel-java/project/build.properties: -------------------------------------------------------------------------------- 1 | sbt.version=0.13.7 2 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-fsm-scala/project/build.properties: -------------------------------------------------------------------------------- 1 | sbt.version=0.13.7 2 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-main-java/project/build.properties: -------------------------------------------------------------------------------- 1 | sbt.version=0.13.7 2 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-main-scala/project/build.properties: -------------------------------------------------------------------------------- 1 | sbt.version=0.13.7 2 | -------------------------------------------------------------------------------- /akka-samples/akka-docs-udp-multicast/project/build.properties: -------------------------------------------------------------------------------- 1 | sbt.version=0.13.7 2 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-camel-scala/project/build.properties: -------------------------------------------------------------------------------- 1 | sbt.version=0.13.7 2 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-cluster-java/project/build.properties: -------------------------------------------------------------------------------- 1 | sbt.version=0.13.7 2 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-cluster-scala/project/build.properties: -------------------------------------------------------------------------------- 1 | sbt.version=0.13.7 2 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-fsm-java-lambda/project/build.properties: -------------------------------------------------------------------------------- 1 | sbt.version=0.13.7 2 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-hello-kernel/project/build.properties: -------------------------------------------------------------------------------- 1 | sbt.version=0.13.7 2 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-remote-java/project/build.properties: -------------------------------------------------------------------------------- 1 | sbt.version=0.13.7 2 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-remote-scala/project/build.properties: -------------------------------------------------------------------------------- 1 | sbt.version=0.13.7 2 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-main-java-lambda/project/build.properties: -------------------------------------------------------------------------------- 1 | sbt.version=0.13.7 2 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-multi-node-scala/project/build.properties: -------------------------------------------------------------------------------- 1 | sbt.version=0.13.7 2 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-persistence-java/project/build.properties: -------------------------------------------------------------------------------- 1 | sbt.version=0.13.7 2 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-persistence-scala/project/build.properties: -------------------------------------------------------------------------------- 1 | sbt.version=0.13.7 2 | -------------------------------------------------------------------------------- /scripts/remove_trailing_whitespace.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | sed -i '' 's/[[:space:]]*$//g' **/*.scala -------------------------------------------------------------------------------- /akka-samples/akka-sample-persistence-java-lambda/project/build.properties: -------------------------------------------------------------------------------- 1 | sbt.version=0.13.7 2 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-supervision-java-lambda/project/build.properties: -------------------------------------------------------------------------------- 1 | sbt.version=0.13.7 2 | -------------------------------------------------------------------------------- /akka-docs/rst/images/more.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcbozonier/akka/master/akka-docs/rst/images/more.png -------------------------------------------------------------------------------- /akka-docs/rst/images/phi1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcbozonier/akka/master/akka-docs/rst/images/phi1.png -------------------------------------------------------------------------------- /akka-docs/rst/images/phi2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcbozonier/akka/master/akka-docs/rst/images/phi2.png -------------------------------------------------------------------------------- /akka-docs/rst/images/phi3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcbozonier/akka/master/akka-docs/rst/images/phi3.png -------------------------------------------------------------------------------- /akka-samples/akka-sample-main-java/src/main/resources/application.conf: -------------------------------------------------------------------------------- 1 | akka { 2 | loglevel = INFO 3 | } 4 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-main-scala/src/main/resources/application.conf: -------------------------------------------------------------------------------- 1 | akka { 2 | loglevel = INFO 3 | } 4 | -------------------------------------------------------------------------------- /akka-contrib/docs/throttler.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcbozonier/akka/master/akka-contrib/docs/throttler.png -------------------------------------------------------------------------------- /akka-samples/akka-sample-main-java-lambda/src/main/resources/application.conf: -------------------------------------------------------------------------------- 1 | akka { 2 | loglevel = INFO 3 | } 4 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-osgi-dining-hakkers/assembly-dist/src/main/distribution/VERSION: -------------------------------------------------------------------------------- 1 | Akka ${project.version} 2 | -------------------------------------------------------------------------------- /akka-contrib/docs/ReliableProxy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcbozonier/akka/master/akka-contrib/docs/ReliableProxy.png -------------------------------------------------------------------------------- /akka-docs/_sphinx/static/akka.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcbozonier/akka/master/akka-docs/_sphinx/static/akka.png -------------------------------------------------------------------------------- /akka-docs/_sphinx/static/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcbozonier/akka/master/akka-docs/_sphinx/static/logo.png -------------------------------------------------------------------------------- /akka-docs/rst/general/ActorPath.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcbozonier/akka/master/akka-docs/rst/general/ActorPath.png -------------------------------------------------------------------------------- /akka-docs/rst/general/guardians.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcbozonier/akka/master/akka-docs/rst/general/guardians.png -------------------------------------------------------------------------------- /akka-docs/rst/images/build-path.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcbozonier/akka/master/akka-docs/rst/images/build-path.png -------------------------------------------------------------------------------- /akka-docs/rst/images/pi-formula.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcbozonier/akka/master/akka-docs/rst/images/pi-formula.png -------------------------------------------------------------------------------- /akka-docs/rst/images/quickfix.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcbozonier/akka/master/akka-docs/rst/images/quickfix.png -------------------------------------------------------------------------------- /akka-docs/rst/images/run-config.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcbozonier/akka/master/akka-docs/rst/images/run-config.png -------------------------------------------------------------------------------- /akka-docs/rst/index.rst: -------------------------------------------------------------------------------- 1 | Contents 2 | ======== 3 | 4 | .. toctree:: 5 | :maxdepth: 1 6 | 7 | java 8 | scala 9 | -------------------------------------------------------------------------------- /akka-actor-tests/src/test/resources/reference.conf: -------------------------------------------------------------------------------- 1 | akka { 2 | actor { 3 | serialize-messages = on 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /akka-docs/_sphinx/static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcbozonier/akka/master/akka-docs/_sphinx/static/favicon.ico -------------------------------------------------------------------------------- /akka-docs/rst/images/camel-pubsub.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcbozonier/akka/master/akka-docs/rst/images/camel-pubsub.png -------------------------------------------------------------------------------- /akka-docs/rst/images/example-code.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcbozonier/akka/master/akka-docs/rst/images/example-code.png -------------------------------------------------------------------------------- /akka-docs/rst/images/actor_lifecycle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcbozonier/akka/master/akka-docs/rst/images/actor_lifecycle.png -------------------------------------------------------------------------------- /akka-docs/rst/images/camel-pubsub2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcbozonier/akka/master/akka-docs/rst/images/camel-pubsub2.png -------------------------------------------------------------------------------- /akka-docs/rst/images/clojure-trees.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcbozonier/akka/master/akka-docs/rst/images/clojure-trees.png -------------------------------------------------------------------------------- /akka-docs/rst/images/import-project.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcbozonier/akka/master/akka-docs/rst/images/import-project.png -------------------------------------------------------------------------------- /akka-docs/rst/images/member-states.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcbozonier/akka/master/akka-docs/rst/images/member-states.png -------------------------------------------------------------------------------- /akka-remote/src/test/resources/keystore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcbozonier/akka/master/akka-remote/src/test/resources/keystore -------------------------------------------------------------------------------- /akka-samples/akka-sample-hello-kernel/project/plugins.sbt: -------------------------------------------------------------------------------- 1 | addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "0.8.0-M2") 2 | -------------------------------------------------------------------------------- /akka-docs/rst/general/RemoteDeployment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcbozonier/akka/master/akka-docs/rst/general/RemoteDeployment.png -------------------------------------------------------------------------------- /akka-docs/rst/images/member-states.drawing: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcbozonier/akka/master/akka-docs/rst/images/member-states.drawing -------------------------------------------------------------------------------- /akka-kernel/src/main/dist/bin/jmxsh-R5.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcbozonier/akka/master/akka-kernel/src/main/dist/bin/jmxsh-R5.jar -------------------------------------------------------------------------------- /akka-remote/src/test/resources/truststore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcbozonier/akka/master/akka-remote/src/test/resources/truststore -------------------------------------------------------------------------------- /akka-docs/_sphinx/themes/akka/theme.conf: -------------------------------------------------------------------------------- 1 | [theme] 2 | inherit = basic 3 | stylesheet = style.css 4 | 5 | [options] 6 | full_logo = false -------------------------------------------------------------------------------- /akka-docs/rst/images/diagnostics-window.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcbozonier/akka/master/akka-docs/rst/images/diagnostics-window.png -------------------------------------------------------------------------------- /akka-kernel/src/main/dist/LICENSES: -------------------------------------------------------------------------------- 1 | The jmxsh library has been obtained from https://code.google.com/p/jmxsh/ under the Apache License 2.0. 2 | -------------------------------------------------------------------------------- /akka-contrib/src/test/resources/reference.conf: -------------------------------------------------------------------------------- 1 | akka { 2 | actor { 3 | serialize-creators = on 4 | serialize-messages = on 5 | } 6 | } -------------------------------------------------------------------------------- /akka-docs/rst/images/association_lifecycle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcbozonier/akka/master/akka-docs/rst/images/association_lifecycle.png -------------------------------------------------------------------------------- /akka-docs/rst/images/circuit-breaker-states.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcbozonier/akka/master/akka-docs/rst/images/circuit-breaker-states.png -------------------------------------------------------------------------------- /akka-remote/src/test/resources/reference.conf: -------------------------------------------------------------------------------- 1 | akka { 2 | actor { 3 | serialize-creators = on 4 | serialize-messages = on 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /akka-cluster/src/test/resources/reference.conf: -------------------------------------------------------------------------------- 1 | akka { 2 | actor { 3 | serialize-creators = on 4 | serialize-messages = on 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /akka-docs/_sphinx/themes/akka/static/pdf-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcbozonier/akka/master/akka-docs/_sphinx/themes/akka/static/pdf-icon.png -------------------------------------------------------------------------------- /akka-docs/_sphinx/themes/akka/static/watermark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcbozonier/akka/master/akka-docs/_sphinx/themes/akka/static/watermark.png -------------------------------------------------------------------------------- /akka-docs/rst/images/akka-remote-testconductor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcbozonier/akka/master/akka-docs/rst/images/akka-remote-testconductor.png -------------------------------------------------------------------------------- /akka-docs/rst/images/install-beta2-updatesite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcbozonier/akka/master/akka-docs/rst/images/install-beta2-updatesite.png -------------------------------------------------------------------------------- /akka-samples/akka-sample-remote-java/src/main/resources/remotelookup.conf: -------------------------------------------------------------------------------- 1 | include "common" 2 | 3 | akka { 4 | remote.netty.tcp.port = 2553 5 | } 6 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-remote-scala/src/main/resources/remotelookup.conf: -------------------------------------------------------------------------------- 1 | include "common" 2 | 3 | akka { 4 | remote.netty.tcp.port = 2553 5 | } 6 | -------------------------------------------------------------------------------- /akka-docs/_sphinx/themes/akka/static/logo-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcbozonier/akka/master/akka-docs/_sphinx/themes/akka/static/logo-small.png -------------------------------------------------------------------------------- /akka-docs/rst/java/index-futures.rst: -------------------------------------------------------------------------------- 1 | Futures and Agents 2 | ================== 3 | 4 | .. toctree:: 5 | :maxdepth: 2 6 | 7 | futures 8 | agents 9 | -------------------------------------------------------------------------------- /akka-remote-tests/src/test/resources/reference.conf: -------------------------------------------------------------------------------- 1 | akka { 2 | actor { 3 | serialize-creators = on 4 | serialize-messages = on 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /akka-cluster-metrics/src/test/resources/reference.conf: -------------------------------------------------------------------------------- 1 | akka { 2 | actor { 3 | serialize-creators = on 4 | serialize-messages = on 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /akka-docs/_sphinx/static/akka-intellij-code-style.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcbozonier/akka/master/akka-docs/_sphinx/static/akka-intellij-code-style.jar -------------------------------------------------------------------------------- /akka-docs/_sphinx/themes/akka/static/pdf-java-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcbozonier/akka/master/akka-docs/_sphinx/themes/akka/static/pdf-java-icon.png -------------------------------------------------------------------------------- /akka-docs/_sphinx/themes/akka/static/pdf-scala-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcbozonier/akka/master/akka-docs/_sphinx/themes/akka/static/pdf-scala-icon.png -------------------------------------------------------------------------------- /akka-docs/rst/scala/index-futures.rst: -------------------------------------------------------------------------------- 1 | Futures and Agents 2 | ================== 3 | 4 | .. toctree:: 5 | :maxdepth: 2 6 | 7 | futures 8 | agents 9 | -------------------------------------------------------------------------------- /akka-docs/rst/images/faulttolerancesample-normal-flow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcbozonier/akka/master/akka-docs/rst/images/faulttolerancesample-normal-flow.png -------------------------------------------------------------------------------- /akka-docs/rst/images/faulttolerancesample-failure-flow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcbozonier/akka/master/akka-docs/rst/images/faulttolerancesample-failure-flow.png -------------------------------------------------------------------------------- /scripts/show-serializer.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Locate akka.serialization.Serializer.identifier() 4 | find . -name *.scala | xargs grep "def identifier =" * | sort 5 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-cluster-java/project/plugins.sbt: -------------------------------------------------------------------------------- 1 | 2 | resolvers += Classpaths.typesafeResolver 3 | 4 | addSbtPlugin("com.typesafe.sbt" % "sbt-multi-jvm" % "0.3.8") 5 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-cluster-scala/project/plugins.sbt: -------------------------------------------------------------------------------- 1 | 2 | resolvers += Classpaths.typesafeResolver 3 | 4 | addSbtPlugin("com.typesafe.sbt" % "sbt-multi-jvm" % "0.3.8") 5 | -------------------------------------------------------------------------------- /akka-docs/rst/images/benchmark-akka-sample-trading-throughput.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcbozonier/akka/master/akka-docs/rst/images/benchmark-akka-sample-trading-throughput.png -------------------------------------------------------------------------------- /akka-samples/akka-sample-multi-node-scala/project/plugins.sbt: -------------------------------------------------------------------------------- 1 | 2 | resolvers += Classpaths.typesafeResolver 3 | 4 | addSbtPlugin("com.typesafe.sbt" % "sbt-multi-jvm" % "0.3.8") 5 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-remote-java/src/main/resources/calculator.conf: -------------------------------------------------------------------------------- 1 | include "common" 2 | 3 | akka { 4 | # LISTEN on tcp port 2552 5 | remote.netty.tcp.port = 2552 6 | } 7 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-remote-scala/src/main/resources/calculator.conf: -------------------------------------------------------------------------------- 1 | include "common" 2 | 3 | akka { 4 | # LISTEN on tcp port 2552 5 | remote.netty.tcp.port = 2552 6 | } 7 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-camel-java/tutorial/camel-custom-route.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcbozonier/akka/master/akka-samples/akka-sample-camel-java/tutorial/camel-custom-route.png -------------------------------------------------------------------------------- /akka-samples/akka-sample-camel-java/tutorial/camel-async-interact.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcbozonier/akka/master/akka-samples/akka-sample-camel-java/tutorial/camel-async-interact.png -------------------------------------------------------------------------------- /akka-samples/akka-sample-camel-java/tutorial/camel-async-sequence.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcbozonier/akka/master/akka-samples/akka-sample-camel-java/tutorial/camel-async-sequence.png -------------------------------------------------------------------------------- /akka-samples/akka-sample-camel-scala/tutorial/camel-async-interact.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcbozonier/akka/master/akka-samples/akka-sample-camel-scala/tutorial/camel-async-interact.png -------------------------------------------------------------------------------- /akka-samples/akka-sample-camel-scala/tutorial/camel-async-sequence.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcbozonier/akka/master/akka-samples/akka-sample-camel-scala/tutorial/camel-async-sequence.png -------------------------------------------------------------------------------- /akka-samples/akka-sample-camel-scala/tutorial/camel-custom-route.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jcbozonier/akka/master/akka-samples/akka-sample-camel-scala/tutorial/camel-custom-route.png -------------------------------------------------------------------------------- /akka-samples/akka-sample-osgi-dining-hakkers/assembly-dist/src/main/resources/etc/readme.txt: -------------------------------------------------------------------------------- 1 | Configuration files for the Karaf etc/ directory. 2 | 3 | Place Karaf ConfigAdmin files here. 4 | -------------------------------------------------------------------------------- /akka-actor-tests/src/test/scala/akka/japi/JavaAPITest.scala: -------------------------------------------------------------------------------- 1 | package akka.japi 2 | 3 | import org.scalatest.junit.JUnitSuiteLike 4 | 5 | class JavaAPITest extends JavaAPITestBase with JUnitSuiteLike 6 | -------------------------------------------------------------------------------- /akka-bench-jmh/build.sbt: -------------------------------------------------------------------------------- 1 | import akka.{ AkkaBuild, Dependencies, Formatting, Unidoc } 2 | 3 | import pl.project13.scala.sbt.SbtJmh._ 4 | import pl.project13.scala.sbt.SbtJmh.JmhKeys._ 5 | 6 | jmhSettings 7 | 8 | -------------------------------------------------------------------------------- /akka-docs/rst/additional/index.rst: -------------------------------------------------------------------------------- 1 | Additional Information 2 | ====================== 3 | 4 | .. toctree:: 5 | :maxdepth: 2 6 | 7 | faq 8 | books 9 | language-bindings 10 | osgi 11 | http 12 | -------------------------------------------------------------------------------- /akka-docs/rst/project/index.rst: -------------------------------------------------------------------------------- 1 | Project Information 2 | =================== 3 | 4 | .. toctree:: 5 | :maxdepth: 2 6 | 7 | migration-guides 8 | issue-tracking 9 | licenses 10 | sponsors 11 | links 12 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-osgi-dining-hakkers/assembly-dist/src/main/distribution/lib/readme.txt: -------------------------------------------------------------------------------- 1 | Jars targeted to the ${app.home}/lib directory should be placed here. 2 | See lib/README in the distribution package for more details. 3 | -------------------------------------------------------------------------------- /project/GitHub.scala: -------------------------------------------------------------------------------- 1 | package akka 2 | 3 | object GitHub { 4 | def url(v: String): String = { 5 | val branch = if (v.endsWith("SNAPSHOT")) "master" else "v" + v 6 | "http://github.com/akka/akka/tree/" + branch 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-main-scala/src/main/scala/sample/hello/Main.scala: -------------------------------------------------------------------------------- 1 | package sample.hello 2 | 3 | object Main { 4 | 5 | def main(args: Array[String]): Unit = { 6 | akka.Main.main(Array(classOf[HelloWorld].getName)) 7 | } 8 | 9 | } -------------------------------------------------------------------------------- /akka-actor/src/main/scala/akka/io/DnsProvider.scala: -------------------------------------------------------------------------------- 1 | package akka.io 2 | 3 | import akka.actor.Actor 4 | 5 | trait DnsProvider { 6 | def cache: Dns 7 | def actorClass: Class[_ <: Actor] 8 | def managerClass: Class[_ <: Actor] 9 | } 10 | -------------------------------------------------------------------------------- /akka-actor/src/main/java/akka/japi/JAPI.java: -------------------------------------------------------------------------------- 1 | package akka.japi; 2 | 3 | import scala.collection.Seq; 4 | 5 | public class JAPI { 6 | 7 | public static Seq seq(T... ts) { 8 | return Util.immutableSeq(ts); 9 | } 10 | 11 | } 12 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-main-java/src/main/java/sample/hello/Main.java: -------------------------------------------------------------------------------- 1 | package sample.hello; 2 | 3 | public class Main { 4 | 5 | public static void main(String[] args) { 6 | akka.Main.main(new String[] { HelloWorld.class.getName() }); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /scripts/dos_to_unix.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | find . -name *.scala -exec dos2unix {} \; 3 | find . -name *.java -exec dos2unix {} \; 4 | find . -name *.html -exec dos2unix {} \; 5 | find . -name *.xml -exec dos2unix {} \; 6 | find . -name *.conf -exec dos2unix {} \; 7 | -------------------------------------------------------------------------------- /akka-docs/rst/intro/index-java.rst: -------------------------------------------------------------------------------- 1 | Introduction 2 | ============ 3 | 4 | .. toctree:: 5 | :maxdepth: 2 6 | 7 | what-is-akka 8 | why-akka 9 | getting-started 10 | ../java/hello-world 11 | deployment-scenarios 12 | use-cases 13 | 14 | -------------------------------------------------------------------------------- /akka-docs/rst/intro/index-scala.rst: -------------------------------------------------------------------------------- 1 | Introduction 2 | ============ 3 | 4 | .. toctree:: 5 | :maxdepth: 2 6 | 7 | what-is-akka 8 | why-akka 9 | getting-started 10 | ../scala/hello-world 11 | deployment-scenarios 12 | use-cases 13 | 14 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-fsm-scala/build.sbt: -------------------------------------------------------------------------------- 1 | name := "akka-sample-fsm-scala" 2 | 3 | version := "2.4-SNAPSHOT" 4 | 5 | scalaVersion := "2.11.5" 6 | 7 | libraryDependencies ++= Seq( 8 | "com.typesafe.akka" %% "akka-actor" % "2.4-SNAPSHOT" 9 | ) 10 | 11 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-main-java-lambda/src/main/java/sample/hello/Main.java: -------------------------------------------------------------------------------- 1 | package sample.hello; 2 | 3 | public class Main { 4 | 5 | public static void main(String[] args) { 6 | akka.Main.main(new String[] { HelloWorld.class.getName() }); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-main-java/build.sbt: -------------------------------------------------------------------------------- 1 | name := "akka-sample-main-java" 2 | 3 | version := "2.4-SNAPSHOT" 4 | 5 | scalaVersion := "2.11.5" 6 | 7 | libraryDependencies ++= Seq( 8 | "com.typesafe.akka" %% "akka-actor" % "2.4-SNAPSHOT" 9 | ) 10 | 11 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-main-scala/build.sbt: -------------------------------------------------------------------------------- 1 | name := "akka-sample-main-scala" 2 | 3 | version := "2.4-SNAPSHOT" 4 | 5 | scalaVersion := "2.11.5" 6 | 7 | libraryDependencies ++= Seq( 8 | "com.typesafe.akka" %% "akka-actor" % "2.4-SNAPSHOT" 9 | ) 10 | -------------------------------------------------------------------------------- /akka-docs/rst/java/lambda-index-actors.rst: -------------------------------------------------------------------------------- 1 | Actors (Java with Lambda Support) 2 | ================================= 3 | 4 | .. toctree:: 5 | :maxdepth: 2 6 | 7 | lambda-actors 8 | lambda-fault-tolerance 9 | lambda-fsm 10 | lambda-persistence 11 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-main-java-lambda/build.sbt: -------------------------------------------------------------------------------- 1 | name := "akka-sample-main-java-lambda" 2 | 3 | version := "1.0" 4 | 5 | scalaVersion := "2.11.5" 6 | 7 | libraryDependencies ++= Seq( 8 | "com.typesafe.akka" %% "akka-actor" % "2.4-SNAPSHOT" 9 | ) 10 | 11 | -------------------------------------------------------------------------------- /akka-docs/rst/java/index-utilities.rst: -------------------------------------------------------------------------------- 1 | Utilities 2 | ========= 3 | 4 | .. toctree:: 5 | :maxdepth: 2 6 | 7 | event-bus 8 | logging 9 | scheduler 10 | ../common/duration 11 | ../common/circuitbreaker 12 | extending-akka 13 | microkernel 14 | -------------------------------------------------------------------------------- /akka-docs/rst/scala/index-utilities.rst: -------------------------------------------------------------------------------- 1 | Utilities 2 | ========= 3 | 4 | .. toctree:: 5 | :maxdepth: 2 6 | 7 | event-bus 8 | logging 9 | scheduler 10 | ../common/duration 11 | ../common/circuitbreaker 12 | extending-akka 13 | microkernel 14 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-camel-java/.gitignore: -------------------------------------------------------------------------------- 1 | *# 2 | *.iml 3 | *.ipr 4 | *.iws 5 | *.pyc 6 | *.tm.epoch 7 | *.vim 8 | *-shim.sbt 9 | .idea/ 10 | /project/plugins/project 11 | project/boot 12 | target/ 13 | /logs 14 | .cache 15 | .classpath 16 | .project 17 | .settings -------------------------------------------------------------------------------- /akka-samples/akka-sample-camel-scala/.gitignore: -------------------------------------------------------------------------------- 1 | *# 2 | *.iml 3 | *.ipr 4 | *.iws 5 | *.pyc 6 | *.tm.epoch 7 | *.vim 8 | *-shim.sbt 9 | .idea/ 10 | /project/plugins/project 11 | project/boot 12 | target/ 13 | /logs 14 | .cache 15 | .classpath 16 | .project 17 | .settings -------------------------------------------------------------------------------- /akka-samples/akka-sample-remote-java/.gitignore: -------------------------------------------------------------------------------- 1 | *# 2 | *.iml 3 | *.ipr 4 | *.iws 5 | *.pyc 6 | *.tm.epoch 7 | *.vim 8 | *-shim.sbt 9 | .idea/ 10 | /project/plugins/project 11 | project/boot 12 | target/ 13 | /logs 14 | .cache 15 | .classpath 16 | .project 17 | .settings -------------------------------------------------------------------------------- /akka-samples/akka-sample-remote-java/src/main/resources/common.conf: -------------------------------------------------------------------------------- 1 | akka { 2 | 3 | actor { 4 | provider = "akka.remote.RemoteActorRefProvider" 5 | } 6 | 7 | remote { 8 | netty.tcp { 9 | hostname = "127.0.0.1" 10 | } 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-remote-scala/src/main/resources/common.conf: -------------------------------------------------------------------------------- 1 | akka { 2 | 3 | actor { 4 | provider = "akka.remote.RemoteActorRefProvider" 5 | } 6 | 7 | remote { 8 | netty.tcp { 9 | hostname = "127.0.0.1" 10 | } 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /akka-docs/rst/java/index-actors.rst: -------------------------------------------------------------------------------- 1 | Actors 2 | ====== 3 | 4 | .. toctree:: 5 | :maxdepth: 2 6 | 7 | untyped-actors 8 | typed-actors 9 | fault-tolerance 10 | dispatchers 11 | mailboxes 12 | routing 13 | fsm 14 | persistence 15 | testing 16 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-cluster-scala/.gitignore: -------------------------------------------------------------------------------- 1 | *# 2 | *.iml 3 | *.ipr 4 | *.iws 5 | *.pyc 6 | *.tm.epoch 7 | *.vim 8 | *-shim.sbt 9 | .idea/ 10 | /project/plugins/project 11 | project/boot 12 | target/ 13 | /logs 14 | .cache 15 | .classpath 16 | .project 17 | .settings -------------------------------------------------------------------------------- /akka-samples/akka-sample-persistence-java/.gitignore: -------------------------------------------------------------------------------- 1 | *# 2 | *.iml 3 | *.ipr 4 | *.iws 5 | *.pyc 6 | *.tm.epoch 7 | *.vim 8 | *-shim.sbt 9 | .idea/ 10 | /project/plugins/project 11 | project/boot 12 | target/ 13 | /logs 14 | .cache 15 | .classpath 16 | .project 17 | .settings -------------------------------------------------------------------------------- /akka-samples/akka-sample-remote-scala/.gitignore: -------------------------------------------------------------------------------- 1 | *# 2 | *.iml 3 | *.ipr 4 | *.iws 5 | *.pyc 6 | *.tm.epoch 7 | *.vim 8 | *-shim.sbt 9 | .idea/ 10 | /project/plugins/project 11 | project/boot 12 | target/ 13 | /logs 14 | .cache 15 | .classpath 16 | .project 17 | .settings -------------------------------------------------------------------------------- /akka-actor-tests/src/test/scala/akka/actor/JavaAPISpec.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2009-2014 Typesafe Inc. 3 | */ 4 | package akka.actor 5 | 6 | import org.scalatest.junit.JUnitSuiteLike 7 | 8 | class JavaAPISpec extends JavaAPI with JUnitSuiteLike 9 | -------------------------------------------------------------------------------- /akka-docs/rst/dev/index.rst: -------------------------------------------------------------------------------- 1 | Information for Akka Developers 2 | =============================== 3 | 4 | .. toctree:: 5 | :maxdepth: 2 6 | 7 | building-akka 8 | multi-jvm-testing 9 | io-layer 10 | developer-guidelines 11 | documentation 12 | team 13 | 14 | -------------------------------------------------------------------------------- /akka-docs/rst/java/index-network.rst: -------------------------------------------------------------------------------- 1 | Networking 2 | ========== 3 | 4 | .. toctree:: 5 | :maxdepth: 2 6 | 7 | ../common/cluster 8 | cluster-usage 9 | cluster-metrics 10 | remoting 11 | serialization 12 | io 13 | io-tcp 14 | io-udp 15 | camel 16 | -------------------------------------------------------------------------------- /akka-docs/rst/scala/index-network.rst: -------------------------------------------------------------------------------- 1 | Networking 2 | ========== 3 | 4 | .. toctree:: 5 | :maxdepth: 2 6 | 7 | ../common/cluster 8 | cluster-usage 9 | cluster-metrics 10 | remoting 11 | serialization 12 | io 13 | io-tcp 14 | io-udp 15 | camel 16 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-persistence-scala/.gitignore: -------------------------------------------------------------------------------- 1 | *# 2 | *.iml 3 | *.ipr 4 | *.iws 5 | *.pyc 6 | *.tm.epoch 7 | *.vim 8 | *-shim.sbt 9 | .idea/ 10 | /project/plugins/project 11 | project/boot 12 | target/ 13 | /logs 14 | .cache 15 | .classpath 16 | .project 17 | .settings -------------------------------------------------------------------------------- /akka-docs/rst/general/index.rst: -------------------------------------------------------------------------------- 1 | General 2 | ======= 3 | 4 | .. toctree:: 5 | :maxdepth: 2 6 | 7 | terminology 8 | actor-systems 9 | actors 10 | supervision 11 | addressing 12 | remoting 13 | jmm 14 | message-delivery-reliability 15 | configuration 16 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-persistence-java-lambda/.gitignore: -------------------------------------------------------------------------------- 1 | *# 2 | *.iml 3 | *.ipr 4 | *.iws 5 | *.pyc 6 | *.tm.epoch 7 | *.vim 8 | *-shim.sbt 9 | .idea/ 10 | /project/plugins/project 11 | project/boot 12 | target/ 13 | /logs 14 | .cache 15 | .classpath 16 | .project 17 | .settings -------------------------------------------------------------------------------- /akka-actor-tests/src/test/scala/akka/util/JavaDurationSpec.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2009-2014 Typesafe Inc. 3 | */ 4 | package akka.util 5 | 6 | import org.scalatest.junit.JUnitSuiteLike 7 | 8 | class JavaDurationSpec extends JavaDuration with JUnitSuiteLike 9 | -------------------------------------------------------------------------------- /akka-docs/_sphinx/themes/akka/static/contentsFix.js: -------------------------------------------------------------------------------- 1 | jQuery(document).ready(function($) { 2 | 3 | $("#toc ul").each(function(){ 4 | var elem = $(this); 5 | if (elem.children().length == 0) { 6 | $(".contents-title").css("display","none"); 7 | } 8 | }); 9 | 10 | }); -------------------------------------------------------------------------------- /akka-samples/akka-sample-cluster-java/.gitignore: -------------------------------------------------------------------------------- 1 | *# 2 | *.iml 3 | *.ipr 4 | *.iws 5 | *.pyc 6 | *.tm.epoch 7 | *.vim 8 | *-shim.sbt 9 | .idea/ 10 | /project/plugins/project 11 | project/boot 12 | target/ 13 | /logs 14 | .cache 15 | .classpath 16 | .project 17 | .settings 18 | native/ 19 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-persistence-java/build.sbt: -------------------------------------------------------------------------------- 1 | name := "akka-sample-persistence-java" 2 | 3 | version := "2.4-SNAPSHOT" 4 | 5 | scalaVersion := "2.11.5" 6 | 7 | libraryDependencies ++= Seq( 8 | "com.typesafe.akka" %% "akka-persistence-experimental" % "2.4-SNAPSHOT" 9 | ) 10 | 11 | -------------------------------------------------------------------------------- /akka-actor-tests/build.sbt: -------------------------------------------------------------------------------- 1 | import akka.{ AkkaBuild, Dependencies, Formatting, Unidoc } 2 | 3 | AkkaBuild.defaultSettings 4 | 5 | Formatting.formatSettings 6 | 7 | Unidoc.scaladocSettings 8 | 9 | publishArtifact in Compile := false 10 | 11 | libraryDependencies ++= Dependencies.actorTests 12 | -------------------------------------------------------------------------------- /akka-docs/rst/java/code/docs/camel/Orders.java: -------------------------------------------------------------------------------- 1 | package docs.camel; 2 | //#Producer 3 | import akka.camel.javaapi.UntypedProducerActor; 4 | 5 | public class Orders extends UntypedProducerActor { 6 | public String getEndpointUri() { 7 | return "jms:queue:Orders"; 8 | } 9 | } 10 | //#Producer -------------------------------------------------------------------------------- /akka-docs/rst/scala/index-actors.rst: -------------------------------------------------------------------------------- 1 | Actors 2 | ====== 3 | 4 | .. toctree:: 5 | :maxdepth: 2 6 | 7 | actors 8 | typed 9 | fault-tolerance 10 | dispatchers 11 | mailboxes 12 | routing 13 | fsm 14 | persistence 15 | testing 16 | actordsl 17 | typed-actors 18 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-camel-java/activator.properties: -------------------------------------------------------------------------------- 1 | name=akka-sample-camel-java 2 | title=Akka Camel Samples with Java 3 | description=Akka Camel Samples with Java 4 | tags=akka,camel,java,sample 5 | authorName=Akka Team 6 | authorLink=http://akka.io/ 7 | sourceLink=https://github.com/akka/akka 8 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-camel-scala/activator.properties: -------------------------------------------------------------------------------- 1 | name=akka-sample-camel-scala 2 | title=Akka Camel Samples with Scala 3 | description=Akka Camel Samples with Scala 4 | tags=akka,camel,scala,sample 5 | authorName=Akka Team 6 | authorLink=http://akka.io/ 7 | sourceLink=https://github.com/akka/akka 8 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-cluster-scala/src/main/scala/sample/cluster/stats/StatsMessages.scala: -------------------------------------------------------------------------------- 1 | package sample.cluster.stats 2 | 3 | //#messages 4 | final case class StatsJob(text: String) 5 | final case class StatsResult(meanWordLength: Double) 6 | final case class JobFailed(reason: String) 7 | //#messages 8 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-remote-java/activator.properties: -------------------------------------------------------------------------------- 1 | name=akka-sample-remote-java 2 | title=Akka Remote Samples with Java 3 | description=Akka Remote Samples with Java 4 | tags=akka,remote,java,sample 5 | authorName=Akka Team 6 | authorLink=http://akka.io/ 7 | sourceLink=https://github.com/akka/akka 8 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-cluster-java/activator.properties: -------------------------------------------------------------------------------- 1 | name=akka-sample-cluster-java 2 | title=Akka Cluster Samples with Java 3 | description=Akka Cluster Samples with Java 4 | tags=akka,cluster,java,sample 5 | authorName=Akka Team 6 | authorLink=http://akka.io/ 7 | sourceLink=https://github.com/akka/akka 8 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-remote-scala/activator.properties: -------------------------------------------------------------------------------- 1 | name=akka-sample-remote-scala 2 | title=Akka Remote Samples with Scala 3 | description=Akka Remote Samples with Scala 4 | tags=akka,remote,scala,sample 5 | authorName=Akka Team 6 | authorLink=http://akka.io/ 7 | sourceLink=https://github.com/akka/akka 8 | -------------------------------------------------------------------------------- /akka-actor-tests/src/test/java/akka/actor/NonStaticCreator.java: -------------------------------------------------------------------------------- 1 | package akka.actor; 2 | 3 | import akka.japi.Creator; 4 | 5 | public class NonStaticCreator implements Creator { 6 | @Override 7 | public UntypedActor create() throws Exception { 8 | return null; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /akka-actor-tests/src/test/java/akka/actor/TestAnnotation.java: -------------------------------------------------------------------------------- 1 | package akka.actor; 2 | 3 | import java.lang.annotation.*; 4 | 5 | @Retention(RetentionPolicy.RUNTIME) 6 | @Target(ElementType.METHOD) 7 | @Inherited 8 | public @interface TestAnnotation { 9 | String someString() default "pigdog"; 10 | } 11 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-cluster-scala/activator.properties: -------------------------------------------------------------------------------- 1 | name=akka-sample-cluster-scala 2 | title=Akka Cluster Samples with Scala 3 | description=Akka Cluster Samples with Scala 4 | tags=akka,cluster,scala,sample 5 | authorName=Akka Team 6 | authorLink=http://akka.io/ 7 | sourceLink=https://github.com/akka/akka 8 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-fsm-scala/activator.properties: -------------------------------------------------------------------------------- 1 | name=akka-sample-fsm-scala 2 | title=Akka FSM in Scala 3 | description=Illustrating how to implement a finite state machine in actors. 4 | tags=akka,scala,sample 5 | authorName=Akka Team 6 | authorLink=http://akka.io/ 7 | sourceLink=https://github.com/akka/akka 8 | -------------------------------------------------------------------------------- /akka-actor/src/main/scala/akka/io/InetAddressDnsProvider.scala: -------------------------------------------------------------------------------- 1 | package akka.io 2 | 3 | class InetAddressDnsProvider extends DnsProvider { 4 | override def cache: Dns = new SimpleDnsCache() 5 | override def actorClass = classOf[InetAddressDnsResolver] 6 | override def managerClass = classOf[SimpleDnsManager] 7 | } 8 | -------------------------------------------------------------------------------- /akka-docs/rst/java/code/docs/camel/Producer1.java: -------------------------------------------------------------------------------- 1 | package docs.camel; 2 | //#Producer1 3 | import akka.camel.javaapi.UntypedProducerActor; 4 | 5 | public class Producer1 extends UntypedProducerActor { 6 | public String getEndpointUri() { 7 | return "http://localhost:8080/news"; 8 | } 9 | } 10 | //#Producer1 -------------------------------------------------------------------------------- /akka-kernel/src/main/dist/config/application.conf: -------------------------------------------------------------------------------- 1 | # In this file you can override any option defined in the 'reference.conf' files. 2 | # Copy in all or parts of the 'reference.conf' files and modify as you please. 3 | # For more info about config, please visit the Akka Documentation: http://akka.io/docs/akka/2.4-SNAPSHOT/ 4 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-remote-java/build.sbt: -------------------------------------------------------------------------------- 1 | name := "akka-sample-remote-java" 2 | 3 | version := "2.4-SNAPSHOT" 4 | 5 | scalaVersion := "2.11.5" 6 | 7 | libraryDependencies ++= Seq( 8 | "com.typesafe.akka" %% "akka-actor" % "2.4-SNAPSHOT", 9 | "com.typesafe.akka" %% "akka-remote" % "2.4-SNAPSHOT" 10 | ) 11 | -------------------------------------------------------------------------------- /akka-docs/rst/java/code/docs/camel/FirstProducer.java: -------------------------------------------------------------------------------- 1 | package docs.camel; 2 | 3 | //#Producer1 4 | import akka.camel.javaapi.UntypedProducerActor; 5 | public class FirstProducer extends UntypedProducerActor { 6 | public String getEndpointUri() { 7 | return "http://localhost:8080/news"; 8 | } 9 | } 10 | //#Producer1 -------------------------------------------------------------------------------- /akka-remote/src/test/protobuf/ProtobufProtocol.proto: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2009-2014 Typesafe Inc. 3 | */ 4 | 5 | option java_package = "akka.remote"; 6 | 7 | message MyMessage { 8 | required uint64 id = 1; 9 | required string name = 2; 10 | required bool status = 3; 11 | } 12 | 13 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-remote-scala/build.sbt: -------------------------------------------------------------------------------- 1 | name := "akka-sample-remote-scala" 2 | 3 | version := "2.4-SNAPSHOT" 4 | 5 | scalaVersion := "2.11.5" 6 | 7 | libraryDependencies ++= Seq( 8 | "com.typesafe.akka" %% "akka-actor" % "2.4-SNAPSHOT", 9 | "com.typesafe.akka" %% "akka-remote" % "2.4-SNAPSHOT" 10 | ) 11 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-persistence-java/activator.properties: -------------------------------------------------------------------------------- 1 | name=akka-sample-persistence-java 2 | title=Akka Persistence Samples with Java 3 | description=Akka Persistence Samples with Java 4 | tags=akka,persistence,java,sample 5 | authorName=Akka Team 6 | authorLink=http://akka.io/ 7 | sourceLink=https://github.com/akka/akka 8 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-supervision-java-lambda/activator.properties: -------------------------------------------------------------------------------- 1 | name=akka-supervision-java-lambda 2 | title=Akka Supervision in Java with Lambdas 3 | description=Illustrates supervision in Akka 4 | tags=akka,java,java8,sample 5 | authorName=Akka Team 6 | authorLink=http://akka.io/ 7 | sourceLink=https://github.com/akka/akka 8 | -------------------------------------------------------------------------------- /akka-typed/build.sbt: -------------------------------------------------------------------------------- 1 | import akka.{ AkkaBuild, Formatting, OSGi, Unidoc, Dependencies } 2 | import com.typesafe.tools.mima.plugin.MimaKeys 3 | 4 | AkkaBuild.defaultSettings 5 | 6 | AkkaBuild.experimentalSettings 7 | 8 | Formatting.formatSettings 9 | 10 | Unidoc.scaladocSettings 11 | 12 | Unidoc.javadocSettings 13 | 14 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-camel-java/src/main/java/sample/camel/route/RouteProducer.java: -------------------------------------------------------------------------------- 1 | package sample.camel.route; 2 | 3 | import akka.camel.javaapi.UntypedProducerActor; 4 | 5 | public class RouteProducer extends UntypedProducerActor { 6 | public String getEndpointUri() { 7 | return "direct:welcome"; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-persistence-scala/activator.properties: -------------------------------------------------------------------------------- 1 | name=akka-sample-persistence-scala 2 | title=Akka Persistence Samples with Scala 3 | description=Akka Persistence Samples with Scala 4 | tags=akka,persistence,scala,sample 5 | authorName=Akka Team 6 | authorLink=http://akka.io/ 7 | sourceLink=https://github.com/akka/akka 8 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-remote-java/src/main/resources/remotecreation.conf: -------------------------------------------------------------------------------- 1 | include "common" 2 | 3 | akka { 4 | actor { 5 | deployment { 6 | "/creationActor/*" { 7 | remote = "akka.tcp://CalculatorWorkerSystem@127.0.0.1:2552" 8 | } 9 | } 10 | } 11 | 12 | remote.netty.tcp.port = 2554 13 | } 14 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-remote-scala/src/main/resources/remotecreation.conf: -------------------------------------------------------------------------------- 1 | include "common" 2 | 3 | akka { 4 | actor { 5 | deployment { 6 | "/creationActor/*" { 7 | remote = "akka.tcp://CalculatorWorkerSystem@127.0.0.1:2552" 8 | } 9 | } 10 | } 11 | 12 | remote.netty.tcp.port = 2554 13 | } 14 | -------------------------------------------------------------------------------- /akka-actor-tests/src/test/java/akka/actor/JavaAPITestActor.java: -------------------------------------------------------------------------------- 1 | package akka.actor; 2 | 3 | public class JavaAPITestActor extends UntypedActor { 4 | public static String ANSWER = "got it!"; 5 | 6 | public void onReceive(Object msg) { 7 | getSender().tell(ANSWER, getSelf()); 8 | getContext().getChildren(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /akka-docs/rst/project/migration-guide-2.0.x-2.1.x.rst: -------------------------------------------------------------------------------- 1 | .. _migration-2.1: 2 | 3 | ################################ 4 | Migration Guide 2.0.x to 2.1.x 5 | ################################ 6 | 7 | Migration from 2.0.x to 2.1.x is described in the 8 | `documentation of 2.1 `_. -------------------------------------------------------------------------------- /akka-docs/rst/project/migration-guide-2.1.x-2.2.x.rst: -------------------------------------------------------------------------------- 1 | .. _migration-2.2: 2 | 3 | ################################ 4 | Migration Guide 2.1.x to 2.2.x 5 | ################################ 6 | 7 | Migration from 2.1.x to 2.2.x is described in the 8 | `documentation of 2.2 `_. -------------------------------------------------------------------------------- /akka-kernel/src/main/dist/bin/akka.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | set AKKA_HOME=%~dp0.. 4 | set JAVA_OPTS=-Xmx1024M -Xms1024M -Xss1M -XX:MaxPermSize=256M -XX:+UseParallelGC 5 | set AKKA_CLASSPATH=%AKKA_HOME%\lib\*;%AKKA_HOME%\config;%AKKA_HOME%\lib\akka\* 6 | 7 | java %JAVA_OPTS% -cp "%AKKA_CLASSPATH%" -Dakka.home="%AKKA_HOME%" akka.kernel.Main %* 8 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-fsm-java-lambda/activator.properties: -------------------------------------------------------------------------------- 1 | name=akka-sample-fsm-java-lambda 2 | title=Akka FSM in Java with Lambdas 3 | description=Illustrating how to implement a finite state machine in actors. 4 | tags=akka,java,java8,sample 5 | authorName=Akka Team 6 | authorLink=http://akka.io/ 7 | sourceLink=https://github.com/akka/akka 8 | -------------------------------------------------------------------------------- /akka-actor/src/main/scala/akka/util/Unsafe.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2009-2014 Typesafe Inc. 3 | */ 4 | 5 | 6 | package akka.util; 7 | 8 | /** 9 | * INTERNAL API 10 | */ 11 | public final class Unsafe { 12 | public final static sun.misc.Unsafe instance = scala.concurrent.util.Unsafe.instance; 13 | } 14 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-persistence-scala/build.sbt: -------------------------------------------------------------------------------- 1 | name := "akka-sample-persistence-scala" 2 | 3 | version := "2.3-SNAPSHOT" 4 | 5 | scalaVersion := "2.11.5" 6 | 7 | libraryDependencies ++= Seq( 8 | "com.typesafe.akka" %% "akka-actor" % "2.4-SNAPSHOT", 9 | "com.typesafe.akka" %% "akka-persistence-experimental" % "2.4-SNAPSHOT" 10 | ) 11 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-main-java/activator.properties: -------------------------------------------------------------------------------- 1 | name=akka-sample-main-java 2 | title=Akka Main in Java 3 | description=Actor based version of obligatory Hello World program using the generic launcher class akka.Main. 4 | tags=Basics,akka,java,starter 5 | authorName=Akka Team 6 | authorLink=http://akka.io/ 7 | sourceLink=https://github.com/akka/akka 8 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-main-scala/activator.properties: -------------------------------------------------------------------------------- 1 | name=akka-sample-main-scala 2 | title=Akka Main in Scala 3 | description=Actor based version of obligatory Hello World program using the generic launcher class akka.Main. 4 | tags=Basics,akka,scala,starter 5 | authorName=Akka Team 6 | authorLink=http://akka.io/ 7 | sourceLink=https://github.com/akka/akka 8 | -------------------------------------------------------------------------------- /akka-testkit/src/test/scala/akka/testkit/TestTags.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2009-2014 Typesafe Inc. 3 | */ 4 | package akka.testkit 5 | 6 | import org.scalatest.Tag 7 | 8 | object TimingTest extends Tag("timing") 9 | object LongRunningTest extends Tag("long-running") 10 | object PerformanceTest extends Tag("performance") 11 | -------------------------------------------------------------------------------- /akka-docs/rst/java/code/docs/agent/AgentDocJavaSpec.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2009-2014 Typesafe Inc. 3 | */ 4 | package docs.agent 5 | 6 | import org.scalatest.junit.JUnitWrapperSuite 7 | 8 | class AgentDocJavaSpec extends JUnitWrapperSuite( 9 | "docs.agent.AgentDocTest", 10 | Thread.currentThread.getContextClassLoader) 11 | -------------------------------------------------------------------------------- /akka-multi-node-testkit/build.sbt: -------------------------------------------------------------------------------- 1 | import akka.{AkkaBuild, Formatting, Unidoc, OSGi} 2 | import com.typesafe.tools.mima.plugin.MimaKeys 3 | 4 | AkkaBuild.defaultSettings 5 | 6 | Formatting.formatSettings 7 | 8 | Unidoc.scaladocSettings 9 | 10 | Unidoc.javadocSettings 11 | 12 | MimaKeys.previousArtifact := akkaPreviousArtifact("akka-multi-node-testkit").value 13 | -------------------------------------------------------------------------------- /akka-docs/rst/project/migration-guide-1.3.x-2.0.x.rst: -------------------------------------------------------------------------------- 1 | .. _migration-2.0: 2 | 3 | ################################ 4 | Migration Guide 1.3.x to 2.0.x 5 | ################################ 6 | 7 | Migration from 1.3.x to 2.0.x is described in the 8 | `documentation of 2.0 `_. 9 | 10 | 11 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-persistence-java-lambda/activator.properties: -------------------------------------------------------------------------------- 1 | name=akka-sample-persistence-java-lambda 2 | title=Akka Persistence Samples in Java with Lambdas 3 | description=Akka Persistence Samples in Java with Lambdas 4 | tags=akka,java,java8,sample,persistence,sample 5 | authorName=Akka Team 6 | authorLink=http://akka.io/ 7 | sourceLink=https://github.com/akka/akka 8 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-persistence-java-lambda/build.sbt: -------------------------------------------------------------------------------- 1 | name := "akka-sample-persistence-java-lambda" 2 | 3 | version := "1.0" 4 | 5 | scalaVersion := "2.11.5" 6 | 7 | javacOptions ++= Seq("-source", "1.8", "-target", "1.8", "-Xlint") 8 | 9 | libraryDependencies ++= Seq( 10 | "com.typesafe.akka" %% "akka-persistence-experimental" % "2.4-SNAPSHOT" 11 | ) 12 | 13 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-persistence-java/src/main/resources/application.conf: -------------------------------------------------------------------------------- 1 | akka.persistence.journal.leveldb.dir = "target/example/journal" 2 | akka.persistence.snapshot-store.local.dir = "target/example/snapshots" 3 | 4 | # DO NOT USE THIS IN PRODUCTION !!! 5 | # See also https://github.com/typesafehub/activator/issues/287 6 | akka.persistence.journal.leveldb.native = false 7 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-persistence-scala/src/main/resources/application.conf: -------------------------------------------------------------------------------- 1 | akka.persistence.journal.leveldb.dir = "target/example/journal" 2 | akka.persistence.snapshot-store.local.dir = "target/example/snapshots" 3 | 4 | # DO NOT USE THIS IN PRODUCTION !!! 5 | # See also https://github.com/typesafehub/activator/issues/287 6 | akka.persistence.journal.leveldb.native = false 7 | -------------------------------------------------------------------------------- /atmos/src/main/resources/reference.conf: -------------------------------------------------------------------------------- 1 | atmos { 2 | trace { 3 | enabled = true 4 | send.port = 28667 5 | 6 | max-length-long-message = 1000 7 | max-length-short-message = 1000 8 | 9 | traceable { 10 | "/" = on 11 | "/system/*" = on 12 | "*" = on 13 | } 14 | 15 | sampling { 16 | "*" = 1 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-osgi-dining-hakkers/assembly-dist/src/main/distribution/etc/readme.txt: -------------------------------------------------------------------------------- 1 | Place files like custom.properties and jre.properties here. Files 2 | placed here will be copied to the Karaf etc/ directory. 3 | 4 | Exclude the Karaf default version of the file in bin.xml. 5 | 6 | Additional configuration files for etc should be placed into 7 | src/main/resources/etc. 8 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-persistence-java-lambda/src/main/resources/application.conf: -------------------------------------------------------------------------------- 1 | akka.persistence.journal.leveldb.dir = "target/example/journal" 2 | akka.persistence.snapshot-store.local.dir = "target/example/snapshots" 3 | 4 | # DO NOT USE THIS IN PRODUCTION !!! 5 | # See also https://github.com/typesafehub/activator/issues/287 6 | akka.persistence.journal.leveldb.native = false 7 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-main-java-lambda/activator.properties: -------------------------------------------------------------------------------- 1 | name=akka-sample-main-java-lambda 2 | title=Akka Main in Java with Lambdas 3 | description=Actor based version of obligatory Hello World program using the generic launcher class akka.Main. 4 | tags=Basics,akka,java,java8,starter 5 | authorName=Akka Team 6 | authorLink=http://akka.io/ 7 | sourceLink=https://github.com/akka/akka 8 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-main-scala/src/main/scala/sample/hello/Greeter.scala: -------------------------------------------------------------------------------- 1 | package sample.hello 2 | 3 | import akka.actor.Actor 4 | 5 | object Greeter { 6 | case object Greet 7 | case object Done 8 | } 9 | 10 | class Greeter extends Actor { 11 | def receive = { 12 | case Greeter.Greet => 13 | println("Hello World!") 14 | sender() ! Greeter.Done 15 | } 16 | } -------------------------------------------------------------------------------- /akka-typed/src/test/resources/reference.conf: -------------------------------------------------------------------------------- 1 | dispatcher-1 { 2 | fork-join-executor { 3 | parallelism-min=1 4 | parallelism-max=1 5 | } 6 | } 7 | dispatcher-2 { 8 | fork-join-executor { 9 | parallelism-min=2 10 | parallelism-max=2 11 | } 12 | } 13 | dispatcher-8 { 14 | fork-join-executor { 15 | parallelism-min=8 16 | parallelism-max=8 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-cluster-scala/src/main/scala/sample/cluster/transformation/TransformationMessages.scala: -------------------------------------------------------------------------------- 1 | package sample.cluster.transformation 2 | 3 | //#messages 4 | final case class TransformationJob(text: String) 5 | final case class TransformationResult(text: String) 6 | final case class JobFailed(reason: String, job: TransformationJob) 7 | case object BackendRegistration 8 | //#messages 9 | -------------------------------------------------------------------------------- /akka-remote/src/test/scala/akka/remote/RemoteActorMailboxSpec.scala: -------------------------------------------------------------------------------- 1 | package akka.remote 2 | 3 | import akka.actor.ActorMailboxSpec 4 | import com.typesafe.config.ConfigFactory 5 | 6 | class RemoteActorMailboxSpec extends ActorMailboxSpec( 7 | ConfigFactory.parseString("""akka.actor.provider = "akka.remote.RemoteActorRefProvider""""). 8 | withFallback(ActorMailboxSpec.mailboxConf)) { 9 | 10 | } -------------------------------------------------------------------------------- /akka-samples/akka-sample-multi-node-scala/activator.properties: -------------------------------------------------------------------------------- 1 | name=akka-sample-multi-node-scala 2 | title=Akka Multi-Node Testing Sample with Scala 3 | description=Sample containing sbt build settings and test classes for illustrating multi-node testing with Akka and Scala 4 | tags=akka,testing,scala,sample 5 | authorName=Akka Team 6 | authorLink=http://akka.io/ 7 | sourceLink=https://github.com/akka/akka 8 | -------------------------------------------------------------------------------- /akka-docs/rst/java/code/docs/dispatcher/MyUnboundedJMessageQueueSemantics.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2009-2014 Typesafe Inc. 3 | */ 4 | 5 | package docs.dispatcher; 6 | 7 | //#mailbox-implementation-example 8 | // Marker interface used for mailbox requirements mapping 9 | public interface MyUnboundedJMessageQueueSemantics { 10 | } 11 | //#mailbox-implementation-example 12 | -------------------------------------------------------------------------------- /akka-docs/rst/scala/testkit-example.rst: -------------------------------------------------------------------------------- 1 | .. _testkit-example: 2 | 3 | ######################## 4 | TestKit Example 5 | ######################## 6 | 7 | Ray Roestenburg's example code from `his blog `_ adapted to work with Akka 2.x. 8 | 9 | .. includecode:: code/docs/testkit/TestKitUsageSpec.scala#testkit-usage 10 | 11 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-camel-java/src/main/java/sample/camel/quartz/QuartzSample.java: -------------------------------------------------------------------------------- 1 | package sample.camel.quartz; 2 | 3 | import akka.actor.ActorSystem; 4 | import akka.actor.Props; 5 | 6 | public class QuartzSample { 7 | public static void main(String[] args) { 8 | ActorSystem system = ActorSystem.create("my-quartz-system"); 9 | system.actorOf(Props.create(MyQuartzActor.class)); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /akka-docs/_sphinx/themes/akka/static/scrollTo.js: -------------------------------------------------------------------------------- 1 | jQuery(document).ready(function($) { 2 | 3 | $(".scroll").click(function(event){ 4 | event.preventDefault(); 5 | $('html,body').animate({scrollTop:$(this.hash).offset().top}, 300); 6 | $('html,body').animate({scrollTop:$(this.hash).offset().top-=5}, 300); 7 | $(this.hash).effect("highlight", {color: "#FFCC85"}, 2000); 8 | }); 9 | }); -------------------------------------------------------------------------------- /akka-docs/rst/scala.rst: -------------------------------------------------------------------------------- 1 | .. _scala-api: 2 | 3 | Scala Documentation 4 | =================== 5 | 6 | .. toctree:: 7 | :maxdepth: 2 8 | 9 | intro/index-scala 10 | general/index 11 | scala/index-actors 12 | scala/index-futures 13 | scala/index-network 14 | scala/index-utilities 15 | scala/howto 16 | experimental/index 17 | dev/index 18 | project/index 19 | additional/index 20 | 21 | -------------------------------------------------------------------------------- /akka-actor-tests/src/test/scala/akka/Messages.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2009-2014 Typesafe Inc. 3 | */ 4 | 5 | package akka 6 | 7 | abstract class TestMessage 8 | 9 | case object Ping extends TestMessage 10 | case object Pong extends TestMessage 11 | case object OneWay extends TestMessage 12 | case object Die extends TestMessage 13 | case object NotifySupervisorExit extends TestMessage 14 | -------------------------------------------------------------------------------- /akka-docs/rst/scala/code/docs/pattern/ScalaTemplate.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2009-2014 Typesafe Inc. 3 | */ 4 | 5 | package docs.pattern 6 | 7 | // this part will not appear in the docs 8 | 9 | //#all-of-it 10 | class ScalaTemplate { 11 | println("Hello, Template!") 12 | //#uninteresting-stuff 13 | // don’t show this plumbimg 14 | //#uninteresting-stuff 15 | } 16 | //#all-of-it 17 | -------------------------------------------------------------------------------- /akka-docs/rst/additional/language-bindings.rst: -------------------------------------------------------------------------------- 1 | Other Language Bindings 2 | ======================= 3 | 4 | JRuby 5 | ----- 6 | 7 | Read more here: ``_. 8 | 9 | Groovy/Groovy++ 10 | --------------- 11 | 12 | Read more here: ``_. 13 | 14 | Clojure 15 | ------- 16 | 17 | Read more here: ``_. 18 | -------------------------------------------------------------------------------- /akka-docs/rst/java/code/docs/camel/ResponseReceiver.java: -------------------------------------------------------------------------------- 1 | package docs.camel; 2 | //#RouteResponse 3 | import akka.actor.UntypedActor; 4 | import akka.camel.CamelMessage; 5 | 6 | public class ResponseReceiver extends UntypedActor{ 7 | public void onReceive(Object message) { 8 | if(message instanceof CamelMessage) { 9 | // do something with the forwarded response 10 | } 11 | } 12 | } 13 | //#RouteResponse 14 | -------------------------------------------------------------------------------- /akka-kernel/build.sbt: -------------------------------------------------------------------------------- 1 | import akka.{ AkkaBuild, Dependencies, Formatting, Unidoc } 2 | import com.typesafe.tools.mima.plugin.MimaKeys 3 | 4 | AkkaBuild.defaultSettings 5 | 6 | Formatting.formatSettings 7 | 8 | Unidoc.scaladocSettingsNoVerificationOfDiagrams 9 | 10 | Unidoc.javadocSettings 11 | 12 | libraryDependencies ++= Dependencies.kernel 13 | 14 | MimaKeys.previousArtifact := akkaPreviousArtifact("akka-kernel").value 15 | -------------------------------------------------------------------------------- /akka-remote/src/test/scala/akka/remote/SerializeCreatorsVerificationSpec.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2009-2014 Typesafe Inc. 3 | */ 4 | 5 | package akka.remote 6 | 7 | import akka.testkit.AkkaSpec 8 | 9 | class SerializeCreatorsVerificationSpec extends AkkaSpec { 10 | 11 | "serialize-creators should be on" in { 12 | system.settings.SerializeAllCreators should ===(true) 13 | } 14 | 15 | } -------------------------------------------------------------------------------- /akka-actor/build.sbt: -------------------------------------------------------------------------------- 1 | import akka.{ AkkaBuild, Formatting, OSGi, Unidoc, Dependencies } 2 | import com.typesafe.tools.mima.plugin.MimaKeys 3 | 4 | AkkaBuild.defaultSettings 5 | 6 | Formatting.formatSettings 7 | 8 | Unidoc.scaladocSettings 9 | 10 | Unidoc.javadocSettings 11 | 12 | OSGi.actor 13 | 14 | libraryDependencies ++= Dependencies.actor 15 | 16 | MimaKeys.previousArtifact := akkaPreviousArtifact("akka-actor").value 17 | -------------------------------------------------------------------------------- /akka-actor/src/main/scala/akka/actor/package.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2009-2014 Typesafe Inc. 3 | */ 4 | 5 | package akka 6 | 7 | import language.implicitConversions 8 | 9 | package object actor { 10 | implicit def actorRef2Scala(ref: ActorRef): ScalaActorRef = ref.asInstanceOf[ScalaActorRef] 11 | implicit def scala2ActorRef(ref: ScalaActorRef): ActorRef = ref.asInstanceOf[ActorRef] 12 | } 13 | -------------------------------------------------------------------------------- /akka-camel/build.sbt: -------------------------------------------------------------------------------- 1 | import akka.{ AkkaBuild, Dependencies, Formatting, OSGi, Unidoc } 2 | import com.typesafe.tools.mima.plugin.MimaKeys 3 | 4 | AkkaBuild.defaultSettings 5 | 6 | Formatting.formatSettings 7 | 8 | Unidoc.scaladocSettings 9 | 10 | Unidoc.javadocSettings 11 | 12 | OSGi.camel 13 | 14 | libraryDependencies ++= Dependencies.camel 15 | 16 | MimaKeys.previousArtifact := akkaPreviousArtifact("akka-camel").value 17 | -------------------------------------------------------------------------------- /akka-cluster/src/test/scala/akka/cluster/SerializeCreatorsVerificationSpec.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2009-2014 Typesafe Inc. 3 | */ 4 | 5 | package akka.cluster 6 | 7 | import akka.testkit.AkkaSpec 8 | 9 | class SerializeCreatorsVerificationSpec extends AkkaSpec { 10 | 11 | "serialize-creators should be on" in { 12 | system.settings.SerializeAllCreators should ===(true) 13 | } 14 | 15 | } -------------------------------------------------------------------------------- /akka-docs/rst/project/migration-guides.rst: -------------------------------------------------------------------------------- 1 | .. _migration: 2 | 3 | Migration Guides 4 | ================ 5 | 6 | .. toctree:: 7 | :maxdepth: 1 8 | 9 | migration-guide-1.3.x-2.0.x 10 | migration-guide-2.0.x-2.1.x 11 | migration-guide-2.1.x-2.2.x 12 | migration-guide-2.2.x-2.3.x 13 | migration-guide-2.3.x-2.4.x 14 | migration-guide-persistence-experimental-2.3.x-2.4.x 15 | migration-guide-eventsourced-2.3.x 16 | -------------------------------------------------------------------------------- /akka-slf4j/build.sbt: -------------------------------------------------------------------------------- 1 | import akka.{ AkkaBuild, Dependencies, Formatting, OSGi, Unidoc } 2 | import com.typesafe.tools.mima.plugin.MimaKeys 3 | 4 | AkkaBuild.defaultSettings 5 | 6 | Formatting.formatSettings 7 | 8 | Unidoc.scaladocSettings 9 | 10 | Unidoc.javadocSettings 11 | 12 | OSGi.slf4j 13 | 14 | libraryDependencies ++= Dependencies.slf4j 15 | 16 | MimaKeys.previousArtifact := akkaPreviousArtifact("akka-slf4j").value 17 | -------------------------------------------------------------------------------- /akka-docs/rst/java.rst: -------------------------------------------------------------------------------- 1 | .. _java-api: 2 | 3 | Java Documentation 4 | ================== 5 | 6 | .. toctree:: 7 | :maxdepth: 2 8 | 9 | intro/index-java 10 | general/index 11 | java/index-actors 12 | java/lambda-index-actors 13 | java/index-futures 14 | java/index-network 15 | java/index-utilities 16 | java/howto 17 | experimental/index-java 18 | dev/index 19 | project/index 20 | additional/index 21 | 22 | -------------------------------------------------------------------------------- /akka-agent/build.sbt: -------------------------------------------------------------------------------- 1 | import akka.{ AkkaBuild, Dependencies, Formatting, OSGi, Unidoc } 2 | import com.typesafe.tools.mima.plugin.MimaKeys 3 | 4 | AkkaBuild.defaultSettings 5 | 6 | Formatting.formatSettings 7 | 8 | Unidoc.scaladocSettingsNoVerificationOfDiagrams 9 | 10 | Unidoc.javadocSettings 11 | 12 | OSGi.agent 13 | 14 | libraryDependencies ++= Dependencies.agent 15 | 16 | MimaKeys.previousArtifact := akkaPreviousArtifact("akka-agent").value 17 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-hello-kernel/LICENSE: -------------------------------------------------------------------------------- 1 | Akka Sample by Typesafe 2 | 3 | Licensed under Public Domain (CC0) 4 | 5 | To the extent possible under law, the person who associated CC0 with 6 | this Akka Sample has waived all copyright and related or neighboring 7 | rights to this Akka Sample. 8 | 9 | You should have received a copy of the CC0 legalcode along with this 10 | work. If not, see . 11 | -------------------------------------------------------------------------------- /akka-docs/_sphinx/themes/akka/static/highlightCode.js: -------------------------------------------------------------------------------- 1 | jQuery(document).ready(function($) { 2 | if (typeof disableStyleCode != "undefined") { 3 | return; 4 | } 5 | var a = false; 6 | $("pre").each(function() { 7 | if (!$(this).hasClass("prettyprint")) { 8 | $(this).addClass("prettyprint lang-scala linenums"); 9 | a = true 10 | } 11 | }); 12 | if (a) { prettyPrint() } 13 | }); 14 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-camel-java/build.sbt: -------------------------------------------------------------------------------- 1 | name := "akka-sample-camel-java" 2 | 3 | version := "2.4-SNAPSHOT" 4 | 5 | scalaVersion := "2.11.5" 6 | 7 | libraryDependencies ++= Seq( 8 | "com.typesafe.akka" %% "akka-camel" % "2.4-SNAPSHOT", 9 | "org.apache.camel" % "camel-jetty" % "2.10.3", 10 | "org.apache.camel" % "camel-quartz" % "2.10.3", 11 | "org.slf4j" % "slf4j-api" % "1.7.2", 12 | "ch.qos.logback" % "logback-classic" % "1.0.7" 13 | ) 14 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-osgi-dining-hakkers/LICENSE: -------------------------------------------------------------------------------- 1 | Akka Sample by Typesafe 2 | 3 | Licensed under Public Domain (CC0) 4 | 5 | To the extent possible under law, the person who associated CC0 with 6 | this Akka Sample has waived all copyright and related or neighboring 7 | rights to this Akka Sample. 8 | 9 | You should have received a copy of the CC0 legalcode along with this 10 | work. If not, see . 11 | -------------------------------------------------------------------------------- /akka-docs/_sphinx/pygments/setup.py: -------------------------------------------------------------------------------- 1 | """ 2 | Akka syntax styles for Pygments. 3 | """ 4 | 5 | from setuptools import setup 6 | 7 | entry_points = """ 8 | [pygments.styles] 9 | simple = styles.simple:SimpleStyle 10 | """ 11 | 12 | setup( 13 | name = 'akkastyles', 14 | version = '0.1', 15 | description = __doc__, 16 | author = "Akka", 17 | packages = ['styles'], 18 | entry_points = entry_points 19 | ) 20 | -------------------------------------------------------------------------------- /akka-osgi/build.sbt: -------------------------------------------------------------------------------- 1 | import akka.{ AkkaBuild, Dependencies, Formatting, OSGi, Unidoc } 2 | import com.typesafe.tools.mima.plugin.MimaKeys 3 | 4 | AkkaBuild.defaultSettings 5 | 6 | Formatting.formatSettings 7 | 8 | Unidoc.scaladocSettings 9 | 10 | Unidoc.javadocSettings 11 | 12 | OSGi.osgi 13 | 14 | libraryDependencies ++= Dependencies.osgi 15 | 16 | parallelExecution in Test := false 17 | 18 | MimaKeys.reportBinaryIssues := () // disable bin comp check 19 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-cluster-scala/src/main/scala/sample/cluster/factorial/FactorialApp.scala: -------------------------------------------------------------------------------- 1 | package sample.cluster.factorial 2 | 3 | object FactorialApp { 4 | def main(args: Array[String]): Unit = { 5 | // starting 3 backend nodes and 1 frontend node 6 | FactorialBackend.main(Seq("2551").toArray) 7 | FactorialBackend.main(Seq("2552").toArray) 8 | FactorialBackend.main(Array.empty) 9 | FactorialFrontend.main(Array.empty) 10 | } 11 | } -------------------------------------------------------------------------------- /akka-samples/akka-sample-hello-kernel/build.sbt: -------------------------------------------------------------------------------- 1 | import NativePackagerKeys._ 2 | 3 | packageArchetype.akka_application 4 | 5 | name := "hello-kernel" 6 | 7 | version := "2.4-SNAPSHOT" 8 | 9 | scalaVersion := "2.11.5" 10 | 11 | mainClass in Compile := Some("sample.kernel.hello.HelloKernel") 12 | 13 | libraryDependencies ++= Seq( 14 | "com.typesafe.akka" %% "akka-kernel" % "2.4-SNAPSHOT", 15 | "com.typesafe.akka" %% "akka-actor" % "2.4-SNAPSHOT" 16 | ) 17 | -------------------------------------------------------------------------------- /akka-camel/src/test/java/akka/camel/SampleUntypedReplyingProducer.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2009-2014 Typesafe Inc. 3 | */ 4 | 5 | package akka.camel; 6 | 7 | import akka.camel.javaapi.UntypedProducerActor; 8 | 9 | /** 10 | * 11 | */ 12 | public class SampleUntypedReplyingProducer extends UntypedProducerActor { 13 | 14 | public String getEndpointUri() { 15 | return "direct:producer-test-1"; 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-camel-java/LICENSE: -------------------------------------------------------------------------------- 1 | Activator Template by Typesafe 2 | 3 | Licensed under Public Domain (CC0) 4 | 5 | To the extent possible under law, the person who associated CC0 with 6 | this Activator Tempate has waived all copyright and related or neighboring 7 | rights to this Activator Template. 8 | 9 | You should have received a copy of the CC0 legalcode along with this 10 | work. If not, see . 11 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-fsm-scala/LICENSE: -------------------------------------------------------------------------------- 1 | Activator Template by Typesafe 2 | 3 | Licensed under Public Domain (CC0) 4 | 5 | To the extent possible under law, the person who associated CC0 with 6 | this Activator Tempate has waived all copyright and related or neighboring 7 | rights to this Activator Template. 8 | 9 | You should have received a copy of the CC0 legalcode along with this 10 | work. If not, see . 11 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-main-java/LICENSE: -------------------------------------------------------------------------------- 1 | Activator Template by Typesafe 2 | 3 | Licensed under Public Domain (CC0) 4 | 5 | To the extent possible under law, the person who associated CC0 with 6 | this Activator Tempate has waived all copyright and related or neighboring 7 | rights to this Activator Template. 8 | 9 | You should have received a copy of the CC0 legalcode along with this 10 | work. If not, see . 11 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-main-scala/LICENSE: -------------------------------------------------------------------------------- 1 | Activator Template by Typesafe 2 | 3 | Licensed under Public Domain (CC0) 4 | 5 | To the extent possible under law, the person who associated CC0 with 6 | this Activator Tempate has waived all copyright and related or neighboring 7 | rights to this Activator Template. 8 | 9 | You should have received a copy of the CC0 legalcode along with this 10 | work. If not, see . 11 | -------------------------------------------------------------------------------- /project/CommandLineOptions.scala: -------------------------------------------------------------------------------- 1 | package akka 2 | 3 | object CommandLineOptions { 4 | 5 | /** 6 | * Aggregated sample builds are transformed by swapping library dependencies to project ones. 7 | * This does work play well with dbuild and breaks scala community build. Therefore it was made 8 | * optional. 9 | * 10 | * Default: true 11 | */ 12 | val aggregateSamples = sys.props.getOrElse("akka.build.aggregateSamples", "true") == "true" 13 | } 14 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-camel-scala/LICENSE: -------------------------------------------------------------------------------- 1 | Activator Template by Typesafe 2 | 3 | Licensed under Public Domain (CC0) 4 | 5 | To the extent possible under law, the person who associated CC0 with 6 | this Activator Tempate has waived all copyright and related or neighboring 7 | rights to this Activator Template. 8 | 9 | You should have received a copy of the CC0 legalcode along with this 10 | work. If not, see . 11 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-cluster-java/LICENSE: -------------------------------------------------------------------------------- 1 | Activator Template by Typesafe 2 | 3 | Licensed under Public Domain (CC0) 4 | 5 | To the extent possible under law, the person who associated CC0 with 6 | this Activator Tempate has waived all copyright and related or neighboring 7 | rights to this Activator Template. 8 | 9 | You should have received a copy of the CC0 legalcode along with this 10 | work. If not, see . 11 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-cluster-java/src/main/resources/stats1.conf: -------------------------------------------------------------------------------- 1 | include "application" 2 | 3 | # //#config-router-lookup 4 | akka.actor.deployment { 5 | /statsService/workerRouter { 6 | router = consistent-hashing-group 7 | nr-of-instances = 100 8 | routees.paths = ["/user/statsWorker"] 9 | cluster { 10 | enabled = on 11 | allow-local-routees = on 12 | use-role = compute 13 | } 14 | } 15 | } 16 | # //#config-router-lookup 17 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-cluster-scala/LICENSE: -------------------------------------------------------------------------------- 1 | Activator Template by Typesafe 2 | 3 | Licensed under Public Domain (CC0) 4 | 5 | To the extent possible under law, the person who associated CC0 with 6 | this Activator Tempate has waived all copyright and related or neighboring 7 | rights to this Activator Template. 8 | 9 | You should have received a copy of the CC0 legalcode along with this 10 | work. If not, see . 11 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-cluster-scala/src/main/resources/stats1.conf: -------------------------------------------------------------------------------- 1 | include "application" 2 | 3 | # //#config-router-lookup 4 | akka.actor.deployment { 5 | /statsService/workerRouter { 6 | router = consistent-hashing-group 7 | nr-of-instances = 100 8 | routees.paths = ["/user/statsWorker"] 9 | cluster { 10 | enabled = on 11 | allow-local-routees = on 12 | use-role = compute 13 | } 14 | } 15 | } 16 | # //#config-router-lookup 17 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-fsm-java-lambda/LICENSE: -------------------------------------------------------------------------------- 1 | Activator Template by Typesafe 2 | 3 | Licensed under Public Domain (CC0) 4 | 5 | To the extent possible under law, the person who associated CC0 with 6 | this Activator Tempate has waived all copyright and related or neighboring 7 | rights to this Activator Template. 8 | 9 | You should have received a copy of the CC0 legalcode along with this 10 | work. If not, see . 11 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-remote-java/LICENSE: -------------------------------------------------------------------------------- 1 | Activator Template by Typesafe 2 | 3 | Licensed under Public Domain (CC0) 4 | 5 | To the extent possible under law, the person who associated CC0 with 6 | this Activator Tempate has waived all copyright and related or neighboring 7 | rights to this Activator Template. 8 | 9 | You should have received a copy of the CC0 legalcode along with this 10 | work. If not, see . 11 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-remote-scala/LICENSE: -------------------------------------------------------------------------------- 1 | Activator Template by Typesafe 2 | 3 | Licensed under Public Domain (CC0) 4 | 5 | To the extent possible under law, the person who associated CC0 with 6 | this Activator Tempate has waived all copyright and related or neighboring 7 | rights to this Activator Template. 8 | 9 | You should have received a copy of the CC0 legalcode along with this 10 | work. If not, see . 11 | -------------------------------------------------------------------------------- /akka-camel/src/main/scala/akka/camel/ActorNotRegisteredException.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2009-2014 Typesafe Inc. 3 | */ 4 | package akka.camel 5 | /** 6 | * Thrown to indicate that the actor referenced by an endpoint URI cannot be 7 | * found in the actor system. 8 | * 9 | */ 10 | class ActorNotRegisteredException(uri: String) extends RuntimeException { 11 | override def getMessage: String = "Actor [%s] doesn't exist" format uri 12 | } 13 | -------------------------------------------------------------------------------- /akka-docs/rst/java/code/docs/pattern/JavaTemplate.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2009-2014 Typesafe Inc. 3 | */ 4 | 5 | package docs.pattern; 6 | 7 | // this part will not appear in the docs 8 | 9 | //#all-of-it 10 | class JavaTemplate { 11 | public JavaTemplate() { 12 | System.out.println("Hello, Template!"); 13 | } 14 | //#uninteresting-stuff 15 | // don’t show this plumbimg 16 | //#uninteresting-stuff 17 | } 18 | //#all-of-it 19 | -------------------------------------------------------------------------------- /akka-remote/build.sbt: -------------------------------------------------------------------------------- 1 | import akka.{AkkaBuild, Dependencies, Formatting, Unidoc, OSGi} 2 | import com.typesafe.tools.mima.plugin.MimaKeys 3 | 4 | AkkaBuild.defaultSettings 5 | 6 | Formatting.formatSettings 7 | 8 | Unidoc.scaladocSettings 9 | 10 | Unidoc.javadocSettings 11 | 12 | OSGi.remote 13 | 14 | libraryDependencies ++= Dependencies.remote 15 | 16 | parallelExecution in Test := false 17 | 18 | MimaKeys.previousArtifact := akkaPreviousArtifact("akka-remote").value 19 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-main-java-lambda/LICENSE: -------------------------------------------------------------------------------- 1 | Activator Template by Typesafe 2 | 3 | Licensed under Public Domain (CC0) 4 | 5 | To the extent possible under law, the person who associated CC0 with 6 | this Activator Tempate has waived all copyright and related or neighboring 7 | rights to this Activator Template. 8 | 9 | You should have received a copy of the CC0 legalcode along with this 10 | work. If not, see . 11 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-multi-node-scala/LICENSE: -------------------------------------------------------------------------------- 1 | Activator Template by Typesafe 2 | 3 | Licensed under Public Domain (CC0) 4 | 5 | To the extent possible under law, the person who associated CC0 with 6 | this Activator Tempate has waived all copyright and related or neighboring 7 | rights to this Activator Template. 8 | 9 | You should have received a copy of the CC0 legalcode along with this 10 | work. If not, see . 11 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-persistence-java/LICENSE: -------------------------------------------------------------------------------- 1 | Activator Template by Typesafe 2 | 3 | Licensed under Public Domain (CC0) 4 | 5 | To the extent possible under law, the person who associated CC0 with 6 | this Activator Tempate has waived all copyright and related or neighboring 7 | rights to this Activator Template. 8 | 9 | You should have received a copy of the CC0 legalcode along with this 10 | work. If not, see . 11 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-persistence-scala/LICENSE: -------------------------------------------------------------------------------- 1 | Activator Template by Typesafe 2 | 3 | Licensed under Public Domain (CC0) 4 | 5 | To the extent possible under law, the person who associated CC0 with 6 | this Activator Tempate has waived all copyright and related or neighboring 7 | rights to this Activator Template. 8 | 9 | You should have received a copy of the CC0 legalcode along with this 10 | work. If not, see . 11 | -------------------------------------------------------------------------------- /akka-docs/_sphinx/themes/akka/static/akka_icon_reverse.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-cluster-java/src/main/resources/stats2.conf: -------------------------------------------------------------------------------- 1 | include "application" 2 | 3 | # //#config-router-deploy 4 | akka.actor.deployment { 5 | /singleton/statsService/workerRouter { 6 | router = consistent-hashing-pool 7 | nr-of-instances = 100 8 | cluster { 9 | enabled = on 10 | max-nr-of-instances-per-node = 3 11 | allow-local-routees = on 12 | use-role = compute 13 | } 14 | } 15 | } 16 | # //#config-router-deploy 17 | 18 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-persistence-java-lambda/LICENSE: -------------------------------------------------------------------------------- 1 | Activator Template by Typesafe 2 | 3 | Licensed under Public Domain (CC0) 4 | 5 | To the extent possible under law, the person who associated CC0 with 6 | this Activator Tempate has waived all copyright and related or neighboring 7 | rights to this Activator Template. 8 | 9 | You should have received a copy of the CC0 legalcode along with this 10 | work. If not, see . 11 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-supervision-java-lambda/LICENSE: -------------------------------------------------------------------------------- 1 | Activator Template by Typesafe 2 | 3 | Licensed under Public Domain (CC0) 4 | 5 | To the extent possible under law, the person who associated CC0 with 6 | this Activator Tempate has waived all copyright and related or neighboring 7 | rights to this Activator Template. 8 | 9 | You should have received a copy of the CC0 legalcode along with this 10 | work. If not, see . 11 | -------------------------------------------------------------------------------- /akka-docs/_sphinx/themes/akka/static/akka_icon_full_color.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /akka-docs/rst/java/code/docs/camel/OnewaySender.java: -------------------------------------------------------------------------------- 1 | package docs.camel; 2 | //#Oneway 3 | import akka.camel.javaapi.UntypedProducerActor; 4 | 5 | public class OnewaySender extends UntypedProducerActor{ 6 | private String uri; 7 | 8 | public OnewaySender(String uri) { 9 | this.uri = uri; 10 | } 11 | public String getEndpointUri() { 12 | return uri; 13 | } 14 | 15 | @Override 16 | public boolean isOneway() { 17 | return true; 18 | } 19 | } 20 | //#Oneway 21 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-cluster-scala/src/main/resources/stats2.conf: -------------------------------------------------------------------------------- 1 | include "application" 2 | 3 | # //#config-router-deploy 4 | akka.actor.deployment { 5 | /singleton/statsService/workerRouter { 6 | router = consistent-hashing-pool 7 | nr-of-instances = 100 8 | cluster { 9 | enabled = on 10 | max-nr-of-instances-per-node = 3 11 | allow-local-routees = on 12 | use-role = compute 13 | } 14 | } 15 | } 16 | # //#config-router-deploy 17 | 18 | -------------------------------------------------------------------------------- /akka-docs/rst/java/code/docs/actor/MyBoundedUntypedActor.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2009-2014 Typesafe Inc. 3 | */ 4 | 5 | package docs.actor; 6 | 7 | //#my-bounded-untyped-actor 8 | import akka.dispatch.BoundedMessageQueueSemantics; 9 | import akka.dispatch.RequiresMessageQueue; 10 | 11 | public class MyBoundedUntypedActor extends MyUntypedActor 12 | implements RequiresMessageQueue { 13 | } 14 | //#my-bounded-untyped-actor 15 | -------------------------------------------------------------------------------- /akka-bench-jmh/src/main/scala/akka/persistence/Common.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2014 Typesafe Inc. 3 | */ 4 | package akka.persistence 5 | 6 | import akka.actor.Actor 7 | 8 | /** only as a "the best we could possibly get" baseline, does not persist anything */ 9 | class BaselineActor(respondAfter: Int) extends Actor { 10 | override def receive = { 11 | case n: Int => if (n == respondAfter) sender() ! n 12 | } 13 | } 14 | 15 | final case class Evt(i: Int) 16 | -------------------------------------------------------------------------------- /akka-cluster/src/test/scala/akka/cluster/TestMember.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2009-2014 Typesafe Inc. 3 | */ 4 | package akka.cluster 5 | 6 | import akka.actor.Address 7 | 8 | object TestMember { 9 | def apply(address: Address, status: MemberStatus): Member = 10 | apply(address, status, Set.empty) 11 | 12 | def apply(address: Address, status: MemberStatus, roles: Set[String]): Member = 13 | new Member(UniqueAddress(address, 0), Int.MaxValue, status, roles) 14 | } -------------------------------------------------------------------------------- /akka-samples/akka-sample-cluster-java/src/main/java/sample/cluster/factorial/FactorialApp.java: -------------------------------------------------------------------------------- 1 | package sample.cluster.factorial; 2 | 3 | public class FactorialApp { 4 | 5 | public static void main(String[] args) { 6 | // starting 3 backend nodes and 1 frontend node 7 | FactorialBackendMain.main(new String[] { "2551" }); 8 | FactorialBackendMain.main(new String[] { "2552" }); 9 | FactorialBackendMain.main(new String[0]); 10 | FactorialFrontendMain.main(new String[0]); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-cluster-java/src/main/java/sample/cluster/factorial/FactorialResult.java: -------------------------------------------------------------------------------- 1 | package sample.cluster.factorial; 2 | 3 | import java.math.BigInteger; 4 | import java.io.Serializable; 5 | 6 | public class FactorialResult implements Serializable { 7 | private static final long serialVersionUID = 1L; 8 | public final int n; 9 | public final BigInteger factorial; 10 | 11 | FactorialResult(int n, BigInteger factorial) { 12 | this.n = n; 13 | this.factorial = factorial; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /akka-actor-tests/src/test/java/akka/actor/NonPublicClass.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2009-2014 Typesafe Inc. 3 | */ 4 | 5 | package akka.actor; 6 | 7 | public class NonPublicClass { 8 | public static Props createProps() { 9 | return Props.create(MyNonPublicActorClass.class); 10 | } 11 | } 12 | 13 | class MyNonPublicActorClass extends UntypedActor { 14 | @Override public void onReceive(Object msg) { 15 | getSender().tell(msg, getSelf()); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /akka-persistence-tck/src/test/scala/akka/persistence/journal/leveldb/LeveldbJournalJavaSpec.scala: -------------------------------------------------------------------------------- 1 | package akka.persistence.journal.leveldb 2 | 3 | import akka.persistence.journal.JournalSpec 4 | import akka.persistence.{ PersistenceSpec, PluginCleanup } 5 | 6 | class LeveldbJournalJavaSpec extends JournalSpec with PluginCleanup { 7 | lazy val config = PersistenceSpec.config( 8 | "leveldb", 9 | "LeveldbJournalJavaSpec", 10 | extraConfig = Some("akka.persistence.journal.leveldb.native = off")) 11 | } 12 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-main-java/src/main/java/sample/hello/Greeter.java: -------------------------------------------------------------------------------- 1 | package sample.hello; 2 | 3 | import akka.actor.UntypedActor; 4 | 5 | public class Greeter extends UntypedActor { 6 | 7 | public static enum Msg { 8 | GREET, DONE; 9 | } 10 | 11 | @Override 12 | public void onReceive(Object msg) { 13 | if (msg == Msg.GREET) { 14 | System.out.println("Hello World!"); 15 | getSender().tell(Msg.DONE, getSelf()); 16 | } else 17 | unhandled(msg); 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-camel-scala/build.sbt: -------------------------------------------------------------------------------- 1 | name := "akka-sample-camel-scala" 2 | 3 | version := "2.4-SNAPSHOT" 4 | 5 | scalaVersion := "2.11.5" 6 | 7 | libraryDependencies ++= Seq( 8 | "com.typesafe.akka" %% "akka-actor" % "2.4-SNAPSHOT", 9 | "com.typesafe.akka" %% "akka-camel" % "2.4-SNAPSHOT", 10 | "org.apache.camel" % "camel-jetty" % "2.10.3", 11 | "org.apache.camel" % "camel-quartz" % "2.10.3", 12 | "org.slf4j" % "slf4j-api" % "1.7.2", 13 | "ch.qos.logback" % "logback-classic" % "1.0.7" 14 | ) 15 | -------------------------------------------------------------------------------- /akka-docs/rst/additional/code/docs/osgi/blueprint.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | some.config { 10 | key=value 11 | } 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /akka-testkit/build.sbt: -------------------------------------------------------------------------------- 1 | import akka.{ AkkaBuild, Formatting, OSGi, Unidoc, Dependencies } 2 | import com.typesafe.tools.mima.plugin.MimaKeys 3 | 4 | AkkaBuild.defaultSettings 5 | 6 | Formatting.formatSettings 7 | 8 | Unidoc.scaladocSettings 9 | 10 | Unidoc.javadocSettings 11 | 12 | OSGi.testkit 13 | 14 | // to fix scaladoc generation 15 | libraryDependencies ++= Dependencies.testkit 16 | 17 | initialCommands += "import akka.testkit._" 18 | 19 | MimaKeys.previousArtifact := akkaPreviousArtifact("akka-testkit").value 20 | -------------------------------------------------------------------------------- /akka-testkit/src/test/java/akka/testkit/TestActorRefJavaCompile.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2009-2014 Typesafe Inc. 3 | */ 4 | 5 | package akka.testkit; 6 | 7 | import akka.actor.Actor; 8 | import akka.actor.Props; 9 | 10 | public class TestActorRefJavaCompile { 11 | 12 | public void shouldBeAbleToCompileWhenUsingApply() { 13 | //Just a dummy call to make sure it compiles 14 | TestActorRef ref = TestActorRef.apply(Props.empty(), null); 15 | ref.toString(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /akka-persistence-tck/src/test/scala/akka/persistence/journal/leveldb/LeveldbJournalNativeSpec.scala: -------------------------------------------------------------------------------- 1 | package akka.persistence.journal.leveldb 2 | 3 | import akka.persistence.journal.JournalSpec 4 | import akka.persistence.{ PersistenceSpec, PluginCleanup } 5 | 6 | class LeveldbJournalNativeSpec extends JournalSpec with PluginCleanup { 7 | lazy val config = PersistenceSpec.config( 8 | "leveldb", 9 | "LeveldbJournalNativeSpec", 10 | extraConfig = Some("akka.persistence.journal.leveldb.native = on")) 11 | 12 | } 13 | -------------------------------------------------------------------------------- /akka-docs/rst/java/code/docs/camel/MyActor.java: -------------------------------------------------------------------------------- 1 | package docs.camel; 2 | //#ProducerTemplate 3 | import akka.actor.UntypedActor; 4 | import akka.camel.Camel; 5 | import akka.camel.CamelExtension; 6 | import org.apache.camel.ProducerTemplate; 7 | 8 | public class MyActor extends UntypedActor { 9 | public void onReceive(Object message) { 10 | Camel camel = CamelExtension.get(getContext().system()); 11 | ProducerTemplate template = camel.template(); 12 | template.sendBody("direct:news", message); 13 | } 14 | } 15 | //#ProducerTemplate -------------------------------------------------------------------------------- /akka-samples/akka-sample-main-java-lambda/src/main/java/sample/hello/Greeter.java: -------------------------------------------------------------------------------- 1 | package sample.hello; 2 | 3 | import akka.actor.AbstractActor; 4 | import akka.japi.pf.ReceiveBuilder; 5 | 6 | public class Greeter extends AbstractActor { 7 | 8 | public static enum Msg { 9 | GREET, DONE; 10 | } 11 | 12 | public Greeter() { 13 | receive(ReceiveBuilder. 14 | matchEquals(Msg.GREET, m -> { 15 | System.out.println("Hello World!"); 16 | sender().tell(Msg.DONE, self()); 17 | }).build()); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /akka-testkit/src/test/scala/akka/testkit/TestActorsSpec.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2009-2014 Typesafe Inc. 3 | */ 4 | package akka.testkit 5 | 6 | class TestActorsSpec extends AkkaSpec with ImplicitSender { 7 | 8 | import TestActors.echoActorProps 9 | 10 | "A EchoActor" must { 11 | "send back messages unchanged" in { 12 | val message = "hello world" 13 | val echo = system.actorOf(echoActorProps) 14 | 15 | echo ! message 16 | 17 | expectMsg(message) 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /akka-cluster/src/test/scala/akka/cluster/SerializationChecksSpec.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2009-2014 Typesafe Inc. 3 | */ 4 | package akka.cluster 5 | 6 | import akka.testkit.AkkaSpec 7 | 8 | class SerializationChecksSpec extends AkkaSpec { 9 | 10 | "Settings serialize-messages and serialize-creators" must { 11 | 12 | "be on for tests" in { 13 | system.settings.SerializeAllCreators should ===(true) 14 | system.settings.SerializeAllMessages should ===(true) 15 | } 16 | 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-cluster-java/src/main/java/sample/cluster/transformation/TransformationApp.java: -------------------------------------------------------------------------------- 1 | package sample.cluster.transformation; 2 | 3 | public class TransformationApp { 4 | 5 | public static void main(String[] args) { 6 | // starting 2 frontend nodes and 3 backend nodes 7 | TransformationBackendMain.main(new String[] { "2551" }); 8 | TransformationBackendMain.main(new String[] { "2552" }); 9 | TransformationBackendMain.main(new String[0]); 10 | TransformationFrontendMain.main(new String[0]); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /akka-remote-tests/src/test/scala/akka/remote/SerializationChecksSpec.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2009-2014 Typesafe Inc. 3 | */ 4 | package akka.remote 5 | 6 | import akka.testkit.AkkaSpec 7 | 8 | class SerializationChecksSpec extends AkkaSpec { 9 | 10 | "Settings serialize-messages and serialize-creators" must { 11 | 12 | "be on for tests" in { 13 | system.settings.SerializeAllCreators should ===(true) 14 | system.settings.SerializeAllMessages should ===(true) 15 | } 16 | 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /akka-persistence/src/main/scala/akka/persistence/package.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2009-2014 Typesafe Inc. 3 | * Copyright (C) 2012-2013 Eligotech BV. 4 | */ 5 | 6 | package akka 7 | 8 | package object persistence { 9 | implicit val snapshotMetadataOrdering = new Ordering[SnapshotMetadata] { 10 | def compare(x: SnapshotMetadata, y: SnapshotMetadata) = 11 | if (x.persistenceId == y.persistenceId) math.signum(x.sequenceNr - y.sequenceNr).toInt 12 | else x.persistenceId.compareTo(y.persistenceId) 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-cluster-scala/src/main/scala/sample/cluster/stats/StatsWorker.scala: -------------------------------------------------------------------------------- 1 | package sample.cluster.stats 2 | 3 | import akka.actor.Actor 4 | 5 | //#worker 6 | class StatsWorker extends Actor { 7 | var cache = Map.empty[String, Int] 8 | def receive = { 9 | case word: String => 10 | val length = cache.get(word) match { 11 | case Some(x) => x 12 | case None => 13 | val x = word.length 14 | cache += (word -> x) 15 | x 16 | } 17 | 18 | sender() ! length 19 | } 20 | } 21 | //#worker -------------------------------------------------------------------------------- /akka-samples/akka-sample-cluster-scala/src/main/scala/sample/cluster/transformation/TransformationApp.scala: -------------------------------------------------------------------------------- 1 | package sample.cluster.transformation 2 | 3 | object TransformationApp { 4 | 5 | def main(args: Array[String]): Unit = { 6 | // starting 2 frontend nodes and 3 backend nodes 7 | TransformationFrontend.main(Seq("2551").toArray) 8 | TransformationBackend.main(Seq("2552").toArray) 9 | TransformationBackend.main(Array.empty) 10 | TransformationBackend.main(Array.empty) 11 | TransformationFrontend.main(Array.empty) 12 | } 13 | 14 | } -------------------------------------------------------------------------------- /akka-persistence-tck/src/test/scala/akka/persistence/japi/JavaJournalSpecSpec.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2014 Typesafe Inc. 3 | */ 4 | package akka.persistence.japi 5 | 6 | import akka.persistence.japi.journal.JavaJournalSpec 7 | import com.typesafe.config.ConfigFactory 8 | import org.scalatest.DoNotDiscover 9 | 10 | /* Only checking that compilation works with the constructor here as expected (no other abstract fields leaked) */ 11 | @DoNotDiscover 12 | class JavaJournalSpecSpec extends JavaJournalSpec(ConfigFactory.parseString("")) 13 | -------------------------------------------------------------------------------- /akka-osgi/src/test/scala/akka/osgi/test/PingPong.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2009-2014 Typesafe Inc. 3 | */ 4 | package akka.osgi.test 5 | 6 | import akka.actor.Actor 7 | 8 | /** 9 | * Simple ping-pong actor, used for testing 10 | */ 11 | object PingPong { 12 | 13 | abstract class TestMessage 14 | 15 | case object Ping extends TestMessage 16 | case object Pong extends TestMessage 17 | 18 | class PongActor extends Actor { 19 | def receive = { 20 | case Ping ⇒ 21 | sender() ! Pong 22 | } 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /akka-remote/src/test/scala/akka/remote/SerializationChecksPlainRemotingSpec.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2009-2014 Typesafe Inc. 3 | */ 4 | package akka.remote 5 | 6 | import akka.testkit.AkkaSpec 7 | 8 | class SerializationChecksPlainRemotingSpec extends AkkaSpec { 9 | 10 | "Settings serialize-messages and serialize-creators" must { 11 | 12 | "be on for tests" in { 13 | system.settings.SerializeAllCreators should ===(true) 14 | system.settings.SerializeAllMessages should ===(true) 15 | } 16 | 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /scripts/convert_tabs_to_spaces.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | find . -name "*.java" |while read line 3 | do 4 | expand $line > $line.new 5 | mv -f $line.new $line 6 | done 7 | find . -name "*.scala" |while read line 8 | do 9 | expand $line > $line.new 10 | mv -f $line.new $line 11 | done 12 | find . -name "*.html" |while read line 13 | do 14 | expand $line > $line.new 15 | mv -f $line.new $line 16 | done 17 | find . -name "*.xml" |while read line 18 | do 19 | expand $line > $line.new 20 | mv -f $line.new $line 21 | done 22 | echo "converted all tabs to 2 spaces" 23 | exit 0 24 | -------------------------------------------------------------------------------- /akka-remote/src/main/scala/akka/remote/security/provider/SeedSize.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2009-2014 Typesafe Inc. 3 | */ 4 | 5 | package akka.remote.security.provider 6 | 7 | /** 8 | * INTERNAL API 9 | * From AESCounterRNG API docs: 10 | * Valid values are 16 (128 bits), 24 (192 bits) and 32 (256 bits). 11 | * Any other values will result in an exception from the AES implementation. 12 | * 13 | * INTERNAL API 14 | */ 15 | private[provider] object SeedSize { 16 | val Seed128 = 16 17 | val Seed192 = 24 18 | val Seed256 = 32 19 | } 20 | 21 | -------------------------------------------------------------------------------- /akka-docs/rst/java/code/docs/camel/CustomRouteBuilder.java: -------------------------------------------------------------------------------- 1 | package docs.camel; 2 | //#CustomRoute 3 | import akka.actor.ActorRef; 4 | import akka.camel.internal.component.CamelPath; 5 | import org.apache.camel.builder.RouteBuilder; 6 | 7 | public class CustomRouteBuilder extends RouteBuilder{ 8 | private String uri; 9 | 10 | public CustomRouteBuilder(ActorRef responder) { 11 | uri = CamelPath.toUri(responder); 12 | } 13 | 14 | public void configure() throws Exception { 15 | from("jetty:http://localhost:8877/camel/custom").to(uri); 16 | } 17 | } 18 | //#CustomRoute 19 | -------------------------------------------------------------------------------- /akka-actor-tests/src/test/scala/akka/util/LineNumberSpecCodeForScala.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2014 Typesafe Inc. 3 | */ 4 | package akka.util 5 | 6 | /* 7 | * IMPORTANT: do not change this file, the line numbers are verified in LineNumberSpec! 8 | */ 9 | 10 | object LineNumberSpecCodeForScala { 11 | 12 | val oneline = (s: String) ⇒ println(s) 13 | 14 | val twoline = (s: String) ⇒ { 15 | println(s) 16 | Integer.parseInt(s) 17 | } 18 | 19 | val partial: PartialFunction[String, Unit] = { 20 | case "a" ⇒ 21 | case "b" ⇒ 22 | } 23 | } -------------------------------------------------------------------------------- /akka-actor/src/main/java/akka/pattern/AbstractCircuitBreaker.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2009-2014 Typesafe Inc. 3 | */ 4 | package akka.pattern; 5 | 6 | import akka.util.Unsafe; 7 | 8 | class AbstractCircuitBreaker { 9 | protected final static long stateOffset; 10 | 11 | static { 12 | try { 13 | stateOffset = Unsafe.instance.objectFieldOffset(CircuitBreaker.class.getDeclaredField("_currentStateDoNotCallMeDirectly")); 14 | } catch(Throwable t){ 15 | throw new ExceptionInInitializerError(t); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /akka-docs/rst/java/code/docs/camel/RequestBodyActor.java: -------------------------------------------------------------------------------- 1 | package docs.camel; 2 | //#RequestProducerTemplate 3 | import akka.actor.UntypedActor; 4 | import akka.camel.Camel; 5 | import akka.camel.CamelExtension; 6 | import org.apache.camel.ProducerTemplate; 7 | 8 | public class RequestBodyActor extends UntypedActor { 9 | public void onReceive(Object message) { 10 | Camel camel = CamelExtension.get(getContext().system()); 11 | ProducerTemplate template = camel.template(); 12 | getSender().tell(template.requestBody("direct:news", message), getSelf()); 13 | } 14 | } 15 | //#RequestProducerTemplate -------------------------------------------------------------------------------- /akka-persistence/build.sbt: -------------------------------------------------------------------------------- 1 | import akka.{ AkkaBuild, Dependencies, Formatting, OSGi, Unidoc } 2 | import com.typesafe.tools.mima.plugin.MimaKeys 3 | import akka.MultiNode 4 | 5 | AkkaBuild.defaultSettings 6 | 7 | AkkaBuild.experimentalSettings 8 | 9 | Formatting.formatSettings 10 | 11 | Unidoc.scaladocSettings 12 | 13 | Unidoc.javadocSettings 14 | 15 | OSGi.persistence 16 | 17 | Dependencies.persistence 18 | 19 | MimaKeys.previousArtifact := akkaPreviousArtifact("akka-persistence-experimental").value 20 | 21 | fork in Test := true 22 | 23 | javaOptions in Test := MultiNode.defaultMultiJvmOptions 24 | -------------------------------------------------------------------------------- /akka-testkit/src/main/scala/akka/testkit/TestActors.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2009-2014 Typesafe Inc. 3 | */ 4 | package akka.testkit 5 | 6 | import akka.actor.{ Props, Actor } 7 | 8 | /** 9 | * A collection of common actor patterns used in tests. 10 | */ 11 | object TestActors { 12 | 13 | /** 14 | * EchoActor sends back received messages (unmodified). 15 | */ 16 | class EchoActor extends Actor { 17 | override def receive = { 18 | case message ⇒ sender() ! message 19 | } 20 | } 21 | 22 | val echoActorProps = Props[EchoActor]() 23 | 24 | } 25 | -------------------------------------------------------------------------------- /akka-camel/src/main/scala/akka/package.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2009-2014 Typesafe Inc. 3 | */ 4 | 5 | package akka 6 | 7 | import language.implicitConversions 8 | 9 | import org.apache.camel.model.ProcessorDefinition 10 | 11 | package object camel { 12 | /** 13 | * To allow using Actors with the Camel Route DSL: 14 | * 15 | * {{{ 16 | * from("file://data/input/CamelConsumer").to(actor) 17 | * }}} 18 | */ 19 | implicit def toActorRouteDefinition[T <: ProcessorDefinition[T]](definition: ProcessorDefinition[T]) = new ActorRouteDefinition(definition) 20 | } 21 | -------------------------------------------------------------------------------- /akka-remote-tests/src/test/scala/akka/remote/testkit/STMultiNodeSpec.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2009-2014 Typesafe Inc. 3 | */ 4 | 5 | package akka.remote.testkit 6 | 7 | import org.scalatest.{ BeforeAndAfterAll, WordSpecLike } 8 | import org.scalatest.Matchers 9 | 10 | /** 11 | * Hooks up MultiNodeSpec with ScalaTest 12 | */ 13 | trait STMultiNodeSpec extends MultiNodeSpecCallbacks with WordSpecLike with Matchers with BeforeAndAfterAll { 14 | 15 | override def beforeAll() = multiNodeSpecBeforeAll() 16 | 17 | override def afterAll() = multiNodeSpecAfterAll() 18 | 19 | } 20 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-main-scala/src/main/scala/sample/hello/HelloWorld.scala: -------------------------------------------------------------------------------- 1 | package sample.hello 2 | 3 | import akka.actor.Actor 4 | import akka.actor.Props 5 | 6 | class HelloWorld extends Actor { 7 | 8 | override def preStart(): Unit = { 9 | // create the greeter actor 10 | val greeter = context.actorOf(Props[Greeter], "greeter") 11 | // tell it to perform the greeting 12 | greeter ! Greeter.Greet 13 | } 14 | 15 | def receive = { 16 | // when the greeter is done, stop this actor and with it the application 17 | case Greeter.Done => context.stop(self) 18 | } 19 | } 20 | 21 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-camel-java/src/main/java/sample/camel/http/HttpConsumer.java: -------------------------------------------------------------------------------- 1 | package sample.camel.http; 2 | 3 | import akka.actor.ActorRef; 4 | import akka.camel.javaapi.UntypedConsumerActor; 5 | 6 | public class HttpConsumer extends UntypedConsumerActor { 7 | 8 | private ActorRef producer; 9 | 10 | public HttpConsumer(ActorRef producer) { 11 | this.producer = producer; 12 | } 13 | 14 | public String getEndpointUri() { 15 | return "jetty:http://0.0.0.0:8875/"; 16 | } 17 | 18 | public void onReceive(Object message) { 19 | producer.forward(message, getContext()); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-camel-java/src/main/java/sample/camel/http/HttpSample.java: -------------------------------------------------------------------------------- 1 | package sample.camel.http; 2 | 3 | import akka.actor.*; 4 | 5 | public class HttpSample { 6 | public static void main(String[] args) { 7 | ActorSystem system = ActorSystem.create("some-system"); 8 | 9 | final ActorRef httpTransformer = system.actorOf(Props.create(HttpTransformer.class)); 10 | 11 | final ActorRef httpProducer = system.actorOf(Props.create(HttpProducer.class, httpTransformer)); 12 | 13 | final ActorRef httpConsumer = system.actorOf(Props.create(HttpConsumer.class, httpProducer)); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-camel-java/src/main/java/sample/camel/route/CustomRouteBuilder.java: -------------------------------------------------------------------------------- 1 | package sample.camel.route; 2 | 3 | import org.apache.camel.Exchange; 4 | import org.apache.camel.Processor; 5 | import org.apache.camel.builder.RouteBuilder; 6 | 7 | public class CustomRouteBuilder extends RouteBuilder { 8 | public void configure() throws Exception { 9 | from("direct:welcome").process(new Processor() { 10 | public void process(Exchange exchange) throws Exception { 11 | exchange.getOut().setBody(String.format("Welcome %s", exchange.getIn().getBody())); 12 | } 13 | }); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-fsm-java-lambda/build.sbt: -------------------------------------------------------------------------------- 1 | name := "akka-docs-java-lambda" 2 | 3 | version := "2.4-SNAPSHOT" 4 | 5 | scalaVersion := "2.11.5" 6 | 7 | javacOptions ++= Seq("-source", "1.8", "-target", "1.8", "-Xlint") 8 | 9 | testOptions += Tests.Argument(TestFrameworks.JUnit, "-v", "-a") 10 | 11 | libraryDependencies ++= Seq( 12 | "com.typesafe.akka" %% "akka-actor" % "2.4-SNAPSHOT", 13 | "com.typesafe.akka" %% "akka-testkit" % "2.4-SNAPSHOT" % "test", 14 | "junit" % "junit" % "4.11" % "test", 15 | "com.novocode" % "junit-interface" % "0.10" % "test") 16 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-hello-kernel/README.md: -------------------------------------------------------------------------------- 1 | Hello World Sample 2 | ================== 3 | 4 | This sample is meant to be used by studying the code; it does not perform any 5 | astounding functions when running it. If you want to run it, check out the akka 6 | sources on your local hard drive, follow the [instructions for setting up Akka 7 | with SBT](http://doc.akka.io/docs/akka/current/intro/getting-started.html). 8 | When you start SBT within the checked-out akka source directory, you can run 9 | this sample by typing 10 | 11 | akka-sample-hello/run 12 | 13 | You can read more in the [Akka docs](http://akka.io/docs). 14 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-supervision-java-lambda/build.sbt: -------------------------------------------------------------------------------- 1 | name := "akka-supervision-java-lambda" 2 | 3 | version := "1.0" 4 | 5 | scalaVersion := "2.11.5" 6 | 7 | javacOptions ++= Seq("-source", "1.8", "-target", "1.8", "-Xlint") 8 | 9 | testOptions += Tests.Argument(TestFrameworks.JUnit, "-v", "-a") 10 | 11 | libraryDependencies ++= Seq( 12 | "com.typesafe.akka" %% "akka-actor" % "2.4-SNAPSHOT", 13 | "com.typesafe.akka" %% "akka-testkit" % "2.4-SNAPSHOT" % "test", 14 | "junit" % "junit" % "4.11" % "test", 15 | "com.novocode" % "junit-interface" % "0.10" % "test") 16 | -------------------------------------------------------------------------------- /akka-persistence-tck/build.sbt: -------------------------------------------------------------------------------- 1 | import akka.{ AkkaBuild, Dependencies, Formatting, OSGi, Unidoc } 2 | import com.typesafe.tools.mima.plugin.MimaKeys 3 | import akka.MultiNode 4 | 5 | AkkaBuild.defaultSettings 6 | 7 | AkkaBuild.experimentalSettings 8 | 9 | Formatting.formatSettings 10 | 11 | Unidoc.scaladocSettings 12 | 13 | Unidoc.javadocSettings 14 | 15 | // OSGi.persistenceTck TODO: we do need to export this as OSGi bundle too? 16 | 17 | libraryDependencies ++= Dependencies.persistenceTck 18 | 19 | MimaKeys.previousArtifact := None 20 | 21 | fork in Test := true 22 | 23 | javaOptions in Test := MultiNode.defaultMultiJvmOptions 24 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-cluster-java/src/main/java/sample/cluster/stats/StatsSampleClientMain.java: -------------------------------------------------------------------------------- 1 | package sample.cluster.stats; 2 | 3 | import akka.actor.ActorSystem; 4 | import akka.actor.Props; 5 | 6 | import com.typesafe.config.ConfigFactory; 7 | 8 | public class StatsSampleClientMain { 9 | 10 | public static void main(String[] args) { 11 | // note that client is not a compute node, role not defined 12 | ActorSystem system = ActorSystem.create("ClusterSystem", 13 | ConfigFactory.load("stats1")); 14 | system.actorOf(Props.create(StatsSampleClient.class, "/user/statsService"), 15 | "client"); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /akka-docs/rst/java/code/docs/camel/Forwarder.java: -------------------------------------------------------------------------------- 1 | package docs.camel; 2 | //#RouteResponse 3 | import akka.actor.ActorRef; 4 | import akka.camel.javaapi.UntypedProducerActor; 5 | 6 | public class Forwarder extends UntypedProducerActor { 7 | private String uri; 8 | private ActorRef target; 9 | 10 | public Forwarder(String uri, ActorRef target) { 11 | this.uri = uri; 12 | this.target = target; 13 | } 14 | 15 | public String getEndpointUri() { 16 | return uri; 17 | } 18 | 19 | @Override 20 | public void onRouteResponse(Object message) { 21 | target.forward(message, getContext()); 22 | } 23 | } 24 | //#RouteResponse 25 | -------------------------------------------------------------------------------- /akka-persistence-tck/src/test/scala/akka/persistence/snapshot/local/LocalSnapshotStoreSpec.scala: -------------------------------------------------------------------------------- 1 | package akka.persistence.snapshot.local 2 | 3 | import com.typesafe.config.ConfigFactory 4 | 5 | import akka.persistence.PluginCleanup 6 | import akka.persistence.snapshot.SnapshotStoreSpec 7 | 8 | class LocalSnapshotStoreSpec extends SnapshotStoreSpec with PluginCleanup { 9 | lazy val config = ConfigFactory.parseString( 10 | """ 11 | akka.test.timefactor = 3 12 | akka.persistence.snapshot-store.plugin = "akka.persistence.snapshot-store.local" 13 | akka.persistence.snapshot-store.local.dir = "target/snapshots" 14 | """) 15 | 16 | } 17 | -------------------------------------------------------------------------------- /akka-actor-tests/src/test/scala/akka/actor/Supervisor.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2009-2014 Typesafe Inc. 3 | */ 4 | package akka.actor 5 | 6 | /** 7 | * For testing Supervisor behavior, normally you don't supply the strategy 8 | * from the outside like this. 9 | */ 10 | class Supervisor(override val supervisorStrategy: SupervisorStrategy) extends Actor { 11 | 12 | def receive = { 13 | case x: Props ⇒ sender() ! context.actorOf(x) 14 | } 15 | // need to override the default of stopping all children upon restart, tests rely on keeping them around 16 | override def preRestart(cause: Throwable, msg: Option[Any]) {} 17 | } 18 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-camel-scala/src/main/scala/sample/camel/QuartzExample.scala: -------------------------------------------------------------------------------- 1 | package sample.camel 2 | 3 | import akka.actor.ActorSystem 4 | import akka.actor.Props 5 | import akka.camel.Consumer 6 | 7 | object QuartzExample { 8 | 9 | def main(args: Array[String]): Unit = { 10 | val system = ActorSystem("my-quartz-system") 11 | system.actorOf(Props[MyQuartzActor]) 12 | } 13 | 14 | class MyQuartzActor extends Consumer { 15 | 16 | def endpointUri = "quartz://example?cron=0/2+*+*+*+*+?" 17 | 18 | def receive = { 19 | 20 | case msg => println("==============> received %s " format msg) 21 | 22 | } 23 | 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /akka-samples/akka-docs-java-lambda/build.sbt: -------------------------------------------------------------------------------- 1 | name := "akka-docs-java-lambda" 2 | 3 | version := "2.4-SNAPSHOT" 4 | 5 | scalaVersion := "2.11.5" 6 | 7 | compileOrder := CompileOrder.ScalaThenJava 8 | 9 | javacOptions ++= Seq("-source", "1.8", "-target", "1.8", "-Xlint") 10 | 11 | testOptions += Tests.Argument(TestFrameworks.JUnit, "-v", "-a") 12 | 13 | libraryDependencies ++= Seq( 14 | "com.typesafe.akka" %% "akka-actor" % "2.4-SNAPSHOT", 15 | "com.typesafe.akka" %% "akka-testkit" % "2.4-SNAPSHOT" % "test", 16 | "junit" % "junit" % "4.11" % "test", 17 | "com.novocode" % "junit-interface" % "0.10" % "test") 18 | -------------------------------------------------------------------------------- /akka-persistence/src/main/scala/akka/persistence/Protocol.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2009-2014 Typesafe Inc. 3 | */ 4 | 5 | package akka.persistence 6 | 7 | /** 8 | * INTERNAL API. 9 | * 10 | * Messages exchanged between persistent actors, views and a journal/snapshot-store. 11 | */ 12 | private[persistence] object Protocol { 13 | 14 | /** 15 | * INTERNAL API. 16 | * 17 | * Internal persistence extension messages extend this trait. 18 | * 19 | * Helps persistence plugin developers to differentiate 20 | * internal persistence extension messages from their custom plugin messages. 21 | */ 22 | trait Message 23 | 24 | } 25 | -------------------------------------------------------------------------------- /akka-samples/akka-docs-udp-multicast/build.sbt: -------------------------------------------------------------------------------- 1 | name := "akka-docs-udp-multicast" 2 | 3 | version := "2.4-SNAPSHOT" 4 | 5 | scalaVersion := "2.11.5" 6 | 7 | compileOrder := CompileOrder.ScalaThenJava 8 | 9 | javacOptions ++= Seq("-source", "1.7", "-target", "1.7", "-Xlint") 10 | 11 | testOptions += Tests.Argument(TestFrameworks.JUnit, "-v", "-a") 12 | 13 | libraryDependencies ++= Seq( 14 | "com.typesafe.akka" %% "akka-actor" % "2.4-SNAPSHOT", 15 | "com.typesafe.akka" %% "akka-testkit" % "2.4-SNAPSHOT", 16 | "org.scalatest" %% "scalatest" % "2.2.1" % "test", 17 | "junit" % "junit" % "4.11" % "test", 18 | "com.novocode" % "junit-interface" % "0.10" % "test" 19 | ) 20 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-cluster-java/src/main/java/sample/cluster/stats/StatsSampleOneMasterClientMain.java: -------------------------------------------------------------------------------- 1 | package sample.cluster.stats; 2 | 3 | import com.typesafe.config.ConfigFactory; 4 | 5 | import akka.actor.ActorSystem; 6 | import akka.actor.Props; 7 | 8 | public class StatsSampleOneMasterClientMain { 9 | 10 | public static void main(String[] args) { 11 | // note that client is not a compute node, role not defined 12 | ActorSystem system = ActorSystem.create("ClusterSystem", 13 | ConfigFactory.load("stats2")); 14 | system.actorOf(Props.create(StatsSampleClient.class, "/user/statsServiceProxy"), 15 | "client"); 16 | 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-multi-node-scala/src/test/scala/sample/multinode/STMultiNodeSpec.scala: -------------------------------------------------------------------------------- 1 | //#example 2 | package sample.multinode 3 | 4 | //#imports 5 | import org.scalatest.{ BeforeAndAfterAll, WordSpecLike } 6 | import org.scalatest.Matchers 7 | import akka.remote.testkit.MultiNodeSpecCallbacks 8 | //#imports 9 | 10 | //#trait 11 | /** 12 | * Hooks up MultiNodeSpec with ScalaTest 13 | */ 14 | trait STMultiNodeSpec extends MultiNodeSpecCallbacks 15 | with WordSpecLike with Matchers with BeforeAndAfterAll { 16 | 17 | override def beforeAll() = multiNodeSpecBeforeAll() 18 | 19 | override def afterAll() = multiNodeSpecAfterAll() 20 | } 21 | //#trait 22 | //#example 23 | -------------------------------------------------------------------------------- /akka-actor-tests/src/test/java/akka/util/JavaDuration.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2009-2014 Typesafe Inc. 3 | */ 4 | package akka.util; 5 | 6 | import org.junit.Test; 7 | import scala.concurrent.duration.Duration; 8 | 9 | public class JavaDuration { 10 | 11 | @Test 12 | public void testCreation() { 13 | final Duration fivesec = Duration.create(5, "seconds"); 14 | final Duration threemillis = Duration.create("3 millis"); 15 | final Duration diff = fivesec.minus(threemillis); 16 | assert diff.lt(fivesec); 17 | assert Duration.Zero().lteq(Duration.Inf()); 18 | assert Duration.Inf().gt(Duration.Zero().neg()); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /akka-docs/rst/java/code/docs/actor/FirstUntypedActor.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2009-2014 Typesafe Inc. 3 | */ 4 | package docs.actor; 5 | 6 | import akka.actor.ActorRef; 7 | import akka.actor.Props; 8 | import akka.actor.PoisonPill; 9 | import akka.actor.UntypedActor; 10 | 11 | //#context-actorOf 12 | public class FirstUntypedActor extends UntypedActor { 13 | ActorRef myActor = getContext().actorOf(Props.create(MyActor.class), "myactor"); 14 | 15 | //#context-actorOf 16 | 17 | public void onReceive(Object message) { 18 | myActor.forward(message, getContext()); 19 | myActor.tell(PoisonPill.getInstance(), ActorRef.noSender()); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /akka-persistence-tck/src/test/scala/akka/persistence/PluginCleanup.scala: -------------------------------------------------------------------------------- 1 | package akka.persistence 2 | 3 | import java.io.File 4 | 5 | import org.apache.commons.io.FileUtils 6 | 7 | trait PluginCleanup extends PluginSpec { 8 | val storageLocations = List( 9 | "akka.persistence.journal.leveldb.dir", 10 | "akka.persistence.snapshot-store.local.dir").map(s ⇒ new File(system.settings.config.getString(s))) 11 | 12 | override def beforeAll() { 13 | storageLocations.foreach(FileUtils.deleteDirectory) 14 | super.beforeAll() 15 | } 16 | 17 | override def afterAll() { 18 | super.afterAll() 19 | storageLocations.foreach(FileUtils.deleteDirectory) 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-camel-java/src/main/java/sample/camel/quartz/MyQuartzActor.java: -------------------------------------------------------------------------------- 1 | package sample.camel.quartz; 2 | 3 | import akka.camel.CamelMessage; 4 | import akka.camel.javaapi.UntypedConsumerActor; 5 | 6 | public class MyQuartzActor extends UntypedConsumerActor { 7 | public String getEndpointUri() { 8 | return "quartz://example?cron=0/2+*+*+*+*+?"; 9 | } 10 | 11 | public void onReceive(Object message) { 12 | if (message instanceof CamelMessage) { 13 | CamelMessage camelMessage = (CamelMessage) message; 14 | System.out.println(String.format("==============> received %s ", camelMessage)); 15 | } else 16 | unhandled(message); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/ls/2.0.json: -------------------------------------------------------------------------------- 1 | 2 | { 3 | "organization":"com.typesafe.akka", 4 | "name":"akka", 5 | "version":"2.0", 6 | "description":"Akka is the platform for the next generation of event-driven, scalable and fault-tolerant architectures on the JVM.", 7 | "site":"http://akka.io", 8 | "tags":["actors","stm","concurrency","distributed","fault-tolerance","scala","java","futures","dataflow","remoting"], 9 | "docs":"http://akka.io/docs", 10 | "licenses": [{ 11 | "name": "Apache 2", 12 | "url": "http://www.apache.org/licenses/LICENSE-2.0.html" 13 | }], 14 | "resolvers": ["http://repo.typesafe.com/typesafe/releases"], 15 | "dependencies": [], 16 | "scalas": ["2.9.1-1"], 17 | "sbt": false 18 | } -------------------------------------------------------------------------------- /akka-samples/akka-sample-remote-scala/src/main/scala/sample/remote/benchmark/Receiver.scala: -------------------------------------------------------------------------------- 1 | package sample.remote.benchmark 2 | 3 | import akka.actor.Actor 4 | import akka.actor.ActorSystem 5 | import com.typesafe.config.ConfigFactory 6 | import akka.actor.Props 7 | 8 | object Receiver { 9 | def main(args: Array[String]): Unit = { 10 | val system = ActorSystem("Sys", ConfigFactory.load("remotelookup")) 11 | system.actorOf(Props[Receiver], "rcv") 12 | } 13 | } 14 | 15 | class Receiver extends Actor { 16 | import Sender._ 17 | 18 | def receive = { 19 | case m: Echo => sender() ! m 20 | case Shutdown => context.system.terminate() 21 | case _ => 22 | } 23 | } 24 | 25 | -------------------------------------------------------------------------------- /akka-agent/src/main/resources/reference.conf: -------------------------------------------------------------------------------- 1 | #################################### 2 | # Akka Agent Reference Config File # 3 | #################################### 4 | 5 | # This is the reference config file that contains all the default settings. 6 | # Make your edits/overrides in your application.conf. 7 | 8 | akka { 9 | agent { 10 | 11 | # The dispatcher used for agent-send-off actor 12 | send-off-dispatcher { 13 | executor = thread-pool-executor 14 | type = PinnedDispatcher 15 | } 16 | 17 | # The dispatcher used for agent-alter-off actor 18 | alter-off-dispatcher { 19 | executor = thread-pool-executor 20 | type = PinnedDispatcher 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-osgi-dining-hakkers/assembly-dist/src/main/distribution/etc/org.apache.karaf.features.cfg: -------------------------------------------------------------------------------- 1 | # 2 | # Comma separated list of features repositories to register by default 3 | # Default list + Dining Hakkers feature 4 | # 5 | featuresRepositories=mvn:org.apache.karaf.assemblies.features/standard/${karaf.version}/xml/features,mvn:org.apache.karaf.assemblies.features/enterprise/${karaf.version}/xml/features,mvn:com.typesafe.akka.akka-sample-osgi-dining-hakkers/akka-sample-osgi-dining-hakkers/${project.version}/xml/features 6 | 7 | # Comma separated list of features to install at startup. Features definitions are looked up from repositories above. 8 | featuresBoot=config,ssh,management,dining-hakker 9 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-osgi-dining-hakkers/karaf.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | projdir=$(cd $(dirname $0); pwd) 4 | version=2.4-SNAPSHOT 5 | 6 | # This directory is specified in the build as the root of the tar 7 | # Use tar --strip-components=1 to ignore the root 8 | outputdir="$projdir/target/akka-sample-osgi-dining-hakkers-$version" 9 | 10 | mkdir $projdir/target 11 | 12 | if [[ -d "$outputdir" ]]; then 13 | echo Deleting existing $outputdir... 14 | rm -fr "$outputdir" 15 | fi 16 | echo Extracting configured container into $outputdir... 17 | tar -C $projdir/target -zxf assembly-dist/target/akka-sample-osgi-dining-hakkers-dist-$version.tar.gz 18 | echo Extract complete, please run $outputdir/bin/karaf 19 | -------------------------------------------------------------------------------- /akka-docs/rst/common/code/docs/duration/Sample.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2013-2014 Typesafe Inc. 3 | */ 4 | 5 | package docs.duration 6 | 7 | import language.postfixOps 8 | 9 | object Scala { 10 | //#dsl 11 | import scala.concurrent.duration._ 12 | 13 | val fivesec = 5.seconds 14 | val threemillis = 3.millis 15 | val diff = fivesec - threemillis 16 | assert(diff < fivesec) 17 | val fourmillis = threemillis * 4 / 3 // you cannot write it the other way around 18 | val n = threemillis / (1 millisecond) 19 | //#dsl 20 | 21 | //#deadline 22 | val deadline = 10.seconds.fromNow 23 | // do something 24 | val rest = deadline.timeLeft 25 | //#deadline 26 | } 27 | -------------------------------------------------------------------------------- /akka-actor/src/main/scala/akka/io/UdpConnectedManager.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2009-2014 Typesafe Inc. 3 | */ 4 | package akka.io 5 | 6 | import akka.actor.Props 7 | import akka.io.UdpConnected.Connect 8 | 9 | /** 10 | * INTERNAL API 11 | */ 12 | private[io] class UdpConnectedManager(udpConn: UdpConnectedExt) 13 | extends SelectionHandler.SelectorBasedManager(udpConn.settings, udpConn.settings.NrOfSelectors) { 14 | 15 | def receive = workerForCommandHandler { 16 | case c: Connect ⇒ 17 | val commander = sender() // cache because we create a function that will run asyncly 18 | registry ⇒ Props(classOf[UdpConnection], udpConn, registry, commander, c) 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /akka-docs/build.sbt: -------------------------------------------------------------------------------- 1 | import akka.{ AkkaBuild, Dependencies, Formatting, SphinxDoc } 2 | import com.typesafe.sbt.SbtScalariform.ScalariformKeys 3 | import com.typesafe.sbt.SbtSite.site 4 | import com.typesafe.tools.mima.plugin.MimaKeys 5 | 6 | AkkaBuild.defaultSettings 7 | 8 | Formatting.docFormatSettings 9 | 10 | site.settings 11 | 12 | site.sphinxSupport() 13 | 14 | site.publishSite 15 | 16 | SphinxDoc.sphinxPreprocessing 17 | 18 | SphinxDoc.docsSettings 19 | 20 | libraryDependencies ++= Dependencies.docs 21 | 22 | publishArtifact in Compile := false 23 | 24 | unmanagedSourceDirectories in ScalariformKeys.format in Test <<= unmanagedSourceDirectories in Test 25 | 26 | MimaKeys.reportBinaryIssues := () // disable bin comp check 27 | -------------------------------------------------------------------------------- /akka-docs/rst/java/code/docs/actor/MyUntypedActor.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2009-2014 Typesafe Inc. 3 | */ 4 | package docs.actor; 5 | 6 | //#my-untyped-actor 7 | import akka.actor.UntypedActor; 8 | import akka.event.Logging; 9 | import akka.event.LoggingAdapter; 10 | 11 | public class MyUntypedActor extends UntypedActor { 12 | LoggingAdapter log = Logging.getLogger(getContext().system(), this); 13 | 14 | public void onReceive(Object message) throws Exception { 15 | if (message instanceof String) { 16 | log.info("Received String message: {}", message); 17 | getSender().tell(message, getSelf()); 18 | } else 19 | unhandled(message); 20 | } 21 | } 22 | //#my-untyped-actor 23 | 24 | -------------------------------------------------------------------------------- /akka-camel/src/test/java/akka/camel/SampleUntypedForwardingProducer.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2009-2014 Typesafe Inc. 3 | */ 4 | 5 | package akka.camel; 6 | 7 | import akka.camel.javaapi.UntypedProducerActor; 8 | /** 9 | * 10 | */ 11 | public class SampleUntypedForwardingProducer extends UntypedProducerActor { 12 | 13 | public String getEndpointUri() { 14 | return "direct:producer-test-1"; 15 | } 16 | 17 | @Override 18 | public void onRouteResponse(Object message) { 19 | CamelMessage msg = (CamelMessage)message; 20 | String body = msg.getBodyAs(String.class,getCamelContext()); 21 | getProducerTemplate().sendBody("direct:forward-test-1", body); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /akka-docs/rst/java/code/docs/camel/Consumer2.java: -------------------------------------------------------------------------------- 1 | package docs.camel; 2 | //#Consumer2 3 | import akka.camel.CamelMessage; 4 | import akka.camel.javaapi.UntypedConsumerActor; 5 | 6 | public class Consumer2 extends UntypedConsumerActor { 7 | public String getEndpointUri() { 8 | return "jetty:http://localhost:8877/camel/default"; 9 | } 10 | 11 | public void onReceive(Object message) { 12 | if (message instanceof CamelMessage) { 13 | CamelMessage camelMessage = (CamelMessage) message; 14 | String body = camelMessage.getBodyAs(String.class, getCamelContext()); 15 | getSender().tell(String.format("Received message: %s",body), getSelf()); 16 | } else 17 | unhandled(message); 18 | } 19 | } 20 | //#Consumer2 21 | -------------------------------------------------------------------------------- /akka-actor/src/main/java/akka/actor/AbstractActorRef.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2009-2014 Typesafe Inc. 3 | */ 4 | 5 | package akka.actor; 6 | 7 | import akka.util.Unsafe; 8 | 9 | final class AbstractActorRef { 10 | final static long cellOffset; 11 | final static long lookupOffset; 12 | 13 | static { 14 | try { 15 | cellOffset = Unsafe.instance.objectFieldOffset(RepointableActorRef.class.getDeclaredField("_cellDoNotCallMeDirectly")); 16 | lookupOffset = Unsafe.instance.objectFieldOffset(RepointableActorRef.class.getDeclaredField("_lookupDoNotCallMeDirectly")); 17 | } catch(Throwable t){ 18 | throw new ExceptionInInitializerError(t); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /akka-actor/src/main/scala/akka/serialization/SerializationExtension.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2009-2014 Typesafe Inc. 3 | */ 4 | package akka.serialization 5 | 6 | import akka.actor.{ ActorSystem, ExtensionId, ExtensionIdProvider, ExtendedActorSystem } 7 | 8 | /** 9 | * SerializationExtension is an Akka Extension to interact with the Serialization 10 | * that is built into Akka 11 | */ 12 | object SerializationExtension extends ExtensionId[Serialization] with ExtensionIdProvider { 13 | override def get(system: ActorSystem): Serialization = super.get(system) 14 | override def lookup = SerializationExtension 15 | override def createExtension(system: ExtendedActorSystem): Serialization = new Serialization(system) 16 | } 17 | -------------------------------------------------------------------------------- /akka-docs/rst/additional/code/docs/osgi/Activator.scala: -------------------------------------------------------------------------------- 1 | package docs.osgi 2 | 3 | case object SomeMessage 4 | 5 | class SomeActor extends akka.actor.Actor { 6 | def receive = { case SomeMessage => } 7 | } 8 | 9 | //#Activator 10 | import akka.actor.{ Props, ActorSystem } 11 | import org.osgi.framework.BundleContext 12 | import akka.osgi.ActorSystemActivator 13 | 14 | class Activator extends ActorSystemActivator { 15 | 16 | def configure(context: BundleContext, system: ActorSystem) { 17 | // optionally register the ActorSystem in the OSGi Service Registry 18 | registerService(context, system) 19 | 20 | val someActor = system.actorOf(Props[SomeActor], name = "someName") 21 | someActor ! SomeMessage 22 | } 23 | 24 | } 25 | //#Activator -------------------------------------------------------------------------------- /akka-remote-tests/src/test/scala/akka/remote/QuietReporter.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2009-2014 Typesafe Inc. 3 | */ 4 | 5 | package org.scalatest.extra 6 | 7 | import org.scalatest.tools.StandardOutReporter 8 | import org.scalatest.events._ 9 | import java.lang.Boolean.getBoolean 10 | 11 | class QuietReporter(inColor: Boolean, withDurations: Boolean = false) extends StandardOutReporter(withDurations, inColor, false, true, false, false, false, false, false) { 12 | 13 | def this() = this(!getBoolean("akka.test.nocolor"), !getBoolean("akka.test.nodurations")) 14 | 15 | override def apply(event: Event): Unit = event match { 16 | case _: RunStarting ⇒ () 17 | case _ ⇒ super.apply(event) 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /akka-testkit/src/test/scala/akka/testkit/ImplicitSenderSpec.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2013-2014 Typesafe Inc. 3 | */ 4 | package akka.testkit 5 | 6 | import org.scalatest.{ WordSpec, BeforeAndAfterAll } 7 | import org.scalatest.Matchers 8 | import akka.actor.ActorSystem 9 | 10 | @org.junit.runner.RunWith(classOf[org.scalatest.junit.JUnitRunner]) 11 | class ImplicitSenderSpec 12 | extends WordSpec with Matchers with BeforeAndAfterAll with TestKitBase with ImplicitSender { 13 | 14 | implicit lazy val system = ActorSystem("AkkaCustomSpec") 15 | 16 | override def afterAll = system.terminate 17 | 18 | "An ImplicitSender" should { 19 | "have testActor as its self" in { 20 | self should ===(testActor) 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /project/MiMa.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2009-2015 Typesafe Inc. 3 | */ 4 | package akka 5 | 6 | import sbt._ 7 | import sbt.Keys._ 8 | import com.typesafe.tools.mima.plugin.MimaKeys.binaryIssueFilters 9 | import com.typesafe.tools.mima.plugin.MimaKeys.previousArtifact 10 | import com.typesafe.tools.mima.plugin.MimaPlugin.mimaDefaultSettings 11 | 12 | object MiMa extends AutoPlugin { 13 | 14 | override def trigger = allRequirements 15 | 16 | override val projectSettings = mimaDefaultSettings ++ Seq( 17 | previousArtifact := None, 18 | binaryIssueFilters ++= mimaIgnoredProblems 19 | ) 20 | 21 | val mimaIgnoredProblems = { 22 | Seq( 23 | // add filters here, see release-2.3 branch 24 | ) 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /akka-docs/rst/images/circuit-breaker-states.dot: -------------------------------------------------------------------------------- 1 | digraph circuit_breaker { 2 | rankdir = "LR"; 3 | size = "6,5"; 4 | graph [ bgcolor = "transparent" ] 5 | node [ fontname = "Helvetica", 6 | fontsize = 14, 7 | shape = circle, 8 | color = white, 9 | style = filled ]; 10 | edge [ fontname = "Helvetica", fontsize = 12 ] 11 | Closed [ fillcolor = green2 ]; 12 | "Half-Open" [fillcolor = yellow2 ]; 13 | Open [ fillcolor = red2 ]; 14 | Closed -> Closed [ label = "Success" ]; 15 | "Half-Open" -> Open [ label = "Trip Breaker" ]; 16 | "Half-Open" -> Closed [ label = "Reset Breaker" ]; 17 | Closed -> Open [ label = "Trip Breaker" ]; 18 | Open -> Open [ label = "Calls failing fast" ]; 19 | Open -> "Half-Open" [ label = "Attempt Reset" ]; -------------------------------------------------------------------------------- /akka-actor/src/main/java/akka/dispatch/AbstractMailbox.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2009-2014 Typesafe Inc. 3 | */ 4 | 5 | package akka.dispatch; 6 | 7 | import akka.util.Unsafe; 8 | 9 | final class AbstractMailbox { 10 | final static long mailboxStatusOffset; 11 | final static long systemMessageOffset; 12 | 13 | static { 14 | try { 15 | mailboxStatusOffset = Unsafe.instance.objectFieldOffset(Mailbox.class.getDeclaredField("_statusDoNotCallMeDirectly")); 16 | systemMessageOffset = Unsafe.instance.objectFieldOffset(Mailbox.class.getDeclaredField("_systemQueueDoNotCallMeDirectly")); 17 | } catch(Throwable t){ 18 | throw new ExceptionInInitializerError(t); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /akka-kernel/src/main/dist/bin/akka: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | declare quiet="false" 4 | 5 | while true; do 6 | case "$1" in 7 | -q | --quiet ) quiet="true"; shift ;; 8 | * ) break ;; 9 | esac 10 | done 11 | 12 | [[ "$@" ]] || { 13 | echo "No boot classes specified" 14 | echo "Usage: bin/akka org.somewhere.BootClass" 15 | exit 1 16 | } 17 | 18 | declare AKKA_HOME="$(cd "$(cd "$(dirname "$0")"; pwd -P)"/..; pwd)" 19 | 20 | [ -n "$JAVA_OPTS" ] || JAVA_OPTS="-Xms1024M -Xmx1024M -Xss1M -XX:MaxPermSize=256M -XX:+UseParallelGC" 21 | 22 | [ -n "$AKKA_CLASSPATH" ] || AKKA_CLASSPATH="$AKKA_HOME/lib/*:$AKKA_HOME/config:$AKKA_HOME/lib/akka/*" 23 | 24 | java $JAVA_OPTS -cp "$AKKA_CLASSPATH" -Dakka.home="$AKKA_HOME" -Dakka.kernel.quiet=$quiet akka.kernel.Main "$@" 25 | -------------------------------------------------------------------------------- /akka-osgi/src/test/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | %date{ISO8601} %-5level %logger %X{akkaSource} %X{sourceThread} - %msg%n 8 | 9 | 10 | 11 | 12 | target/akka-osgi.log 13 | true 14 | 15 | %date{ISO8601} %-5level %logger %X{akkaSource} %X{sourceThread} - %msg%n 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-remote-scala/src/main/scala/sample/remote/calculator/CreationActor.scala: -------------------------------------------------------------------------------- 1 | package sample.remote.calculator 2 | 3 | import akka.actor.Actor 4 | import akka.actor.ActorRef 5 | import akka.actor.Props 6 | 7 | class CreationActor extends Actor { 8 | 9 | def receive = { 10 | case op: MathOp => 11 | val calculator = context.actorOf(Props[CalculatorActor]) 12 | calculator ! op 13 | case result: MathResult => result match { 14 | case MultiplicationResult(n1, n2, r) => 15 | printf("Mul result: %d * %d = %d\n", n1, n2, r) 16 | context.stop(sender()) 17 | case DivisionResult(n1, n2, r) => 18 | printf("Div result: %.0f / %d = %.2f\n", n1, n2, r) 19 | context.stop(sender()) 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /akka-actor/src/main/java/akka/pattern/AbstractPromiseActorRef.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2009-2014 Typesafe Inc. 3 | */ 4 | 5 | package akka.pattern; 6 | 7 | import akka.util.Unsafe; 8 | 9 | final class AbstractPromiseActorRef { 10 | final static long stateOffset; 11 | final static long watchedByOffset; 12 | 13 | static { 14 | try { 15 | stateOffset = Unsafe.instance.objectFieldOffset(PromiseActorRef.class.getDeclaredField("_stateDoNotCallMeDirectly")); 16 | watchedByOffset = Unsafe.instance.objectFieldOffset(PromiseActorRef.class.getDeclaredField("_watchedByDoNotCallMeDirectly")); 17 | } catch(Throwable t){ 18 | throw new ExceptionInInitializerError(t); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /akka-persistence-tck/src/test/scala/akka/persistence/journal/leveldb/LeveldbJournalNativePerfSpec.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2014 Typesafe Inc. 3 | */ 4 | package akka.persistence.journal.leveldb 5 | 6 | import akka.persistence.journal.{ JournalPerfSpec, JournalSpec } 7 | import akka.persistence.{ PersistenceSpec, PluginCleanup } 8 | import org.scalatest.DoNotDiscover 9 | 10 | @DoNotDiscover // because only checking that compilation is OK with JournalPerfSpec 11 | class LeveldbJournalNativePerfSpec extends JournalSpec with JournalPerfSpec with PluginCleanup { 12 | lazy val config = PersistenceSpec.config( 13 | "leveldb", 14 | "LeveldbJournalNativePerfSpec", 15 | extraConfig = Some("akka.persistence.journal.leveldb.native = on")) 16 | } 17 | -------------------------------------------------------------------------------- /project/RootSettings.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2009-2014 Typesafe Inc. 3 | */ 4 | package akka 5 | 6 | import sbt._ 7 | import sbt.Keys._ 8 | import akka.ValidatePullRequest.validatePullRequest 9 | import sbtunidoc.Plugin.UnidocKeys.unidoc 10 | import com.typesafe.sbt.site.SphinxSupport 11 | import com.typesafe.sbt.site.SphinxSupport.Sphinx 12 | 13 | object RootSettings extends AutoPlugin { 14 | 15 | lazy val docs = ProjectRef(file("."), "akka-docs") 16 | 17 | // settings for root project goes here 18 | override val projectSettings = Seq( 19 | validatePullRequest <<= validatePullRequest.dependsOn(unidoc in Compile), 20 | validatePullRequest <<= validatePullRequest.dependsOn(SphinxSupport.generate in Sphinx in docs) 21 | ) 22 | } 23 | -------------------------------------------------------------------------------- /akka-persistence/src/main/scala/akka/persistence/serialization/package.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2009-2014 Typesafe Inc. 3 | */ 4 | 5 | package akka.persistence 6 | 7 | import java.io.{ ByteArrayOutputStream, InputStream } 8 | 9 | package object serialization { 10 | /** 11 | * Converts an input stream to a byte array. 12 | */ 13 | def streamToBytes(inputStream: InputStream): Array[Byte] = { 14 | val len = 16384 15 | val buf = Array.ofDim[Byte](len) 16 | val out = new ByteArrayOutputStream 17 | 18 | @scala.annotation.tailrec 19 | def copy(): Array[Byte] = { 20 | val n = inputStream.read(buf, 0, len) 21 | if (n != -1) { out.write(buf, 0, n); copy() } else out.toByteArray 22 | } 23 | 24 | copy() 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /akka-actor/src/main/scala/akka/util/BoxedType.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2009-2014 Typesafe Inc. 3 | */ 4 | package akka.util 5 | 6 | object BoxedType { 7 | import java.{ lang ⇒ jl } 8 | 9 | private val toBoxed = Map[Class[_], Class[_]]( 10 | classOf[Boolean] -> classOf[jl.Boolean], 11 | classOf[Byte] -> classOf[jl.Byte], 12 | classOf[Char] -> classOf[jl.Character], 13 | classOf[Short] -> classOf[jl.Short], 14 | classOf[Int] -> classOf[jl.Integer], 15 | classOf[Long] -> classOf[jl.Long], 16 | classOf[Float] -> classOf[jl.Float], 17 | classOf[Double] -> classOf[jl.Double], 18 | classOf[Unit] -> classOf[scala.runtime.BoxedUnit]) 19 | 20 | final def apply(c: Class[_]): Class[_] = if (c.isPrimitive) toBoxed(c) else c 21 | } 22 | -------------------------------------------------------------------------------- /akka-docs/rst/java/code/docs/camel/CustomRouteTestBase.java: -------------------------------------------------------------------------------- 1 | package docs.camel; 2 | 3 | import akka.actor.ActorRef; 4 | import akka.actor.ActorSystem; 5 | import akka.actor.Props; 6 | import akka.camel.Camel; 7 | import akka.camel.CamelExtension; 8 | import akka.testkit.JavaTestKit; 9 | 10 | public class CustomRouteTestBase { 11 | public void customRoute() throws Exception{ 12 | //#CustomRoute 13 | ActorSystem system = ActorSystem.create("some-system"); 14 | Camel camel = CamelExtension.get(system); 15 | ActorRef responder = system.actorOf(Props.create(Responder.class), "TestResponder"); 16 | camel.context().addRoutes(new CustomRouteBuilder(responder)); 17 | //#CustomRoute 18 | system.stop(responder); 19 | JavaTestKit.shutdownActorSystem(system); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /akka-camel/src/test/java/akka/camel/SampleUntypedConsumer.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2009-2014 Typesafe Inc. 3 | */ 4 | 5 | package akka.camel; 6 | 7 | import akka.camel.javaapi.UntypedConsumerActor; 8 | 9 | /** 10 | * 11 | */ 12 | public class SampleUntypedConsumer extends UntypedConsumerActor { 13 | 14 | public String getEndpointUri() { 15 | return "direct:test-untyped-consumer"; 16 | } 17 | 18 | public void onReceive(Object message) { 19 | CamelMessage msg = (CamelMessage)message; 20 | String body = msg.getBodyAs(String.class, getCamelContext()); 21 | String header = msg.getHeaderAs("test", String.class,getCamelContext()); 22 | sender().tell(String.format("%s %s", body, header), getSelf()); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /akka-testkit/src/test/scala/akka/testkit/DefaultTimeoutSpec.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2013-2014 Typesafe Inc. 3 | */ 4 | package akka.testkit 5 | 6 | import org.scalatest.{ WordSpec, BeforeAndAfterAll } 7 | import org.scalatest.Matchers 8 | import akka.actor.ActorSystem 9 | 10 | @org.junit.runner.RunWith(classOf[org.scalatest.junit.JUnitRunner]) 11 | class DefaultTimeoutSpec 12 | extends WordSpec with Matchers with BeforeAndAfterAll with TestKitBase with DefaultTimeout { 13 | 14 | implicit lazy val system = ActorSystem("AkkaCustomSpec") 15 | 16 | override def afterAll = system.terminate 17 | 18 | "A spec with DefaultTimeout" should { 19 | "use timeout from settings" in { 20 | timeout should ===(testKitSettings.DefaultTimeout) 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /akka-camel/src/main/scala/akka/camel/CamelSupport.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2009-2014 Typesafe Inc. 3 | */ 4 | package akka.camel 5 | 6 | import akka.actor.Actor 7 | import com.typesafe.config.Config 8 | import scala.concurrent.duration.Duration 9 | import java.util.concurrent.TimeUnit._ 10 | 11 | private[camel] trait CamelSupport { this: Actor ⇒ 12 | 13 | /** 14 | * INTERNAL API 15 | * Returns a [[akka.camel.Camel]] trait which provides access to the CamelExtension. 16 | */ 17 | protected val camel = CamelExtension(context.system) 18 | 19 | /** 20 | * Returns the CamelContext. 21 | * The camelContext is defined implicit for simplifying the use of CamelMessage from the Scala API. 22 | */ 23 | protected implicit def camelContext = camel.context 24 | 25 | } 26 | -------------------------------------------------------------------------------- /akka-camel/src/test/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | %date{ISO8601} %-5level %logger %X{akkaSource} %X{sourceThread} - %msg%n 8 | 9 | 10 | 11 | 12 | target/akka-camel.log 13 | true 14 | 15 | %date{ISO8601} %-5level %logger %X{akkaSource} %X{sourceThread} - %msg%n 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /project/ValidatePullRequest.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2009-2015 Typesafe Inc. 3 | */ 4 | package akka 5 | 6 | import sbt._ 7 | import sbt.Keys._ 8 | import com.typesafe.tools.mima.plugin.MimaKeys.reportBinaryIssues 9 | 10 | object ValidatePullRequest extends AutoPlugin { 11 | 12 | val validatePullRequest = taskKey[Unit]("Additional tasks for pull request validation") 13 | 14 | override def trigger = allRequirements 15 | 16 | override lazy val projectSettings = Seq( 17 | validatePullRequest := (), 18 | validatePullRequest <<= validatePullRequest.dependsOn(test in Test), 19 | 20 | // add reportBinaryIssues to validatePullRequest on minor version maintenance branch 21 | validatePullRequest <<= validatePullRequest.dependsOn(reportBinaryIssues) 22 | ) 23 | } 24 | -------------------------------------------------------------------------------- /akka-docs/rst/java/code/docs/actor/ImmutableMessage.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2009-2014 Typesafe Inc. 3 | */ 4 | package docs.actor; 5 | 6 | import java.util.ArrayList; 7 | import java.util.Collections; 8 | import java.util.List; 9 | 10 | //#immutable-message 11 | public class ImmutableMessage { 12 | private final int sequenceNumber; 13 | private final List values; 14 | 15 | public ImmutableMessage(int sequenceNumber, List values) { 16 | this.sequenceNumber = sequenceNumber; 17 | this.values = Collections.unmodifiableList(new ArrayList(values)); 18 | } 19 | 20 | public int getSequenceNumber() { 21 | return sequenceNumber; 22 | } 23 | 24 | public List getValues() { 25 | return values; 26 | } 27 | } 28 | //#immutable-message 29 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-cluster-java/src/main/java/sample/cluster/stats/StatsWorker.java: -------------------------------------------------------------------------------- 1 | package sample.cluster.stats; 2 | 3 | import java.util.HashMap; 4 | import java.util.Map; 5 | 6 | import akka.actor.UntypedActor; 7 | 8 | //#worker 9 | public class StatsWorker extends UntypedActor { 10 | 11 | Map cache = new HashMap(); 12 | 13 | @Override 14 | public void onReceive(Object message) { 15 | if (message instanceof String) { 16 | String word = (String) message; 17 | Integer length = cache.get(word); 18 | if (length == null) { 19 | length = word.length(); 20 | cache.put(word, length); 21 | } 22 | getSender().tell(length, getSelf()); 23 | 24 | } else { 25 | unhandled(message); 26 | } 27 | } 28 | 29 | } 30 | //#worker -------------------------------------------------------------------------------- /akka-samples/akka-sample-main-java/src/main/java/sample/hello/HelloWorld.java: -------------------------------------------------------------------------------- 1 | package sample.hello; 2 | 3 | import akka.actor.Props; 4 | import akka.actor.UntypedActor; 5 | import akka.actor.ActorRef; 6 | 7 | public class HelloWorld extends UntypedActor { 8 | 9 | @Override 10 | public void preStart() { 11 | // create the greeter actor 12 | final ActorRef greeter = getContext().actorOf(Props.create(Greeter.class), "greeter"); 13 | // tell it to perform the greeting 14 | greeter.tell(Greeter.Msg.GREET, getSelf()); 15 | } 16 | 17 | @Override 18 | public void onReceive(Object msg) { 19 | if (msg == Greeter.Msg.DONE) { 20 | // when the greeter is done, stop this actor and with it the application 21 | getContext().stop(getSelf()); 22 | } else 23 | unhandled(msg); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /akka-actor/src/main/java/akka/dispatch/AbstractMessageDispatcher.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2009-2014 Typesafe Inc. 3 | */ 4 | 5 | package akka.dispatch; 6 | 7 | import akka.util.Unsafe; 8 | 9 | abstract class AbstractMessageDispatcher { 10 | final static long shutdownScheduleOffset; 11 | final static long inhabitantsOffset; 12 | 13 | static { 14 | try { 15 | shutdownScheduleOffset = Unsafe.instance.objectFieldOffset(MessageDispatcher.class.getDeclaredField("_shutdownScheduleDoNotCallMeDirectly")); 16 | inhabitantsOffset = Unsafe.instance.objectFieldOffset(MessageDispatcher.class.getDeclaredField("_inhabitantsDoNotCallMeDirectly")); 17 | } catch(Throwable t){ 18 | throw new ExceptionInInitializerError(t); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /akka-docs/rst/additional/books.rst: -------------------------------------------------------------------------------- 1 | Books 2 | ===== 3 | 4 | * `Akka in Action `_, by Raymond Roestenburg and Rob Bakker, Manning Publications Co., ISBN: 9781617291012, est fall 2013 5 | * `Developing an Akka Edge `_, by Thomas Lockney and Raymond Tay, Bleeding Edge Press, ISBN: 9781939902054, April 2014 6 | * `Effective Akka `_, by Jamie Allen, O'Reilly Media, ISBN: 1449360076, August 2013 7 | * `Akka Concurrency `_, by Derek Wyatt, artima developer, ISBN: 0981531660, May 2013 8 | * `Akka Essentials `_, by Munish K. Gupta, PACKT Publishing, ISBN: 1849518289, October 2012 9 | -------------------------------------------------------------------------------- /akka-docs/rst/java/code/docs/camel/Consumer1.java: -------------------------------------------------------------------------------- 1 | package docs.camel; 2 | //#Consumer1 3 | import akka.camel.CamelMessage; 4 | import akka.camel.javaapi.UntypedConsumerActor; 5 | import akka.event.Logging; 6 | import akka.event.LoggingAdapter; 7 | 8 | public class Consumer1 extends UntypedConsumerActor { 9 | LoggingAdapter log = Logging.getLogger(getContext().system(), this); 10 | 11 | public String getEndpointUri() { 12 | return "file:data/input/actor"; 13 | } 14 | 15 | public void onReceive(Object message) { 16 | if (message instanceof CamelMessage) { 17 | CamelMessage camelMessage = (CamelMessage) message; 18 | String body = camelMessage.getBodyAs(String.class, getCamelContext()); 19 | log.info("Received message: {}", body); 20 | } else 21 | unhandled(message); 22 | } 23 | } 24 | //#Consumer1 25 | -------------------------------------------------------------------------------- /akka-remote/src/main/protobuf/ContainerFormats.proto: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2009-2014 Typesafe Inc. 3 | */ 4 | 5 | option java_package = "akka.remote"; 6 | option optimize_for = SPEED; 7 | 8 | /****************************************** 9 | ActorSelection related formats 10 | *******************************************/ 11 | 12 | message SelectionEnvelope { 13 | required bytes enclosedMessage = 1; 14 | required int32 serializerId = 2; 15 | repeated Selection pattern = 3; 16 | optional bytes messageManifest = 4; 17 | optional bool wildcardFanOut = 5; // optional for pre 2.3.4 compatibility 18 | } 19 | 20 | enum PatternType { 21 | PARENT = 0; 22 | CHILD_NAME = 1; 23 | CHILD_PATTERN = 2; 24 | } 25 | 26 | message Selection { 27 | required PatternType type = 1; 28 | optional string matcher = 2; 29 | } -------------------------------------------------------------------------------- /akka-samples/akka-sample-camel-java/src/main/java/sample/camel/route/CustomRouteSample.java: -------------------------------------------------------------------------------- 1 | package sample.camel.route; 2 | 3 | import akka.actor.*; 4 | import akka.camel.CamelExtension; 5 | 6 | public class CustomRouteSample { 7 | @SuppressWarnings("unused") 8 | public static void main(String[] args) { 9 | try { 10 | ActorSystem system = ActorSystem.create("some-system"); 11 | final ActorRef producer = system.actorOf(Props.create(RouteProducer.class)); 12 | final ActorRef mediator = system.actorOf(Props.create(RouteTransformer.class, producer)); 13 | final ActorRef consumer = system.actorOf(Props.create(RouteConsumer.class, mediator)); 14 | CamelExtension.get(system).context().addRoutes(new CustomRouteBuilder()); 15 | } catch (Exception e) { 16 | e.printStackTrace(); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-remote-scala/src/main/scala/sample/remote/calculator/CalculatorActor.scala: -------------------------------------------------------------------------------- 1 | package sample.remote.calculator 2 | 3 | import akka.actor.Props 4 | import akka.actor.Actor 5 | 6 | class CalculatorActor extends Actor { 7 | def receive = { 8 | case Add(n1, n2) => 9 | println("Calculating %d + %d".format(n1, n2)) 10 | sender() ! AddResult(n1, n2, n1 + n2) 11 | case Subtract(n1, n2) => 12 | println("Calculating %d - %d".format(n1, n2)) 13 | sender() ! SubtractResult(n1, n2, n1 - n2) 14 | case Multiply(n1, n2) => 15 | println("Calculating %d * %d".format(n1, n2)) 16 | sender() ! MultiplicationResult(n1, n2, n1 * n2) 17 | case Divide(n1, n2) => 18 | println("Calculating %.0f / %d".format(n1, n2)) 19 | sender() ! DivisionResult(n1, n2, n1 / n2) 20 | } 21 | } 22 | 23 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-remote-scala/src/main/scala/sample/remote/calculator/MathOp.scala: -------------------------------------------------------------------------------- 1 | package sample.remote.calculator 2 | 3 | trait MathOp 4 | 5 | final case class Add(nbr1: Int, nbr2: Int) extends MathOp 6 | 7 | final case class Subtract(nbr1: Int, nbr2: Int) extends MathOp 8 | 9 | final case class Multiply(nbr1: Int, nbr2: Int) extends MathOp 10 | 11 | final case class Divide(nbr1: Double, nbr2: Int) extends MathOp 12 | 13 | trait MathResult 14 | 15 | final case class AddResult(nbr: Int, nbr2: Int, result: Int) extends MathResult 16 | 17 | final case class SubtractResult(nbr1: Int, nbr2: Int, result: Int) extends MathResult 18 | 19 | final case class MultiplicationResult(nbr1: Int, nbr2: Int, result: Int) extends MathResult 20 | 21 | final case class DivisionResult(nbr1: Double, nbr2: Int, result: Double) extends MathResult 22 | 23 | -------------------------------------------------------------------------------- /akka-remote-tests/build.sbt: -------------------------------------------------------------------------------- 1 | import akka.{ AkkaBuild, Dependencies, Formatting, MultiNode, Unidoc } 2 | import com.typesafe.sbt.SbtMultiJvm.MultiJvmKeys._ 3 | import com.typesafe.tools.mima.plugin.MimaKeys 4 | 5 | AkkaBuild.defaultSettings 6 | 7 | Formatting.formatSettings 8 | 9 | Unidoc.scaladocSettings 10 | 11 | MultiNode.multiJvmSettings 12 | 13 | Dependencies.remoteTests 14 | 15 | // disable parallel tests 16 | parallelExecution in Test := false 17 | 18 | extraOptions in MultiJvm <<= (sourceDirectory in MultiJvm) { src => 19 | (name: String) => (src ** (name + ".conf")).get.headOption.map("-Dakka.config=" + _.absolutePath).toSeq 20 | } 21 | 22 | scalatestOptions in MultiJvm := MultiNode.defaultMultiJvmScalatestOptions.value 23 | 24 | publishArtifact in Compile := false 25 | 26 | MimaKeys.reportBinaryIssues := () // disable bin comp check 27 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-main-scala/src/main/scala/sample/hello/Main2.scala: -------------------------------------------------------------------------------- 1 | package sample.hello 2 | 3 | import akka.actor.ActorSystem 4 | import akka.actor.Props 5 | import akka.actor.ActorRef 6 | import akka.actor.Actor 7 | import akka.actor.ActorLogging 8 | import akka.actor.Terminated 9 | 10 | object Main2 { 11 | 12 | def main(args: Array[String]): Unit = { 13 | val system = ActorSystem("Hello") 14 | val a = system.actorOf(Props[HelloWorld], "helloWorld") 15 | system.actorOf(Props(classOf[Terminator], a), "terminator") 16 | } 17 | 18 | class Terminator(ref: ActorRef) extends Actor with ActorLogging { 19 | context watch ref 20 | def receive = { 21 | case Terminated(_) => 22 | log.info("{} has terminated, shutting down system", ref.path) 23 | context.system.terminate() 24 | } 25 | } 26 | 27 | } -------------------------------------------------------------------------------- /README.textile: -------------------------------------------------------------------------------- 1 | h1. Akka 2 | 3 | We believe that writing correct concurrent, fault-tolerant and scalable applications is too hard. Most of the time it's because we are using the wrong tools and the wrong level of abstraction. 4 | 5 | Akka is here to change that. 6 | 7 | Using the Actor Model we raise the abstraction level and provide a better platform to build correct concurrent and scalable applications. 8 | 9 | For fault-tolerance we adopt the "Let it crash" model which the telecom industry has used with great success to build applications that self-heal and systems that never stop. 10 | 11 | Actors also provide the abstraction for transparent distribution and the basis for truly scalable and fault-tolerant applications. 12 | 13 | Akka is Open Source and available under the Apache 2 License. 14 | 15 | Learn more at "http://akka.io":http://akka.io. 16 | -------------------------------------------------------------------------------- /akka-docs/rst/common/code/docs/duration/Java.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2013-2014 Typesafe Inc. 3 | */ 4 | 5 | package docs.duration; 6 | 7 | //#import 8 | import scala.concurrent.duration.Duration; 9 | import scala.concurrent.duration.Deadline; 10 | //#import 11 | 12 | class Java { 13 | public void demo() { 14 | //#dsl 15 | final Duration fivesec = Duration.create(5, "seconds"); 16 | final Duration threemillis = Duration.create("3 millis"); 17 | final Duration diff = fivesec.minus(threemillis); 18 | assert diff.lt(fivesec); 19 | assert Duration.Zero().lt(Duration.Inf()); 20 | //#dsl 21 | //#deadline 22 | final Deadline deadline = Duration.create(10, "seconds").fromNow(); 23 | final Duration rest = deadline.timeLeft(); 24 | //#deadline 25 | rest.toString(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /akka-docs/rst/java/code/docs/camel/MyEndpoint.java: -------------------------------------------------------------------------------- 1 | package docs.camel; 2 | 3 | //#Consumer-mina 4 | import akka.camel.CamelMessage; 5 | import akka.camel.javaapi.UntypedConsumerActor; 6 | 7 | public class MyEndpoint extends UntypedConsumerActor{ 8 | private String uri; 9 | 10 | public String getEndpointUri() { 11 | return uri; 12 | } 13 | 14 | public void onReceive(Object message) throws Exception { 15 | if (message instanceof CamelMessage) { 16 | /* ... */ 17 | } else 18 | unhandled(message); 19 | } 20 | 21 | // Extra constructor to change the default uri, 22 | // for instance to "jetty:http://localhost:8877/example" 23 | public MyEndpoint(String uri) { 24 | this.uri = uri; 25 | } 26 | 27 | public MyEndpoint() { 28 | this.uri = "mina2:tcp://localhost:6200?textline=true"; 29 | } 30 | } 31 | //#Consumer-mina -------------------------------------------------------------------------------- /akka-docs/rst/java/code/docs/camel/Responder.java: -------------------------------------------------------------------------------- 1 | package docs.camel; 2 | //#CustomRoute 3 | import akka.actor.UntypedActor; 4 | import akka.camel.CamelMessage; 5 | import akka.dispatch.Mapper; 6 | import akka.japi.Function; 7 | 8 | public class Responder extends UntypedActor{ 9 | 10 | public void onReceive(Object message) { 11 | if (message instanceof CamelMessage) { 12 | CamelMessage camelMessage = (CamelMessage) message; 13 | getSender().tell(createResponse(camelMessage), getSelf()); 14 | } else 15 | unhandled(message); 16 | } 17 | 18 | private CamelMessage createResponse(CamelMessage msg) { 19 | return msg.mapBody(new Mapper() { 20 | @Override 21 | public String apply(String body) { 22 | return String.format("received %s", body); 23 | } 24 | }); 25 | } 26 | } 27 | //#CustomRoute -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | This software is licensed under the Apache 2 license, quoted below. 2 | 3 | Copyright 2009-2014 Typesafe Inc. [http://www.typesafe.com] 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); you may not 6 | use this file except in compliance with the License. You may obtain a copy of 7 | the License at 8 | 9 | [http://www.apache.org/licenses/LICENSE-2.0] 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 | License for the specific language governing permissions and limitations under 15 | the License. 16 | 17 | --------------- 18 | 19 | Licenses for dependency projects can be found here: 20 | [http://akka.io/docs/akka/snapshot/project/licenses.html] 21 | -------------------------------------------------------------------------------- /akka-persistence/src/main/scala/akka/persistence/journal/WriteJournalBase.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2014 Typesafe Inc. 3 | */ 4 | 5 | package akka.persistence.journal 6 | 7 | import akka.persistence.{ PersistentRepr, PersistentEnvelope } 8 | import akka.actor.Actor 9 | import scala.collection.immutable 10 | 11 | private[akka] trait WriteJournalBase { 12 | this: Actor ⇒ 13 | 14 | protected def preparePersistentBatch(rb: immutable.Seq[PersistentEnvelope]): immutable.Seq[PersistentRepr] = 15 | rb.filter(persistentPrepareWrite).asInstanceOf[immutable.Seq[PersistentRepr]] // filter instead of flatMap to avoid Some allocations 16 | 17 | private def persistentPrepareWrite(r: PersistentEnvelope): Boolean = r match { 18 | case p: PersistentRepr ⇒ 19 | p.prepareWrite(); true 20 | case _ ⇒ 21 | false 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /akka-actor/src/main/scala/akka/japi/pf/CaseStatements.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2009-2014 Typesafe Inc. 3 | */ 4 | 5 | package akka.japi.pf 6 | 7 | import FI.{ UnitApply, Apply, Predicate } 8 | 9 | private[pf] object CaseStatement { 10 | def empty[F, T](): PartialFunction[F, T] = PartialFunction.empty 11 | } 12 | 13 | private[pf] class CaseStatement[-F, +P, T](predicate: Predicate, apply: Apply[P, T]) 14 | extends PartialFunction[F, T] { 15 | 16 | override def isDefinedAt(o: F) = predicate.defined(o) 17 | 18 | override def apply(o: F) = apply.apply(o.asInstanceOf[P]) 19 | } 20 | 21 | private[pf] class UnitCaseStatement[F, P](predicate: Predicate, apply: UnitApply[P]) 22 | extends PartialFunction[F, Unit] { 23 | 24 | override def isDefinedAt(o: F) = predicate.defined(o) 25 | 26 | override def apply(o: F) = apply.apply(o.asInstanceOf[P]) 27 | } -------------------------------------------------------------------------------- /akka-cluster/build.sbt: -------------------------------------------------------------------------------- 1 | import akka.{ AkkaBuild, Dependencies, Formatting, OSGi, MultiNode, Unidoc } 2 | import com.typesafe.sbt.SbtMultiJvm.MultiJvmKeys._ 3 | import com.typesafe.tools.mima.plugin.MimaKeys 4 | 5 | AkkaBuild.defaultSettings 6 | 7 | Formatting.formatSettings 8 | 9 | Unidoc.scaladocSettings 10 | 11 | Unidoc.javadocSettings 12 | 13 | MultiNode.multiJvmSettings 14 | 15 | OSGi.cluster 16 | 17 | libraryDependencies ++= Dependencies.cluster 18 | 19 | MimaKeys.previousArtifact := akkaPreviousArtifact("akka-cluster").value 20 | 21 | // disable parallel tests 22 | parallelExecution in Test := false 23 | 24 | extraOptions in MultiJvm <<= (sourceDirectory in MultiJvm) { src => 25 | (name: String) => (src ** (name + ".conf")).get.headOption.map("-Dakka.config=" + _.absolutePath).toSeq 26 | } 27 | 28 | scalatestOptions in MultiJvm := MultiNode.defaultMultiJvmScalatestOptions.value 29 | -------------------------------------------------------------------------------- /akka-docs/rst/java/code/docs/camel/Consumer3.java: -------------------------------------------------------------------------------- 1 | package docs.camel; 2 | //#Consumer3 3 | import akka.actor.Status; 4 | import akka.camel.Ack; 5 | import akka.camel.CamelMessage; 6 | import akka.camel.javaapi.UntypedConsumerActor; 7 | 8 | public class Consumer3 extends UntypedConsumerActor{ 9 | 10 | @Override 11 | public boolean autoAck() { 12 | return false; 13 | } 14 | 15 | public String getEndpointUri() { 16 | return "jms:queue:test"; 17 | } 18 | 19 | public void onReceive(Object message) { 20 | if (message instanceof CamelMessage) { 21 | getSender().tell(Ack.getInstance(), getSelf()); 22 | // on success 23 | // .. 24 | Exception someException = new Exception("e1"); 25 | // on failure 26 | getSender().tell(new Status.Failure(someException), getSelf()); 27 | } else 28 | unhandled(message); 29 | } 30 | } 31 | //#Consumer3 32 | -------------------------------------------------------------------------------- /akka-persistence/src/main/scala/akka/persistence/journal/japi/SyncWriteJournal.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2009-2014 Typesafe Inc. 3 | */ 4 | 5 | package akka.persistence.journal.japi 6 | 7 | import scala.collection.immutable 8 | import scala.collection.JavaConverters._ 9 | 10 | import akka.persistence._ 11 | import akka.persistence.journal.{ SyncWriteJournal ⇒ SSyncWriteJournal } 12 | 13 | /** 14 | * Java API: abstract journal, optimized for synchronous writes. 15 | */ 16 | abstract class SyncWriteJournal extends AsyncRecovery with SSyncWriteJournal with SyncWritePlugin { 17 | final def writeMessages(messages: immutable.Seq[PersistentRepr]) = 18 | doWriteMessages(messages.asJava) 19 | 20 | final def deleteMessagesTo(persistenceId: String, toSequenceNr: Long, permanent: Boolean) = 21 | doDeleteMessagesTo(persistenceId, toSequenceNr, permanent) 22 | } 23 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-main-java-lambda/src/main/java/sample/hello/HelloWorld.java: -------------------------------------------------------------------------------- 1 | package sample.hello; 2 | 3 | import akka.actor.AbstractActor; 4 | import akka.actor.Props; 5 | import akka.actor.ActorRef; 6 | import akka.japi.pf.ReceiveBuilder; 7 | import static sample.hello.Greeter.Msg; 8 | 9 | public class HelloWorld extends AbstractActor { 10 | 11 | public HelloWorld() { 12 | receive(ReceiveBuilder. 13 | matchEquals(Msg.DONE, m -> { 14 | // when the greeter is done, stop this actor and with it the application 15 | context().stop(self()); 16 | }).build()); 17 | } 18 | 19 | @Override 20 | public void preStart() { 21 | // create the greeter actor 22 | final ActorRef greeter = getContext().actorOf(Props.create(Greeter.class), "greeter"); 23 | // tell it to perform the greeting 24 | greeter.tell(Greeter.Msg.GREET, self()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /akka-testkit/src/test/scala/akka/testkit/metrics/AveragingGauge.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2009-2014 Typesafe Inc. 3 | */ 4 | package akka.testkit.metrics 5 | 6 | import com.codahale.metrics.Gauge 7 | 8 | /** 9 | * Gauge which exposes the Arithmetic Mean of values given to it. 10 | * 11 | * Can be used to expose average of a series of values to [[com.codahale.metrics.ScheduledReporter]]s. 12 | */ 13 | class AveragingGauge extends Gauge[Double] { 14 | 15 | private val sum = new LongAdder 16 | private val count = new LongAdder 17 | 18 | def add(n: Long) { 19 | count.increment() 20 | sum add n 21 | } 22 | 23 | def add(ns: Seq[Long]) { 24 | // takes a mutable Seq on order to allow use with Array's 25 | count add ns.length 26 | sum add ns.sum 27 | } 28 | 29 | override def getValue: Double = sum.sum().toDouble / count.sum() 30 | } 31 | -------------------------------------------------------------------------------- /akka-remote/src/test/scala/akka/remote/serialization/ProtobufSerializerSpec.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2009-2014 Typesafe Inc. 3 | */ 4 | 5 | package akka.remote.serialization 6 | 7 | import akka.serialization.SerializationExtension 8 | import akka.testkit.AkkaSpec 9 | import akka.remote.WireFormats.SerializedMessage 10 | import akka.remote.ProtobufProtocol.MyMessage 11 | 12 | @org.junit.runner.RunWith(classOf[org.scalatest.junit.JUnitRunner]) 13 | class ProtobufSerializerSpec extends AkkaSpec { 14 | 15 | val ser = SerializationExtension(system) 16 | 17 | "Serialization" must { 18 | 19 | "resolve protobuf serializer" in { 20 | ser.serializerFor(classOf[SerializedMessage]).getClass should ===(classOf[ProtobufSerializer]) 21 | ser.serializerFor(classOf[MyMessage]).getClass should ===(classOf[ProtobufSerializer]) 22 | } 23 | 24 | } 25 | } 26 | 27 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-main-java/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 4.0.0 7 | akka-sample-main-java 8 | com.typesafe.akka.samples 9 | Akka Main in Java 10 | 1.0 11 | 12 | 13 | UTF-8 14 | 15 | 16 | 17 | 18 | com.typesafe.akka 19 | akka-actor_2.11 20 | 2.4-SNAPSHOT 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /akka-docs/rst/project/sponsors.rst: -------------------------------------------------------------------------------- 1 | .. _sponsors: 2 | 3 | Sponsors 4 | ======== 5 | 6 | Typesafe 7 | -------- 8 | 9 | Typesafe is the company behind the Akka Project, Scala Programming Language, 10 | Play Web Framework, Scala IDE, Simple Build Tool and many other open source 11 | projects. It also provides the Typesafe Stack, a full-featured development 12 | stack consisting of AKka, Play and Scala. Learn more at 13 | `typesafe.com `_. 14 | 15 | YourKit 16 | ------- 17 | 18 | YourKit is kindly supporting open source projects with its full-featured Java Profiler. 19 | 20 | YourKit, LLC is the creator of innovative and intelligent tools for profiling Java 21 | and .NET applications. Take a look at YourKit’s leading software products: 22 | `YourKit Java Profiler `_ 23 | and `YourKit .NET Profiler `_ 24 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-hello-kernel/src/main/scala/sample/kernel/hello/HelloKernel.scala: -------------------------------------------------------------------------------- 1 | package sample.kernel.hello 2 | 3 | import akka.actor.{ Actor, ActorSystem, Props } 4 | import akka.kernel.Bootable 5 | 6 | case object Start 7 | 8 | class HelloActor extends Actor { 9 | val worldActor = context.actorOf(Props[WorldActor]) 10 | 11 | def receive = { 12 | case Start => worldActor ! "Hello" 13 | case message: String => 14 | println("Received message '%s'" format message) 15 | } 16 | } 17 | 18 | class WorldActor extends Actor { 19 | def receive = { 20 | case message: String => sender() ! (message.toUpperCase + " world!") 21 | } 22 | } 23 | 24 | class HelloKernel extends Bootable { 25 | val system = ActorSystem("hellokernel") 26 | 27 | def startup = { 28 | system.actorOf(Props[HelloActor]) ! Start 29 | } 30 | 31 | def shutdown = { 32 | system.terminate() 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /akka-actor/src/main/scala/akka/io/IO.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2009-2014 Typesafe Inc. 3 | */ 4 | 5 | package akka.io 6 | 7 | import scala.util.control.NonFatal 8 | import akka.actor._ 9 | import akka.io.SelectionHandler.WorkerForCommand 10 | import akka.event.Logging 11 | 12 | /** 13 | * Entry point to Akka’s IO layer. 14 | * 15 | * @see the Akka online documentation 16 | */ 17 | object IO { 18 | 19 | trait Extension extends akka.actor.Extension { 20 | def manager: ActorRef 21 | } 22 | 23 | /** 24 | * Scala API: obtain a reference to the manager actor for the given IO extension, 25 | * for example [[Tcp]] or [[Udp]]. 26 | * 27 | * For the Java API please refer to the individual extensions directly. 28 | */ 29 | def apply[T <: Extension](key: ExtensionId[T])(implicit system: ActorSystem): ActorRef = key(system).manager 30 | 31 | } -------------------------------------------------------------------------------- /akka-docs/rst/java/code/docs/io/japi/Watcher.java: -------------------------------------------------------------------------------- 1 | package docs.io.japi; 2 | 3 | import java.util.concurrent.CountDownLatch; 4 | 5 | import akka.actor.ActorRef; 6 | import akka.actor.Terminated; 7 | import akka.actor.UntypedActor; 8 | 9 | public class Watcher extends UntypedActor { 10 | 11 | static public class Watch { 12 | final ActorRef target; 13 | public Watch(ActorRef target) { 14 | this.target = target; 15 | } 16 | } 17 | 18 | final CountDownLatch latch; 19 | 20 | public Watcher(CountDownLatch latch) { 21 | this.latch = latch; 22 | } 23 | 24 | @Override 25 | public void onReceive(Object msg) throws Exception { 26 | if (msg instanceof Watch) { 27 | getContext().watch(((Watch) msg).target); 28 | } else if (msg instanceof Terminated) { 29 | latch.countDown(); 30 | if (latch.getCount() == 0) getContext().stop(getSelf()); 31 | } 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-osgi-dining-hakkers/core/src/main/scala/akka/sample/osgi/serialization/DiningHakkerSerializer.scala: -------------------------------------------------------------------------------- 1 | package akka.sample.osgi.serialization 2 | 3 | import akka.serialization.Serializer 4 | import akka.actor.ExtendedActorSystem 5 | import akka.serialization.Serialization 6 | import akka.serialization.SerializationExtension 7 | 8 | class DiningHakkerSerializer(val system: ExtendedActorSystem) extends Serializer { 9 | 10 | override def includeManifest: Boolean = true 11 | 12 | override def identifier = 98765 13 | 14 | lazy val javaSerializer = SerializationExtension(system).findSerializerFor(classOf[java.io.Serializable]) 15 | 16 | def toBinary(obj: AnyRef): Array[Byte] = { 17 | javaSerializer.toBinary(obj) 18 | } 19 | 20 | def fromBinary(bytes: Array[Byte], 21 | clazz: Option[Class[_]]): AnyRef = { 22 | javaSerializer.fromBinary(bytes, clazz) 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-osgi-dining-hakkers/api/src/main/scala/akka/sample/osgi/api/DiningHakkersService.scala: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2013 Crossing-Tech 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | package akka.sample.osgi.api 17 | 18 | import akka.actor.ActorRef 19 | 20 | trait DiningHakkersService { 21 | def getHakker(name: String, chairNumber: Int): ActorRef 22 | def getTracker(): ActorRef 23 | } 24 | -------------------------------------------------------------------------------- /akka-docs/rst/additional/http.rst: -------------------------------------------------------------------------------- 1 | .. _http-module: 2 | 3 | Incomplete List of HTTP Frameworks 4 | ################################## 5 | 6 | Play 7 | ==== 8 | 9 | The `Play framework `_ is built using Akka, and is well suited for building both full web applications as well as REST services. 10 | 11 | Spray 12 | ===== 13 | 14 | The `Spray toolkit `_ is built using Akka, and is a minimalistic HTTP/REST layer. 15 | 16 | Akka Mist 17 | ========= 18 | 19 | If you are using Akka Mist (Akka's old HTTP/REST module) with Akka 1.x and wish to upgrade to 2.x 20 | there is now a port of Akka Mist to Akka 2.x. You can find it `here `_. 21 | 22 | Other Alternatives 23 | ================== 24 | 25 | There are a bunch of other alternatives for using Akka with HTTP/REST. You can find some of them 26 | among the `Community Projects `_. 27 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-osgi-dining-hakkers/core/src/main/resources/application.conf: -------------------------------------------------------------------------------- 1 | akka { 2 | 3 | loggers = ["akka.event.slf4j.Slf4jLogger", "akka.event.Logging$DefaultLogger"] 4 | logging-filter = "akka.event.slf4j.Slf4jLoggingFilter" 5 | 6 | actor { 7 | provider = "akka.cluster.ClusterActorRefProvider" 8 | 9 | serialize-messages = on 10 | 11 | serializers { 12 | dining = "akka.sample.osgi.serialization.DiningHakkerSerializer" 13 | } 14 | 15 | serialization-bindings { 16 | "akka.sample.osgi.api.DiningHakkerMessage" = dining 17 | } 18 | } 19 | 20 | remote { 21 | netty.tcp { 22 | hostname = "localhost" 23 | port = 4242 24 | } 25 | } 26 | 27 | cluster { 28 | seed-nodes = ["akka.tcp://akka-osgi-sample@localhost:4242"] 29 | auto-down-unreachable-after = 20 s 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /akka-actor/src/main/scala/akka/util/ClassLoaderObjectInputStream.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2009-2014 Typesafe Inc. 3 | */ 4 | 5 | package akka.util 6 | 7 | import java.io.{ InputStream, ObjectInputStream, ObjectStreamClass } 8 | 9 | /** 10 | * ClassLoaderObjectInputStream tries to utilize the provided ClassLoader to load Classes and falls 11 | * back to ObjectInputStreams resolver. 12 | * 13 | * @param classLoader - the ClassLoader which is to be used primarily 14 | * @param is - the InputStream that is wrapped 15 | */ 16 | class ClassLoaderObjectInputStream(classLoader: ClassLoader, is: InputStream) extends ObjectInputStream(is) { 17 | override protected def resolveClass(objectStreamClass: ObjectStreamClass): Class[_] = 18 | try Class.forName(objectStreamClass.getName, false, classLoader) catch { 19 | case cnfe: ClassNotFoundException ⇒ super.resolveClass(objectStreamClass) 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /akka-cluster-metrics/build.sbt: -------------------------------------------------------------------------------- 1 | import akka.{ AkkaBuild, Dependencies, Formatting, OSGi, MultiNode, Unidoc, SigarLoader } 2 | import com.typesafe.sbt.SbtMultiJvm.MultiJvmKeys._ 3 | import com.typesafe.tools.mima.plugin.MimaKeys 4 | 5 | AkkaBuild.defaultSettings 6 | 7 | Formatting.formatSettings 8 | 9 | Unidoc.scaladocSettings 10 | 11 | Unidoc.javadocSettings 12 | 13 | MultiNode.multiJvmSettings 14 | 15 | SigarLoader.sigarSettings 16 | 17 | OSGi.clusterMetrics 18 | 19 | libraryDependencies ++= Dependencies.clusterMetrics 20 | 21 | //MimaKeys.previousArtifact := akkaPreviousArtifact("akka-cluster-metrics").value 22 | 23 | parallelExecution in Test := false 24 | 25 | extraOptions in MultiJvm <<= (sourceDirectory in MultiJvm) { src => 26 | (name: String) => (src ** (name + ".conf")).get.headOption.map("-Dakka.config=" + _.absolutePath).toSeq 27 | } 28 | 29 | scalatestOptions in MultiJvm := MultiNode.defaultMultiJvmScalatestOptions.value 30 | -------------------------------------------------------------------------------- /akka-samples/akka-docs-java-lambda/src/test/java/docs/actor/MyActor.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2009-2014 Typesafe Inc. 3 | */ 4 | 5 | package docs.actor; 6 | 7 | //#imports 8 | import akka.actor.AbstractActor; 9 | import akka.event.Logging; 10 | import akka.event.LoggingAdapter; 11 | import akka.japi.pf.ReceiveBuilder; 12 | 13 | //#imports 14 | 15 | //#my-actor 16 | public class MyActor extends AbstractActor { 17 | private final LoggingAdapter log = Logging.getLogger(context().system(), this); 18 | 19 | public MyActor() { 20 | receive(ReceiveBuilder. 21 | match(String.class, s -> { 22 | log.info("Received String message: {}", s); 23 | //#my-actor 24 | //#reply 25 | sender().tell(s, self()); 26 | //#reply 27 | //#my-actor 28 | }). 29 | matchAny(o -> log.info("received unknown message")).build() 30 | ); 31 | } 32 | } 33 | //#my-actor 34 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-main-java-lambda/src/main/java/sample/hello/Main2.java: -------------------------------------------------------------------------------- 1 | package sample.hello; 2 | 3 | import akka.actor.*; 4 | import akka.japi.pf.ReceiveBuilder; 5 | 6 | public class Main2 { 7 | 8 | public static void main(String[] args) { 9 | ActorSystem system = ActorSystem.create("Hello"); 10 | ActorRef a = system.actorOf(Props.create(HelloWorld.class), "helloWorld"); 11 | system.actorOf(Props.create(Terminator.class, a), "terminator"); 12 | } 13 | 14 | public static class Terminator extends AbstractLoggingActor { 15 | 16 | private final ActorRef ref; 17 | 18 | public Terminator(ActorRef ref) { 19 | this.ref = ref; 20 | getContext().watch(ref); 21 | receive(ReceiveBuilder. 22 | match(Terminated.class, t -> { 23 | log().info("{} has terminated, shutting down system", ref.path()); 24 | context().system().terminate(); 25 | }).build()); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /scripts/multi-node-log-replace.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # Utility to make log files from multi-node tests easier to analyze. 4 | # Replaces jvm names and host:port with corresponding logical role name. 5 | # 6 | # Use with 0, 1 or 2 arguments. 7 | # 8 | # When using 0 arguments it reads from standard input 9 | # and writes to standard output. 10 | # 11 | # With 1 argument it reads from the file specified in the first argument 12 | # and writes to standard output. 13 | # 14 | # With 2 arguments it reads the file specified in the first argument 15 | # and writes to the file specified in the second argument. 16 | # 17 | # You can also replace the contents of the clipboard instead of using files 18 | # by supplying `clipboard` as argument 19 | # 20 | 21 | 22 | # check for an sbt command 23 | type -P sbt &> /dev/null || fail "sbt command not found" 24 | 25 | sbt "project akka-remote-tests" "test:run-main akka.remote.testkit.LogRoleReplace $1 $2" 26 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-osgi-dining-hakkers/api/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | com.typesafe.akka.akka-sample-osgi-dining-hakkers 7 | project 8 | 2.4-SNAPSHOT 9 | 10 | 4.0.0 11 | 12 | api 13 | Dining Hakker :: Service API 14 | bundle 15 | 16 | 17 | 18 | 19 | com.typesafe.akka 20 | akka-osgi_${scala.dep.version} 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /akka-docs/rst/java/code/docs/camel/OnRouteResponseTestBase.java: -------------------------------------------------------------------------------- 1 | package docs.camel; 2 | 3 | import akka.actor.*; 4 | import akka.testkit.JavaTestKit; 5 | 6 | public class OnRouteResponseTestBase { 7 | 8 | public void onRouteResponse(){ 9 | //#RouteResponse 10 | ActorSystem system = ActorSystem.create("some-system"); 11 | Props receiverProps = Props.create(ResponseReceiver.class); 12 | final ActorRef receiver = system.actorOf(receiverProps,"responseReceiver"); 13 | ActorRef forwardResponse = system.actorOf(Props.create( 14 | Forwarder.class, "http://localhost:8080/news/akka", receiver)); 15 | // the Forwarder sends out a request to the web page and forwards the response to 16 | // the ResponseReceiver 17 | forwardResponse.tell("some request", ActorRef.noSender()); 18 | //#RouteResponse 19 | system.stop(receiver); 20 | system.stop(forwardResponse); 21 | JavaTestKit.shutdownActorSystem(system); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /akka-persistence-tck/src/main/scala/akka/persistence/japi/journal/JavaJournalSpec.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2014 Typesafe Inc. 3 | */ 4 | package akka.persistence.japi.journal 5 | 6 | import akka.persistence.journal.JournalSpec 7 | import com.typesafe.config.Config 8 | import org.junit.runner.RunWith 9 | import org.scalatest.junit.JUnitRunner 10 | 11 | /** 12 | * JAVA API 13 | * 14 | * Java / JUnit API for [[akka.persistence.journal.JournalSpec]]. 15 | * 16 | * In case your journal plugin needs some kind of setup or teardown, override the `beforeAll` or `afterAll` 17 | * methods (don't forget to call `super` in your overriden methods). 18 | * 19 | * @see [[akka.persistence.journal.JournalSpec]] 20 | * @see [[akka.persistence.journal.JournalPerfSpec]] 21 | * @param config configures the Journal plugin to be tested 22 | */ 23 | @RunWith(classOf[JUnitRunner]) 24 | class JavaJournalSpec(val config: Config) extends JournalSpec 25 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-cluster-java/src/main/resources/application.conf: -------------------------------------------------------------------------------- 1 | akka { 2 | actor { 3 | provider = "akka.cluster.ClusterActorRefProvider" 4 | } 5 | remote { 6 | log-remote-lifecycle-events = off 7 | netty.tcp { 8 | hostname = "127.0.0.1" 9 | port = 0 10 | } 11 | } 12 | 13 | cluster { 14 | seed-nodes = [ 15 | "akka.tcp://ClusterSystem@127.0.0.1:2551", 16 | "akka.tcp://ClusterSystem@127.0.0.1:2552"] 17 | 18 | auto-down-unreachable-after = 10s 19 | } 20 | } 21 | 22 | # Disable legacy metrics in akka-cluster. 23 | akka.cluster.metrics.enabled=off 24 | 25 | # Enable metrics extension in akka-cluster-metrics. 26 | akka.extensions=["akka.cluster.metrics.ClusterMetricsExtension"] 27 | 28 | # Sigar native library extract location during tests. 29 | # Note: use per-jvm-instance folder when running multiple jvm on one host. 30 | akka.cluster.metrics.native-library-extract-folder=${user.dir}/target/native 31 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-cluster-scala/src/main/resources/application.conf: -------------------------------------------------------------------------------- 1 | akka { 2 | actor { 3 | provider = "akka.cluster.ClusterActorRefProvider" 4 | } 5 | remote { 6 | log-remote-lifecycle-events = off 7 | netty.tcp { 8 | hostname = "127.0.0.1" 9 | port = 0 10 | } 11 | } 12 | 13 | cluster { 14 | seed-nodes = [ 15 | "akka.tcp://ClusterSystem@127.0.0.1:2551", 16 | "akka.tcp://ClusterSystem@127.0.0.1:2552"] 17 | 18 | auto-down-unreachable-after = 10s 19 | } 20 | } 21 | 22 | # Disable legacy metrics in akka-cluster. 23 | akka.cluster.metrics.enabled=off 24 | 25 | # Enable metrics extension in akka-cluster-metrics. 26 | akka.extensions=["akka.cluster.metrics.ClusterMetricsExtension"] 27 | 28 | # Sigar native library extract location during tests. 29 | # Note: use per-jvm-instance folder when running multiple jvm on one host. 30 | akka.cluster.metrics.native-library-extract-folder=${user.dir}/target/native 31 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-cluster-java/src/main/java/sample/cluster/transformation/TransformationBackendMain.java: -------------------------------------------------------------------------------- 1 | package sample.cluster.transformation; 2 | 3 | import com.typesafe.config.Config; 4 | import com.typesafe.config.ConfigFactory; 5 | 6 | import akka.actor.ActorSystem; 7 | import akka.actor.Props; 8 | 9 | public class TransformationBackendMain { 10 | 11 | public static void main(String[] args) { 12 | // Override the configuration of the port when specified as program argument 13 | final String port = args.length > 0 ? args[0] : "0"; 14 | final Config config = ConfigFactory.parseString("akka.remote.netty.tcp.port=" + port). 15 | withFallback(ConfigFactory.parseString("akka.cluster.roles = [backend]")). 16 | withFallback(ConfigFactory.load()); 17 | 18 | ActorSystem system = ActorSystem.create("ClusterSystem", config); 19 | 20 | system.actorOf(Props.create(TransformationBackend.class), "backend"); 21 | 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /akka-contrib/docs/jul.rst: -------------------------------------------------------------------------------- 1 | Java Logging (JUL) 2 | ================== 3 | 4 | This extension module provides a logging backend which uses the `java.util.logging` (j.u.l) 5 | API to do the endpoint logging for `akka.event.Logging`. 6 | 7 | Provided with this module is an implementation of `akka.event.LoggingAdapter` which is independent of any `ActorSystem` being in place. This means that j.u.l can be used as the backend, via the Akka Logging API, for both Actor and non-Actor codebases. 8 | 9 | To enable j.u.l as the `akka.event.Logging` backend, use the following Akka config: 10 | 11 | loggers = ["akka.contrib.jul.JavaLogger"] 12 | 13 | To access the `akka.event.Logging` API from non-Actor code, mix in `akka.contrib.jul.JavaLogging`. 14 | 15 | This module is preferred over SLF4J with its JDK14 backend, due to integration issues resulting in the incorrect handling of `threadId`, `className` and `methodName`. 16 | 17 | This extension module was contributed by Sam Halliday. 18 | -------------------------------------------------------------------------------- /akka-camel/src/main/scala/akka/camel/ContextProvider.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2009-2014 Typesafe Inc. 3 | */ 4 | package akka.camel 5 | 6 | import akka.actor.ExtendedActorSystem 7 | import org.apache.camel.impl.DefaultCamelContext 8 | 9 | /** 10 | * Implement this interface in order to inject a specific CamelContext in a system 11 | * An instance of this class must be instantiable using a no-arg constructor. 12 | */ 13 | trait ContextProvider { 14 | /** 15 | * Retrieve or create a Camel Context for the given actor system 16 | * Called once per actor system 17 | */ 18 | def getContext(system: ExtendedActorSystem): DefaultCamelContext 19 | } 20 | 21 | /** 22 | * Default implementation of [[akka.camel.ContextProvider]] 23 | * Provides a new DefaultCamelContext per actor system 24 | */ 25 | final class DefaultContextProvider extends ContextProvider { 26 | override def getContext(system: ExtendedActorSystem) = new DefaultCamelContext 27 | } -------------------------------------------------------------------------------- /akka-samples/akka-sample-camel-java/src/main/java/sample/camel/http/HttpTransformer.java: -------------------------------------------------------------------------------- 1 | package sample.camel.http; 2 | 3 | import akka.actor.Status; 4 | import akka.actor.UntypedActor; 5 | import akka.camel.CamelMessage; 6 | import akka.dispatch.Mapper; 7 | 8 | public class HttpTransformer extends UntypedActor { 9 | public void onReceive(Object message) { 10 | if (message instanceof CamelMessage) { 11 | CamelMessage camelMessage = (CamelMessage) message; 12 | CamelMessage replacedMessage = camelMessage.mapBody(new Mapper() { 13 | @Override 14 | public String apply(Object body) { 15 | String text = new String((byte[]) body); 16 | return text.replaceAll("Akka ", "AKKA "); 17 | } 18 | }); 19 | getSender().tell(replacedMessage, getSelf()); 20 | } else if (message instanceof Status.Failure) { 21 | getSender().tell(message, getSelf()); 22 | } else 23 | unhandled(message); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-cluster-scala/src/main/scala/sample/cluster/simple/SimpleClusterApp.scala: -------------------------------------------------------------------------------- 1 | package sample.cluster.simple 2 | 3 | import com.typesafe.config.ConfigFactory 4 | import akka.actor.ActorSystem 5 | import akka.actor.Props 6 | 7 | object SimpleClusterApp { 8 | def main(args: Array[String]): Unit = { 9 | if (args.isEmpty) 10 | startup(Seq("2551", "2552", "0")) 11 | else 12 | startup(args) 13 | } 14 | 15 | def startup(ports: Seq[String]): Unit = { 16 | ports foreach { port => 17 | // Override the configuration of the port 18 | val config = ConfigFactory.parseString("akka.remote.netty.tcp.port=" + port). 19 | withFallback(ConfigFactory.load()) 20 | 21 | // Create an Akka system 22 | val system = ActorSystem("ClusterSystem", config) 23 | // Create an actor that handles cluster domain events 24 | system.actorOf(Props[SimpleClusterListener], name = "clusterListener") 25 | } 26 | } 27 | 28 | } 29 | 30 | -------------------------------------------------------------------------------- /akka-persistence/src/main/scala/akka/persistence/journal/japi/AsyncWriteJournal.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2009-2014 Typesafe Inc. 3 | */ 4 | 5 | package akka.persistence.journal.japi 6 | 7 | import scala.collection.immutable 8 | import scala.collection.JavaConverters._ 9 | 10 | import akka.persistence._ 11 | import akka.persistence.journal.{ AsyncWriteJournal ⇒ SAsyncWriteJournal } 12 | 13 | /** 14 | * Java API: abstract journal, optimized for asynchronous, non-blocking writes. 15 | */ 16 | abstract class AsyncWriteJournal extends AsyncRecovery with SAsyncWriteJournal with AsyncWritePlugin { 17 | import context.dispatcher 18 | 19 | final def asyncWriteMessages(messages: immutable.Seq[PersistentRepr]) = 20 | doAsyncWriteMessages(messages.asJava).map(Unit.unbox) 21 | 22 | final def asyncDeleteMessagesTo(persistenceId: String, toSequenceNr: Long, permanent: Boolean) = 23 | doAsyncDeleteMessagesTo(persistenceId, toSequenceNr, permanent).map(Unit.unbox) 24 | } 25 | -------------------------------------------------------------------------------- /akka-persistence-tck/src/main/scala/akka/persistence/japi/snapshot/JavaSnapshotStoreSpec.scala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2014 Typesafe Inc. 3 | */ 4 | package akka.persistence.japi.snapshot 5 | 6 | import akka.persistence.snapshot.{ SnapshotStore, SnapshotStoreSpec } 7 | import com.typesafe.config.Config 8 | import org.junit.runner.RunWith 9 | import org.scalatest.junit.JUnitRunner 10 | 11 | /** 12 | * JAVA API 13 | * 14 | * This spec aims to verify custom akka-persistence [[SnapshotStore]] implementations. 15 | * Plugin authors are highly encouraged to include it in their plugin's test suites. 16 | * 17 | * In case your snapshot-store plugin needs some kind of setup or teardown, override the `beforeAll` or `afterAll` 18 | * methods (don't forget to call `super` in your overriden methods). 19 | * 20 | * @see [[akka.persistence.snapshot.SnapshotStoreSpec]] 21 | */ 22 | @RunWith(classOf[JUnitRunner]) 23 | class JavaSnapshotStoreSpec(val config: Config) extends SnapshotStoreSpec 24 | -------------------------------------------------------------------------------- /akka-samples/akka-sample-camel-java/src/main/java/sample/camel/route/RouteConsumer.java: -------------------------------------------------------------------------------- 1 | package sample.camel.route; 2 | 3 | import akka.actor.ActorRef; 4 | import akka.camel.CamelMessage; 5 | import akka.camel.javaapi.UntypedConsumerActor; 6 | 7 | public class RouteConsumer extends UntypedConsumerActor { 8 | private ActorRef transformer; 9 | 10 | public RouteConsumer(ActorRef transformer) { 11 | this.transformer = transformer; 12 | } 13 | 14 | public String getEndpointUri() { 15 | return "jetty:http://0.0.0.0:8877/camel/welcome"; 16 | } 17 | 18 | public void onReceive(Object message) { 19 | if (message instanceof CamelMessage) { 20 | CamelMessage camelMessage = (CamelMessage) message; 21 | // Forward a string representation of the message body to transformer 22 | String body = camelMessage.getBodyAs(String.class, getCamelContext()); 23 | transformer.forward(camelMessage.withBody(body), getContext()); 24 | } else 25 | unhandled(message); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /project/plugins.sbt: -------------------------------------------------------------------------------- 1 | resolvers += Classpaths.typesafeResolver 2 | 3 | resolvers += "jgit-repo" at "http://download.eclipse.org/jgit/maven" 4 | 5 | // these comment markers are for including code into the docs 6 | //#sbt-multi-jvm 7 | addSbtPlugin("com.typesafe.sbt" % "sbt-multi-jvm" % "0.3.8") 8 | //#sbt-multi-jvm 9 | 10 | addSbtPlugin("com.typesafe.sbt" % "sbt-scalariform" % "1.2.0") 11 | 12 | addSbtPlugin("com.typesafe.sbt" % "sbt-site" % "0.7.1") 13 | 14 | addSbtPlugin("com.typesafe.sbt" % "sbt-osgi" % "0.6.0") 15 | 16 | addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "0.1.6") 17 | 18 | addSbtPlugin("com.typesafe.sbt" % "sbt-pgp" % "0.8.3") 19 | 20 | addSbtPlugin("com.typesafe.sbt" % "sbt-s3" % "0.5") 21 | 22 | addSbtPlugin("com.eed3si9n" % "sbt-unidoc" % "0.3.1") 23 | 24 | addSbtPlugin("com.typesafe.sbt" % "sbt-git" % "0.6.2") 25 | 26 | addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.1.6") 27 | 28 | // stats reporting 29 | libraryDependencies += "com.timgroup" % "java-statsd-client" % "2.0.0" 30 | -------------------------------------------------------------------------------- /akka-docs/rst/additional/code/docs/faq/Faq.scala: -------------------------------------------------------------------------------- 1 | package docs.faq 2 | 3 | import akka.actor.Actor 4 | 5 | //#exhaustiveness-check 6 | object MyActor { 7 | // these are the messages we accept 8 | sealed abstract trait Message 9 | final case class FooMessage(foo: String) extends Message 10 | final case class BarMessage(bar: Int) extends Message 11 | 12 | // these are the replies we send 13 | sealed abstract trait Reply 14 | final case class BazMessage(baz: String) extends Reply 15 | } 16 | 17 | class MyActor extends Actor { 18 | import MyActor._ 19 | def receive = { 20 | case message: Message => message match { 21 | case BarMessage(bar) => sender() ! BazMessage("Got " + bar) 22 | // warning here: 23 | // "match may not be exhaustive. It would fail on the following input: FooMessage(_)" 24 | //#exhaustiveness-check 25 | case FooMessage(_) => // avoid the warning in our build logs 26 | //#exhaustiveness-check 27 | } 28 | } 29 | } 30 | //#exhaustiveness-check -------------------------------------------------------------------------------- /akka-samples/akka-sample-cluster-java/src/main/resources/factorial.conf: -------------------------------------------------------------------------------- 1 | include "application" 2 | 3 | # //#min-nr-of-members 4 | akka.cluster.min-nr-of-members = 3 5 | # //#min-nr-of-members 6 | 7 | # //#role-min-nr-of-members 8 | akka.cluster.role { 9 | frontend.min-nr-of-members = 1 10 | backend.min-nr-of-members = 2 11 | } 12 | # //#role-min-nr-of-members 13 | 14 | # //#adaptive-router 15 | akka.actor.deployment { 16 | /factorialFrontend/factorialBackendRouter = { 17 | # Router type provided by metrics extension. 18 | router = cluster-metrics-adaptive-group 19 | # Router parameter specific for metrics extension. 20 | # metrics-selector = heap 21 | # metrics-selector = load 22 | # metrics-selector = cpu 23 | metrics-selector = mix 24 | # 25 | nr-of-instances = 100 26 | routees.paths = ["/user/factorialBackend"] 27 | cluster { 28 | enabled = on 29 | use-role = backend 30 | allow-local-routees = off 31 | } 32 | } 33 | } 34 | # //#adaptive-router 35 | --------------------------------------------------------------------------------