From c1152a0b42d14873d27d60cc505c8af3fd89887a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Bone=CC=81r?= Date: Thu, 27 Oct 2011 15:14:15 +0200 Subject: [PATCH 01/57] Fixed minor stuff in Gossiper after code review feedback. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jonas Bonér --- .../src/main/scala/akka/remote/Gossiper.scala | 25 ++++++++----------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/akka-remote/src/main/scala/akka/remote/Gossiper.scala b/akka-remote/src/main/scala/akka/remote/Gossiper.scala index 73e975ad91..95adec1edf 100644 --- a/akka-remote/src/main/scala/akka/remote/Gossiper.scala +++ b/akka-remote/src/main/scala/akka/remote/Gossiper.scala @@ -14,7 +14,7 @@ import akka.remote.RemoteProtocol.RemoteSystemDaemonMessageType._ import java.net.InetSocketAddress import java.util.concurrent.atomic.AtomicReference import java.util.concurrent.TimeUnit -import java.util.Random +import java.security.SecureRandom import System.{ currentTimeMillis ⇒ newTimestamp } import scala.collection.immutable.Map @@ -112,8 +112,8 @@ class Gossiper(remote: Remote) { private val address = new InetSocketAddress(app.hostname, app.port) private val nodeFingerprint = address.## - private val random = new Random(newTimestamp) - private val initalDelayForGossip = 5 seconds // FIXME make configurablev + private val random = SecureRandom.getInstance("SHA1PRNG") + private val initalDelayForGossip = 5 seconds // FIXME make configurable private val gossipFrequency = 1 seconds // FIXME make configurable private val timeUnit = { assert(gossipFrequency.unit == initalDelayForGossip.unit) @@ -216,14 +216,12 @@ class Gossiper(remote: Remote) { if (random.nextDouble() < probability) gossipTo(oldUnavailableNodes) } - if (!gossipedToSeed || oldAvailableNodesSize < 1) { - // 3. gossip to a seed for facilitating partition healing - if (seeds.head != address) { - if (oldAvailableNodesSize == 0) gossipTo(seeds) - else { - val probability = 1.0 / oldAvailableNodesSize + oldUnavailableNodesSize - if (random.nextDouble() <= probability) gossipTo(seeds) - } + // 3. gossip to a seed for facilitating partition healing + if ((!gossipedToSeed || oldAvailableNodesSize < 1) && (seeds.head != address)) { + if (oldAvailableNodesSize == 0) gossipTo(seeds) + else { + val probability = 1.0 / oldAvailableNodesSize + oldUnavailableNodesSize + if (random.nextDouble() <= probability) gossipTo(seeds) } } } @@ -247,17 +245,14 @@ class Gossiper(remote: Remote) { case Some(Failure(cause)) ⇒ app.eventHandler.error(cause, this, cause.toString) - throw cause case None ⇒ val error = new RemoteException("Gossip to [%s] timed out".format(connection.address)) app.eventHandler.error(error, this, error.toString) - throw error } } catch { case e: Exception ⇒ app.eventHandler.error(e, this, "Could not gossip to [%s] due to: %s".format(connection.address, e.toString)) - throw e } seeds exists (peer == _) @@ -274,7 +269,7 @@ class Gossiper(remote: Remote) { val oldAvailableNodes = oldGossip.availableNodes val oldUnavailableNodes = oldGossip.unavailableNodes - val newlyDetectedUnavailableNodes = oldAvailableNodes filter (!failureDetector.isAvailable(_)) + val newlyDetectedUnavailableNodes = oldAvailableNodes filterNot failureDetector.isAvailable if (!newlyDetectedUnavailableNodes.isEmpty) { // we have newly detected nodes marked as unavailable val newAvailableNodes = oldAvailableNodes diff newlyDetectedUnavailableNodes From 706692dacdc370acc04a32085fdda58509e851a8 Mon Sep 17 00:00:00 2001 From: Peter Vlugter Date: Thu, 27 Oct 2011 15:17:49 +0200 Subject: [PATCH 02/57] Some more cluster documentation --- akka-docs/cluster/cluster.rst | 108 +++++++++++++++++++++++----------- 1 file changed, 75 insertions(+), 33 deletions(-) diff --git a/akka-docs/cluster/cluster.rst b/akka-docs/cluster/cluster.rst index ff7ef3fe6b..f46148a22e 100644 --- a/akka-docs/cluster/cluster.rst +++ b/akka-docs/cluster/cluster.rst @@ -11,12 +11,11 @@ Intro Akka Cluster provides a fault-tolerant, elastic, decentralized peer-to-peer cluster with no single point of failure (SPOF) or single point of bottleneck -(SPOB). It implemented as a Dynamo-style system using gossip protocols, -automatic failure detection, automatic partitioning, handoff, and cluster -rebalancing. But with some differences due to the fact that it is not just -managing passive data, but actors, e.g. active, sometimes stateful, components -that have requirements on message ordering, the number of active instances in -the cluster, etc. +(SPOB). It implements a Dynamo-style system using gossip protocols, automatic +failure detection, automatic partitioning, handoff, and cluster rebalancing. But +with some differences due to the fact that it is not just managing passive data, +but actors - active, sometimes stateful, components that also have requirements +on message ordering, the number of active instances in the cluster, etc. Terms @@ -32,8 +31,12 @@ These terms are used throughout the documentation. A set of nodes. Contains distributed Akka applications. **partition** - An actor (possibly a subtree of actors) in the Akka application that - is distributed within the cluster. + An actor or subtree of actors in the Akka application that is distributed + within the cluster. + +**partition point** + The actor at the head of a partition. The point around which a partition is + formed. **partition path** Also referred to as the actor address. Has the format `actor1/actor2/actor3` @@ -46,8 +49,8 @@ These terms are used throughout the documentation. ``N-value`` of the partition. **partition table** - A mapping from partition path to base node and its ``N-value`` (i.e. its - instance count). + A mapping from partition path to base node and its ``N-value`` (instance + count). Membership @@ -64,10 +67,11 @@ Gossip ------ The cluster membership used in Akka is based on Amazon's `Dynamo`_ system and -particularly the approach taken Basho's' `Riak`_ distributed database. Cluster -membership is communicated using a `Gossip Protocol`_, where the current state -of the cluster is gossiped randomly through the cluster. Joining a cluster is -initiated by specifying a set of ``seed`` nodes with which to begin gossiping. +particularly the approach taken in Basho's' `Riak`_ distributed database. +Cluster membership is communicated using a `Gossip Protocol`_, where the current +state of the cluster is gossiped randomly through the cluster. Joining a cluster +is initiated by specifying a set of ``seed`` nodes with which to begin +gossiping. .. _Gossip Protocol: http://en.wikipedia.org/wiki/Gossip_protocol .. _Dynamo: http://www.allthingsdistributed.com/files/amazon-dynamo-sosp2007.pdf @@ -92,6 +96,7 @@ the `pruning algorithm`_ in Riak. .. _Vector Clocks: http://en.wikipedia.org/wiki/Vector_clock .. _pruning algorithm: http://wiki.basho.com/Vector-Clocks.html#Vector-Clock-Pruning + Gossip convergence ^^^^^^^^^^^^^^^^^^ @@ -113,13 +118,13 @@ unreachable from the rest of the cluster. For this we are using an implementation of `The Phi Accrual Failure Detector`_ by Hayashibara et al. An accrual failure detector decouple monitoring and interpretation. That makes -them applicable to a wider area ofQ scenarios and more adequate to build generic +them applicable to a wider area of scenarios and more adequate to build generic failure detection services. The idea is that it is keeping a history of failure statistics, calculated from heartbeats received from the gossip protocol, and is trying to do educated guesses by taking multiple factors, and how they accumulate over time, into account in order to come up with a better guess if a specific node is up or down. Rather than just answering "yes" or "no" to the -question "is the node down?" it returns a ``phi`` value representing the +question "is the node down?" it returns a ``phi`` value representing the likelihood that the node is down. The ``threshold`` that is the basis for the calculation is configurable by the @@ -132,6 +137,7 @@ order to account for network issues that sometimes occur on such platforms. .. _The Phi Accrual Failure Detector: http://ddg.jaist.ac.jp/pub/HDY+04.pdf + Leader ^^^^^^ @@ -345,28 +351,50 @@ Partitioning ============ Each partition (an actor or actor subtree) in the actor system is assigned to a -base node. The mapping from partition path (actor address on the format "a/b/c") -to base node is stored in the partition table and is maintained as part of the -cluster state through the gossip protocol. The partition table is only updated -by the leader node. If the partition has a configured instance count, referred -to as the ``N-value``, greater than one, then the location of the other -instances can be found deterministically by counting from the base node. (The -``N-value`` is larger than 1 when a actor is configured to be routed.) The first -instance will be found on the base node, and the other instances on the next N-1 -nodes, given the nodes in sorted order. +base node. The actor at the head of the partition is referred to as the +partition point. The mapping from partition path (actor address of the format +"a/b/c") to base node is stored in the partition table and is maintained as part +of the cluster state through the gossip protocol. The partition table is only +updated by the leader node. Currently the only possible partition points are +*routed* actors. -TODO: discuss how different N values within the tree work (especially subtrees -with a greater or lesser N value). A simple implementation would only allow the -highest-up-the-tree, non-singular (greater than one) value to be used for any -subtree. +Routed actors can have an instance count greater than one. The instance count is +also referred to as the ``N-value``. If the ``N-value`` is greater than one then +the first instance will be found on the base node, and the other instances on +the next N-1 nodes, given the nodes in sorted order. + +Note that in the first implementation there may be a restriction such that only +top-level partitions are possible (the highest possible partition points are +used and sub-partitioning is not allowed). Still to be explored in more detail. + +The cluster leader determines the current instance count for a partition based +on two axes: fault-tolerance and scaling. + +Fault-tolerance determines a minimum number of instances for a routed actor +(allowing N-1 nodes to crash while still maintaining at least one running actor +instance). The user can specify a function from current number of nodes to the +number of acceptable node failures: n: Int => f: Int where f < n. + +Scaling reflects the number of instances needed to maintain good throughput and +is influenced by metrics from the system, particularly a history of mailbox +size, CPU load, and GC percentages. It may also be possible to accept scaling +hints from the user that indicate expected load. + +The balancing of partitions is determined in a simple way (at least for the +first implementation) where the overlap of partitions is minimized. Partitions +are spread over the cluster ring in a circular fashion, with each base node +in the first available space. + +For example, given a cluster with ten nodes and three partitions having N-values +of 4, 3, and 5; partition 1 would have base node 1 and instances on nodes +1-4; partition 2 would have base node 5 and instances on nodes 5-7; partition 3 +would have base node 8 and instances on nodes 8-10 and 1-2. The only overlap is +on nodes 1 and 2. When rebalancing is required the leader will schedule handoffs, gossiping a set of pending changes, and when each change is complete the leader will update the partition table. -TODO: look further into how actors will be distributed and also avoiding -unnecessary migrations just to create a more balanced cluster. - Handoff ------- @@ -433,7 +461,7 @@ Update transition The second transition begins when the migration is marked as complete and ends when all nodes have the updated partition table (when all nodes will use ``N2`` -as the host for ``A``), e.g. we have convergence, and is referred to as the +as the host for ``A``, i.e. we have convergence) and is referred to as the *update transition*. Once the update transition begins ``N1`` can forward any messages it receives @@ -532,3 +560,17 @@ have a dependency on message ordering from any given source. Support for stateful singleton actors will come in future releases of Akka, most likely Akka 2.2. + + +Other ideas +=========== + +Behaviour and state +------------------- + +If we provide actor clustering it is only half of the solution, we need to +provide both actor clustering for stateless actors (behaviour) and easy ways to +store and distribute state. Having a dynamo base for the clustering already we +could use the same infrastructure and provide both actor clustering and +datastore. We can also provide an event sourcing API with the default +implementation using the distributed datastore. From fef4075b8aff960fe314bd196069669ef0c39ab8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Bone=CC=81r?= Date: Thu, 27 Oct 2011 17:06:57 +0200 Subject: [PATCH 03/57] Added section about how to do a distributed dynamo-style datastorage on top of akka cluster --- akka-docs/cluster/cluster.rst | 49 ++++++++++++++++++++++++++--------- 1 file changed, 37 insertions(+), 12 deletions(-) diff --git a/akka-docs/cluster/cluster.rst b/akka-docs/cluster/cluster.rst index f46148a22e..6d31c2f07c 100644 --- a/akka-docs/cluster/cluster.rst +++ b/akka-docs/cluster/cluster.rst @@ -558,19 +558,44 @@ have a dependency on message ordering from any given source. and state is transfered during the migration initialization, then options 2b and 3b would be required. -Support for stateful singleton actors will come in future releases of Akka, most -likely Akka 2.2. +Stateful Actor Replication +========================== +Support for stateful singleton actors will come in future releases of Akka, and +is scheduled for Akka 2.2. Having a Dynamo base for the clustering already we +should use the same infrastructure to provide stateful actor clustering and +datastore as well. The stateful actor clustering should be layered on top of the +distributed datastore. See the next section for a rough outline on how the +distributed datastore could be implemented. -Other ideas -=========== +Implementing a Dynamo-style distributed database on top of Akka Cluster +----------------------------------------------------------------------- -Behaviour and state -------------------- +The missing pieces to implement a full Dynamo-style eventually consistent data +storage on top of the Akka Cluster as described in this document are: + +- Configuration of ``READ`` and ``WRITE`` consistency levels according to the ``N/R/W`` numbers + defined in the Dynamo paper. + - R = read replica count + - W = write replica count + - N = replication factor + - Q = QUORUM = N / 2 + 1 + - W + R > N = full consistency + +- Define a versioned data message wrapper: ``Versioned[T](hash: Long, version: VectorClock, data: T)``. + +- Define a single system data broker actor on each node that uses a ``Consistent + Hashing Router`` and that have instances on all other nodes in the node ring. + +- For ``WRITE``: + 1. Wrap data in a ``Versioned Message`` + 2. Send a ``Versioned Message`` with the data is sent to a number of nodes matching the ``W-value``. + +- For ``READ``: + 1. Read in the ``Versioned Message`` with the data from as many replicas as you need for the consistency level required by the ``R-value``. + 2. Do comparison on the versions (using `Vector Clocks`_) + 3. If the versions differ then do `Read Repair`_ to update the inconsistent nodes. + 4. Return the latest versioned data. + +.. _Read Repair: http://wiki.apache.org/cassandra/ReadRepair -If we provide actor clustering it is only half of the solution, we need to -provide both actor clustering for stateless actors (behaviour) and easy ways to -store and distribute state. Having a dynamo base for the clustering already we -could use the same infrastructure and provide both actor clustering and -datastore. We can also provide an event sourcing API with the default -implementation using the distributed datastore. From 885fdfe2a8fd472d964751fbf0b29ed93c818a50 Mon Sep 17 00:00:00 2001 From: Derek Williams Date: Thu, 27 Oct 2011 20:04:32 -0600 Subject: [PATCH 04/57] Send tasks back to the Dispatcher if Future.await is called. Fixes #1313 * Future.redispatchTasks() is a public method that can be manually called if a deadlock might occur due to queued tasks being executed synchronously. --- .../test/scala/akka/dispatch/FutureSpec.scala | 17 +++++++++++ .../src/main/scala/akka/dispatch/Future.scala | 29 ++++++++++++++++++- 2 files changed, 45 insertions(+), 1 deletion(-) diff --git a/akka-actor-tests/src/test/scala/akka/dispatch/FutureSpec.scala b/akka-actor-tests/src/test/scala/akka/dispatch/FutureSpec.scala index 417ee1e441..3b6b147ec5 100644 --- a/akka-actor-tests/src/test/scala/akka/dispatch/FutureSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/dispatch/FutureSpec.scala @@ -831,6 +831,23 @@ class FutureSpec extends AkkaSpec with Checkers with BeforeAndAfterAll { f4.await must be('completed) } + + "should not deadlock with nested await (ticket 1313)" in { + + val simple = Future() map (_ ⇒ (Future() map (_ ⇒ ())).get) + simple.await must be('completed) + + val latch = new StandardLatch + val complex = Future() map { _ ⇒ + val nested = Future() + nested.await + nested foreach (_ ⇒ latch.open) + Future.redispatchTasks + latch.await + } + complex.await must be('completed) + + } } } diff --git a/akka-actor/src/main/scala/akka/dispatch/Future.scala b/akka-actor/src/main/scala/akka/dispatch/Future.scala index 922aa9cf5c..a41463999b 100644 --- a/akka-actor/src/main/scala/akka/dispatch/Future.scala +++ b/akka-actor/src/main/scala/akka/dispatch/Future.scala @@ -359,6 +359,31 @@ object Future { // TODO make variant of flow(timeout)(body) which does NOT break type inference + /** + * Send queued tasks back to the dispatcher to be executed. This is needed if the current + * task may block while waiting for something to happen in a queued task. + * + * Example: + *
+   * val latch = new StandardLatch
+   * val future = Future() map { _ ⇒
+   *   val nested = Future()
+   *   nested.await
+   *   nested foreach (_ ⇒ latch.open)
+   *   Future.redispatchTasks
+   *   latch.await
+   * }
+   * 
+ */ + def redispatchTasks()(implicit dispatcher: MessageDispatcher): Unit = + _taskStack.get match { + case Some(taskStack) if taskStack.nonEmpty ⇒ + val tasks = taskStack.elems + taskStack.clear() + dispatchTask(() ⇒ _taskStack.get.get.elems = tasks, true) + case _ ⇒ // nothing to do + } + private val _taskStack = new ThreadLocal[Option[Stack[() ⇒ Unit]]]() { override def initialValue = None } @@ -857,7 +882,9 @@ class DefaultPromise[T](val timeout: Timeout)(implicit val dispatcher: MessageDi } } - def await(atMost: Duration): this.type = { + def await(atMost: Duration): this.type = if (value.isDefined) this else { + Future.redispatchTasks() + val waitNanos = if (timeout.duration.isFinite && atMost.isFinite) atMost.toNanos min timeLeft() From 7b485f659b73ce5bfa750e581362f3c54337c98a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Bone=CC=81r?= Date: Fri, 28 Oct 2011 11:01:24 +0200 Subject: [PATCH 05/57] Added documentation page on guaranteed delivery. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jonas Bonér --- akka-docs/general/guaranteed-delivery.rst | 42 +++++++++++++++++++++++ akka-docs/general/index.rst | 1 + 2 files changed, 43 insertions(+) create mode 100644 akka-docs/general/guaranteed-delivery.rst diff --git a/akka-docs/general/guaranteed-delivery.rst b/akka-docs/general/guaranteed-delivery.rst new file mode 100644 index 0000000000..957a3f2e0d --- /dev/null +++ b/akka-docs/general/guaranteed-delivery.rst @@ -0,0 +1,42 @@ + +.. _guaranteed-delivery: + +######### + Guaranteed Delivery +######### + + +Guaranteed Delivery +===== + +Akka does *not* support guaranteed delivery. + +First it is close to impossible to actually give guarantees like that, +second it is extremely costly trying to do so. +The network is inherently unreliable and there is no such thing as 100% +guarantee delivery, so it can never be guaranteed. + +The question is what to guarantee. That: + +1. The message is sent out on the network? +2. The message is received by the other host? +3. The message is put on the target actor's mailbox? +4. The message is applied to the target actor? +5. The message is starting to be executed by the target actor? +6. The message is finished executing by the target actor? + +Each one of this have different challenges and costs. + +Akka embraces distributed computing and the network and makes it explicit +through message passing, therefore it does not try to lie and emulate a +leaky abstraction. This is a model that have been used with great success +in Erlang and requires the user to model his application around. You can +read more about this approach in the `Erlang documentation`_ (section +10.9 and 10.10), Akka follows it closely. + +Bottom line; you as a developer knows what guarantees you need in your +application and can solve it fastest and most reliable by explicit ``ACK`` and +``RETRY`` (if you really need it, most often you don't). Using Akka's Durable +Mailboxes could help with this. + +.. _Erlang documentation: http://www.erlang.org/faq/academic.html diff --git a/akka-docs/general/index.rst b/akka-docs/general/index.rst index a578ebacbd..08874ecfac 100644 --- a/akka-docs/general/index.rst +++ b/akka-docs/general/index.rst @@ -9,4 +9,5 @@ General event-handler slf4j supervision + guaranteed-delivery From e9dfaf7ed8c155f1bf3d6436dbed0badfbc8cfdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Bone=CC=81r?= Date: Fri, 28 Oct 2011 12:00:06 +0200 Subject: [PATCH 06/57] Fixed misc FIXMEs --- akka-actor/src/main/scala/akka/actor/Actor.scala | 3 ++- .../main/scala/akka/routing/ConnectionManager.scala | 1 - .../src/main/scala/akka/routing/RoutedProps.scala | 2 -- akka-actor/src/main/scala/akka/routing/Routing.scala | 10 +++++----- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/akka-actor/src/main/scala/akka/actor/Actor.scala b/akka-actor/src/main/scala/akka/actor/Actor.scala index d55c330840..a6cb36443d 100644 --- a/akka-actor/src/main/scala/akka/actor/Actor.scala +++ b/akka-actor/src/main/scala/akka/actor/Actor.scala @@ -119,8 +119,9 @@ case class UnhandledMessageException(msg: Any, ref: ActorRef = null) extends Exc /** * Classes for passing status back to the sender. + * Used for internal ACKing protocol. But exposed as utility class for user-specific ACKing protocols as well. */ -object Status { //FIXME Why does this exist at all? +object Status { sealed trait Status extends Serializable case class Success(status: AnyRef) extends Status case class Failure(cause: Throwable) extends Status diff --git a/akka-actor/src/main/scala/akka/routing/ConnectionManager.scala b/akka-actor/src/main/scala/akka/routing/ConnectionManager.scala index 69ae417f53..80230e73ff 100644 --- a/akka-actor/src/main/scala/akka/routing/ConnectionManager.scala +++ b/akka-actor/src/main/scala/akka/routing/ConnectionManager.scala @@ -14,7 +14,6 @@ import java.net.InetSocketAddress /** * An Iterable that also contains a version. */ -// FIXME REMOVE VersionedIterable trait VersionedIterable[A] { val version: Long diff --git a/akka-actor/src/main/scala/akka/routing/RoutedProps.scala b/akka-actor/src/main/scala/akka/routing/RoutedProps.scala index a1b15dd763..9492824cc6 100644 --- a/akka-actor/src/main/scala/akka/routing/RoutedProps.scala +++ b/akka-actor/src/main/scala/akka/routing/RoutedProps.scala @@ -59,8 +59,6 @@ object RouterType { /** * A RouterType that select the connection based on the least amount of ram used. - * - * FIXME: this is extremely vague currently since there are so many ways to define least amount of ram. */ object LeastRAM extends RouterType diff --git a/akka-actor/src/main/scala/akka/routing/Routing.scala b/akka-actor/src/main/scala/akka/routing/Routing.scala index 77ce3de642..b68c6016ae 100644 --- a/akka-actor/src/main/scala/akka/routing/Routing.scala +++ b/akka-actor/src/main/scala/akka/routing/Routing.scala @@ -142,8 +142,6 @@ private[akka] class RoutedActorRef(val routedProps: RoutedProps, override val ad /** * An Abstract Router implementation that already provides the basic infrastructure so that a concrete * Router only needs to implement the next method. - * - * FIXME: this is also the location where message buffering should be done in case of failure. */ trait BasicRouter extends Router { @@ -258,15 +256,17 @@ class DirectRouter extends BasicRouter { * @author Jonas Bonér */ class RandomRouter extends BasicRouter { + import java.security.SecureRandom private val state = new AtomicReference[RandomRouterState] - //FIXME: threadlocal random? - private val random = new java.util.Random(System.nanoTime) + private val random = new ThreadLocal[SecureRandom] { + override def initialValue = SecureRandom.getInstance("SHA1PRNG") + } def next: Option[ActorRef] = currentState.array match { case a if a.isEmpty ⇒ None - case a ⇒ Some(a(random.nextInt(a.length))) + case a ⇒ Some(a(random.get.nextInt(a.length))) } @tailrec From 9bf9cea0d961b3b448fdfc79aa55f1dc2c4c102f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Bone=CC=81r?= Date: Fri, 28 Oct 2011 15:55:15 +0200 Subject: [PATCH 07/57] Removed trailing whitespace --- .../java/akka/dispatch/JavaFutureTests.java | 2 +- .../src/main/java/com/eaio/uuid/UUIDGen.java | 10 +- .../main/scala/akka/actor/FaultHandling.scala | 8 +- .../main/scala/akka/dispatch/Dispatcher.scala | 2 +- .../main/scala/akka/event/DeathWatch.scala | 2 +- .../src/main/scala/akka/event/EventBus.scala | 2 +- .../scala/akka/event/EventBusJavaAPI.scala | 2 +- .../src/main/scala/akka/event/Logging.scala | 6 +- .../ClusterActorRefCleanupMultiJvmNode3.conf | 2 +- .../DirectRoutingFailoverMultiJvmNode1.conf | 2 +- .../homenode/HomeNodeMultiJvmNode1.conf | 2 +- .../homenode/HomeNodeMultiJvmNode2.conf | 2 +- .../Random1ReplicaMultiJvmNode1.conf | 2 +- .../RoundRobinFailoverMultiJvmNode1.conf | 2 +- .../RoundRobinFailoverMultiJvmNode2.conf | 2 +- .../RoundRobinFailoverMultiJvmNode3.conf | 2 +- .../homenode/HomeNodeMultiJvmNode1.conf | 2 +- .../homenode/HomeNodeMultiJvmNode2.conf | 2 +- .../RoundRobin1ReplicaMultiJvmNode1.conf | 2 +- .../ScatterGatherFailoverMultiJvmNode1.conf | 2 +- .../ScatterGatherFailoverMultiJvmNode2.conf | 2 +- .../akka/actor/mailbox/MailboxProtocol.java | 188 +- .../main/java/akka/remote/RemoteProtocol.java | 1650 ++++++++--------- .../scala/akka/remote/FileBasedBarrier.scala | 2 +- .../java/akka/actor/ProtobufProtocol.java | 96 +- .../remote/AccrualFailureDetectorSpec.scala | 2 +- .../test/scala/akka/remote/GossiperSpec.scala | 2 +- .../scala/akka/remote/VectorClockSpec.scala | 2 +- .../akka-sample-camel/config/akka.conf | 2 +- .../akka-sample-hello/config/akka.conf | 2 +- .../spring/RemoteTypedSessionActorImpl.java | 2 +- .../java/akka/spring/foo/StatefulPojo.java | 2 +- akka-spring/src/test/resources/akka-test.conf | 2 +- .../java/akka/transactor/test/Increment.java | 2 +- .../test/scala/akka/testkit/AkkaSpec.scala | 2 +- 35 files changed, 1008 insertions(+), 1008 deletions(-) diff --git a/akka-actor-tests/src/test/java/akka/dispatch/JavaFutureTests.java b/akka-actor-tests/src/test/java/akka/dispatch/JavaFutureTests.java index 88ca6bcb30..1dc80937ae 100644 --- a/akka-actor-tests/src/test/java/akka/dispatch/JavaFutureTests.java +++ b/akka-actor-tests/src/test/java/akka/dispatch/JavaFutureTests.java @@ -18,7 +18,7 @@ import scala.Some; import scala.Right; public class JavaFutureTests { - + private final AkkaApplication app = new AkkaApplication(); private final Timeout t = app.AkkaConfig().ActorTimeout(); private final FutureFactory ff = new FutureFactory(app.dispatcher(), t); diff --git a/akka-actor/src/main/java/com/eaio/uuid/UUIDGen.java b/akka-actor/src/main/java/com/eaio/uuid/UUIDGen.java index 6e46b7e294..fb60e1727a 100644 --- a/akka-actor/src/main/java/com/eaio/uuid/UUIDGen.java +++ b/akka-actor/src/main/java/com/eaio/uuid/UUIDGen.java @@ -74,7 +74,7 @@ public final class UUIDGen { * The last time value. Used to remove duplicate UUIDs. */ private final static AtomicLong lastTime = new AtomicLong(Long.MIN_VALUE); - + /** * The cached MAC address. */ @@ -233,11 +233,11 @@ public final class UUIDGen { public static long newTime() { return createTime(System.currentTimeMillis()); } - + /** * Creates a new time field from the given timestamp. Note that even identical * values of currentTimeMillis will produce different time fields. - * + * * @param currentTimeMillis the timestamp * @return a new time value * @see UUID#getTime() @@ -275,10 +275,10 @@ public final class UUIDGen { return time; } - + /** * Returns the MAC address. Not guaranteed to return anything. - * + * * @return the MAC address, may be null */ public static String getMACAddress() { diff --git a/akka-actor/src/main/scala/akka/actor/FaultHandling.scala b/akka-actor/src/main/scala/akka/actor/FaultHandling.scala index e3e662726e..c40514bd62 100644 --- a/akka-actor/src/main/scala/akka/actor/FaultHandling.scala +++ b/akka-actor/src/main/scala/akka/actor/FaultHandling.scala @@ -21,8 +21,8 @@ case class ChildRestartStats(var maxNrOfRetriesCount: Int = 0, var restartTimeWi private def retriesInWindowOkay(retries: Int, window: Int): Boolean = { /* - * Simple window algorithm: window is kept open for a certain time - * after a restart and if enough restarts happen during this time, it + * Simple window algorithm: window is kept open for a certain time + * after a restart and if enough restarts happen during this time, it * denies. Otherwise window closes and the scheme starts over. */ val retriesDone = maxNrOfRetriesCount + 1 @@ -181,7 +181,7 @@ case class AllForOneStrategy(decider: FaultHandlingStrategy.Decider, if (withinTimeRange < 0) None else Some(withinTimeRange)) /* - * this is a performance optimization to avoid re-allocating the pairs upon + * this is a performance optimization to avoid re-allocating the pairs upon * every call to requestRestartPermission, assuming that strategies are shared * across actors and thus this field does not take up much space */ @@ -238,7 +238,7 @@ case class OneForOneStrategy(decider: FaultHandlingStrategy.Decider, if (withinTimeRange < 0) None else Some(withinTimeRange)) /* - * this is a performance optimization to avoid re-allocating the pairs upon + * this is a performance optimization to avoid re-allocating the pairs upon * every call to requestRestartPermission, assuming that strategies are shared * across actors and thus this field does not take up much space */ diff --git a/akka-actor/src/main/scala/akka/dispatch/Dispatcher.scala b/akka-actor/src/main/scala/akka/dispatch/Dispatcher.scala index f9819c3cd3..946bac8a9c 100644 --- a/akka-actor/src/main/scala/akka/dispatch/Dispatcher.scala +++ b/akka-actor/src/main/scala/akka/dispatch/Dispatcher.scala @@ -153,4 +153,4 @@ abstract class PriorityGenerator extends java.util.Comparator[Envelope] { final def compare(thisMessage: Envelope, thatMessage: Envelope): Int = gen(thisMessage.message) - gen(thatMessage.message) -} \ No newline at end of file +} diff --git a/akka-actor/src/main/scala/akka/event/DeathWatch.scala b/akka-actor/src/main/scala/akka/event/DeathWatch.scala index 099d45a703..b03dbe97b9 100644 --- a/akka-actor/src/main/scala/akka/event/DeathWatch.scala +++ b/akka-actor/src/main/scala/akka/event/DeathWatch.scala @@ -16,4 +16,4 @@ trait DeathWatch extends ActorEventBus with ActorClassifier { type Event = Terminated protected final def classify(event: Event): Classifier = event.actor -} \ No newline at end of file +} diff --git a/akka-actor/src/main/scala/akka/event/EventBus.scala b/akka-actor/src/main/scala/akka/event/EventBus.scala index 9dd76f5344..36b878dcb9 100644 --- a/akka-actor/src/main/scala/akka/event/EventBus.scala +++ b/akka-actor/src/main/scala/akka/event/EventBus.scala @@ -262,4 +262,4 @@ trait ActorClassification { self: ActorEventBus with ActorClassifier ⇒ def subscribe(subscriber: Subscriber, to: Classifier): Boolean = associate(to, subscriber) def unsubscribe(subscriber: Subscriber, from: Classifier): Boolean = dissociate(from, subscriber) def unsubscribe(subscriber: Subscriber): Unit = dissociate(subscriber) -} \ No newline at end of file +} diff --git a/akka-actor/src/main/scala/akka/event/EventBusJavaAPI.scala b/akka-actor/src/main/scala/akka/event/EventBusJavaAPI.scala index 669198c187..059df35cd2 100644 --- a/akka-actor/src/main/scala/akka/event/EventBusJavaAPI.scala +++ b/akka-actor/src/main/scala/akka/event/EventBusJavaAPI.scala @@ -35,4 +35,4 @@ abstract class ScanningEventBus[E, S, C] extends EventBus with ScanningClassific abstract class ActorEventBus[E] extends akka.event.ActorEventBus with ActorClassification with ActorClassifier { -} \ No newline at end of file +} diff --git a/akka-actor/src/main/scala/akka/event/Logging.scala b/akka-actor/src/main/scala/akka/event/Logging.scala index 12ead94967..38964d3f43 100644 --- a/akka-actor/src/main/scala/akka/event/Logging.scala +++ b/akka-actor/src/main/scala/akka/event/Logging.scala @@ -11,7 +11,7 @@ import akka.actor.Actor trait Logging { /* - * implement these as precisely as needed/possible: always returning true + * implement these as precisely as needed/possible: always returning true * just makes the notify... methods be called every time. */ def isErrorEnabled: Boolean @@ -20,7 +20,7 @@ trait Logging { def isDebugEnabled: Boolean /* - * These actually implement the passing on of the messages to be logged. + * These actually implement the passing on of the messages to be logged. * Will not be called if is...Enabled returned false. */ protected def notifyError(cause: Throwable, message: String) @@ -105,4 +105,4 @@ class EventHandlerLogging(val eventHandler: EventHandler, val loggingInstance: A protected def notifyDebug(message: String) { eventHandler.notifyListeners(Debug(loggingInstance, message)) } -} \ No newline at end of file +} diff --git a/akka-cluster/src/multi-jvm/scala/akka/cluster/reflogic/ClusterActorRefCleanupMultiJvmNode3.conf b/akka-cluster/src/multi-jvm/scala/akka/cluster/reflogic/ClusterActorRefCleanupMultiJvmNode3.conf index c14213d337..20e6354a0d 100644 --- a/akka-cluster/src/multi-jvm/scala/akka/cluster/reflogic/ClusterActorRefCleanupMultiJvmNode3.conf +++ b/akka-cluster/src/multi-jvm/scala/akka/cluster/reflogic/ClusterActorRefCleanupMultiJvmNode3.conf @@ -3,4 +3,4 @@ akka.event-handler-level = "WARNING" akka.actor.deployment.service-test.router = "round-robin" akka.actor.deployment.service-test.cluster.preferred-nodes = ["node:node2","node:node3"] akka.actor.deployment.service-test.nr-of-instances = 2 -akka.remote.client.buffering.retry-message-send-on-failure = false \ No newline at end of file +akka.remote.client.buffering.retry-message-send-on-failure = false diff --git a/akka-cluster/src/multi-jvm/scala/akka/cluster/routing/direct/failover/DirectRoutingFailoverMultiJvmNode1.conf b/akka-cluster/src/multi-jvm/scala/akka/cluster/routing/direct/failover/DirectRoutingFailoverMultiJvmNode1.conf index aa92b01e0b..7332be6934 100644 --- a/akka-cluster/src/multi-jvm/scala/akka/cluster/routing/direct/failover/DirectRoutingFailoverMultiJvmNode1.conf +++ b/akka-cluster/src/multi-jvm/scala/akka/cluster/routing/direct/failover/DirectRoutingFailoverMultiJvmNode1.conf @@ -2,4 +2,4 @@ akka.enabled-modules = ["cluster"] akka.event-handlers = ["akka.testkit.TestEventListener"] akka.event-handler-level = "WARNING" akka.actor.deployment.service-hello.router = "direct" -akka.actor.deployment.service-hello.cluster.preferred-nodes = ["node:node2"] \ No newline at end of file +akka.actor.deployment.service-hello.cluster.preferred-nodes = ["node:node2"] diff --git a/akka-cluster/src/multi-jvm/scala/akka/cluster/routing/random/homenode/HomeNodeMultiJvmNode1.conf b/akka-cluster/src/multi-jvm/scala/akka/cluster/routing/random/homenode/HomeNodeMultiJvmNode1.conf index e392d0d66f..012685917c 100644 --- a/akka-cluster/src/multi-jvm/scala/akka/cluster/routing/random/homenode/HomeNodeMultiJvmNode1.conf +++ b/akka-cluster/src/multi-jvm/scala/akka/cluster/routing/random/homenode/HomeNodeMultiJvmNode1.conf @@ -5,4 +5,4 @@ akka.actor.deployment.service-node1.cluster.preferred-nodes = ["node:node1"] akka.actor.deployment.service-node1.nr-of-instances = 1 akka.actor.deployment.service-node2.router = "random" akka.actor.deployment.service-node2.cluster.preferred-nodes = ["node:node2"] -akka.actor.deployment.service-node2.nr-of-instances = 1 \ No newline at end of file +akka.actor.deployment.service-node2.nr-of-instances = 1 diff --git a/akka-cluster/src/multi-jvm/scala/akka/cluster/routing/random/homenode/HomeNodeMultiJvmNode2.conf b/akka-cluster/src/multi-jvm/scala/akka/cluster/routing/random/homenode/HomeNodeMultiJvmNode2.conf index e392d0d66f..012685917c 100644 --- a/akka-cluster/src/multi-jvm/scala/akka/cluster/routing/random/homenode/HomeNodeMultiJvmNode2.conf +++ b/akka-cluster/src/multi-jvm/scala/akka/cluster/routing/random/homenode/HomeNodeMultiJvmNode2.conf @@ -5,4 +5,4 @@ akka.actor.deployment.service-node1.cluster.preferred-nodes = ["node:node1"] akka.actor.deployment.service-node1.nr-of-instances = 1 akka.actor.deployment.service-node2.router = "random" akka.actor.deployment.service-node2.cluster.preferred-nodes = ["node:node2"] -akka.actor.deployment.service-node2.nr-of-instances = 1 \ No newline at end of file +akka.actor.deployment.service-node2.nr-of-instances = 1 diff --git a/akka-cluster/src/multi-jvm/scala/akka/cluster/routing/random/replicationfactor_1/Random1ReplicaMultiJvmNode1.conf b/akka-cluster/src/multi-jvm/scala/akka/cluster/routing/random/replicationfactor_1/Random1ReplicaMultiJvmNode1.conf index b74a4c1892..729dc64fd6 100644 --- a/akka-cluster/src/multi-jvm/scala/akka/cluster/routing/random/replicationfactor_1/Random1ReplicaMultiJvmNode1.conf +++ b/akka-cluster/src/multi-jvm/scala/akka/cluster/routing/random/replicationfactor_1/Random1ReplicaMultiJvmNode1.conf @@ -1,4 +1,4 @@ akka.enabled-modules = ["cluster"] akka.event-handler-level = "WARNING" akka.actor.deployment.service-hello.router = "random" -akka.actor.deployment.service-hello.nr-of-instances = 1 \ No newline at end of file +akka.actor.deployment.service-hello.nr-of-instances = 1 diff --git a/akka-cluster/src/multi-jvm/scala/akka/cluster/routing/roundrobin/failover/RoundRobinFailoverMultiJvmNode1.conf b/akka-cluster/src/multi-jvm/scala/akka/cluster/routing/roundrobin/failover/RoundRobinFailoverMultiJvmNode1.conf index 10f400826f..0a858fb8fd 100644 --- a/akka-cluster/src/multi-jvm/scala/akka/cluster/routing/roundrobin/failover/RoundRobinFailoverMultiJvmNode1.conf +++ b/akka-cluster/src/multi-jvm/scala/akka/cluster/routing/roundrobin/failover/RoundRobinFailoverMultiJvmNode1.conf @@ -5,4 +5,4 @@ akka.actor.deployment.service-hello.router = "round-robin" akka.actor.deployment.service-hello.nr-of-instances = 2 akka.actor.deployment.service-hello.cluster.preferred-nodes = ["node:node1","node:node3"] akka.cluster.include-ref-node-in-replica-set = on -akka.actor.timeout = 30 \ No newline at end of file +akka.actor.timeout = 30 diff --git a/akka-cluster/src/multi-jvm/scala/akka/cluster/routing/roundrobin/failover/RoundRobinFailoverMultiJvmNode2.conf b/akka-cluster/src/multi-jvm/scala/akka/cluster/routing/roundrobin/failover/RoundRobinFailoverMultiJvmNode2.conf index 10f400826f..0a858fb8fd 100644 --- a/akka-cluster/src/multi-jvm/scala/akka/cluster/routing/roundrobin/failover/RoundRobinFailoverMultiJvmNode2.conf +++ b/akka-cluster/src/multi-jvm/scala/akka/cluster/routing/roundrobin/failover/RoundRobinFailoverMultiJvmNode2.conf @@ -5,4 +5,4 @@ akka.actor.deployment.service-hello.router = "round-robin" akka.actor.deployment.service-hello.nr-of-instances = 2 akka.actor.deployment.service-hello.cluster.preferred-nodes = ["node:node1","node:node3"] akka.cluster.include-ref-node-in-replica-set = on -akka.actor.timeout = 30 \ No newline at end of file +akka.actor.timeout = 30 diff --git a/akka-cluster/src/multi-jvm/scala/akka/cluster/routing/roundrobin/failover/RoundRobinFailoverMultiJvmNode3.conf b/akka-cluster/src/multi-jvm/scala/akka/cluster/routing/roundrobin/failover/RoundRobinFailoverMultiJvmNode3.conf index 10f400826f..0a858fb8fd 100644 --- a/akka-cluster/src/multi-jvm/scala/akka/cluster/routing/roundrobin/failover/RoundRobinFailoverMultiJvmNode3.conf +++ b/akka-cluster/src/multi-jvm/scala/akka/cluster/routing/roundrobin/failover/RoundRobinFailoverMultiJvmNode3.conf @@ -5,4 +5,4 @@ akka.actor.deployment.service-hello.router = "round-robin" akka.actor.deployment.service-hello.nr-of-instances = 2 akka.actor.deployment.service-hello.cluster.preferred-nodes = ["node:node1","node:node3"] akka.cluster.include-ref-node-in-replica-set = on -akka.actor.timeout = 30 \ No newline at end of file +akka.actor.timeout = 30 diff --git a/akka-cluster/src/multi-jvm/scala/akka/cluster/routing/roundrobin/homenode/HomeNodeMultiJvmNode1.conf b/akka-cluster/src/multi-jvm/scala/akka/cluster/routing/roundrobin/homenode/HomeNodeMultiJvmNode1.conf index 068c164510..85536cd656 100644 --- a/akka-cluster/src/multi-jvm/scala/akka/cluster/routing/roundrobin/homenode/HomeNodeMultiJvmNode1.conf +++ b/akka-cluster/src/multi-jvm/scala/akka/cluster/routing/roundrobin/homenode/HomeNodeMultiJvmNode1.conf @@ -5,4 +5,4 @@ akka.actor.deployment.service-node1.cluster.preferred-nodes = ["node:node1"] akka.actor.deployment.service-node1.nr-of-instances = 1 akka.actor.deployment.service-node2.router = "round-robin" akka.actor.deployment.service-node2.cluster.preferred-nodes = ["node:node2"] -akka.actor.deployment.service-node2.nr-of-instances = 1 \ No newline at end of file +akka.actor.deployment.service-node2.nr-of-instances = 1 diff --git a/akka-cluster/src/multi-jvm/scala/akka/cluster/routing/roundrobin/homenode/HomeNodeMultiJvmNode2.conf b/akka-cluster/src/multi-jvm/scala/akka/cluster/routing/roundrobin/homenode/HomeNodeMultiJvmNode2.conf index a1d99e5260..99c85fd1a8 100644 --- a/akka-cluster/src/multi-jvm/scala/akka/cluster/routing/roundrobin/homenode/HomeNodeMultiJvmNode2.conf +++ b/akka-cluster/src/multi-jvm/scala/akka/cluster/routing/roundrobin/homenode/HomeNodeMultiJvmNode2.conf @@ -2,4 +2,4 @@ akka.enabled-modules = ["cluster"] akka.event-handler-level = "WARNING" akka.actor.deployment.service-hello.router = "round-robin" akka.actor.deployment.service-hello.cluster.preferred-nodes = ["node:node1"] -akka.actor.deployment.service-hello.nr-of-instances = 1 \ No newline at end of file +akka.actor.deployment.service-hello.nr-of-instances = 1 diff --git a/akka-cluster/src/multi-jvm/scala/akka/cluster/routing/roundrobin/replicationfactor_1/RoundRobin1ReplicaMultiJvmNode1.conf b/akka-cluster/src/multi-jvm/scala/akka/cluster/routing/roundrobin/replicationfactor_1/RoundRobin1ReplicaMultiJvmNode1.conf index a9418d6360..88df1a6421 100644 --- a/akka-cluster/src/multi-jvm/scala/akka/cluster/routing/roundrobin/replicationfactor_1/RoundRobin1ReplicaMultiJvmNode1.conf +++ b/akka-cluster/src/multi-jvm/scala/akka/cluster/routing/roundrobin/replicationfactor_1/RoundRobin1ReplicaMultiJvmNode1.conf @@ -1,4 +1,4 @@ akka.enabled-modules = ["cluster"] akka.event-handler-level = "WARNING" akka.actor.deployment.service-hello.router = "round-robin" -akka.actor.deployment.service-hello.nr-of-instances = 1 \ No newline at end of file +akka.actor.deployment.service-hello.nr-of-instances = 1 diff --git a/akka-cluster/src/multi-jvm/scala/akka/cluster/routing/scattergather/failover/ScatterGatherFailoverMultiJvmNode1.conf b/akka-cluster/src/multi-jvm/scala/akka/cluster/routing/scattergather/failover/ScatterGatherFailoverMultiJvmNode1.conf index 2140cc3d27..fd2babf3a9 100644 --- a/akka-cluster/src/multi-jvm/scala/akka/cluster/routing/scattergather/failover/ScatterGatherFailoverMultiJvmNode1.conf +++ b/akka-cluster/src/multi-jvm/scala/akka/cluster/routing/scattergather/failover/ScatterGatherFailoverMultiJvmNode1.conf @@ -3,4 +3,4 @@ akka.event-handlers = ["akka.testkit.TestEventListener"] akka.event-handler-level = "WARNING" akka.actor.deployment.service-hello.router = "akka.routing.ScatterGatherFirstCompletedRouter" akka.actor.deployment.service-hello.nr-of-instances = 2 -akka.actor.timeout = 30 \ No newline at end of file +akka.actor.timeout = 30 diff --git a/akka-cluster/src/multi-jvm/scala/akka/cluster/routing/scattergather/failover/ScatterGatherFailoverMultiJvmNode2.conf b/akka-cluster/src/multi-jvm/scala/akka/cluster/routing/scattergather/failover/ScatterGatherFailoverMultiJvmNode2.conf index 2140cc3d27..fd2babf3a9 100644 --- a/akka-cluster/src/multi-jvm/scala/akka/cluster/routing/scattergather/failover/ScatterGatherFailoverMultiJvmNode2.conf +++ b/akka-cluster/src/multi-jvm/scala/akka/cluster/routing/scattergather/failover/ScatterGatherFailoverMultiJvmNode2.conf @@ -3,4 +3,4 @@ akka.event-handlers = ["akka.testkit.TestEventListener"] akka.event-handler-level = "WARNING" akka.actor.deployment.service-hello.router = "akka.routing.ScatterGatherFirstCompletedRouter" akka.actor.deployment.service-hello.nr-of-instances = 2 -akka.actor.timeout = 30 \ No newline at end of file +akka.actor.timeout = 30 diff --git a/akka-durable-mailboxes/akka-mailboxes-common/src/main/java/akka/actor/mailbox/MailboxProtocol.java b/akka-durable-mailboxes/akka-mailboxes-common/src/main/java/akka/actor/mailbox/MailboxProtocol.java index 94c8cfde3e..dc395167d4 100644 --- a/akka-durable-mailboxes/akka-mailboxes-common/src/main/java/akka/actor/mailbox/MailboxProtocol.java +++ b/akka-durable-mailboxes/akka-mailboxes-common/src/main/java/akka/actor/mailbox/MailboxProtocol.java @@ -10,20 +10,20 @@ public final class MailboxProtocol { } public interface DurableMailboxMessageProtocolOrBuilder extends com.google.protobuf.MessageOrBuilder { - + // required string ownerAddress = 1; boolean hasOwnerAddress(); String getOwnerAddress(); - + // optional string senderAddress = 2; boolean hasSenderAddress(); String getSenderAddress(); - + // optional .UuidProtocol futureUuid = 3; boolean hasFutureUuid(); akka.actor.mailbox.MailboxProtocol.UuidProtocol getFutureUuid(); akka.actor.mailbox.MailboxProtocol.UuidProtocolOrBuilder getFutureUuidOrBuilder(); - + // required bytes message = 4; boolean hasMessage(); com.google.protobuf.ByteString getMessage(); @@ -36,26 +36,26 @@ public final class MailboxProtocol { super(builder); } private DurableMailboxMessageProtocol(boolean noInit) {} - + private static final DurableMailboxMessageProtocol defaultInstance; public static DurableMailboxMessageProtocol getDefaultInstance() { return defaultInstance; } - + public DurableMailboxMessageProtocol getDefaultInstanceForType() { return defaultInstance; } - + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return akka.actor.mailbox.MailboxProtocol.internal_static_DurableMailboxMessageProtocol_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return akka.actor.mailbox.MailboxProtocol.internal_static_DurableMailboxMessageProtocol_fieldAccessorTable; } - + private int bitField0_; // required string ownerAddress = 1; public static final int OWNERADDRESS_FIELD_NUMBER = 1; @@ -68,7 +68,7 @@ public final class MailboxProtocol { if (ref instanceof String) { return (String) ref; } else { - com.google.protobuf.ByteString bs = + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; String s = bs.toStringUtf8(); if (com.google.protobuf.Internal.isValidUtf8(bs)) { @@ -80,7 +80,7 @@ public final class MailboxProtocol { private com.google.protobuf.ByteString getOwnerAddressBytes() { java.lang.Object ref = ownerAddress_; if (ref instanceof String) { - com.google.protobuf.ByteString b = + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((String) ref); ownerAddress_ = b; return b; @@ -88,7 +88,7 @@ public final class MailboxProtocol { return (com.google.protobuf.ByteString) ref; } } - + // optional string senderAddress = 2; public static final int SENDERADDRESS_FIELD_NUMBER = 2; private java.lang.Object senderAddress_; @@ -100,7 +100,7 @@ public final class MailboxProtocol { if (ref instanceof String) { return (String) ref; } else { - com.google.protobuf.ByteString bs = + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; String s = bs.toStringUtf8(); if (com.google.protobuf.Internal.isValidUtf8(bs)) { @@ -112,7 +112,7 @@ public final class MailboxProtocol { private com.google.protobuf.ByteString getSenderAddressBytes() { java.lang.Object ref = senderAddress_; if (ref instanceof String) { - com.google.protobuf.ByteString b = + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((String) ref); senderAddress_ = b; return b; @@ -120,7 +120,7 @@ public final class MailboxProtocol { return (com.google.protobuf.ByteString) ref; } } - + // optional .UuidProtocol futureUuid = 3; public static final int FUTUREUUID_FIELD_NUMBER = 3; private akka.actor.mailbox.MailboxProtocol.UuidProtocol futureUuid_; @@ -133,7 +133,7 @@ public final class MailboxProtocol { public akka.actor.mailbox.MailboxProtocol.UuidProtocolOrBuilder getFutureUuidOrBuilder() { return futureUuid_; } - + // required bytes message = 4; public static final int MESSAGE_FIELD_NUMBER = 4; private com.google.protobuf.ByteString message_; @@ -143,7 +143,7 @@ public final class MailboxProtocol { public com.google.protobuf.ByteString getMessage() { return message_; } - + private void initFields() { ownerAddress_ = ""; senderAddress_ = ""; @@ -154,7 +154,7 @@ public final class MailboxProtocol { public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized != -1) return isInitialized == 1; - + if (!hasOwnerAddress()) { memoizedIsInitialized = 0; return false; @@ -172,7 +172,7 @@ public final class MailboxProtocol { memoizedIsInitialized = 1; return true; } - + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); @@ -190,12 +190,12 @@ public final class MailboxProtocol { } getUnknownFields().writeTo(output); } - + private int memoizedSerializedSize = -1; public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; - + size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream @@ -217,14 +217,14 @@ public final class MailboxProtocol { memoizedSerializedSize = size; return size; } - + private static final long serialVersionUID = 0L; @java.lang.Override protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { return super.writeReplace(); } - + public static akka.actor.mailbox.MailboxProtocol.DurableMailboxMessageProtocol parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { @@ -291,14 +291,14 @@ public final class MailboxProtocol { return newBuilder().mergeFrom(input, extensionRegistry) .buildParsed(); } - + public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(akka.actor.mailbox.MailboxProtocol.DurableMailboxMessageProtocol prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } - + @java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessage.BuilderParent parent) { @@ -312,17 +312,17 @@ public final class MailboxProtocol { getDescriptor() { return akka.actor.mailbox.MailboxProtocol.internal_static_DurableMailboxMessageProtocol_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return akka.actor.mailbox.MailboxProtocol.internal_static_DurableMailboxMessageProtocol_fieldAccessorTable; } - + // Construct using akka.actor.mailbox.MailboxProtocol.DurableMailboxMessageProtocol.newBuilder() private Builder() { maybeForceBuilderInitialization(); } - + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); @@ -335,7 +335,7 @@ public final class MailboxProtocol { private static Builder create() { return new Builder(); } - + public Builder clear() { super.clear(); ownerAddress_ = ""; @@ -352,20 +352,20 @@ public final class MailboxProtocol { bitField0_ = (bitField0_ & ~0x00000008); return this; } - + public Builder clone() { return create().mergeFrom(buildPartial()); } - + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return akka.actor.mailbox.MailboxProtocol.DurableMailboxMessageProtocol.getDescriptor(); } - + public akka.actor.mailbox.MailboxProtocol.DurableMailboxMessageProtocol getDefaultInstanceForType() { return akka.actor.mailbox.MailboxProtocol.DurableMailboxMessageProtocol.getDefaultInstance(); } - + public akka.actor.mailbox.MailboxProtocol.DurableMailboxMessageProtocol build() { akka.actor.mailbox.MailboxProtocol.DurableMailboxMessageProtocol result = buildPartial(); if (!result.isInitialized()) { @@ -373,7 +373,7 @@ public final class MailboxProtocol { } return result; } - + private akka.actor.mailbox.MailboxProtocol.DurableMailboxMessageProtocol buildParsed() throws com.google.protobuf.InvalidProtocolBufferException { akka.actor.mailbox.MailboxProtocol.DurableMailboxMessageProtocol result = buildPartial(); @@ -383,7 +383,7 @@ public final class MailboxProtocol { } return result; } - + public akka.actor.mailbox.MailboxProtocol.DurableMailboxMessageProtocol buildPartial() { akka.actor.mailbox.MailboxProtocol.DurableMailboxMessageProtocol result = new akka.actor.mailbox.MailboxProtocol.DurableMailboxMessageProtocol(this); int from_bitField0_ = bitField0_; @@ -412,7 +412,7 @@ public final class MailboxProtocol { onBuilt(); return result; } - + public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof akka.actor.mailbox.MailboxProtocol.DurableMailboxMessageProtocol) { return mergeFrom((akka.actor.mailbox.MailboxProtocol.DurableMailboxMessageProtocol)other); @@ -421,7 +421,7 @@ public final class MailboxProtocol { return this; } } - + public Builder mergeFrom(akka.actor.mailbox.MailboxProtocol.DurableMailboxMessageProtocol other) { if (other == akka.actor.mailbox.MailboxProtocol.DurableMailboxMessageProtocol.getDefaultInstance()) return this; if (other.hasOwnerAddress()) { @@ -439,25 +439,25 @@ public final class MailboxProtocol { this.mergeUnknownFields(other.getUnknownFields()); return this; } - + public final boolean isInitialized() { if (!hasOwnerAddress()) { - + return false; } if (!hasMessage()) { - + return false; } if (hasFutureUuid()) { if (!getFutureUuid().isInitialized()) { - + return false; } } return true; } - + public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) @@ -508,9 +508,9 @@ public final class MailboxProtocol { } } } - + private int bitField0_; - + // required string ownerAddress = 1; private java.lang.Object ownerAddress_ = ""; public boolean hasOwnerAddress() { @@ -546,7 +546,7 @@ public final class MailboxProtocol { ownerAddress_ = value; onChanged(); } - + // optional string senderAddress = 2; private java.lang.Object senderAddress_ = ""; public boolean hasSenderAddress() { @@ -582,7 +582,7 @@ public final class MailboxProtocol { senderAddress_ = value; onChanged(); } - + // optional .UuidProtocol futureUuid = 3; private akka.actor.mailbox.MailboxProtocol.UuidProtocol futureUuid_ = akka.actor.mailbox.MailboxProtocol.UuidProtocol.getDefaultInstance(); private com.google.protobuf.SingleFieldBuilder< @@ -660,7 +660,7 @@ public final class MailboxProtocol { } } private com.google.protobuf.SingleFieldBuilder< - akka.actor.mailbox.MailboxProtocol.UuidProtocol, akka.actor.mailbox.MailboxProtocol.UuidProtocol.Builder, akka.actor.mailbox.MailboxProtocol.UuidProtocolOrBuilder> + akka.actor.mailbox.MailboxProtocol.UuidProtocol, akka.actor.mailbox.MailboxProtocol.UuidProtocol.Builder, akka.actor.mailbox.MailboxProtocol.UuidProtocolOrBuilder> getFutureUuidFieldBuilder() { if (futureUuidBuilder_ == null) { futureUuidBuilder_ = new com.google.protobuf.SingleFieldBuilder< @@ -672,7 +672,7 @@ public final class MailboxProtocol { } return futureUuidBuilder_; } - + // required bytes message = 4; private com.google.protobuf.ByteString message_ = com.google.protobuf.ByteString.EMPTY; public boolean hasMessage() { @@ -696,25 +696,25 @@ public final class MailboxProtocol { onChanged(); return this; } - + // @@protoc_insertion_point(builder_scope:DurableMailboxMessageProtocol) } - + static { defaultInstance = new DurableMailboxMessageProtocol(true); defaultInstance.initFields(); } - + // @@protoc_insertion_point(class_scope:DurableMailboxMessageProtocol) } - + public interface UuidProtocolOrBuilder extends com.google.protobuf.MessageOrBuilder { - + // required uint64 high = 1; boolean hasHigh(); long getHigh(); - + // required uint64 low = 2; boolean hasLow(); long getLow(); @@ -727,26 +727,26 @@ public final class MailboxProtocol { super(builder); } private UuidProtocol(boolean noInit) {} - + private static final UuidProtocol defaultInstance; public static UuidProtocol getDefaultInstance() { return defaultInstance; } - + public UuidProtocol getDefaultInstanceForType() { return defaultInstance; } - + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return akka.actor.mailbox.MailboxProtocol.internal_static_UuidProtocol_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return akka.actor.mailbox.MailboxProtocol.internal_static_UuidProtocol_fieldAccessorTable; } - + private int bitField0_; // required uint64 high = 1; public static final int HIGH_FIELD_NUMBER = 1; @@ -757,7 +757,7 @@ public final class MailboxProtocol { public long getHigh() { return high_; } - + // required uint64 low = 2; public static final int LOW_FIELD_NUMBER = 2; private long low_; @@ -767,7 +767,7 @@ public final class MailboxProtocol { public long getLow() { return low_; } - + private void initFields() { high_ = 0L; low_ = 0L; @@ -776,7 +776,7 @@ public final class MailboxProtocol { public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized != -1) return isInitialized == 1; - + if (!hasHigh()) { memoizedIsInitialized = 0; return false; @@ -788,7 +788,7 @@ public final class MailboxProtocol { memoizedIsInitialized = 1; return true; } - + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); @@ -800,12 +800,12 @@ public final class MailboxProtocol { } getUnknownFields().writeTo(output); } - + private int memoizedSerializedSize = -1; public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; - + size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream @@ -819,14 +819,14 @@ public final class MailboxProtocol { memoizedSerializedSize = size; return size; } - + private static final long serialVersionUID = 0L; @java.lang.Override protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { return super.writeReplace(); } - + public static akka.actor.mailbox.MailboxProtocol.UuidProtocol parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { @@ -893,14 +893,14 @@ public final class MailboxProtocol { return newBuilder().mergeFrom(input, extensionRegistry) .buildParsed(); } - + public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(akka.actor.mailbox.MailboxProtocol.UuidProtocol prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } - + @java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessage.BuilderParent parent) { @@ -914,17 +914,17 @@ public final class MailboxProtocol { getDescriptor() { return akka.actor.mailbox.MailboxProtocol.internal_static_UuidProtocol_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return akka.actor.mailbox.MailboxProtocol.internal_static_UuidProtocol_fieldAccessorTable; } - + // Construct using akka.actor.mailbox.MailboxProtocol.UuidProtocol.newBuilder() private Builder() { maybeForceBuilderInitialization(); } - + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); @@ -936,7 +936,7 @@ public final class MailboxProtocol { private static Builder create() { return new Builder(); } - + public Builder clear() { super.clear(); high_ = 0L; @@ -945,20 +945,20 @@ public final class MailboxProtocol { bitField0_ = (bitField0_ & ~0x00000002); return this; } - + public Builder clone() { return create().mergeFrom(buildPartial()); } - + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return akka.actor.mailbox.MailboxProtocol.UuidProtocol.getDescriptor(); } - + public akka.actor.mailbox.MailboxProtocol.UuidProtocol getDefaultInstanceForType() { return akka.actor.mailbox.MailboxProtocol.UuidProtocol.getDefaultInstance(); } - + public akka.actor.mailbox.MailboxProtocol.UuidProtocol build() { akka.actor.mailbox.MailboxProtocol.UuidProtocol result = buildPartial(); if (!result.isInitialized()) { @@ -966,7 +966,7 @@ public final class MailboxProtocol { } return result; } - + private akka.actor.mailbox.MailboxProtocol.UuidProtocol buildParsed() throws com.google.protobuf.InvalidProtocolBufferException { akka.actor.mailbox.MailboxProtocol.UuidProtocol result = buildPartial(); @@ -976,7 +976,7 @@ public final class MailboxProtocol { } return result; } - + public akka.actor.mailbox.MailboxProtocol.UuidProtocol buildPartial() { akka.actor.mailbox.MailboxProtocol.UuidProtocol result = new akka.actor.mailbox.MailboxProtocol.UuidProtocol(this); int from_bitField0_ = bitField0_; @@ -993,7 +993,7 @@ public final class MailboxProtocol { onBuilt(); return result; } - + public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof akka.actor.mailbox.MailboxProtocol.UuidProtocol) { return mergeFrom((akka.actor.mailbox.MailboxProtocol.UuidProtocol)other); @@ -1002,7 +1002,7 @@ public final class MailboxProtocol { return this; } } - + public Builder mergeFrom(akka.actor.mailbox.MailboxProtocol.UuidProtocol other) { if (other == akka.actor.mailbox.MailboxProtocol.UuidProtocol.getDefaultInstance()) return this; if (other.hasHigh()) { @@ -1014,19 +1014,19 @@ public final class MailboxProtocol { this.mergeUnknownFields(other.getUnknownFields()); return this; } - + public final boolean isInitialized() { if (!hasHigh()) { - + return false; } if (!hasLow()) { - + return false; } return true; } - + public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) @@ -1063,9 +1063,9 @@ public final class MailboxProtocol { } } } - + private int bitField0_; - + // required uint64 high = 1; private long high_ ; public boolean hasHigh() { @@ -1086,7 +1086,7 @@ public final class MailboxProtocol { onChanged(); return this; } - + // required uint64 low = 2; private long low_ ; public boolean hasLow() { @@ -1107,18 +1107,18 @@ public final class MailboxProtocol { onChanged(); return this; } - + // @@protoc_insertion_point(builder_scope:UuidProtocol) } - + static { defaultInstance = new UuidProtocol(true); defaultInstance.initFields(); } - + // @@protoc_insertion_point(class_scope:UuidProtocol) } - + private static com.google.protobuf.Descriptors.Descriptor internal_static_DurableMailboxMessageProtocol_descriptor; private static @@ -1129,7 +1129,7 @@ public final class MailboxProtocol { private static com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_UuidProtocol_fieldAccessorTable; - + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { return descriptor; @@ -1174,6 +1174,6 @@ public final class MailboxProtocol { new com.google.protobuf.Descriptors.FileDescriptor[] { }, assigner); } - + // @@protoc_insertion_point(outer_class_scope) } diff --git a/akka-remote/src/main/java/akka/remote/RemoteProtocol.java b/akka-remote/src/main/java/akka/remote/RemoteProtocol.java index 423d2383a3..83b8e31da6 100644 --- a/akka-remote/src/main/java/akka/remote/RemoteProtocol.java +++ b/akka-remote/src/main/java/akka/remote/RemoteProtocol.java @@ -13,13 +13,13 @@ public final class RemoteProtocol { CONNECT(0, 1), SHUTDOWN(1, 2), ; - + public static final int CONNECT_VALUE = 1; public static final int SHUTDOWN_VALUE = 2; - - + + public final int getNumber() { return value; } - + public static CommandType valueOf(int value) { switch (value) { case 1: return CONNECT; @@ -27,7 +27,7 @@ public final class RemoteProtocol { default: return null; } } - + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { return internalValueMap; @@ -39,7 +39,7 @@ public final class RemoteProtocol { return CommandType.valueOf(number); } }; - + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { return getDescriptor().getValues().get(index); @@ -52,11 +52,11 @@ public final class RemoteProtocol { getDescriptor() { return akka.remote.RemoteProtocol.getDescriptor().getEnumTypes().get(0); } - + private static final CommandType[] VALUES = { - CONNECT, SHUTDOWN, + CONNECT, SHUTDOWN, }; - + public static CommandType valueOf( com.google.protobuf.Descriptors.EnumValueDescriptor desc) { if (desc.getType() != getDescriptor()) { @@ -65,32 +65,32 @@ public final class RemoteProtocol { } return VALUES[desc.getIndex()]; } - + private final int index; private final int value; - + private CommandType(int index, int value) { this.index = index; this.value = value; } - + // @@protoc_insertion_point(enum_scope:CommandType) } - + public enum ReplicationStorageType implements com.google.protobuf.ProtocolMessageEnum { TRANSIENT(0, 1), TRANSACTION_LOG(1, 2), DATA_GRID(2, 3), ; - + public static final int TRANSIENT_VALUE = 1; public static final int TRANSACTION_LOG_VALUE = 2; public static final int DATA_GRID_VALUE = 3; - - + + public final int getNumber() { return value; } - + public static ReplicationStorageType valueOf(int value) { switch (value) { case 1: return TRANSIENT; @@ -99,7 +99,7 @@ public final class RemoteProtocol { default: return null; } } - + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { return internalValueMap; @@ -111,7 +111,7 @@ public final class RemoteProtocol { return ReplicationStorageType.valueOf(number); } }; - + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { return getDescriptor().getValues().get(index); @@ -124,11 +124,11 @@ public final class RemoteProtocol { getDescriptor() { return akka.remote.RemoteProtocol.getDescriptor().getEnumTypes().get(1); } - + private static final ReplicationStorageType[] VALUES = { - TRANSIENT, TRANSACTION_LOG, DATA_GRID, + TRANSIENT, TRANSACTION_LOG, DATA_GRID, }; - + public static ReplicationStorageType valueOf( com.google.protobuf.Descriptors.EnumValueDescriptor desc) { if (desc.getType() != getDescriptor()) { @@ -137,30 +137,30 @@ public final class RemoteProtocol { } return VALUES[desc.getIndex()]; } - + private final int index; private final int value; - + private ReplicationStorageType(int index, int value) { this.index = index; this.value = value; } - + // @@protoc_insertion_point(enum_scope:ReplicationStorageType) } - + public enum ReplicationStrategyType implements com.google.protobuf.ProtocolMessageEnum { WRITE_THROUGH(0, 1), WRITE_BEHIND(1, 2), ; - + public static final int WRITE_THROUGH_VALUE = 1; public static final int WRITE_BEHIND_VALUE = 2; - - + + public final int getNumber() { return value; } - + public static ReplicationStrategyType valueOf(int value) { switch (value) { case 1: return WRITE_THROUGH; @@ -168,7 +168,7 @@ public final class RemoteProtocol { default: return null; } } - + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { return internalValueMap; @@ -180,7 +180,7 @@ public final class RemoteProtocol { return ReplicationStrategyType.valueOf(number); } }; - + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { return getDescriptor().getValues().get(index); @@ -193,11 +193,11 @@ public final class RemoteProtocol { getDescriptor() { return akka.remote.RemoteProtocol.getDescriptor().getEnumTypes().get(2); } - + private static final ReplicationStrategyType[] VALUES = { - WRITE_THROUGH, WRITE_BEHIND, + WRITE_THROUGH, WRITE_BEHIND, }; - + public static ReplicationStrategyType valueOf( com.google.protobuf.Descriptors.EnumValueDescriptor desc) { if (desc.getType() != getDescriptor()) { @@ -206,18 +206,18 @@ public final class RemoteProtocol { } return VALUES[desc.getIndex()]; } - + private final int index; private final int value; - + private ReplicationStrategyType(int index, int value) { this.index = index; this.value = value; } - + // @@protoc_insertion_point(enum_scope:ReplicationStrategyType) } - + public enum SerializationSchemeType implements com.google.protobuf.ProtocolMessageEnum { JAVA(0, 1), @@ -226,16 +226,16 @@ public final class RemoteProtocol { JAVA_JSON(3, 4), PROTOBUF(4, 5), ; - + public static final int JAVA_VALUE = 1; public static final int SBINARY_VALUE = 2; public static final int SCALA_JSON_VALUE = 3; public static final int JAVA_JSON_VALUE = 4; public static final int PROTOBUF_VALUE = 5; - - + + public final int getNumber() { return value; } - + public static SerializationSchemeType valueOf(int value) { switch (value) { case 1: return JAVA; @@ -246,7 +246,7 @@ public final class RemoteProtocol { default: return null; } } - + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { return internalValueMap; @@ -258,7 +258,7 @@ public final class RemoteProtocol { return SerializationSchemeType.valueOf(number); } }; - + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { return getDescriptor().getValues().get(index); @@ -271,11 +271,11 @@ public final class RemoteProtocol { getDescriptor() { return akka.remote.RemoteProtocol.getDescriptor().getEnumTypes().get(3); } - + private static final SerializationSchemeType[] VALUES = { - JAVA, SBINARY, SCALA_JSON, JAVA_JSON, PROTOBUF, + JAVA, SBINARY, SCALA_JSON, JAVA_JSON, PROTOBUF, }; - + public static SerializationSchemeType valueOf( com.google.protobuf.Descriptors.EnumValueDescriptor desc) { if (desc.getType() != getDescriptor()) { @@ -284,30 +284,30 @@ public final class RemoteProtocol { } return VALUES[desc.getIndex()]; } - + private final int index; private final int value; - + private SerializationSchemeType(int index, int value) { this.index = index; this.value = value; } - + // @@protoc_insertion_point(enum_scope:SerializationSchemeType) } - + public enum LifeCycleType implements com.google.protobuf.ProtocolMessageEnum { PERMANENT(0, 1), TEMPORARY(1, 2), ; - + public static final int PERMANENT_VALUE = 1; public static final int TEMPORARY_VALUE = 2; - - + + public final int getNumber() { return value; } - + public static LifeCycleType valueOf(int value) { switch (value) { case 1: return PERMANENT; @@ -315,7 +315,7 @@ public final class RemoteProtocol { default: return null; } } - + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { return internalValueMap; @@ -327,7 +327,7 @@ public final class RemoteProtocol { return LifeCycleType.valueOf(number); } }; - + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { return getDescriptor().getValues().get(index); @@ -340,11 +340,11 @@ public final class RemoteProtocol { getDescriptor() { return akka.remote.RemoteProtocol.getDescriptor().getEnumTypes().get(4); } - + private static final LifeCycleType[] VALUES = { - PERMANENT, TEMPORARY, + PERMANENT, TEMPORARY, }; - + public static LifeCycleType valueOf( com.google.protobuf.Descriptors.EnumValueDescriptor desc) { if (desc.getType() != getDescriptor()) { @@ -353,18 +353,18 @@ public final class RemoteProtocol { } return VALUES[desc.getIndex()]; } - + private final int index; private final int value; - + private LifeCycleType(int index, int value) { this.index = index; this.value = value; } - + // @@protoc_insertion_point(enum_scope:LifeCycleType) } - + public enum RemoteSystemDaemonMessageType implements com.google.protobuf.ProtocolMessageEnum { STOP(0, 1), @@ -383,7 +383,7 @@ public final class RemoteProtocol { FUNCTION_FUN1_ARG_UNIT(13, 23), FUNCTION_FUN1_ARG_ANY(14, 24), ; - + public static final int STOP_VALUE = 1; public static final int USE_VALUE = 2; public static final int RELEASE_VALUE = 3; @@ -399,10 +399,10 @@ public final class RemoteProtocol { public static final int FUNCTION_FUN0_ANY_VALUE = 22; public static final int FUNCTION_FUN1_ARG_UNIT_VALUE = 23; public static final int FUNCTION_FUN1_ARG_ANY_VALUE = 24; - - + + public final int getNumber() { return value; } - + public static RemoteSystemDaemonMessageType valueOf(int value) { switch (value) { case 1: return STOP; @@ -423,7 +423,7 @@ public final class RemoteProtocol { default: return null; } } - + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { return internalValueMap; @@ -435,7 +435,7 @@ public final class RemoteProtocol { return RemoteSystemDaemonMessageType.valueOf(number); } }; - + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { return getDescriptor().getValues().get(index); @@ -448,11 +448,11 @@ public final class RemoteProtocol { getDescriptor() { return akka.remote.RemoteProtocol.getDescriptor().getEnumTypes().get(5); } - + private static final RemoteSystemDaemonMessageType[] VALUES = { - STOP, USE, RELEASE, MAKE_AVAILABLE, MAKE_UNAVAILABLE, DISCONNECT, RECONNECT, RESIGN, GOSSIP, GOSSIP_ACK, FAIL_OVER_CONNECTIONS, FUNCTION_FUN0_UNIT, FUNCTION_FUN0_ANY, FUNCTION_FUN1_ARG_UNIT, FUNCTION_FUN1_ARG_ANY, + STOP, USE, RELEASE, MAKE_AVAILABLE, MAKE_UNAVAILABLE, DISCONNECT, RECONNECT, RESIGN, GOSSIP, GOSSIP_ACK, FAIL_OVER_CONNECTIONS, FUNCTION_FUN0_UNIT, FUNCTION_FUN0_ANY, FUNCTION_FUN1_ARG_UNIT, FUNCTION_FUN1_ARG_ANY, }; - + public static RemoteSystemDaemonMessageType valueOf( com.google.protobuf.Descriptors.EnumValueDescriptor desc) { if (desc.getType() != getDescriptor()) { @@ -461,26 +461,26 @@ public final class RemoteProtocol { } return VALUES[desc.getIndex()]; } - + private final int index; private final int value; - + private RemoteSystemDaemonMessageType(int index, int value) { this.index = index; this.value = value; } - + // @@protoc_insertion_point(enum_scope:RemoteSystemDaemonMessageType) } - + public interface AkkaRemoteProtocolOrBuilder extends com.google.protobuf.MessageOrBuilder { - + // optional .RemoteMessageProtocol message = 1; boolean hasMessage(); akka.remote.RemoteProtocol.RemoteMessageProtocol getMessage(); akka.remote.RemoteProtocol.RemoteMessageProtocolOrBuilder getMessageOrBuilder(); - + // optional .RemoteControlProtocol instruction = 2; boolean hasInstruction(); akka.remote.RemoteProtocol.RemoteControlProtocol getInstruction(); @@ -494,26 +494,26 @@ public final class RemoteProtocol { super(builder); } private AkkaRemoteProtocol(boolean noInit) {} - + private static final AkkaRemoteProtocol defaultInstance; public static AkkaRemoteProtocol getDefaultInstance() { return defaultInstance; } - + public AkkaRemoteProtocol getDefaultInstanceForType() { return defaultInstance; } - + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return akka.remote.RemoteProtocol.internal_static_AkkaRemoteProtocol_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return akka.remote.RemoteProtocol.internal_static_AkkaRemoteProtocol_fieldAccessorTable; } - + private int bitField0_; // optional .RemoteMessageProtocol message = 1; public static final int MESSAGE_FIELD_NUMBER = 1; @@ -527,7 +527,7 @@ public final class RemoteProtocol { public akka.remote.RemoteProtocol.RemoteMessageProtocolOrBuilder getMessageOrBuilder() { return message_; } - + // optional .RemoteControlProtocol instruction = 2; public static final int INSTRUCTION_FIELD_NUMBER = 2; private akka.remote.RemoteProtocol.RemoteControlProtocol instruction_; @@ -540,7 +540,7 @@ public final class RemoteProtocol { public akka.remote.RemoteProtocol.RemoteControlProtocolOrBuilder getInstructionOrBuilder() { return instruction_; } - + private void initFields() { message_ = akka.remote.RemoteProtocol.RemoteMessageProtocol.getDefaultInstance(); instruction_ = akka.remote.RemoteProtocol.RemoteControlProtocol.getDefaultInstance(); @@ -549,7 +549,7 @@ public final class RemoteProtocol { public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized != -1) return isInitialized == 1; - + if (hasMessage()) { if (!getMessage().isInitialized()) { memoizedIsInitialized = 0; @@ -565,7 +565,7 @@ public final class RemoteProtocol { memoizedIsInitialized = 1; return true; } - + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); @@ -577,12 +577,12 @@ public final class RemoteProtocol { } getUnknownFields().writeTo(output); } - + private int memoizedSerializedSize = -1; public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; - + size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream @@ -596,14 +596,14 @@ public final class RemoteProtocol { memoizedSerializedSize = size; return size; } - + private static final long serialVersionUID = 0L; @java.lang.Override protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { return super.writeReplace(); } - + public static akka.remote.RemoteProtocol.AkkaRemoteProtocol parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { @@ -670,14 +670,14 @@ public final class RemoteProtocol { return newBuilder().mergeFrom(input, extensionRegistry) .buildParsed(); } - + public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(akka.remote.RemoteProtocol.AkkaRemoteProtocol prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } - + @java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessage.BuilderParent parent) { @@ -691,17 +691,17 @@ public final class RemoteProtocol { getDescriptor() { return akka.remote.RemoteProtocol.internal_static_AkkaRemoteProtocol_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return akka.remote.RemoteProtocol.internal_static_AkkaRemoteProtocol_fieldAccessorTable; } - + // Construct using akka.remote.RemoteProtocol.AkkaRemoteProtocol.newBuilder() private Builder() { maybeForceBuilderInitialization(); } - + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); @@ -715,7 +715,7 @@ public final class RemoteProtocol { private static Builder create() { return new Builder(); } - + public Builder clear() { super.clear(); if (messageBuilder_ == null) { @@ -732,20 +732,20 @@ public final class RemoteProtocol { bitField0_ = (bitField0_ & ~0x00000002); return this; } - + public Builder clone() { return create().mergeFrom(buildPartial()); } - + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return akka.remote.RemoteProtocol.AkkaRemoteProtocol.getDescriptor(); } - + public akka.remote.RemoteProtocol.AkkaRemoteProtocol getDefaultInstanceForType() { return akka.remote.RemoteProtocol.AkkaRemoteProtocol.getDefaultInstance(); } - + public akka.remote.RemoteProtocol.AkkaRemoteProtocol build() { akka.remote.RemoteProtocol.AkkaRemoteProtocol result = buildPartial(); if (!result.isInitialized()) { @@ -753,7 +753,7 @@ public final class RemoteProtocol { } return result; } - + private akka.remote.RemoteProtocol.AkkaRemoteProtocol buildParsed() throws com.google.protobuf.InvalidProtocolBufferException { akka.remote.RemoteProtocol.AkkaRemoteProtocol result = buildPartial(); @@ -763,7 +763,7 @@ public final class RemoteProtocol { } return result; } - + public akka.remote.RemoteProtocol.AkkaRemoteProtocol buildPartial() { akka.remote.RemoteProtocol.AkkaRemoteProtocol result = new akka.remote.RemoteProtocol.AkkaRemoteProtocol(this); int from_bitField0_ = bitField0_; @@ -788,7 +788,7 @@ public final class RemoteProtocol { onBuilt(); return result; } - + public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof akka.remote.RemoteProtocol.AkkaRemoteProtocol) { return mergeFrom((akka.remote.RemoteProtocol.AkkaRemoteProtocol)other); @@ -797,7 +797,7 @@ public final class RemoteProtocol { return this; } } - + public Builder mergeFrom(akka.remote.RemoteProtocol.AkkaRemoteProtocol other) { if (other == akka.remote.RemoteProtocol.AkkaRemoteProtocol.getDefaultInstance()) return this; if (other.hasMessage()) { @@ -809,23 +809,23 @@ public final class RemoteProtocol { this.mergeUnknownFields(other.getUnknownFields()); return this; } - + public final boolean isInitialized() { if (hasMessage()) { if (!getMessage().isInitialized()) { - + return false; } } if (hasInstruction()) { if (!getInstruction().isInitialized()) { - + return false; } } return true; } - + public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) @@ -870,9 +870,9 @@ public final class RemoteProtocol { } } } - + private int bitField0_; - + // optional .RemoteMessageProtocol message = 1; private akka.remote.RemoteProtocol.RemoteMessageProtocol message_ = akka.remote.RemoteProtocol.RemoteMessageProtocol.getDefaultInstance(); private com.google.protobuf.SingleFieldBuilder< @@ -950,7 +950,7 @@ public final class RemoteProtocol { } } private com.google.protobuf.SingleFieldBuilder< - akka.remote.RemoteProtocol.RemoteMessageProtocol, akka.remote.RemoteProtocol.RemoteMessageProtocol.Builder, akka.remote.RemoteProtocol.RemoteMessageProtocolOrBuilder> + akka.remote.RemoteProtocol.RemoteMessageProtocol, akka.remote.RemoteProtocol.RemoteMessageProtocol.Builder, akka.remote.RemoteProtocol.RemoteMessageProtocolOrBuilder> getMessageFieldBuilder() { if (messageBuilder_ == null) { messageBuilder_ = new com.google.protobuf.SingleFieldBuilder< @@ -962,7 +962,7 @@ public final class RemoteProtocol { } return messageBuilder_; } - + // optional .RemoteControlProtocol instruction = 2; private akka.remote.RemoteProtocol.RemoteControlProtocol instruction_ = akka.remote.RemoteProtocol.RemoteControlProtocol.getDefaultInstance(); private com.google.protobuf.SingleFieldBuilder< @@ -1040,7 +1040,7 @@ public final class RemoteProtocol { } } private com.google.protobuf.SingleFieldBuilder< - akka.remote.RemoteProtocol.RemoteControlProtocol, akka.remote.RemoteProtocol.RemoteControlProtocol.Builder, akka.remote.RemoteProtocol.RemoteControlProtocolOrBuilder> + akka.remote.RemoteProtocol.RemoteControlProtocol, akka.remote.RemoteProtocol.RemoteControlProtocol.Builder, akka.remote.RemoteProtocol.RemoteControlProtocolOrBuilder> getInstructionFieldBuilder() { if (instructionBuilder_ == null) { instructionBuilder_ = new com.google.protobuf.SingleFieldBuilder< @@ -1052,61 +1052,61 @@ public final class RemoteProtocol { } return instructionBuilder_; } - + // @@protoc_insertion_point(builder_scope:AkkaRemoteProtocol) } - + static { defaultInstance = new AkkaRemoteProtocol(true); defaultInstance.initFields(); } - + // @@protoc_insertion_point(class_scope:AkkaRemoteProtocol) } - + public interface RemoteMessageProtocolOrBuilder extends com.google.protobuf.MessageOrBuilder { - + // required .UuidProtocol uuid = 1; boolean hasUuid(); akka.remote.RemoteProtocol.UuidProtocol getUuid(); akka.remote.RemoteProtocol.UuidProtocolOrBuilder getUuidOrBuilder(); - + // required .ActorInfoProtocol actorInfo = 2; boolean hasActorInfo(); akka.remote.RemoteProtocol.ActorInfoProtocol getActorInfo(); akka.remote.RemoteProtocol.ActorInfoProtocolOrBuilder getActorInfoOrBuilder(); - + // required bool oneWay = 3; boolean hasOneWay(); boolean getOneWay(); - + // optional .MessageProtocol message = 4; boolean hasMessage(); akka.remote.RemoteProtocol.MessageProtocol getMessage(); akka.remote.RemoteProtocol.MessageProtocolOrBuilder getMessageOrBuilder(); - + // optional .ExceptionProtocol exception = 5; boolean hasException(); akka.remote.RemoteProtocol.ExceptionProtocol getException(); akka.remote.RemoteProtocol.ExceptionProtocolOrBuilder getExceptionOrBuilder(); - + // optional .UuidProtocol supervisorUuid = 6; boolean hasSupervisorUuid(); akka.remote.RemoteProtocol.UuidProtocol getSupervisorUuid(); akka.remote.RemoteProtocol.UuidProtocolOrBuilder getSupervisorUuidOrBuilder(); - + // optional .RemoteActorRefProtocol sender = 7; boolean hasSender(); akka.remote.RemoteProtocol.RemoteActorRefProtocol getSender(); akka.remote.RemoteProtocol.RemoteActorRefProtocolOrBuilder getSenderOrBuilder(); - + // repeated .MetadataEntryProtocol metadata = 8; - java.util.List + java.util.List getMetadataList(); akka.remote.RemoteProtocol.MetadataEntryProtocol getMetadata(int index); int getMetadataCount(); - java.util.List + java.util.List getMetadataOrBuilderList(); akka.remote.RemoteProtocol.MetadataEntryProtocolOrBuilder getMetadataOrBuilder( int index); @@ -1119,26 +1119,26 @@ public final class RemoteProtocol { super(builder); } private RemoteMessageProtocol(boolean noInit) {} - + private static final RemoteMessageProtocol defaultInstance; public static RemoteMessageProtocol getDefaultInstance() { return defaultInstance; } - + public RemoteMessageProtocol getDefaultInstanceForType() { return defaultInstance; } - + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return akka.remote.RemoteProtocol.internal_static_RemoteMessageProtocol_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return akka.remote.RemoteProtocol.internal_static_RemoteMessageProtocol_fieldAccessorTable; } - + private int bitField0_; // required .UuidProtocol uuid = 1; public static final int UUID_FIELD_NUMBER = 1; @@ -1152,7 +1152,7 @@ public final class RemoteProtocol { public akka.remote.RemoteProtocol.UuidProtocolOrBuilder getUuidOrBuilder() { return uuid_; } - + // required .ActorInfoProtocol actorInfo = 2; public static final int ACTORINFO_FIELD_NUMBER = 2; private akka.remote.RemoteProtocol.ActorInfoProtocol actorInfo_; @@ -1165,7 +1165,7 @@ public final class RemoteProtocol { public akka.remote.RemoteProtocol.ActorInfoProtocolOrBuilder getActorInfoOrBuilder() { return actorInfo_; } - + // required bool oneWay = 3; public static final int ONEWAY_FIELD_NUMBER = 3; private boolean oneWay_; @@ -1175,7 +1175,7 @@ public final class RemoteProtocol { public boolean getOneWay() { return oneWay_; } - + // optional .MessageProtocol message = 4; public static final int MESSAGE_FIELD_NUMBER = 4; private akka.remote.RemoteProtocol.MessageProtocol message_; @@ -1188,7 +1188,7 @@ public final class RemoteProtocol { public akka.remote.RemoteProtocol.MessageProtocolOrBuilder getMessageOrBuilder() { return message_; } - + // optional .ExceptionProtocol exception = 5; public static final int EXCEPTION_FIELD_NUMBER = 5; private akka.remote.RemoteProtocol.ExceptionProtocol exception_; @@ -1201,7 +1201,7 @@ public final class RemoteProtocol { public akka.remote.RemoteProtocol.ExceptionProtocolOrBuilder getExceptionOrBuilder() { return exception_; } - + // optional .UuidProtocol supervisorUuid = 6; public static final int SUPERVISORUUID_FIELD_NUMBER = 6; private akka.remote.RemoteProtocol.UuidProtocol supervisorUuid_; @@ -1214,7 +1214,7 @@ public final class RemoteProtocol { public akka.remote.RemoteProtocol.UuidProtocolOrBuilder getSupervisorUuidOrBuilder() { return supervisorUuid_; } - + // optional .RemoteActorRefProtocol sender = 7; public static final int SENDER_FIELD_NUMBER = 7; private akka.remote.RemoteProtocol.RemoteActorRefProtocol sender_; @@ -1227,14 +1227,14 @@ public final class RemoteProtocol { public akka.remote.RemoteProtocol.RemoteActorRefProtocolOrBuilder getSenderOrBuilder() { return sender_; } - + // repeated .MetadataEntryProtocol metadata = 8; public static final int METADATA_FIELD_NUMBER = 8; private java.util.List metadata_; public java.util.List getMetadataList() { return metadata_; } - public java.util.List + public java.util.List getMetadataOrBuilderList() { return metadata_; } @@ -1248,7 +1248,7 @@ public final class RemoteProtocol { int index) { return metadata_.get(index); } - + private void initFields() { uuid_ = akka.remote.RemoteProtocol.UuidProtocol.getDefaultInstance(); actorInfo_ = akka.remote.RemoteProtocol.ActorInfoProtocol.getDefaultInstance(); @@ -1263,7 +1263,7 @@ public final class RemoteProtocol { public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized != -1) return isInitialized == 1; - + if (!hasUuid()) { memoizedIsInitialized = 0; return false; @@ -1317,7 +1317,7 @@ public final class RemoteProtocol { memoizedIsInitialized = 1; return true; } - + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); @@ -1347,12 +1347,12 @@ public final class RemoteProtocol { } getUnknownFields().writeTo(output); } - + private int memoizedSerializedSize = -1; public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; - + size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream @@ -1390,14 +1390,14 @@ public final class RemoteProtocol { memoizedSerializedSize = size; return size; } - + private static final long serialVersionUID = 0L; @java.lang.Override protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { return super.writeReplace(); } - + public static akka.remote.RemoteProtocol.RemoteMessageProtocol parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { @@ -1464,14 +1464,14 @@ public final class RemoteProtocol { return newBuilder().mergeFrom(input, extensionRegistry) .buildParsed(); } - + public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(akka.remote.RemoteProtocol.RemoteMessageProtocol prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } - + @java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessage.BuilderParent parent) { @@ -1485,17 +1485,17 @@ public final class RemoteProtocol { getDescriptor() { return akka.remote.RemoteProtocol.internal_static_RemoteMessageProtocol_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return akka.remote.RemoteProtocol.internal_static_RemoteMessageProtocol_fieldAccessorTable; } - + // Construct using akka.remote.RemoteProtocol.RemoteMessageProtocol.newBuilder() private Builder() { maybeForceBuilderInitialization(); } - + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); @@ -1514,7 +1514,7 @@ public final class RemoteProtocol { private static Builder create() { return new Builder(); } - + public Builder clear() { super.clear(); if (uuidBuilder_ == null) { @@ -1563,20 +1563,20 @@ public final class RemoteProtocol { } return this; } - + public Builder clone() { return create().mergeFrom(buildPartial()); } - + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return akka.remote.RemoteProtocol.RemoteMessageProtocol.getDescriptor(); } - + public akka.remote.RemoteProtocol.RemoteMessageProtocol getDefaultInstanceForType() { return akka.remote.RemoteProtocol.RemoteMessageProtocol.getDefaultInstance(); } - + public akka.remote.RemoteProtocol.RemoteMessageProtocol build() { akka.remote.RemoteProtocol.RemoteMessageProtocol result = buildPartial(); if (!result.isInitialized()) { @@ -1584,7 +1584,7 @@ public final class RemoteProtocol { } return result; } - + private akka.remote.RemoteProtocol.RemoteMessageProtocol buildParsed() throws com.google.protobuf.InvalidProtocolBufferException { akka.remote.RemoteProtocol.RemoteMessageProtocol result = buildPartial(); @@ -1594,7 +1594,7 @@ public final class RemoteProtocol { } return result; } - + public akka.remote.RemoteProtocol.RemoteMessageProtocol buildPartial() { akka.remote.RemoteProtocol.RemoteMessageProtocol result = new akka.remote.RemoteProtocol.RemoteMessageProtocol(this); int from_bitField0_ = bitField0_; @@ -1664,7 +1664,7 @@ public final class RemoteProtocol { onBuilt(); return result; } - + public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof akka.remote.RemoteProtocol.RemoteMessageProtocol) { return mergeFrom((akka.remote.RemoteProtocol.RemoteMessageProtocol)other); @@ -1673,7 +1673,7 @@ public final class RemoteProtocol { return this; } } - + public Builder mergeFrom(akka.remote.RemoteProtocol.RemoteMessageProtocol other) { if (other == akka.remote.RemoteProtocol.RemoteMessageProtocol.getDefaultInstance()) return this; if (other.hasUuid()) { @@ -1715,7 +1715,7 @@ public final class RemoteProtocol { metadataBuilder_ = null; metadata_ = other.metadata_; bitField0_ = (bitField0_ & ~0x00000080); - metadataBuilder_ = + metadataBuilder_ = com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? getMetadataFieldBuilder() : null; } else { @@ -1726,61 +1726,61 @@ public final class RemoteProtocol { this.mergeUnknownFields(other.getUnknownFields()); return this; } - + public final boolean isInitialized() { if (!hasUuid()) { - + return false; } if (!hasActorInfo()) { - + return false; } if (!hasOneWay()) { - + return false; } if (!getUuid().isInitialized()) { - + return false; } if (!getActorInfo().isInitialized()) { - + return false; } if (hasMessage()) { if (!getMessage().isInitialized()) { - + return false; } } if (hasException()) { if (!getException().isInitialized()) { - + return false; } } if (hasSupervisorUuid()) { if (!getSupervisorUuid().isInitialized()) { - + return false; } } if (hasSender()) { if (!getSender().isInitialized()) { - + return false; } } for (int i = 0; i < getMetadataCount(); i++) { if (!getMetadata(i).isInitialized()) { - + return false; } } return true; } - + public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) @@ -1872,9 +1872,9 @@ public final class RemoteProtocol { } } } - + private int bitField0_; - + // required .UuidProtocol uuid = 1; private akka.remote.RemoteProtocol.UuidProtocol uuid_ = akka.remote.RemoteProtocol.UuidProtocol.getDefaultInstance(); private com.google.protobuf.SingleFieldBuilder< @@ -1952,7 +1952,7 @@ public final class RemoteProtocol { } } private com.google.protobuf.SingleFieldBuilder< - akka.remote.RemoteProtocol.UuidProtocol, akka.remote.RemoteProtocol.UuidProtocol.Builder, akka.remote.RemoteProtocol.UuidProtocolOrBuilder> + akka.remote.RemoteProtocol.UuidProtocol, akka.remote.RemoteProtocol.UuidProtocol.Builder, akka.remote.RemoteProtocol.UuidProtocolOrBuilder> getUuidFieldBuilder() { if (uuidBuilder_ == null) { uuidBuilder_ = new com.google.protobuf.SingleFieldBuilder< @@ -1964,7 +1964,7 @@ public final class RemoteProtocol { } return uuidBuilder_; } - + // required .ActorInfoProtocol actorInfo = 2; private akka.remote.RemoteProtocol.ActorInfoProtocol actorInfo_ = akka.remote.RemoteProtocol.ActorInfoProtocol.getDefaultInstance(); private com.google.protobuf.SingleFieldBuilder< @@ -2042,7 +2042,7 @@ public final class RemoteProtocol { } } private com.google.protobuf.SingleFieldBuilder< - akka.remote.RemoteProtocol.ActorInfoProtocol, akka.remote.RemoteProtocol.ActorInfoProtocol.Builder, akka.remote.RemoteProtocol.ActorInfoProtocolOrBuilder> + akka.remote.RemoteProtocol.ActorInfoProtocol, akka.remote.RemoteProtocol.ActorInfoProtocol.Builder, akka.remote.RemoteProtocol.ActorInfoProtocolOrBuilder> getActorInfoFieldBuilder() { if (actorInfoBuilder_ == null) { actorInfoBuilder_ = new com.google.protobuf.SingleFieldBuilder< @@ -2054,7 +2054,7 @@ public final class RemoteProtocol { } return actorInfoBuilder_; } - + // required bool oneWay = 3; private boolean oneWay_ ; public boolean hasOneWay() { @@ -2075,7 +2075,7 @@ public final class RemoteProtocol { onChanged(); return this; } - + // optional .MessageProtocol message = 4; private akka.remote.RemoteProtocol.MessageProtocol message_ = akka.remote.RemoteProtocol.MessageProtocol.getDefaultInstance(); private com.google.protobuf.SingleFieldBuilder< @@ -2153,7 +2153,7 @@ public final class RemoteProtocol { } } private com.google.protobuf.SingleFieldBuilder< - akka.remote.RemoteProtocol.MessageProtocol, akka.remote.RemoteProtocol.MessageProtocol.Builder, akka.remote.RemoteProtocol.MessageProtocolOrBuilder> + akka.remote.RemoteProtocol.MessageProtocol, akka.remote.RemoteProtocol.MessageProtocol.Builder, akka.remote.RemoteProtocol.MessageProtocolOrBuilder> getMessageFieldBuilder() { if (messageBuilder_ == null) { messageBuilder_ = new com.google.protobuf.SingleFieldBuilder< @@ -2165,7 +2165,7 @@ public final class RemoteProtocol { } return messageBuilder_; } - + // optional .ExceptionProtocol exception = 5; private akka.remote.RemoteProtocol.ExceptionProtocol exception_ = akka.remote.RemoteProtocol.ExceptionProtocol.getDefaultInstance(); private com.google.protobuf.SingleFieldBuilder< @@ -2243,7 +2243,7 @@ public final class RemoteProtocol { } } private com.google.protobuf.SingleFieldBuilder< - akka.remote.RemoteProtocol.ExceptionProtocol, akka.remote.RemoteProtocol.ExceptionProtocol.Builder, akka.remote.RemoteProtocol.ExceptionProtocolOrBuilder> + akka.remote.RemoteProtocol.ExceptionProtocol, akka.remote.RemoteProtocol.ExceptionProtocol.Builder, akka.remote.RemoteProtocol.ExceptionProtocolOrBuilder> getExceptionFieldBuilder() { if (exceptionBuilder_ == null) { exceptionBuilder_ = new com.google.protobuf.SingleFieldBuilder< @@ -2255,7 +2255,7 @@ public final class RemoteProtocol { } return exceptionBuilder_; } - + // optional .UuidProtocol supervisorUuid = 6; private akka.remote.RemoteProtocol.UuidProtocol supervisorUuid_ = akka.remote.RemoteProtocol.UuidProtocol.getDefaultInstance(); private com.google.protobuf.SingleFieldBuilder< @@ -2333,7 +2333,7 @@ public final class RemoteProtocol { } } private com.google.protobuf.SingleFieldBuilder< - akka.remote.RemoteProtocol.UuidProtocol, akka.remote.RemoteProtocol.UuidProtocol.Builder, akka.remote.RemoteProtocol.UuidProtocolOrBuilder> + akka.remote.RemoteProtocol.UuidProtocol, akka.remote.RemoteProtocol.UuidProtocol.Builder, akka.remote.RemoteProtocol.UuidProtocolOrBuilder> getSupervisorUuidFieldBuilder() { if (supervisorUuidBuilder_ == null) { supervisorUuidBuilder_ = new com.google.protobuf.SingleFieldBuilder< @@ -2345,7 +2345,7 @@ public final class RemoteProtocol { } return supervisorUuidBuilder_; } - + // optional .RemoteActorRefProtocol sender = 7; private akka.remote.RemoteProtocol.RemoteActorRefProtocol sender_ = akka.remote.RemoteProtocol.RemoteActorRefProtocol.getDefaultInstance(); private com.google.protobuf.SingleFieldBuilder< @@ -2423,7 +2423,7 @@ public final class RemoteProtocol { } } private com.google.protobuf.SingleFieldBuilder< - akka.remote.RemoteProtocol.RemoteActorRefProtocol, akka.remote.RemoteProtocol.RemoteActorRefProtocol.Builder, akka.remote.RemoteProtocol.RemoteActorRefProtocolOrBuilder> + akka.remote.RemoteProtocol.RemoteActorRefProtocol, akka.remote.RemoteProtocol.RemoteActorRefProtocol.Builder, akka.remote.RemoteProtocol.RemoteActorRefProtocolOrBuilder> getSenderFieldBuilder() { if (senderBuilder_ == null) { senderBuilder_ = new com.google.protobuf.SingleFieldBuilder< @@ -2435,7 +2435,7 @@ public final class RemoteProtocol { } return senderBuilder_; } - + // repeated .MetadataEntryProtocol metadata = 8; private java.util.List metadata_ = java.util.Collections.emptyList(); @@ -2445,10 +2445,10 @@ public final class RemoteProtocol { bitField0_ |= 0x00000080; } } - + private com.google.protobuf.RepeatedFieldBuilder< akka.remote.RemoteProtocol.MetadataEntryProtocol, akka.remote.RemoteProtocol.MetadataEntryProtocol.Builder, akka.remote.RemoteProtocol.MetadataEntryProtocolOrBuilder> metadataBuilder_; - + public java.util.List getMetadataList() { if (metadataBuilder_ == null) { return java.util.Collections.unmodifiableList(metadata_); @@ -2586,7 +2586,7 @@ public final class RemoteProtocol { return metadataBuilder_.getMessageOrBuilder(index); } } - public java.util.List + public java.util.List getMetadataOrBuilderList() { if (metadataBuilder_ != null) { return metadataBuilder_.getMessageOrBuilderList(); @@ -2603,12 +2603,12 @@ public final class RemoteProtocol { return getMetadataFieldBuilder().addBuilder( index, akka.remote.RemoteProtocol.MetadataEntryProtocol.getDefaultInstance()); } - public java.util.List + public java.util.List getMetadataBuilderList() { return getMetadataFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilder< - akka.remote.RemoteProtocol.MetadataEntryProtocol, akka.remote.RemoteProtocol.MetadataEntryProtocol.Builder, akka.remote.RemoteProtocol.MetadataEntryProtocolOrBuilder> + akka.remote.RemoteProtocol.MetadataEntryProtocol, akka.remote.RemoteProtocol.MetadataEntryProtocol.Builder, akka.remote.RemoteProtocol.MetadataEntryProtocolOrBuilder> getMetadataFieldBuilder() { if (metadataBuilder_ == null) { metadataBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< @@ -2621,25 +2621,25 @@ public final class RemoteProtocol { } return metadataBuilder_; } - + // @@protoc_insertion_point(builder_scope:RemoteMessageProtocol) } - + static { defaultInstance = new RemoteMessageProtocol(true); defaultInstance.initFields(); } - + // @@protoc_insertion_point(class_scope:RemoteMessageProtocol) } - + public interface RemoteControlProtocolOrBuilder extends com.google.protobuf.MessageOrBuilder { - + // optional string cookie = 1; boolean hasCookie(); String getCookie(); - + // required .CommandType commandType = 2; boolean hasCommandType(); akka.remote.RemoteProtocol.CommandType getCommandType(); @@ -2652,26 +2652,26 @@ public final class RemoteProtocol { super(builder); } private RemoteControlProtocol(boolean noInit) {} - + private static final RemoteControlProtocol defaultInstance; public static RemoteControlProtocol getDefaultInstance() { return defaultInstance; } - + public RemoteControlProtocol getDefaultInstanceForType() { return defaultInstance; } - + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return akka.remote.RemoteProtocol.internal_static_RemoteControlProtocol_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return akka.remote.RemoteProtocol.internal_static_RemoteControlProtocol_fieldAccessorTable; } - + private int bitField0_; // optional string cookie = 1; public static final int COOKIE_FIELD_NUMBER = 1; @@ -2684,7 +2684,7 @@ public final class RemoteProtocol { if (ref instanceof String) { return (String) ref; } else { - com.google.protobuf.ByteString bs = + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; String s = bs.toStringUtf8(); if (com.google.protobuf.Internal.isValidUtf8(bs)) { @@ -2696,7 +2696,7 @@ public final class RemoteProtocol { private com.google.protobuf.ByteString getCookieBytes() { java.lang.Object ref = cookie_; if (ref instanceof String) { - com.google.protobuf.ByteString b = + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((String) ref); cookie_ = b; return b; @@ -2704,7 +2704,7 @@ public final class RemoteProtocol { return (com.google.protobuf.ByteString) ref; } } - + // required .CommandType commandType = 2; public static final int COMMANDTYPE_FIELD_NUMBER = 2; private akka.remote.RemoteProtocol.CommandType commandType_; @@ -2714,7 +2714,7 @@ public final class RemoteProtocol { public akka.remote.RemoteProtocol.CommandType getCommandType() { return commandType_; } - + private void initFields() { cookie_ = ""; commandType_ = akka.remote.RemoteProtocol.CommandType.CONNECT; @@ -2723,7 +2723,7 @@ public final class RemoteProtocol { public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized != -1) return isInitialized == 1; - + if (!hasCommandType()) { memoizedIsInitialized = 0; return false; @@ -2731,7 +2731,7 @@ public final class RemoteProtocol { memoizedIsInitialized = 1; return true; } - + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); @@ -2743,12 +2743,12 @@ public final class RemoteProtocol { } getUnknownFields().writeTo(output); } - + private int memoizedSerializedSize = -1; public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; - + size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream @@ -2762,14 +2762,14 @@ public final class RemoteProtocol { memoizedSerializedSize = size; return size; } - + private static final long serialVersionUID = 0L; @java.lang.Override protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { return super.writeReplace(); } - + public static akka.remote.RemoteProtocol.RemoteControlProtocol parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { @@ -2836,14 +2836,14 @@ public final class RemoteProtocol { return newBuilder().mergeFrom(input, extensionRegistry) .buildParsed(); } - + public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(akka.remote.RemoteProtocol.RemoteControlProtocol prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } - + @java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessage.BuilderParent parent) { @@ -2857,17 +2857,17 @@ public final class RemoteProtocol { getDescriptor() { return akka.remote.RemoteProtocol.internal_static_RemoteControlProtocol_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return akka.remote.RemoteProtocol.internal_static_RemoteControlProtocol_fieldAccessorTable; } - + // Construct using akka.remote.RemoteProtocol.RemoteControlProtocol.newBuilder() private Builder() { maybeForceBuilderInitialization(); } - + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); @@ -2879,7 +2879,7 @@ public final class RemoteProtocol { private static Builder create() { return new Builder(); } - + public Builder clear() { super.clear(); cookie_ = ""; @@ -2888,20 +2888,20 @@ public final class RemoteProtocol { bitField0_ = (bitField0_ & ~0x00000002); return this; } - + public Builder clone() { return create().mergeFrom(buildPartial()); } - + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return akka.remote.RemoteProtocol.RemoteControlProtocol.getDescriptor(); } - + public akka.remote.RemoteProtocol.RemoteControlProtocol getDefaultInstanceForType() { return akka.remote.RemoteProtocol.RemoteControlProtocol.getDefaultInstance(); } - + public akka.remote.RemoteProtocol.RemoteControlProtocol build() { akka.remote.RemoteProtocol.RemoteControlProtocol result = buildPartial(); if (!result.isInitialized()) { @@ -2909,7 +2909,7 @@ public final class RemoteProtocol { } return result; } - + private akka.remote.RemoteProtocol.RemoteControlProtocol buildParsed() throws com.google.protobuf.InvalidProtocolBufferException { akka.remote.RemoteProtocol.RemoteControlProtocol result = buildPartial(); @@ -2919,7 +2919,7 @@ public final class RemoteProtocol { } return result; } - + public akka.remote.RemoteProtocol.RemoteControlProtocol buildPartial() { akka.remote.RemoteProtocol.RemoteControlProtocol result = new akka.remote.RemoteProtocol.RemoteControlProtocol(this); int from_bitField0_ = bitField0_; @@ -2936,7 +2936,7 @@ public final class RemoteProtocol { onBuilt(); return result; } - + public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof akka.remote.RemoteProtocol.RemoteControlProtocol) { return mergeFrom((akka.remote.RemoteProtocol.RemoteControlProtocol)other); @@ -2945,7 +2945,7 @@ public final class RemoteProtocol { return this; } } - + public Builder mergeFrom(akka.remote.RemoteProtocol.RemoteControlProtocol other) { if (other == akka.remote.RemoteProtocol.RemoteControlProtocol.getDefaultInstance()) return this; if (other.hasCookie()) { @@ -2957,15 +2957,15 @@ public final class RemoteProtocol { this.mergeUnknownFields(other.getUnknownFields()); return this; } - + public final boolean isInitialized() { if (!hasCommandType()) { - + return false; } return true; } - + public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) @@ -3008,9 +3008,9 @@ public final class RemoteProtocol { } } } - + private int bitField0_; - + // optional string cookie = 1; private java.lang.Object cookie_ = ""; public boolean hasCookie() { @@ -3046,7 +3046,7 @@ public final class RemoteProtocol { cookie_ = value; onChanged(); } - + // required .CommandType commandType = 2; private akka.remote.RemoteProtocol.CommandType commandType_ = akka.remote.RemoteProtocol.CommandType.CONNECT; public boolean hasCommandType() { @@ -3070,29 +3070,29 @@ public final class RemoteProtocol { onChanged(); return this; } - + // @@protoc_insertion_point(builder_scope:RemoteControlProtocol) } - + static { defaultInstance = new RemoteControlProtocol(true); defaultInstance.initFields(); } - + // @@protoc_insertion_point(class_scope:RemoteControlProtocol) } - + public interface RemoteActorRefProtocolOrBuilder extends com.google.protobuf.MessageOrBuilder { - + // required string address = 1; boolean hasAddress(); String getAddress(); - + // required bytes inetSocketAddress = 2; boolean hasInetSocketAddress(); com.google.protobuf.ByteString getInetSocketAddress(); - + // optional uint64 timeout = 3; boolean hasTimeout(); long getTimeout(); @@ -3105,26 +3105,26 @@ public final class RemoteProtocol { super(builder); } private RemoteActorRefProtocol(boolean noInit) {} - + private static final RemoteActorRefProtocol defaultInstance; public static RemoteActorRefProtocol getDefaultInstance() { return defaultInstance; } - + public RemoteActorRefProtocol getDefaultInstanceForType() { return defaultInstance; } - + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return akka.remote.RemoteProtocol.internal_static_RemoteActorRefProtocol_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return akka.remote.RemoteProtocol.internal_static_RemoteActorRefProtocol_fieldAccessorTable; } - + private int bitField0_; // required string address = 1; public static final int ADDRESS_FIELD_NUMBER = 1; @@ -3137,7 +3137,7 @@ public final class RemoteProtocol { if (ref instanceof String) { return (String) ref; } else { - com.google.protobuf.ByteString bs = + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; String s = bs.toStringUtf8(); if (com.google.protobuf.Internal.isValidUtf8(bs)) { @@ -3149,7 +3149,7 @@ public final class RemoteProtocol { private com.google.protobuf.ByteString getAddressBytes() { java.lang.Object ref = address_; if (ref instanceof String) { - com.google.protobuf.ByteString b = + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((String) ref); address_ = b; return b; @@ -3157,7 +3157,7 @@ public final class RemoteProtocol { return (com.google.protobuf.ByteString) ref; } } - + // required bytes inetSocketAddress = 2; public static final int INETSOCKETADDRESS_FIELD_NUMBER = 2; private com.google.protobuf.ByteString inetSocketAddress_; @@ -3167,7 +3167,7 @@ public final class RemoteProtocol { public com.google.protobuf.ByteString getInetSocketAddress() { return inetSocketAddress_; } - + // optional uint64 timeout = 3; public static final int TIMEOUT_FIELD_NUMBER = 3; private long timeout_; @@ -3177,7 +3177,7 @@ public final class RemoteProtocol { public long getTimeout() { return timeout_; } - + private void initFields() { address_ = ""; inetSocketAddress_ = com.google.protobuf.ByteString.EMPTY; @@ -3187,7 +3187,7 @@ public final class RemoteProtocol { public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized != -1) return isInitialized == 1; - + if (!hasAddress()) { memoizedIsInitialized = 0; return false; @@ -3199,7 +3199,7 @@ public final class RemoteProtocol { memoizedIsInitialized = 1; return true; } - + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); @@ -3214,12 +3214,12 @@ public final class RemoteProtocol { } getUnknownFields().writeTo(output); } - + private int memoizedSerializedSize = -1; public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; - + size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream @@ -3237,14 +3237,14 @@ public final class RemoteProtocol { memoizedSerializedSize = size; return size; } - + private static final long serialVersionUID = 0L; @java.lang.Override protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { return super.writeReplace(); } - + public static akka.remote.RemoteProtocol.RemoteActorRefProtocol parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { @@ -3311,14 +3311,14 @@ public final class RemoteProtocol { return newBuilder().mergeFrom(input, extensionRegistry) .buildParsed(); } - + public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(akka.remote.RemoteProtocol.RemoteActorRefProtocol prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } - + @java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessage.BuilderParent parent) { @@ -3332,17 +3332,17 @@ public final class RemoteProtocol { getDescriptor() { return akka.remote.RemoteProtocol.internal_static_RemoteActorRefProtocol_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return akka.remote.RemoteProtocol.internal_static_RemoteActorRefProtocol_fieldAccessorTable; } - + // Construct using akka.remote.RemoteProtocol.RemoteActorRefProtocol.newBuilder() private Builder() { maybeForceBuilderInitialization(); } - + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); @@ -3354,7 +3354,7 @@ public final class RemoteProtocol { private static Builder create() { return new Builder(); } - + public Builder clear() { super.clear(); address_ = ""; @@ -3365,20 +3365,20 @@ public final class RemoteProtocol { bitField0_ = (bitField0_ & ~0x00000004); return this; } - + public Builder clone() { return create().mergeFrom(buildPartial()); } - + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return akka.remote.RemoteProtocol.RemoteActorRefProtocol.getDescriptor(); } - + public akka.remote.RemoteProtocol.RemoteActorRefProtocol getDefaultInstanceForType() { return akka.remote.RemoteProtocol.RemoteActorRefProtocol.getDefaultInstance(); } - + public akka.remote.RemoteProtocol.RemoteActorRefProtocol build() { akka.remote.RemoteProtocol.RemoteActorRefProtocol result = buildPartial(); if (!result.isInitialized()) { @@ -3386,7 +3386,7 @@ public final class RemoteProtocol { } return result; } - + private akka.remote.RemoteProtocol.RemoteActorRefProtocol buildParsed() throws com.google.protobuf.InvalidProtocolBufferException { akka.remote.RemoteProtocol.RemoteActorRefProtocol result = buildPartial(); @@ -3396,7 +3396,7 @@ public final class RemoteProtocol { } return result; } - + public akka.remote.RemoteProtocol.RemoteActorRefProtocol buildPartial() { akka.remote.RemoteProtocol.RemoteActorRefProtocol result = new akka.remote.RemoteProtocol.RemoteActorRefProtocol(this); int from_bitField0_ = bitField0_; @@ -3417,7 +3417,7 @@ public final class RemoteProtocol { onBuilt(); return result; } - + public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof akka.remote.RemoteProtocol.RemoteActorRefProtocol) { return mergeFrom((akka.remote.RemoteProtocol.RemoteActorRefProtocol)other); @@ -3426,7 +3426,7 @@ public final class RemoteProtocol { return this; } } - + public Builder mergeFrom(akka.remote.RemoteProtocol.RemoteActorRefProtocol other) { if (other == akka.remote.RemoteProtocol.RemoteActorRefProtocol.getDefaultInstance()) return this; if (other.hasAddress()) { @@ -3441,19 +3441,19 @@ public final class RemoteProtocol { this.mergeUnknownFields(other.getUnknownFields()); return this; } - + public final boolean isInitialized() { if (!hasAddress()) { - + return false; } if (!hasInetSocketAddress()) { - + return false; } return true; } - + public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) @@ -3495,9 +3495,9 @@ public final class RemoteProtocol { } } } - + private int bitField0_; - + // required string address = 1; private java.lang.Object address_ = ""; public boolean hasAddress() { @@ -3533,7 +3533,7 @@ public final class RemoteProtocol { address_ = value; onChanged(); } - + // required bytes inetSocketAddress = 2; private com.google.protobuf.ByteString inetSocketAddress_ = com.google.protobuf.ByteString.EMPTY; public boolean hasInetSocketAddress() { @@ -3557,7 +3557,7 @@ public final class RemoteProtocol { onChanged(); return this; } - + // optional uint64 timeout = 3; private long timeout_ ; public boolean hasTimeout() { @@ -3578,78 +3578,78 @@ public final class RemoteProtocol { onChanged(); return this; } - + // @@protoc_insertion_point(builder_scope:RemoteActorRefProtocol) } - + static { defaultInstance = new RemoteActorRefProtocol(true); defaultInstance.initFields(); } - + // @@protoc_insertion_point(class_scope:RemoteActorRefProtocol) } - + public interface SerializedActorRefProtocolOrBuilder extends com.google.protobuf.MessageOrBuilder { - + // required .UuidProtocol uuid = 1; boolean hasUuid(); akka.remote.RemoteProtocol.UuidProtocol getUuid(); akka.remote.RemoteProtocol.UuidProtocolOrBuilder getUuidOrBuilder(); - + // required string address = 2; boolean hasAddress(); String getAddress(); - + // required string actorClassname = 3; boolean hasActorClassname(); String getActorClassname(); - + // optional bytes actorInstance = 4; boolean hasActorInstance(); com.google.protobuf.ByteString getActorInstance(); - + // optional string serializerClassname = 5; boolean hasSerializerClassname(); String getSerializerClassname(); - + // optional uint64 timeout = 6; boolean hasTimeout(); long getTimeout(); - + // optional uint64 receiveTimeout = 7; boolean hasReceiveTimeout(); long getReceiveTimeout(); - + // optional .LifeCycleProtocol lifeCycle = 8; boolean hasLifeCycle(); akka.remote.RemoteProtocol.LifeCycleProtocol getLifeCycle(); akka.remote.RemoteProtocol.LifeCycleProtocolOrBuilder getLifeCycleOrBuilder(); - + // optional .RemoteActorRefProtocol supervisor = 9; boolean hasSupervisor(); akka.remote.RemoteProtocol.RemoteActorRefProtocol getSupervisor(); akka.remote.RemoteProtocol.RemoteActorRefProtocolOrBuilder getSupervisorOrBuilder(); - + // optional bytes hotswapStack = 10; boolean hasHotswapStack(); com.google.protobuf.ByteString getHotswapStack(); - + // optional .ReplicationStorageType replicationStorage = 11; boolean hasReplicationStorage(); akka.remote.RemoteProtocol.ReplicationStorageType getReplicationStorage(); - + // optional .ReplicationStrategyType replicationStrategy = 12; boolean hasReplicationStrategy(); akka.remote.RemoteProtocol.ReplicationStrategyType getReplicationStrategy(); - + // repeated .RemoteMessageProtocol messages = 13; - java.util.List + java.util.List getMessagesList(); akka.remote.RemoteProtocol.RemoteMessageProtocol getMessages(int index); int getMessagesCount(); - java.util.List + java.util.List getMessagesOrBuilderList(); akka.remote.RemoteProtocol.RemoteMessageProtocolOrBuilder getMessagesOrBuilder( int index); @@ -3662,26 +3662,26 @@ public final class RemoteProtocol { super(builder); } private SerializedActorRefProtocol(boolean noInit) {} - + private static final SerializedActorRefProtocol defaultInstance; public static SerializedActorRefProtocol getDefaultInstance() { return defaultInstance; } - + public SerializedActorRefProtocol getDefaultInstanceForType() { return defaultInstance; } - + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return akka.remote.RemoteProtocol.internal_static_SerializedActorRefProtocol_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return akka.remote.RemoteProtocol.internal_static_SerializedActorRefProtocol_fieldAccessorTable; } - + private int bitField0_; // required .UuidProtocol uuid = 1; public static final int UUID_FIELD_NUMBER = 1; @@ -3695,7 +3695,7 @@ public final class RemoteProtocol { public akka.remote.RemoteProtocol.UuidProtocolOrBuilder getUuidOrBuilder() { return uuid_; } - + // required string address = 2; public static final int ADDRESS_FIELD_NUMBER = 2; private java.lang.Object address_; @@ -3707,7 +3707,7 @@ public final class RemoteProtocol { if (ref instanceof String) { return (String) ref; } else { - com.google.protobuf.ByteString bs = + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; String s = bs.toStringUtf8(); if (com.google.protobuf.Internal.isValidUtf8(bs)) { @@ -3719,7 +3719,7 @@ public final class RemoteProtocol { private com.google.protobuf.ByteString getAddressBytes() { java.lang.Object ref = address_; if (ref instanceof String) { - com.google.protobuf.ByteString b = + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((String) ref); address_ = b; return b; @@ -3727,7 +3727,7 @@ public final class RemoteProtocol { return (com.google.protobuf.ByteString) ref; } } - + // required string actorClassname = 3; public static final int ACTORCLASSNAME_FIELD_NUMBER = 3; private java.lang.Object actorClassname_; @@ -3739,7 +3739,7 @@ public final class RemoteProtocol { if (ref instanceof String) { return (String) ref; } else { - com.google.protobuf.ByteString bs = + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; String s = bs.toStringUtf8(); if (com.google.protobuf.Internal.isValidUtf8(bs)) { @@ -3751,7 +3751,7 @@ public final class RemoteProtocol { private com.google.protobuf.ByteString getActorClassnameBytes() { java.lang.Object ref = actorClassname_; if (ref instanceof String) { - com.google.protobuf.ByteString b = + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((String) ref); actorClassname_ = b; return b; @@ -3759,7 +3759,7 @@ public final class RemoteProtocol { return (com.google.protobuf.ByteString) ref; } } - + // optional bytes actorInstance = 4; public static final int ACTORINSTANCE_FIELD_NUMBER = 4; private com.google.protobuf.ByteString actorInstance_; @@ -3769,7 +3769,7 @@ public final class RemoteProtocol { public com.google.protobuf.ByteString getActorInstance() { return actorInstance_; } - + // optional string serializerClassname = 5; public static final int SERIALIZERCLASSNAME_FIELD_NUMBER = 5; private java.lang.Object serializerClassname_; @@ -3781,7 +3781,7 @@ public final class RemoteProtocol { if (ref instanceof String) { return (String) ref; } else { - com.google.protobuf.ByteString bs = + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; String s = bs.toStringUtf8(); if (com.google.protobuf.Internal.isValidUtf8(bs)) { @@ -3793,7 +3793,7 @@ public final class RemoteProtocol { private com.google.protobuf.ByteString getSerializerClassnameBytes() { java.lang.Object ref = serializerClassname_; if (ref instanceof String) { - com.google.protobuf.ByteString b = + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((String) ref); serializerClassname_ = b; return b; @@ -3801,7 +3801,7 @@ public final class RemoteProtocol { return (com.google.protobuf.ByteString) ref; } } - + // optional uint64 timeout = 6; public static final int TIMEOUT_FIELD_NUMBER = 6; private long timeout_; @@ -3811,7 +3811,7 @@ public final class RemoteProtocol { public long getTimeout() { return timeout_; } - + // optional uint64 receiveTimeout = 7; public static final int RECEIVETIMEOUT_FIELD_NUMBER = 7; private long receiveTimeout_; @@ -3821,7 +3821,7 @@ public final class RemoteProtocol { public long getReceiveTimeout() { return receiveTimeout_; } - + // optional .LifeCycleProtocol lifeCycle = 8; public static final int LIFECYCLE_FIELD_NUMBER = 8; private akka.remote.RemoteProtocol.LifeCycleProtocol lifeCycle_; @@ -3834,7 +3834,7 @@ public final class RemoteProtocol { public akka.remote.RemoteProtocol.LifeCycleProtocolOrBuilder getLifeCycleOrBuilder() { return lifeCycle_; } - + // optional .RemoteActorRefProtocol supervisor = 9; public static final int SUPERVISOR_FIELD_NUMBER = 9; private akka.remote.RemoteProtocol.RemoteActorRefProtocol supervisor_; @@ -3847,7 +3847,7 @@ public final class RemoteProtocol { public akka.remote.RemoteProtocol.RemoteActorRefProtocolOrBuilder getSupervisorOrBuilder() { return supervisor_; } - + // optional bytes hotswapStack = 10; public static final int HOTSWAPSTACK_FIELD_NUMBER = 10; private com.google.protobuf.ByteString hotswapStack_; @@ -3857,7 +3857,7 @@ public final class RemoteProtocol { public com.google.protobuf.ByteString getHotswapStack() { return hotswapStack_; } - + // optional .ReplicationStorageType replicationStorage = 11; public static final int REPLICATIONSTORAGE_FIELD_NUMBER = 11; private akka.remote.RemoteProtocol.ReplicationStorageType replicationStorage_; @@ -3867,7 +3867,7 @@ public final class RemoteProtocol { public akka.remote.RemoteProtocol.ReplicationStorageType getReplicationStorage() { return replicationStorage_; } - + // optional .ReplicationStrategyType replicationStrategy = 12; public static final int REPLICATIONSTRATEGY_FIELD_NUMBER = 12; private akka.remote.RemoteProtocol.ReplicationStrategyType replicationStrategy_; @@ -3877,14 +3877,14 @@ public final class RemoteProtocol { public akka.remote.RemoteProtocol.ReplicationStrategyType getReplicationStrategy() { return replicationStrategy_; } - + // repeated .RemoteMessageProtocol messages = 13; public static final int MESSAGES_FIELD_NUMBER = 13; private java.util.List messages_; public java.util.List getMessagesList() { return messages_; } - public java.util.List + public java.util.List getMessagesOrBuilderList() { return messages_; } @@ -3898,7 +3898,7 @@ public final class RemoteProtocol { int index) { return messages_.get(index); } - + private void initFields() { uuid_ = akka.remote.RemoteProtocol.UuidProtocol.getDefaultInstance(); address_ = ""; @@ -3918,7 +3918,7 @@ public final class RemoteProtocol { public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized != -1) return isInitialized == 1; - + if (!hasUuid()) { memoizedIsInitialized = 0; return false; @@ -3956,7 +3956,7 @@ public final class RemoteProtocol { memoizedIsInitialized = 1; return true; } - + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); @@ -4001,12 +4001,12 @@ public final class RemoteProtocol { } getUnknownFields().writeTo(output); } - + private int memoizedSerializedSize = -1; public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; - + size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream @@ -4064,14 +4064,14 @@ public final class RemoteProtocol { memoizedSerializedSize = size; return size; } - + private static final long serialVersionUID = 0L; @java.lang.Override protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { return super.writeReplace(); } - + public static akka.remote.RemoteProtocol.SerializedActorRefProtocol parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { @@ -4138,14 +4138,14 @@ public final class RemoteProtocol { return newBuilder().mergeFrom(input, extensionRegistry) .buildParsed(); } - + public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(akka.remote.RemoteProtocol.SerializedActorRefProtocol prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } - + @java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessage.BuilderParent parent) { @@ -4159,17 +4159,17 @@ public final class RemoteProtocol { getDescriptor() { return akka.remote.RemoteProtocol.internal_static_SerializedActorRefProtocol_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return akka.remote.RemoteProtocol.internal_static_SerializedActorRefProtocol_fieldAccessorTable; } - + // Construct using akka.remote.RemoteProtocol.SerializedActorRefProtocol.newBuilder() private Builder() { maybeForceBuilderInitialization(); } - + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); @@ -4185,7 +4185,7 @@ public final class RemoteProtocol { private static Builder create() { return new Builder(); } - + public Builder clear() { super.clear(); if (uuidBuilder_ == null) { @@ -4232,20 +4232,20 @@ public final class RemoteProtocol { } return this; } - + public Builder clone() { return create().mergeFrom(buildPartial()); } - + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return akka.remote.RemoteProtocol.SerializedActorRefProtocol.getDescriptor(); } - + public akka.remote.RemoteProtocol.SerializedActorRefProtocol getDefaultInstanceForType() { return akka.remote.RemoteProtocol.SerializedActorRefProtocol.getDefaultInstance(); } - + public akka.remote.RemoteProtocol.SerializedActorRefProtocol build() { akka.remote.RemoteProtocol.SerializedActorRefProtocol result = buildPartial(); if (!result.isInitialized()) { @@ -4253,7 +4253,7 @@ public final class RemoteProtocol { } return result; } - + private akka.remote.RemoteProtocol.SerializedActorRefProtocol buildParsed() throws com.google.protobuf.InvalidProtocolBufferException { akka.remote.RemoteProtocol.SerializedActorRefProtocol result = buildPartial(); @@ -4263,7 +4263,7 @@ public final class RemoteProtocol { } return result; } - + public akka.remote.RemoteProtocol.SerializedActorRefProtocol buildPartial() { akka.remote.RemoteProtocol.SerializedActorRefProtocol result = new akka.remote.RemoteProtocol.SerializedActorRefProtocol(this); int from_bitField0_ = bitField0_; @@ -4341,7 +4341,7 @@ public final class RemoteProtocol { onBuilt(); return result; } - + public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof akka.remote.RemoteProtocol.SerializedActorRefProtocol) { return mergeFrom((akka.remote.RemoteProtocol.SerializedActorRefProtocol)other); @@ -4350,7 +4350,7 @@ public final class RemoteProtocol { return this; } } - + public Builder mergeFrom(akka.remote.RemoteProtocol.SerializedActorRefProtocol other) { if (other == akka.remote.RemoteProtocol.SerializedActorRefProtocol.getDefaultInstance()) return this; if (other.hasUuid()) { @@ -4407,7 +4407,7 @@ public final class RemoteProtocol { messagesBuilder_ = null; messages_ = other.messages_; bitField0_ = (bitField0_ & ~0x00001000); - messagesBuilder_ = + messagesBuilder_ = com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? getMessagesFieldBuilder() : null; } else { @@ -4418,45 +4418,45 @@ public final class RemoteProtocol { this.mergeUnknownFields(other.getUnknownFields()); return this; } - + public final boolean isInitialized() { if (!hasUuid()) { - + return false; } if (!hasAddress()) { - + return false; } if (!hasActorClassname()) { - + return false; } if (!getUuid().isInitialized()) { - + return false; } if (hasLifeCycle()) { if (!getLifeCycle().isInitialized()) { - + return false; } } if (hasSupervisor()) { if (!getSupervisor().isInitialized()) { - + return false; } } for (int i = 0; i < getMessagesCount(); i++) { if (!getMessages(i).isInitialized()) { - + return false; } } return true; } - + public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) @@ -4573,9 +4573,9 @@ public final class RemoteProtocol { } } } - + private int bitField0_; - + // required .UuidProtocol uuid = 1; private akka.remote.RemoteProtocol.UuidProtocol uuid_ = akka.remote.RemoteProtocol.UuidProtocol.getDefaultInstance(); private com.google.protobuf.SingleFieldBuilder< @@ -4653,7 +4653,7 @@ public final class RemoteProtocol { } } private com.google.protobuf.SingleFieldBuilder< - akka.remote.RemoteProtocol.UuidProtocol, akka.remote.RemoteProtocol.UuidProtocol.Builder, akka.remote.RemoteProtocol.UuidProtocolOrBuilder> + akka.remote.RemoteProtocol.UuidProtocol, akka.remote.RemoteProtocol.UuidProtocol.Builder, akka.remote.RemoteProtocol.UuidProtocolOrBuilder> getUuidFieldBuilder() { if (uuidBuilder_ == null) { uuidBuilder_ = new com.google.protobuf.SingleFieldBuilder< @@ -4665,7 +4665,7 @@ public final class RemoteProtocol { } return uuidBuilder_; } - + // required string address = 2; private java.lang.Object address_ = ""; public boolean hasAddress() { @@ -4701,7 +4701,7 @@ public final class RemoteProtocol { address_ = value; onChanged(); } - + // required string actorClassname = 3; private java.lang.Object actorClassname_ = ""; public boolean hasActorClassname() { @@ -4737,7 +4737,7 @@ public final class RemoteProtocol { actorClassname_ = value; onChanged(); } - + // optional bytes actorInstance = 4; private com.google.protobuf.ByteString actorInstance_ = com.google.protobuf.ByteString.EMPTY; public boolean hasActorInstance() { @@ -4761,7 +4761,7 @@ public final class RemoteProtocol { onChanged(); return this; } - + // optional string serializerClassname = 5; private java.lang.Object serializerClassname_ = ""; public boolean hasSerializerClassname() { @@ -4797,7 +4797,7 @@ public final class RemoteProtocol { serializerClassname_ = value; onChanged(); } - + // optional uint64 timeout = 6; private long timeout_ ; public boolean hasTimeout() { @@ -4818,7 +4818,7 @@ public final class RemoteProtocol { onChanged(); return this; } - + // optional uint64 receiveTimeout = 7; private long receiveTimeout_ ; public boolean hasReceiveTimeout() { @@ -4839,7 +4839,7 @@ public final class RemoteProtocol { onChanged(); return this; } - + // optional .LifeCycleProtocol lifeCycle = 8; private akka.remote.RemoteProtocol.LifeCycleProtocol lifeCycle_ = akka.remote.RemoteProtocol.LifeCycleProtocol.getDefaultInstance(); private com.google.protobuf.SingleFieldBuilder< @@ -4917,7 +4917,7 @@ public final class RemoteProtocol { } } private com.google.protobuf.SingleFieldBuilder< - akka.remote.RemoteProtocol.LifeCycleProtocol, akka.remote.RemoteProtocol.LifeCycleProtocol.Builder, akka.remote.RemoteProtocol.LifeCycleProtocolOrBuilder> + akka.remote.RemoteProtocol.LifeCycleProtocol, akka.remote.RemoteProtocol.LifeCycleProtocol.Builder, akka.remote.RemoteProtocol.LifeCycleProtocolOrBuilder> getLifeCycleFieldBuilder() { if (lifeCycleBuilder_ == null) { lifeCycleBuilder_ = new com.google.protobuf.SingleFieldBuilder< @@ -4929,7 +4929,7 @@ public final class RemoteProtocol { } return lifeCycleBuilder_; } - + // optional .RemoteActorRefProtocol supervisor = 9; private akka.remote.RemoteProtocol.RemoteActorRefProtocol supervisor_ = akka.remote.RemoteProtocol.RemoteActorRefProtocol.getDefaultInstance(); private com.google.protobuf.SingleFieldBuilder< @@ -5007,7 +5007,7 @@ public final class RemoteProtocol { } } private com.google.protobuf.SingleFieldBuilder< - akka.remote.RemoteProtocol.RemoteActorRefProtocol, akka.remote.RemoteProtocol.RemoteActorRefProtocol.Builder, akka.remote.RemoteProtocol.RemoteActorRefProtocolOrBuilder> + akka.remote.RemoteProtocol.RemoteActorRefProtocol, akka.remote.RemoteProtocol.RemoteActorRefProtocol.Builder, akka.remote.RemoteProtocol.RemoteActorRefProtocolOrBuilder> getSupervisorFieldBuilder() { if (supervisorBuilder_ == null) { supervisorBuilder_ = new com.google.protobuf.SingleFieldBuilder< @@ -5019,7 +5019,7 @@ public final class RemoteProtocol { } return supervisorBuilder_; } - + // optional bytes hotswapStack = 10; private com.google.protobuf.ByteString hotswapStack_ = com.google.protobuf.ByteString.EMPTY; public boolean hasHotswapStack() { @@ -5043,7 +5043,7 @@ public final class RemoteProtocol { onChanged(); return this; } - + // optional .ReplicationStorageType replicationStorage = 11; private akka.remote.RemoteProtocol.ReplicationStorageType replicationStorage_ = akka.remote.RemoteProtocol.ReplicationStorageType.TRANSIENT; public boolean hasReplicationStorage() { @@ -5067,7 +5067,7 @@ public final class RemoteProtocol { onChanged(); return this; } - + // optional .ReplicationStrategyType replicationStrategy = 12; private akka.remote.RemoteProtocol.ReplicationStrategyType replicationStrategy_ = akka.remote.RemoteProtocol.ReplicationStrategyType.WRITE_THROUGH; public boolean hasReplicationStrategy() { @@ -5091,7 +5091,7 @@ public final class RemoteProtocol { onChanged(); return this; } - + // repeated .RemoteMessageProtocol messages = 13; private java.util.List messages_ = java.util.Collections.emptyList(); @@ -5101,10 +5101,10 @@ public final class RemoteProtocol { bitField0_ |= 0x00001000; } } - + private com.google.protobuf.RepeatedFieldBuilder< akka.remote.RemoteProtocol.RemoteMessageProtocol, akka.remote.RemoteProtocol.RemoteMessageProtocol.Builder, akka.remote.RemoteProtocol.RemoteMessageProtocolOrBuilder> messagesBuilder_; - + public java.util.List getMessagesList() { if (messagesBuilder_ == null) { return java.util.Collections.unmodifiableList(messages_); @@ -5242,7 +5242,7 @@ public final class RemoteProtocol { return messagesBuilder_.getMessageOrBuilder(index); } } - public java.util.List + public java.util.List getMessagesOrBuilderList() { if (messagesBuilder_ != null) { return messagesBuilder_.getMessageOrBuilderList(); @@ -5259,12 +5259,12 @@ public final class RemoteProtocol { return getMessagesFieldBuilder().addBuilder( index, akka.remote.RemoteProtocol.RemoteMessageProtocol.getDefaultInstance()); } - public java.util.List + public java.util.List getMessagesBuilderList() { return getMessagesFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilder< - akka.remote.RemoteProtocol.RemoteMessageProtocol, akka.remote.RemoteProtocol.RemoteMessageProtocol.Builder, akka.remote.RemoteProtocol.RemoteMessageProtocolOrBuilder> + akka.remote.RemoteProtocol.RemoteMessageProtocol, akka.remote.RemoteProtocol.RemoteMessageProtocol.Builder, akka.remote.RemoteProtocol.RemoteMessageProtocolOrBuilder> getMessagesFieldBuilder() { if (messagesBuilder_ == null) { messagesBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< @@ -5277,26 +5277,26 @@ public final class RemoteProtocol { } return messagesBuilder_; } - + // @@protoc_insertion_point(builder_scope:SerializedActorRefProtocol) } - + static { defaultInstance = new SerializedActorRefProtocol(true); defaultInstance.initFields(); } - + // @@protoc_insertion_point(class_scope:SerializedActorRefProtocol) } - + public interface SerializedTypedActorRefProtocolOrBuilder extends com.google.protobuf.MessageOrBuilder { - + // required .SerializedActorRefProtocol actorRef = 1; boolean hasActorRef(); akka.remote.RemoteProtocol.SerializedActorRefProtocol getActorRef(); akka.remote.RemoteProtocol.SerializedActorRefProtocolOrBuilder getActorRefOrBuilder(); - + // required string interfaceName = 2; boolean hasInterfaceName(); String getInterfaceName(); @@ -5309,26 +5309,26 @@ public final class RemoteProtocol { super(builder); } private SerializedTypedActorRefProtocol(boolean noInit) {} - + private static final SerializedTypedActorRefProtocol defaultInstance; public static SerializedTypedActorRefProtocol getDefaultInstance() { return defaultInstance; } - + public SerializedTypedActorRefProtocol getDefaultInstanceForType() { return defaultInstance; } - + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return akka.remote.RemoteProtocol.internal_static_SerializedTypedActorRefProtocol_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return akka.remote.RemoteProtocol.internal_static_SerializedTypedActorRefProtocol_fieldAccessorTable; } - + private int bitField0_; // required .SerializedActorRefProtocol actorRef = 1; public static final int ACTORREF_FIELD_NUMBER = 1; @@ -5342,7 +5342,7 @@ public final class RemoteProtocol { public akka.remote.RemoteProtocol.SerializedActorRefProtocolOrBuilder getActorRefOrBuilder() { return actorRef_; } - + // required string interfaceName = 2; public static final int INTERFACENAME_FIELD_NUMBER = 2; private java.lang.Object interfaceName_; @@ -5354,7 +5354,7 @@ public final class RemoteProtocol { if (ref instanceof String) { return (String) ref; } else { - com.google.protobuf.ByteString bs = + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; String s = bs.toStringUtf8(); if (com.google.protobuf.Internal.isValidUtf8(bs)) { @@ -5366,7 +5366,7 @@ public final class RemoteProtocol { private com.google.protobuf.ByteString getInterfaceNameBytes() { java.lang.Object ref = interfaceName_; if (ref instanceof String) { - com.google.protobuf.ByteString b = + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((String) ref); interfaceName_ = b; return b; @@ -5374,7 +5374,7 @@ public final class RemoteProtocol { return (com.google.protobuf.ByteString) ref; } } - + private void initFields() { actorRef_ = akka.remote.RemoteProtocol.SerializedActorRefProtocol.getDefaultInstance(); interfaceName_ = ""; @@ -5383,7 +5383,7 @@ public final class RemoteProtocol { public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized != -1) return isInitialized == 1; - + if (!hasActorRef()) { memoizedIsInitialized = 0; return false; @@ -5399,7 +5399,7 @@ public final class RemoteProtocol { memoizedIsInitialized = 1; return true; } - + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); @@ -5411,12 +5411,12 @@ public final class RemoteProtocol { } getUnknownFields().writeTo(output); } - + private int memoizedSerializedSize = -1; public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; - + size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream @@ -5430,14 +5430,14 @@ public final class RemoteProtocol { memoizedSerializedSize = size; return size; } - + private static final long serialVersionUID = 0L; @java.lang.Override protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { return super.writeReplace(); } - + public static akka.remote.RemoteProtocol.SerializedTypedActorRefProtocol parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { @@ -5504,14 +5504,14 @@ public final class RemoteProtocol { return newBuilder().mergeFrom(input, extensionRegistry) .buildParsed(); } - + public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(akka.remote.RemoteProtocol.SerializedTypedActorRefProtocol prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } - + @java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessage.BuilderParent parent) { @@ -5525,17 +5525,17 @@ public final class RemoteProtocol { getDescriptor() { return akka.remote.RemoteProtocol.internal_static_SerializedTypedActorRefProtocol_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return akka.remote.RemoteProtocol.internal_static_SerializedTypedActorRefProtocol_fieldAccessorTable; } - + // Construct using akka.remote.RemoteProtocol.SerializedTypedActorRefProtocol.newBuilder() private Builder() { maybeForceBuilderInitialization(); } - + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); @@ -5548,7 +5548,7 @@ public final class RemoteProtocol { private static Builder create() { return new Builder(); } - + public Builder clear() { super.clear(); if (actorRefBuilder_ == null) { @@ -5561,20 +5561,20 @@ public final class RemoteProtocol { bitField0_ = (bitField0_ & ~0x00000002); return this; } - + public Builder clone() { return create().mergeFrom(buildPartial()); } - + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return akka.remote.RemoteProtocol.SerializedTypedActorRefProtocol.getDescriptor(); } - + public akka.remote.RemoteProtocol.SerializedTypedActorRefProtocol getDefaultInstanceForType() { return akka.remote.RemoteProtocol.SerializedTypedActorRefProtocol.getDefaultInstance(); } - + public akka.remote.RemoteProtocol.SerializedTypedActorRefProtocol build() { akka.remote.RemoteProtocol.SerializedTypedActorRefProtocol result = buildPartial(); if (!result.isInitialized()) { @@ -5582,7 +5582,7 @@ public final class RemoteProtocol { } return result; } - + private akka.remote.RemoteProtocol.SerializedTypedActorRefProtocol buildParsed() throws com.google.protobuf.InvalidProtocolBufferException { akka.remote.RemoteProtocol.SerializedTypedActorRefProtocol result = buildPartial(); @@ -5592,7 +5592,7 @@ public final class RemoteProtocol { } return result; } - + public akka.remote.RemoteProtocol.SerializedTypedActorRefProtocol buildPartial() { akka.remote.RemoteProtocol.SerializedTypedActorRefProtocol result = new akka.remote.RemoteProtocol.SerializedTypedActorRefProtocol(this); int from_bitField0_ = bitField0_; @@ -5613,7 +5613,7 @@ public final class RemoteProtocol { onBuilt(); return result; } - + public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof akka.remote.RemoteProtocol.SerializedTypedActorRefProtocol) { return mergeFrom((akka.remote.RemoteProtocol.SerializedTypedActorRefProtocol)other); @@ -5622,7 +5622,7 @@ public final class RemoteProtocol { return this; } } - + public Builder mergeFrom(akka.remote.RemoteProtocol.SerializedTypedActorRefProtocol other) { if (other == akka.remote.RemoteProtocol.SerializedTypedActorRefProtocol.getDefaultInstance()) return this; if (other.hasActorRef()) { @@ -5634,23 +5634,23 @@ public final class RemoteProtocol { this.mergeUnknownFields(other.getUnknownFields()); return this; } - + public final boolean isInitialized() { if (!hasActorRef()) { - + return false; } if (!hasInterfaceName()) { - + return false; } if (!getActorRef().isInitialized()) { - + return false; } return true; } - + public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) @@ -5691,9 +5691,9 @@ public final class RemoteProtocol { } } } - + private int bitField0_; - + // required .SerializedActorRefProtocol actorRef = 1; private akka.remote.RemoteProtocol.SerializedActorRefProtocol actorRef_ = akka.remote.RemoteProtocol.SerializedActorRefProtocol.getDefaultInstance(); private com.google.protobuf.SingleFieldBuilder< @@ -5771,7 +5771,7 @@ public final class RemoteProtocol { } } private com.google.protobuf.SingleFieldBuilder< - akka.remote.RemoteProtocol.SerializedActorRefProtocol, akka.remote.RemoteProtocol.SerializedActorRefProtocol.Builder, akka.remote.RemoteProtocol.SerializedActorRefProtocolOrBuilder> + akka.remote.RemoteProtocol.SerializedActorRefProtocol, akka.remote.RemoteProtocol.SerializedActorRefProtocol.Builder, akka.remote.RemoteProtocol.SerializedActorRefProtocolOrBuilder> getActorRefFieldBuilder() { if (actorRefBuilder_ == null) { actorRefBuilder_ = new com.google.protobuf.SingleFieldBuilder< @@ -5783,7 +5783,7 @@ public final class RemoteProtocol { } return actorRefBuilder_; } - + // required string interfaceName = 2; private java.lang.Object interfaceName_ = ""; public boolean hasInterfaceName() { @@ -5819,25 +5819,25 @@ public final class RemoteProtocol { interfaceName_ = value; onChanged(); } - + // @@protoc_insertion_point(builder_scope:SerializedTypedActorRefProtocol) } - + static { defaultInstance = new SerializedTypedActorRefProtocol(true); defaultInstance.initFields(); } - + // @@protoc_insertion_point(class_scope:SerializedTypedActorRefProtocol) } - + public interface MessageProtocolOrBuilder extends com.google.protobuf.MessageOrBuilder { - + // required bytes message = 1; boolean hasMessage(); com.google.protobuf.ByteString getMessage(); - + // optional bytes messageManifest = 2; boolean hasMessageManifest(); com.google.protobuf.ByteString getMessageManifest(); @@ -5850,26 +5850,26 @@ public final class RemoteProtocol { super(builder); } private MessageProtocol(boolean noInit) {} - + private static final MessageProtocol defaultInstance; public static MessageProtocol getDefaultInstance() { return defaultInstance; } - + public MessageProtocol getDefaultInstanceForType() { return defaultInstance; } - + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return akka.remote.RemoteProtocol.internal_static_MessageProtocol_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return akka.remote.RemoteProtocol.internal_static_MessageProtocol_fieldAccessorTable; } - + private int bitField0_; // required bytes message = 1; public static final int MESSAGE_FIELD_NUMBER = 1; @@ -5880,7 +5880,7 @@ public final class RemoteProtocol { public com.google.protobuf.ByteString getMessage() { return message_; } - + // optional bytes messageManifest = 2; public static final int MESSAGEMANIFEST_FIELD_NUMBER = 2; private com.google.protobuf.ByteString messageManifest_; @@ -5890,7 +5890,7 @@ public final class RemoteProtocol { public com.google.protobuf.ByteString getMessageManifest() { return messageManifest_; } - + private void initFields() { message_ = com.google.protobuf.ByteString.EMPTY; messageManifest_ = com.google.protobuf.ByteString.EMPTY; @@ -5899,7 +5899,7 @@ public final class RemoteProtocol { public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized != -1) return isInitialized == 1; - + if (!hasMessage()) { memoizedIsInitialized = 0; return false; @@ -5907,7 +5907,7 @@ public final class RemoteProtocol { memoizedIsInitialized = 1; return true; } - + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); @@ -5919,12 +5919,12 @@ public final class RemoteProtocol { } getUnknownFields().writeTo(output); } - + private int memoizedSerializedSize = -1; public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; - + size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream @@ -5938,14 +5938,14 @@ public final class RemoteProtocol { memoizedSerializedSize = size; return size; } - + private static final long serialVersionUID = 0L; @java.lang.Override protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { return super.writeReplace(); } - + public static akka.remote.RemoteProtocol.MessageProtocol parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { @@ -6012,14 +6012,14 @@ public final class RemoteProtocol { return newBuilder().mergeFrom(input, extensionRegistry) .buildParsed(); } - + public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(akka.remote.RemoteProtocol.MessageProtocol prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } - + @java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessage.BuilderParent parent) { @@ -6033,17 +6033,17 @@ public final class RemoteProtocol { getDescriptor() { return akka.remote.RemoteProtocol.internal_static_MessageProtocol_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return akka.remote.RemoteProtocol.internal_static_MessageProtocol_fieldAccessorTable; } - + // Construct using akka.remote.RemoteProtocol.MessageProtocol.newBuilder() private Builder() { maybeForceBuilderInitialization(); } - + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); @@ -6055,7 +6055,7 @@ public final class RemoteProtocol { private static Builder create() { return new Builder(); } - + public Builder clear() { super.clear(); message_ = com.google.protobuf.ByteString.EMPTY; @@ -6064,20 +6064,20 @@ public final class RemoteProtocol { bitField0_ = (bitField0_ & ~0x00000002); return this; } - + public Builder clone() { return create().mergeFrom(buildPartial()); } - + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return akka.remote.RemoteProtocol.MessageProtocol.getDescriptor(); } - + public akka.remote.RemoteProtocol.MessageProtocol getDefaultInstanceForType() { return akka.remote.RemoteProtocol.MessageProtocol.getDefaultInstance(); } - + public akka.remote.RemoteProtocol.MessageProtocol build() { akka.remote.RemoteProtocol.MessageProtocol result = buildPartial(); if (!result.isInitialized()) { @@ -6085,7 +6085,7 @@ public final class RemoteProtocol { } return result; } - + private akka.remote.RemoteProtocol.MessageProtocol buildParsed() throws com.google.protobuf.InvalidProtocolBufferException { akka.remote.RemoteProtocol.MessageProtocol result = buildPartial(); @@ -6095,7 +6095,7 @@ public final class RemoteProtocol { } return result; } - + public akka.remote.RemoteProtocol.MessageProtocol buildPartial() { akka.remote.RemoteProtocol.MessageProtocol result = new akka.remote.RemoteProtocol.MessageProtocol(this); int from_bitField0_ = bitField0_; @@ -6112,7 +6112,7 @@ public final class RemoteProtocol { onBuilt(); return result; } - + public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof akka.remote.RemoteProtocol.MessageProtocol) { return mergeFrom((akka.remote.RemoteProtocol.MessageProtocol)other); @@ -6121,7 +6121,7 @@ public final class RemoteProtocol { return this; } } - + public Builder mergeFrom(akka.remote.RemoteProtocol.MessageProtocol other) { if (other == akka.remote.RemoteProtocol.MessageProtocol.getDefaultInstance()) return this; if (other.hasMessage()) { @@ -6133,15 +6133,15 @@ public final class RemoteProtocol { this.mergeUnknownFields(other.getUnknownFields()); return this; } - + public final boolean isInitialized() { if (!hasMessage()) { - + return false; } return true; } - + public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) @@ -6178,9 +6178,9 @@ public final class RemoteProtocol { } } } - + private int bitField0_; - + // required bytes message = 1; private com.google.protobuf.ByteString message_ = com.google.protobuf.ByteString.EMPTY; public boolean hasMessage() { @@ -6204,7 +6204,7 @@ public final class RemoteProtocol { onChanged(); return this; } - + // optional bytes messageManifest = 2; private com.google.protobuf.ByteString messageManifest_ = com.google.protobuf.ByteString.EMPTY; public boolean hasMessageManifest() { @@ -6228,30 +6228,30 @@ public final class RemoteProtocol { onChanged(); return this; } - + // @@protoc_insertion_point(builder_scope:MessageProtocol) } - + static { defaultInstance = new MessageProtocol(true); defaultInstance.initFields(); } - + // @@protoc_insertion_point(class_scope:MessageProtocol) } - + public interface ActorInfoProtocolOrBuilder extends com.google.protobuf.MessageOrBuilder { - + // required .UuidProtocol uuid = 1; boolean hasUuid(); akka.remote.RemoteProtocol.UuidProtocol getUuid(); akka.remote.RemoteProtocol.UuidProtocolOrBuilder getUuidOrBuilder(); - + // required uint64 timeout = 2; boolean hasTimeout(); long getTimeout(); - + // optional string address = 3; boolean hasAddress(); String getAddress(); @@ -6264,26 +6264,26 @@ public final class RemoteProtocol { super(builder); } private ActorInfoProtocol(boolean noInit) {} - + private static final ActorInfoProtocol defaultInstance; public static ActorInfoProtocol getDefaultInstance() { return defaultInstance; } - + public ActorInfoProtocol getDefaultInstanceForType() { return defaultInstance; } - + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return akka.remote.RemoteProtocol.internal_static_ActorInfoProtocol_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return akka.remote.RemoteProtocol.internal_static_ActorInfoProtocol_fieldAccessorTable; } - + private int bitField0_; // required .UuidProtocol uuid = 1; public static final int UUID_FIELD_NUMBER = 1; @@ -6297,7 +6297,7 @@ public final class RemoteProtocol { public akka.remote.RemoteProtocol.UuidProtocolOrBuilder getUuidOrBuilder() { return uuid_; } - + // required uint64 timeout = 2; public static final int TIMEOUT_FIELD_NUMBER = 2; private long timeout_; @@ -6307,7 +6307,7 @@ public final class RemoteProtocol { public long getTimeout() { return timeout_; } - + // optional string address = 3; public static final int ADDRESS_FIELD_NUMBER = 3; private java.lang.Object address_; @@ -6319,7 +6319,7 @@ public final class RemoteProtocol { if (ref instanceof String) { return (String) ref; } else { - com.google.protobuf.ByteString bs = + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; String s = bs.toStringUtf8(); if (com.google.protobuf.Internal.isValidUtf8(bs)) { @@ -6331,7 +6331,7 @@ public final class RemoteProtocol { private com.google.protobuf.ByteString getAddressBytes() { java.lang.Object ref = address_; if (ref instanceof String) { - com.google.protobuf.ByteString b = + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((String) ref); address_ = b; return b; @@ -6339,7 +6339,7 @@ public final class RemoteProtocol { return (com.google.protobuf.ByteString) ref; } } - + private void initFields() { uuid_ = akka.remote.RemoteProtocol.UuidProtocol.getDefaultInstance(); timeout_ = 0L; @@ -6349,7 +6349,7 @@ public final class RemoteProtocol { public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized != -1) return isInitialized == 1; - + if (!hasUuid()) { memoizedIsInitialized = 0; return false; @@ -6365,7 +6365,7 @@ public final class RemoteProtocol { memoizedIsInitialized = 1; return true; } - + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); @@ -6380,12 +6380,12 @@ public final class RemoteProtocol { } getUnknownFields().writeTo(output); } - + private int memoizedSerializedSize = -1; public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; - + size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream @@ -6403,14 +6403,14 @@ public final class RemoteProtocol { memoizedSerializedSize = size; return size; } - + private static final long serialVersionUID = 0L; @java.lang.Override protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { return super.writeReplace(); } - + public static akka.remote.RemoteProtocol.ActorInfoProtocol parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { @@ -6477,14 +6477,14 @@ public final class RemoteProtocol { return newBuilder().mergeFrom(input, extensionRegistry) .buildParsed(); } - + public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(akka.remote.RemoteProtocol.ActorInfoProtocol prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } - + @java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessage.BuilderParent parent) { @@ -6498,17 +6498,17 @@ public final class RemoteProtocol { getDescriptor() { return akka.remote.RemoteProtocol.internal_static_ActorInfoProtocol_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return akka.remote.RemoteProtocol.internal_static_ActorInfoProtocol_fieldAccessorTable; } - + // Construct using akka.remote.RemoteProtocol.ActorInfoProtocol.newBuilder() private Builder() { maybeForceBuilderInitialization(); } - + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); @@ -6521,7 +6521,7 @@ public final class RemoteProtocol { private static Builder create() { return new Builder(); } - + public Builder clear() { super.clear(); if (uuidBuilder_ == null) { @@ -6536,20 +6536,20 @@ public final class RemoteProtocol { bitField0_ = (bitField0_ & ~0x00000004); return this; } - + public Builder clone() { return create().mergeFrom(buildPartial()); } - + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return akka.remote.RemoteProtocol.ActorInfoProtocol.getDescriptor(); } - + public akka.remote.RemoteProtocol.ActorInfoProtocol getDefaultInstanceForType() { return akka.remote.RemoteProtocol.ActorInfoProtocol.getDefaultInstance(); } - + public akka.remote.RemoteProtocol.ActorInfoProtocol build() { akka.remote.RemoteProtocol.ActorInfoProtocol result = buildPartial(); if (!result.isInitialized()) { @@ -6557,7 +6557,7 @@ public final class RemoteProtocol { } return result; } - + private akka.remote.RemoteProtocol.ActorInfoProtocol buildParsed() throws com.google.protobuf.InvalidProtocolBufferException { akka.remote.RemoteProtocol.ActorInfoProtocol result = buildPartial(); @@ -6567,7 +6567,7 @@ public final class RemoteProtocol { } return result; } - + public akka.remote.RemoteProtocol.ActorInfoProtocol buildPartial() { akka.remote.RemoteProtocol.ActorInfoProtocol result = new akka.remote.RemoteProtocol.ActorInfoProtocol(this); int from_bitField0_ = bitField0_; @@ -6592,7 +6592,7 @@ public final class RemoteProtocol { onBuilt(); return result; } - + public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof akka.remote.RemoteProtocol.ActorInfoProtocol) { return mergeFrom((akka.remote.RemoteProtocol.ActorInfoProtocol)other); @@ -6601,7 +6601,7 @@ public final class RemoteProtocol { return this; } } - + public Builder mergeFrom(akka.remote.RemoteProtocol.ActorInfoProtocol other) { if (other == akka.remote.RemoteProtocol.ActorInfoProtocol.getDefaultInstance()) return this; if (other.hasUuid()) { @@ -6616,23 +6616,23 @@ public final class RemoteProtocol { this.mergeUnknownFields(other.getUnknownFields()); return this; } - + public final boolean isInitialized() { if (!hasUuid()) { - + return false; } if (!hasTimeout()) { - + return false; } if (!getUuid().isInitialized()) { - + return false; } return true; } - + public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) @@ -6678,9 +6678,9 @@ public final class RemoteProtocol { } } } - + private int bitField0_; - + // required .UuidProtocol uuid = 1; private akka.remote.RemoteProtocol.UuidProtocol uuid_ = akka.remote.RemoteProtocol.UuidProtocol.getDefaultInstance(); private com.google.protobuf.SingleFieldBuilder< @@ -6758,7 +6758,7 @@ public final class RemoteProtocol { } } private com.google.protobuf.SingleFieldBuilder< - akka.remote.RemoteProtocol.UuidProtocol, akka.remote.RemoteProtocol.UuidProtocol.Builder, akka.remote.RemoteProtocol.UuidProtocolOrBuilder> + akka.remote.RemoteProtocol.UuidProtocol, akka.remote.RemoteProtocol.UuidProtocol.Builder, akka.remote.RemoteProtocol.UuidProtocolOrBuilder> getUuidFieldBuilder() { if (uuidBuilder_ == null) { uuidBuilder_ = new com.google.protobuf.SingleFieldBuilder< @@ -6770,7 +6770,7 @@ public final class RemoteProtocol { } return uuidBuilder_; } - + // required uint64 timeout = 2; private long timeout_ ; public boolean hasTimeout() { @@ -6791,7 +6791,7 @@ public final class RemoteProtocol { onChanged(); return this; } - + // optional string address = 3; private java.lang.Object address_ = ""; public boolean hasAddress() { @@ -6827,25 +6827,25 @@ public final class RemoteProtocol { address_ = value; onChanged(); } - + // @@protoc_insertion_point(builder_scope:ActorInfoProtocol) } - + static { defaultInstance = new ActorInfoProtocol(true); defaultInstance.initFields(); } - + // @@protoc_insertion_point(class_scope:ActorInfoProtocol) } - + public interface UuidProtocolOrBuilder extends com.google.protobuf.MessageOrBuilder { - + // required uint64 high = 1; boolean hasHigh(); long getHigh(); - + // required uint64 low = 2; boolean hasLow(); long getLow(); @@ -6858,26 +6858,26 @@ public final class RemoteProtocol { super(builder); } private UuidProtocol(boolean noInit) {} - + private static final UuidProtocol defaultInstance; public static UuidProtocol getDefaultInstance() { return defaultInstance; } - + public UuidProtocol getDefaultInstanceForType() { return defaultInstance; } - + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return akka.remote.RemoteProtocol.internal_static_UuidProtocol_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return akka.remote.RemoteProtocol.internal_static_UuidProtocol_fieldAccessorTable; } - + private int bitField0_; // required uint64 high = 1; public static final int HIGH_FIELD_NUMBER = 1; @@ -6888,7 +6888,7 @@ public final class RemoteProtocol { public long getHigh() { return high_; } - + // required uint64 low = 2; public static final int LOW_FIELD_NUMBER = 2; private long low_; @@ -6898,7 +6898,7 @@ public final class RemoteProtocol { public long getLow() { return low_; } - + private void initFields() { high_ = 0L; low_ = 0L; @@ -6907,7 +6907,7 @@ public final class RemoteProtocol { public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized != -1) return isInitialized == 1; - + if (!hasHigh()) { memoizedIsInitialized = 0; return false; @@ -6919,7 +6919,7 @@ public final class RemoteProtocol { memoizedIsInitialized = 1; return true; } - + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); @@ -6931,12 +6931,12 @@ public final class RemoteProtocol { } getUnknownFields().writeTo(output); } - + private int memoizedSerializedSize = -1; public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; - + size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream @@ -6950,14 +6950,14 @@ public final class RemoteProtocol { memoizedSerializedSize = size; return size; } - + private static final long serialVersionUID = 0L; @java.lang.Override protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { return super.writeReplace(); } - + public static akka.remote.RemoteProtocol.UuidProtocol parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { @@ -7024,14 +7024,14 @@ public final class RemoteProtocol { return newBuilder().mergeFrom(input, extensionRegistry) .buildParsed(); } - + public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(akka.remote.RemoteProtocol.UuidProtocol prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } - + @java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessage.BuilderParent parent) { @@ -7045,17 +7045,17 @@ public final class RemoteProtocol { getDescriptor() { return akka.remote.RemoteProtocol.internal_static_UuidProtocol_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return akka.remote.RemoteProtocol.internal_static_UuidProtocol_fieldAccessorTable; } - + // Construct using akka.remote.RemoteProtocol.UuidProtocol.newBuilder() private Builder() { maybeForceBuilderInitialization(); } - + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); @@ -7067,7 +7067,7 @@ public final class RemoteProtocol { private static Builder create() { return new Builder(); } - + public Builder clear() { super.clear(); high_ = 0L; @@ -7076,20 +7076,20 @@ public final class RemoteProtocol { bitField0_ = (bitField0_ & ~0x00000002); return this; } - + public Builder clone() { return create().mergeFrom(buildPartial()); } - + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return akka.remote.RemoteProtocol.UuidProtocol.getDescriptor(); } - + public akka.remote.RemoteProtocol.UuidProtocol getDefaultInstanceForType() { return akka.remote.RemoteProtocol.UuidProtocol.getDefaultInstance(); } - + public akka.remote.RemoteProtocol.UuidProtocol build() { akka.remote.RemoteProtocol.UuidProtocol result = buildPartial(); if (!result.isInitialized()) { @@ -7097,7 +7097,7 @@ public final class RemoteProtocol { } return result; } - + private akka.remote.RemoteProtocol.UuidProtocol buildParsed() throws com.google.protobuf.InvalidProtocolBufferException { akka.remote.RemoteProtocol.UuidProtocol result = buildPartial(); @@ -7107,7 +7107,7 @@ public final class RemoteProtocol { } return result; } - + public akka.remote.RemoteProtocol.UuidProtocol buildPartial() { akka.remote.RemoteProtocol.UuidProtocol result = new akka.remote.RemoteProtocol.UuidProtocol(this); int from_bitField0_ = bitField0_; @@ -7124,7 +7124,7 @@ public final class RemoteProtocol { onBuilt(); return result; } - + public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof akka.remote.RemoteProtocol.UuidProtocol) { return mergeFrom((akka.remote.RemoteProtocol.UuidProtocol)other); @@ -7133,7 +7133,7 @@ public final class RemoteProtocol { return this; } } - + public Builder mergeFrom(akka.remote.RemoteProtocol.UuidProtocol other) { if (other == akka.remote.RemoteProtocol.UuidProtocol.getDefaultInstance()) return this; if (other.hasHigh()) { @@ -7145,19 +7145,19 @@ public final class RemoteProtocol { this.mergeUnknownFields(other.getUnknownFields()); return this; } - + public final boolean isInitialized() { if (!hasHigh()) { - + return false; } if (!hasLow()) { - + return false; } return true; } - + public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) @@ -7194,9 +7194,9 @@ public final class RemoteProtocol { } } } - + private int bitField0_; - + // required uint64 high = 1; private long high_ ; public boolean hasHigh() { @@ -7217,7 +7217,7 @@ public final class RemoteProtocol { onChanged(); return this; } - + // required uint64 low = 2; private long low_ ; public boolean hasLow() { @@ -7238,25 +7238,25 @@ public final class RemoteProtocol { onChanged(); return this; } - + // @@protoc_insertion_point(builder_scope:UuidProtocol) } - + static { defaultInstance = new UuidProtocol(true); defaultInstance.initFields(); } - + // @@protoc_insertion_point(class_scope:UuidProtocol) } - + public interface MetadataEntryProtocolOrBuilder extends com.google.protobuf.MessageOrBuilder { - + // required string key = 1; boolean hasKey(); String getKey(); - + // required bytes value = 2; boolean hasValue(); com.google.protobuf.ByteString getValue(); @@ -7269,26 +7269,26 @@ public final class RemoteProtocol { super(builder); } private MetadataEntryProtocol(boolean noInit) {} - + private static final MetadataEntryProtocol defaultInstance; public static MetadataEntryProtocol getDefaultInstance() { return defaultInstance; } - + public MetadataEntryProtocol getDefaultInstanceForType() { return defaultInstance; } - + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return akka.remote.RemoteProtocol.internal_static_MetadataEntryProtocol_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return akka.remote.RemoteProtocol.internal_static_MetadataEntryProtocol_fieldAccessorTable; } - + private int bitField0_; // required string key = 1; public static final int KEY_FIELD_NUMBER = 1; @@ -7301,7 +7301,7 @@ public final class RemoteProtocol { if (ref instanceof String) { return (String) ref; } else { - com.google.protobuf.ByteString bs = + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; String s = bs.toStringUtf8(); if (com.google.protobuf.Internal.isValidUtf8(bs)) { @@ -7313,7 +7313,7 @@ public final class RemoteProtocol { private com.google.protobuf.ByteString getKeyBytes() { java.lang.Object ref = key_; if (ref instanceof String) { - com.google.protobuf.ByteString b = + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((String) ref); key_ = b; return b; @@ -7321,7 +7321,7 @@ public final class RemoteProtocol { return (com.google.protobuf.ByteString) ref; } } - + // required bytes value = 2; public static final int VALUE_FIELD_NUMBER = 2; private com.google.protobuf.ByteString value_; @@ -7331,7 +7331,7 @@ public final class RemoteProtocol { public com.google.protobuf.ByteString getValue() { return value_; } - + private void initFields() { key_ = ""; value_ = com.google.protobuf.ByteString.EMPTY; @@ -7340,7 +7340,7 @@ public final class RemoteProtocol { public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized != -1) return isInitialized == 1; - + if (!hasKey()) { memoizedIsInitialized = 0; return false; @@ -7352,7 +7352,7 @@ public final class RemoteProtocol { memoizedIsInitialized = 1; return true; } - + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); @@ -7364,12 +7364,12 @@ public final class RemoteProtocol { } getUnknownFields().writeTo(output); } - + private int memoizedSerializedSize = -1; public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; - + size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream @@ -7383,14 +7383,14 @@ public final class RemoteProtocol { memoizedSerializedSize = size; return size; } - + private static final long serialVersionUID = 0L; @java.lang.Override protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { return super.writeReplace(); } - + public static akka.remote.RemoteProtocol.MetadataEntryProtocol parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { @@ -7457,14 +7457,14 @@ public final class RemoteProtocol { return newBuilder().mergeFrom(input, extensionRegistry) .buildParsed(); } - + public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(akka.remote.RemoteProtocol.MetadataEntryProtocol prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } - + @java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessage.BuilderParent parent) { @@ -7478,17 +7478,17 @@ public final class RemoteProtocol { getDescriptor() { return akka.remote.RemoteProtocol.internal_static_MetadataEntryProtocol_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return akka.remote.RemoteProtocol.internal_static_MetadataEntryProtocol_fieldAccessorTable; } - + // Construct using akka.remote.RemoteProtocol.MetadataEntryProtocol.newBuilder() private Builder() { maybeForceBuilderInitialization(); } - + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); @@ -7500,7 +7500,7 @@ public final class RemoteProtocol { private static Builder create() { return new Builder(); } - + public Builder clear() { super.clear(); key_ = ""; @@ -7509,20 +7509,20 @@ public final class RemoteProtocol { bitField0_ = (bitField0_ & ~0x00000002); return this; } - + public Builder clone() { return create().mergeFrom(buildPartial()); } - + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return akka.remote.RemoteProtocol.MetadataEntryProtocol.getDescriptor(); } - + public akka.remote.RemoteProtocol.MetadataEntryProtocol getDefaultInstanceForType() { return akka.remote.RemoteProtocol.MetadataEntryProtocol.getDefaultInstance(); } - + public akka.remote.RemoteProtocol.MetadataEntryProtocol build() { akka.remote.RemoteProtocol.MetadataEntryProtocol result = buildPartial(); if (!result.isInitialized()) { @@ -7530,7 +7530,7 @@ public final class RemoteProtocol { } return result; } - + private akka.remote.RemoteProtocol.MetadataEntryProtocol buildParsed() throws com.google.protobuf.InvalidProtocolBufferException { akka.remote.RemoteProtocol.MetadataEntryProtocol result = buildPartial(); @@ -7540,7 +7540,7 @@ public final class RemoteProtocol { } return result; } - + public akka.remote.RemoteProtocol.MetadataEntryProtocol buildPartial() { akka.remote.RemoteProtocol.MetadataEntryProtocol result = new akka.remote.RemoteProtocol.MetadataEntryProtocol(this); int from_bitField0_ = bitField0_; @@ -7557,7 +7557,7 @@ public final class RemoteProtocol { onBuilt(); return result; } - + public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof akka.remote.RemoteProtocol.MetadataEntryProtocol) { return mergeFrom((akka.remote.RemoteProtocol.MetadataEntryProtocol)other); @@ -7566,7 +7566,7 @@ public final class RemoteProtocol { return this; } } - + public Builder mergeFrom(akka.remote.RemoteProtocol.MetadataEntryProtocol other) { if (other == akka.remote.RemoteProtocol.MetadataEntryProtocol.getDefaultInstance()) return this; if (other.hasKey()) { @@ -7578,19 +7578,19 @@ public final class RemoteProtocol { this.mergeUnknownFields(other.getUnknownFields()); return this; } - + public final boolean isInitialized() { if (!hasKey()) { - + return false; } if (!hasValue()) { - + return false; } return true; } - + public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) @@ -7627,9 +7627,9 @@ public final class RemoteProtocol { } } } - + private int bitField0_; - + // required string key = 1; private java.lang.Object key_ = ""; public boolean hasKey() { @@ -7665,7 +7665,7 @@ public final class RemoteProtocol { key_ = value; onChanged(); } - + // required bytes value = 2; private com.google.protobuf.ByteString value_ = com.google.protobuf.ByteString.EMPTY; public boolean hasValue() { @@ -7689,21 +7689,21 @@ public final class RemoteProtocol { onChanged(); return this; } - + // @@protoc_insertion_point(builder_scope:MetadataEntryProtocol) } - + static { defaultInstance = new MetadataEntryProtocol(true); defaultInstance.initFields(); } - + // @@protoc_insertion_point(class_scope:MetadataEntryProtocol) } - + public interface LifeCycleProtocolOrBuilder extends com.google.protobuf.MessageOrBuilder { - + // required .LifeCycleType lifeCycle = 1; boolean hasLifeCycle(); akka.remote.RemoteProtocol.LifeCycleType getLifeCycle(); @@ -7716,26 +7716,26 @@ public final class RemoteProtocol { super(builder); } private LifeCycleProtocol(boolean noInit) {} - + private static final LifeCycleProtocol defaultInstance; public static LifeCycleProtocol getDefaultInstance() { return defaultInstance; } - + public LifeCycleProtocol getDefaultInstanceForType() { return defaultInstance; } - + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return akka.remote.RemoteProtocol.internal_static_LifeCycleProtocol_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return akka.remote.RemoteProtocol.internal_static_LifeCycleProtocol_fieldAccessorTable; } - + private int bitField0_; // required .LifeCycleType lifeCycle = 1; public static final int LIFECYCLE_FIELD_NUMBER = 1; @@ -7746,7 +7746,7 @@ public final class RemoteProtocol { public akka.remote.RemoteProtocol.LifeCycleType getLifeCycle() { return lifeCycle_; } - + private void initFields() { lifeCycle_ = akka.remote.RemoteProtocol.LifeCycleType.PERMANENT; } @@ -7754,7 +7754,7 @@ public final class RemoteProtocol { public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized != -1) return isInitialized == 1; - + if (!hasLifeCycle()) { memoizedIsInitialized = 0; return false; @@ -7762,7 +7762,7 @@ public final class RemoteProtocol { memoizedIsInitialized = 1; return true; } - + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); @@ -7771,12 +7771,12 @@ public final class RemoteProtocol { } getUnknownFields().writeTo(output); } - + private int memoizedSerializedSize = -1; public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; - + size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream @@ -7786,14 +7786,14 @@ public final class RemoteProtocol { memoizedSerializedSize = size; return size; } - + private static final long serialVersionUID = 0L; @java.lang.Override protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { return super.writeReplace(); } - + public static akka.remote.RemoteProtocol.LifeCycleProtocol parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { @@ -7860,14 +7860,14 @@ public final class RemoteProtocol { return newBuilder().mergeFrom(input, extensionRegistry) .buildParsed(); } - + public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(akka.remote.RemoteProtocol.LifeCycleProtocol prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } - + @java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessage.BuilderParent parent) { @@ -7881,17 +7881,17 @@ public final class RemoteProtocol { getDescriptor() { return akka.remote.RemoteProtocol.internal_static_LifeCycleProtocol_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return akka.remote.RemoteProtocol.internal_static_LifeCycleProtocol_fieldAccessorTable; } - + // Construct using akka.remote.RemoteProtocol.LifeCycleProtocol.newBuilder() private Builder() { maybeForceBuilderInitialization(); } - + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); @@ -7903,27 +7903,27 @@ public final class RemoteProtocol { private static Builder create() { return new Builder(); } - + public Builder clear() { super.clear(); lifeCycle_ = akka.remote.RemoteProtocol.LifeCycleType.PERMANENT; bitField0_ = (bitField0_ & ~0x00000001); return this; } - + public Builder clone() { return create().mergeFrom(buildPartial()); } - + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return akka.remote.RemoteProtocol.LifeCycleProtocol.getDescriptor(); } - + public akka.remote.RemoteProtocol.LifeCycleProtocol getDefaultInstanceForType() { return akka.remote.RemoteProtocol.LifeCycleProtocol.getDefaultInstance(); } - + public akka.remote.RemoteProtocol.LifeCycleProtocol build() { akka.remote.RemoteProtocol.LifeCycleProtocol result = buildPartial(); if (!result.isInitialized()) { @@ -7931,7 +7931,7 @@ public final class RemoteProtocol { } return result; } - + private akka.remote.RemoteProtocol.LifeCycleProtocol buildParsed() throws com.google.protobuf.InvalidProtocolBufferException { akka.remote.RemoteProtocol.LifeCycleProtocol result = buildPartial(); @@ -7941,7 +7941,7 @@ public final class RemoteProtocol { } return result; } - + public akka.remote.RemoteProtocol.LifeCycleProtocol buildPartial() { akka.remote.RemoteProtocol.LifeCycleProtocol result = new akka.remote.RemoteProtocol.LifeCycleProtocol(this); int from_bitField0_ = bitField0_; @@ -7954,7 +7954,7 @@ public final class RemoteProtocol { onBuilt(); return result; } - + public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof akka.remote.RemoteProtocol.LifeCycleProtocol) { return mergeFrom((akka.remote.RemoteProtocol.LifeCycleProtocol)other); @@ -7963,7 +7963,7 @@ public final class RemoteProtocol { return this; } } - + public Builder mergeFrom(akka.remote.RemoteProtocol.LifeCycleProtocol other) { if (other == akka.remote.RemoteProtocol.LifeCycleProtocol.getDefaultInstance()) return this; if (other.hasLifeCycle()) { @@ -7972,15 +7972,15 @@ public final class RemoteProtocol { this.mergeUnknownFields(other.getUnknownFields()); return this; } - + public final boolean isInitialized() { if (!hasLifeCycle()) { - + return false; } return true; } - + public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) @@ -8018,9 +8018,9 @@ public final class RemoteProtocol { } } } - + private int bitField0_; - + // required .LifeCycleType lifeCycle = 1; private akka.remote.RemoteProtocol.LifeCycleType lifeCycle_ = akka.remote.RemoteProtocol.LifeCycleType.PERMANENT; public boolean hasLifeCycle() { @@ -8044,25 +8044,25 @@ public final class RemoteProtocol { onChanged(); return this; } - + // @@protoc_insertion_point(builder_scope:LifeCycleProtocol) } - + static { defaultInstance = new LifeCycleProtocol(true); defaultInstance.initFields(); } - + // @@protoc_insertion_point(class_scope:LifeCycleProtocol) } - + public interface AddressProtocolOrBuilder extends com.google.protobuf.MessageOrBuilder { - + // required string hostname = 1; boolean hasHostname(); String getHostname(); - + // required uint32 port = 2; boolean hasPort(); int getPort(); @@ -8075,26 +8075,26 @@ public final class RemoteProtocol { super(builder); } private AddressProtocol(boolean noInit) {} - + private static final AddressProtocol defaultInstance; public static AddressProtocol getDefaultInstance() { return defaultInstance; } - + public AddressProtocol getDefaultInstanceForType() { return defaultInstance; } - + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return akka.remote.RemoteProtocol.internal_static_AddressProtocol_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return akka.remote.RemoteProtocol.internal_static_AddressProtocol_fieldAccessorTable; } - + private int bitField0_; // required string hostname = 1; public static final int HOSTNAME_FIELD_NUMBER = 1; @@ -8107,7 +8107,7 @@ public final class RemoteProtocol { if (ref instanceof String) { return (String) ref; } else { - com.google.protobuf.ByteString bs = + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; String s = bs.toStringUtf8(); if (com.google.protobuf.Internal.isValidUtf8(bs)) { @@ -8119,7 +8119,7 @@ public final class RemoteProtocol { private com.google.protobuf.ByteString getHostnameBytes() { java.lang.Object ref = hostname_; if (ref instanceof String) { - com.google.protobuf.ByteString b = + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((String) ref); hostname_ = b; return b; @@ -8127,7 +8127,7 @@ public final class RemoteProtocol { return (com.google.protobuf.ByteString) ref; } } - + // required uint32 port = 2; public static final int PORT_FIELD_NUMBER = 2; private int port_; @@ -8137,7 +8137,7 @@ public final class RemoteProtocol { public int getPort() { return port_; } - + private void initFields() { hostname_ = ""; port_ = 0; @@ -8146,7 +8146,7 @@ public final class RemoteProtocol { public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized != -1) return isInitialized == 1; - + if (!hasHostname()) { memoizedIsInitialized = 0; return false; @@ -8158,7 +8158,7 @@ public final class RemoteProtocol { memoizedIsInitialized = 1; return true; } - + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); @@ -8170,12 +8170,12 @@ public final class RemoteProtocol { } getUnknownFields().writeTo(output); } - + private int memoizedSerializedSize = -1; public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; - + size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream @@ -8189,14 +8189,14 @@ public final class RemoteProtocol { memoizedSerializedSize = size; return size; } - + private static final long serialVersionUID = 0L; @java.lang.Override protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { return super.writeReplace(); } - + public static akka.remote.RemoteProtocol.AddressProtocol parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { @@ -8263,14 +8263,14 @@ public final class RemoteProtocol { return newBuilder().mergeFrom(input, extensionRegistry) .buildParsed(); } - + public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(akka.remote.RemoteProtocol.AddressProtocol prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } - + @java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessage.BuilderParent parent) { @@ -8284,17 +8284,17 @@ public final class RemoteProtocol { getDescriptor() { return akka.remote.RemoteProtocol.internal_static_AddressProtocol_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return akka.remote.RemoteProtocol.internal_static_AddressProtocol_fieldAccessorTable; } - + // Construct using akka.remote.RemoteProtocol.AddressProtocol.newBuilder() private Builder() { maybeForceBuilderInitialization(); } - + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); @@ -8306,7 +8306,7 @@ public final class RemoteProtocol { private static Builder create() { return new Builder(); } - + public Builder clear() { super.clear(); hostname_ = ""; @@ -8315,20 +8315,20 @@ public final class RemoteProtocol { bitField0_ = (bitField0_ & ~0x00000002); return this; } - + public Builder clone() { return create().mergeFrom(buildPartial()); } - + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return akka.remote.RemoteProtocol.AddressProtocol.getDescriptor(); } - + public akka.remote.RemoteProtocol.AddressProtocol getDefaultInstanceForType() { return akka.remote.RemoteProtocol.AddressProtocol.getDefaultInstance(); } - + public akka.remote.RemoteProtocol.AddressProtocol build() { akka.remote.RemoteProtocol.AddressProtocol result = buildPartial(); if (!result.isInitialized()) { @@ -8336,7 +8336,7 @@ public final class RemoteProtocol { } return result; } - + private akka.remote.RemoteProtocol.AddressProtocol buildParsed() throws com.google.protobuf.InvalidProtocolBufferException { akka.remote.RemoteProtocol.AddressProtocol result = buildPartial(); @@ -8346,7 +8346,7 @@ public final class RemoteProtocol { } return result; } - + public akka.remote.RemoteProtocol.AddressProtocol buildPartial() { akka.remote.RemoteProtocol.AddressProtocol result = new akka.remote.RemoteProtocol.AddressProtocol(this); int from_bitField0_ = bitField0_; @@ -8363,7 +8363,7 @@ public final class RemoteProtocol { onBuilt(); return result; } - + public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof akka.remote.RemoteProtocol.AddressProtocol) { return mergeFrom((akka.remote.RemoteProtocol.AddressProtocol)other); @@ -8372,7 +8372,7 @@ public final class RemoteProtocol { return this; } } - + public Builder mergeFrom(akka.remote.RemoteProtocol.AddressProtocol other) { if (other == akka.remote.RemoteProtocol.AddressProtocol.getDefaultInstance()) return this; if (other.hasHostname()) { @@ -8384,19 +8384,19 @@ public final class RemoteProtocol { this.mergeUnknownFields(other.getUnknownFields()); return this; } - + public final boolean isInitialized() { if (!hasHostname()) { - + return false; } if (!hasPort()) { - + return false; } return true; } - + public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) @@ -8433,9 +8433,9 @@ public final class RemoteProtocol { } } } - + private int bitField0_; - + // required string hostname = 1; private java.lang.Object hostname_ = ""; public boolean hasHostname() { @@ -8471,7 +8471,7 @@ public final class RemoteProtocol { hostname_ = value; onChanged(); } - + // required uint32 port = 2; private int port_ ; public boolean hasPort() { @@ -8492,25 +8492,25 @@ public final class RemoteProtocol { onChanged(); return this; } - + // @@protoc_insertion_point(builder_scope:AddressProtocol) } - + static { defaultInstance = new AddressProtocol(true); defaultInstance.initFields(); } - + // @@protoc_insertion_point(class_scope:AddressProtocol) } - + public interface ExceptionProtocolOrBuilder extends com.google.protobuf.MessageOrBuilder { - + // required string classname = 1; boolean hasClassname(); String getClassname(); - + // required string message = 2; boolean hasMessage(); String getMessage(); @@ -8523,26 +8523,26 @@ public final class RemoteProtocol { super(builder); } private ExceptionProtocol(boolean noInit) {} - + private static final ExceptionProtocol defaultInstance; public static ExceptionProtocol getDefaultInstance() { return defaultInstance; } - + public ExceptionProtocol getDefaultInstanceForType() { return defaultInstance; } - + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return akka.remote.RemoteProtocol.internal_static_ExceptionProtocol_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return akka.remote.RemoteProtocol.internal_static_ExceptionProtocol_fieldAccessorTable; } - + private int bitField0_; // required string classname = 1; public static final int CLASSNAME_FIELD_NUMBER = 1; @@ -8555,7 +8555,7 @@ public final class RemoteProtocol { if (ref instanceof String) { return (String) ref; } else { - com.google.protobuf.ByteString bs = + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; String s = bs.toStringUtf8(); if (com.google.protobuf.Internal.isValidUtf8(bs)) { @@ -8567,7 +8567,7 @@ public final class RemoteProtocol { private com.google.protobuf.ByteString getClassnameBytes() { java.lang.Object ref = classname_; if (ref instanceof String) { - com.google.protobuf.ByteString b = + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((String) ref); classname_ = b; return b; @@ -8575,7 +8575,7 @@ public final class RemoteProtocol { return (com.google.protobuf.ByteString) ref; } } - + // required string message = 2; public static final int MESSAGE_FIELD_NUMBER = 2; private java.lang.Object message_; @@ -8587,7 +8587,7 @@ public final class RemoteProtocol { if (ref instanceof String) { return (String) ref; } else { - com.google.protobuf.ByteString bs = + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; String s = bs.toStringUtf8(); if (com.google.protobuf.Internal.isValidUtf8(bs)) { @@ -8599,7 +8599,7 @@ public final class RemoteProtocol { private com.google.protobuf.ByteString getMessageBytes() { java.lang.Object ref = message_; if (ref instanceof String) { - com.google.protobuf.ByteString b = + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((String) ref); message_ = b; return b; @@ -8607,7 +8607,7 @@ public final class RemoteProtocol { return (com.google.protobuf.ByteString) ref; } } - + private void initFields() { classname_ = ""; message_ = ""; @@ -8616,7 +8616,7 @@ public final class RemoteProtocol { public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized != -1) return isInitialized == 1; - + if (!hasClassname()) { memoizedIsInitialized = 0; return false; @@ -8628,7 +8628,7 @@ public final class RemoteProtocol { memoizedIsInitialized = 1; return true; } - + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); @@ -8640,12 +8640,12 @@ public final class RemoteProtocol { } getUnknownFields().writeTo(output); } - + private int memoizedSerializedSize = -1; public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; - + size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream @@ -8659,14 +8659,14 @@ public final class RemoteProtocol { memoizedSerializedSize = size; return size; } - + private static final long serialVersionUID = 0L; @java.lang.Override protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { return super.writeReplace(); } - + public static akka.remote.RemoteProtocol.ExceptionProtocol parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { @@ -8733,14 +8733,14 @@ public final class RemoteProtocol { return newBuilder().mergeFrom(input, extensionRegistry) .buildParsed(); } - + public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(akka.remote.RemoteProtocol.ExceptionProtocol prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } - + @java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessage.BuilderParent parent) { @@ -8754,17 +8754,17 @@ public final class RemoteProtocol { getDescriptor() { return akka.remote.RemoteProtocol.internal_static_ExceptionProtocol_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return akka.remote.RemoteProtocol.internal_static_ExceptionProtocol_fieldAccessorTable; } - + // Construct using akka.remote.RemoteProtocol.ExceptionProtocol.newBuilder() private Builder() { maybeForceBuilderInitialization(); } - + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); @@ -8776,7 +8776,7 @@ public final class RemoteProtocol { private static Builder create() { return new Builder(); } - + public Builder clear() { super.clear(); classname_ = ""; @@ -8785,20 +8785,20 @@ public final class RemoteProtocol { bitField0_ = (bitField0_ & ~0x00000002); return this; } - + public Builder clone() { return create().mergeFrom(buildPartial()); } - + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return akka.remote.RemoteProtocol.ExceptionProtocol.getDescriptor(); } - + public akka.remote.RemoteProtocol.ExceptionProtocol getDefaultInstanceForType() { return akka.remote.RemoteProtocol.ExceptionProtocol.getDefaultInstance(); } - + public akka.remote.RemoteProtocol.ExceptionProtocol build() { akka.remote.RemoteProtocol.ExceptionProtocol result = buildPartial(); if (!result.isInitialized()) { @@ -8806,7 +8806,7 @@ public final class RemoteProtocol { } return result; } - + private akka.remote.RemoteProtocol.ExceptionProtocol buildParsed() throws com.google.protobuf.InvalidProtocolBufferException { akka.remote.RemoteProtocol.ExceptionProtocol result = buildPartial(); @@ -8816,7 +8816,7 @@ public final class RemoteProtocol { } return result; } - + public akka.remote.RemoteProtocol.ExceptionProtocol buildPartial() { akka.remote.RemoteProtocol.ExceptionProtocol result = new akka.remote.RemoteProtocol.ExceptionProtocol(this); int from_bitField0_ = bitField0_; @@ -8833,7 +8833,7 @@ public final class RemoteProtocol { onBuilt(); return result; } - + public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof akka.remote.RemoteProtocol.ExceptionProtocol) { return mergeFrom((akka.remote.RemoteProtocol.ExceptionProtocol)other); @@ -8842,7 +8842,7 @@ public final class RemoteProtocol { return this; } } - + public Builder mergeFrom(akka.remote.RemoteProtocol.ExceptionProtocol other) { if (other == akka.remote.RemoteProtocol.ExceptionProtocol.getDefaultInstance()) return this; if (other.hasClassname()) { @@ -8854,19 +8854,19 @@ public final class RemoteProtocol { this.mergeUnknownFields(other.getUnknownFields()); return this; } - + public final boolean isInitialized() { if (!hasClassname()) { - + return false; } if (!hasMessage()) { - + return false; } return true; } - + public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) @@ -8903,9 +8903,9 @@ public final class RemoteProtocol { } } } - + private int bitField0_; - + // required string classname = 1; private java.lang.Object classname_ = ""; public boolean hasClassname() { @@ -8941,7 +8941,7 @@ public final class RemoteProtocol { classname_ = value; onChanged(); } - + // required string message = 2; private java.lang.Object message_ = ""; public boolean hasMessage() { @@ -8977,38 +8977,38 @@ public final class RemoteProtocol { message_ = value; onChanged(); } - + // @@protoc_insertion_point(builder_scope:ExceptionProtocol) } - + static { defaultInstance = new ExceptionProtocol(true); defaultInstance.initFields(); } - + // @@protoc_insertion_point(class_scope:ExceptionProtocol) } - + public interface RemoteSystemDaemonMessageProtocolOrBuilder extends com.google.protobuf.MessageOrBuilder { - + // required .RemoteSystemDaemonMessageType messageType = 1; boolean hasMessageType(); akka.remote.RemoteProtocol.RemoteSystemDaemonMessageType getMessageType(); - + // optional .UuidProtocol actorUuid = 2; boolean hasActorUuid(); akka.remote.RemoteProtocol.UuidProtocol getActorUuid(); akka.remote.RemoteProtocol.UuidProtocolOrBuilder getActorUuidOrBuilder(); - + // optional string actorAddress = 3; boolean hasActorAddress(); String getActorAddress(); - + // optional bytes payload = 5; boolean hasPayload(); com.google.protobuf.ByteString getPayload(); - + // optional .UuidProtocol replicateActorFromUuid = 6; boolean hasReplicateActorFromUuid(); akka.remote.RemoteProtocol.UuidProtocol getReplicateActorFromUuid(); @@ -9022,26 +9022,26 @@ public final class RemoteProtocol { super(builder); } private RemoteSystemDaemonMessageProtocol(boolean noInit) {} - + private static final RemoteSystemDaemonMessageProtocol defaultInstance; public static RemoteSystemDaemonMessageProtocol getDefaultInstance() { return defaultInstance; } - + public RemoteSystemDaemonMessageProtocol getDefaultInstanceForType() { return defaultInstance; } - + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return akka.remote.RemoteProtocol.internal_static_RemoteSystemDaemonMessageProtocol_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return akka.remote.RemoteProtocol.internal_static_RemoteSystemDaemonMessageProtocol_fieldAccessorTable; } - + private int bitField0_; // required .RemoteSystemDaemonMessageType messageType = 1; public static final int MESSAGETYPE_FIELD_NUMBER = 1; @@ -9052,7 +9052,7 @@ public final class RemoteProtocol { public akka.remote.RemoteProtocol.RemoteSystemDaemonMessageType getMessageType() { return messageType_; } - + // optional .UuidProtocol actorUuid = 2; public static final int ACTORUUID_FIELD_NUMBER = 2; private akka.remote.RemoteProtocol.UuidProtocol actorUuid_; @@ -9065,7 +9065,7 @@ public final class RemoteProtocol { public akka.remote.RemoteProtocol.UuidProtocolOrBuilder getActorUuidOrBuilder() { return actorUuid_; } - + // optional string actorAddress = 3; public static final int ACTORADDRESS_FIELD_NUMBER = 3; private java.lang.Object actorAddress_; @@ -9077,7 +9077,7 @@ public final class RemoteProtocol { if (ref instanceof String) { return (String) ref; } else { - com.google.protobuf.ByteString bs = + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; String s = bs.toStringUtf8(); if (com.google.protobuf.Internal.isValidUtf8(bs)) { @@ -9089,7 +9089,7 @@ public final class RemoteProtocol { private com.google.protobuf.ByteString getActorAddressBytes() { java.lang.Object ref = actorAddress_; if (ref instanceof String) { - com.google.protobuf.ByteString b = + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((String) ref); actorAddress_ = b; return b; @@ -9097,7 +9097,7 @@ public final class RemoteProtocol { return (com.google.protobuf.ByteString) ref; } } - + // optional bytes payload = 5; public static final int PAYLOAD_FIELD_NUMBER = 5; private com.google.protobuf.ByteString payload_; @@ -9107,7 +9107,7 @@ public final class RemoteProtocol { public com.google.protobuf.ByteString getPayload() { return payload_; } - + // optional .UuidProtocol replicateActorFromUuid = 6; public static final int REPLICATEACTORFROMUUID_FIELD_NUMBER = 6; private akka.remote.RemoteProtocol.UuidProtocol replicateActorFromUuid_; @@ -9120,7 +9120,7 @@ public final class RemoteProtocol { public akka.remote.RemoteProtocol.UuidProtocolOrBuilder getReplicateActorFromUuidOrBuilder() { return replicateActorFromUuid_; } - + private void initFields() { messageType_ = akka.remote.RemoteProtocol.RemoteSystemDaemonMessageType.STOP; actorUuid_ = akka.remote.RemoteProtocol.UuidProtocol.getDefaultInstance(); @@ -9132,7 +9132,7 @@ public final class RemoteProtocol { public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized != -1) return isInitialized == 1; - + if (!hasMessageType()) { memoizedIsInitialized = 0; return false; @@ -9152,7 +9152,7 @@ public final class RemoteProtocol { memoizedIsInitialized = 1; return true; } - + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); @@ -9173,12 +9173,12 @@ public final class RemoteProtocol { } getUnknownFields().writeTo(output); } - + private int memoizedSerializedSize = -1; public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; - + size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream @@ -9204,14 +9204,14 @@ public final class RemoteProtocol { memoizedSerializedSize = size; return size; } - + private static final long serialVersionUID = 0L; @java.lang.Override protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { return super.writeReplace(); } - + public static akka.remote.RemoteProtocol.RemoteSystemDaemonMessageProtocol parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { @@ -9278,14 +9278,14 @@ public final class RemoteProtocol { return newBuilder().mergeFrom(input, extensionRegistry) .buildParsed(); } - + public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(akka.remote.RemoteProtocol.RemoteSystemDaemonMessageProtocol prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } - + @java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessage.BuilderParent parent) { @@ -9299,17 +9299,17 @@ public final class RemoteProtocol { getDescriptor() { return akka.remote.RemoteProtocol.internal_static_RemoteSystemDaemonMessageProtocol_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return akka.remote.RemoteProtocol.internal_static_RemoteSystemDaemonMessageProtocol_fieldAccessorTable; } - + // Construct using akka.remote.RemoteProtocol.RemoteSystemDaemonMessageProtocol.newBuilder() private Builder() { maybeForceBuilderInitialization(); } - + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); @@ -9323,7 +9323,7 @@ public final class RemoteProtocol { private static Builder create() { return new Builder(); } - + public Builder clear() { super.clear(); messageType_ = akka.remote.RemoteProtocol.RemoteSystemDaemonMessageType.STOP; @@ -9346,20 +9346,20 @@ public final class RemoteProtocol { bitField0_ = (bitField0_ & ~0x00000010); return this; } - + public Builder clone() { return create().mergeFrom(buildPartial()); } - + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return akka.remote.RemoteProtocol.RemoteSystemDaemonMessageProtocol.getDescriptor(); } - + public akka.remote.RemoteProtocol.RemoteSystemDaemonMessageProtocol getDefaultInstanceForType() { return akka.remote.RemoteProtocol.RemoteSystemDaemonMessageProtocol.getDefaultInstance(); } - + public akka.remote.RemoteProtocol.RemoteSystemDaemonMessageProtocol build() { akka.remote.RemoteProtocol.RemoteSystemDaemonMessageProtocol result = buildPartial(); if (!result.isInitialized()) { @@ -9367,7 +9367,7 @@ public final class RemoteProtocol { } return result; } - + private akka.remote.RemoteProtocol.RemoteSystemDaemonMessageProtocol buildParsed() throws com.google.protobuf.InvalidProtocolBufferException { akka.remote.RemoteProtocol.RemoteSystemDaemonMessageProtocol result = buildPartial(); @@ -9377,7 +9377,7 @@ public final class RemoteProtocol { } return result; } - + public akka.remote.RemoteProtocol.RemoteSystemDaemonMessageProtocol buildPartial() { akka.remote.RemoteProtocol.RemoteSystemDaemonMessageProtocol result = new akka.remote.RemoteProtocol.RemoteSystemDaemonMessageProtocol(this); int from_bitField0_ = bitField0_; @@ -9414,7 +9414,7 @@ public final class RemoteProtocol { onBuilt(); return result; } - + public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof akka.remote.RemoteProtocol.RemoteSystemDaemonMessageProtocol) { return mergeFrom((akka.remote.RemoteProtocol.RemoteSystemDaemonMessageProtocol)other); @@ -9423,7 +9423,7 @@ public final class RemoteProtocol { return this; } } - + public Builder mergeFrom(akka.remote.RemoteProtocol.RemoteSystemDaemonMessageProtocol other) { if (other == akka.remote.RemoteProtocol.RemoteSystemDaemonMessageProtocol.getDefaultInstance()) return this; if (other.hasMessageType()) { @@ -9444,27 +9444,27 @@ public final class RemoteProtocol { this.mergeUnknownFields(other.getUnknownFields()); return this; } - + public final boolean isInitialized() { if (!hasMessageType()) { - + return false; } if (hasActorUuid()) { if (!getActorUuid().isInitialized()) { - + return false; } } if (hasReplicateActorFromUuid()) { if (!getReplicateActorFromUuid().isInitialized()) { - + return false; } } return true; } - + public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) @@ -9530,9 +9530,9 @@ public final class RemoteProtocol { } } } - + private int bitField0_; - + // required .RemoteSystemDaemonMessageType messageType = 1; private akka.remote.RemoteProtocol.RemoteSystemDaemonMessageType messageType_ = akka.remote.RemoteProtocol.RemoteSystemDaemonMessageType.STOP; public boolean hasMessageType() { @@ -9556,7 +9556,7 @@ public final class RemoteProtocol { onChanged(); return this; } - + // optional .UuidProtocol actorUuid = 2; private akka.remote.RemoteProtocol.UuidProtocol actorUuid_ = akka.remote.RemoteProtocol.UuidProtocol.getDefaultInstance(); private com.google.protobuf.SingleFieldBuilder< @@ -9634,7 +9634,7 @@ public final class RemoteProtocol { } } private com.google.protobuf.SingleFieldBuilder< - akka.remote.RemoteProtocol.UuidProtocol, akka.remote.RemoteProtocol.UuidProtocol.Builder, akka.remote.RemoteProtocol.UuidProtocolOrBuilder> + akka.remote.RemoteProtocol.UuidProtocol, akka.remote.RemoteProtocol.UuidProtocol.Builder, akka.remote.RemoteProtocol.UuidProtocolOrBuilder> getActorUuidFieldBuilder() { if (actorUuidBuilder_ == null) { actorUuidBuilder_ = new com.google.protobuf.SingleFieldBuilder< @@ -9646,7 +9646,7 @@ public final class RemoteProtocol { } return actorUuidBuilder_; } - + // optional string actorAddress = 3; private java.lang.Object actorAddress_ = ""; public boolean hasActorAddress() { @@ -9682,7 +9682,7 @@ public final class RemoteProtocol { actorAddress_ = value; onChanged(); } - + // optional bytes payload = 5; private com.google.protobuf.ByteString payload_ = com.google.protobuf.ByteString.EMPTY; public boolean hasPayload() { @@ -9706,7 +9706,7 @@ public final class RemoteProtocol { onChanged(); return this; } - + // optional .UuidProtocol replicateActorFromUuid = 6; private akka.remote.RemoteProtocol.UuidProtocol replicateActorFromUuid_ = akka.remote.RemoteProtocol.UuidProtocol.getDefaultInstance(); private com.google.protobuf.SingleFieldBuilder< @@ -9784,7 +9784,7 @@ public final class RemoteProtocol { } } private com.google.protobuf.SingleFieldBuilder< - akka.remote.RemoteProtocol.UuidProtocol, akka.remote.RemoteProtocol.UuidProtocol.Builder, akka.remote.RemoteProtocol.UuidProtocolOrBuilder> + akka.remote.RemoteProtocol.UuidProtocol, akka.remote.RemoteProtocol.UuidProtocol.Builder, akka.remote.RemoteProtocol.UuidProtocolOrBuilder> getReplicateActorFromUuidFieldBuilder() { if (replicateActorFromUuidBuilder_ == null) { replicateActorFromUuidBuilder_ = new com.google.protobuf.SingleFieldBuilder< @@ -9796,34 +9796,34 @@ public final class RemoteProtocol { } return replicateActorFromUuidBuilder_; } - + // @@protoc_insertion_point(builder_scope:RemoteSystemDaemonMessageProtocol) } - + static { defaultInstance = new RemoteSystemDaemonMessageProtocol(true); defaultInstance.initFields(); } - + // @@protoc_insertion_point(class_scope:RemoteSystemDaemonMessageProtocol) } - + public interface DurableMailboxMessageProtocolOrBuilder extends com.google.protobuf.MessageOrBuilder { - + // required string ownerActorAddress = 1; boolean hasOwnerActorAddress(); String getOwnerActorAddress(); - + // optional string senderActorAddress = 2; boolean hasSenderActorAddress(); String getSenderActorAddress(); - + // optional .UuidProtocol futureUuid = 3; boolean hasFutureUuid(); akka.remote.RemoteProtocol.UuidProtocol getFutureUuid(); akka.remote.RemoteProtocol.UuidProtocolOrBuilder getFutureUuidOrBuilder(); - + // required bytes message = 4; boolean hasMessage(); com.google.protobuf.ByteString getMessage(); @@ -9836,26 +9836,26 @@ public final class RemoteProtocol { super(builder); } private DurableMailboxMessageProtocol(boolean noInit) {} - + private static final DurableMailboxMessageProtocol defaultInstance; public static DurableMailboxMessageProtocol getDefaultInstance() { return defaultInstance; } - + public DurableMailboxMessageProtocol getDefaultInstanceForType() { return defaultInstance; } - + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return akka.remote.RemoteProtocol.internal_static_DurableMailboxMessageProtocol_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return akka.remote.RemoteProtocol.internal_static_DurableMailboxMessageProtocol_fieldAccessorTable; } - + private int bitField0_; // required string ownerActorAddress = 1; public static final int OWNERACTORADDRESS_FIELD_NUMBER = 1; @@ -9868,7 +9868,7 @@ public final class RemoteProtocol { if (ref instanceof String) { return (String) ref; } else { - com.google.protobuf.ByteString bs = + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; String s = bs.toStringUtf8(); if (com.google.protobuf.Internal.isValidUtf8(bs)) { @@ -9880,7 +9880,7 @@ public final class RemoteProtocol { private com.google.protobuf.ByteString getOwnerActorAddressBytes() { java.lang.Object ref = ownerActorAddress_; if (ref instanceof String) { - com.google.protobuf.ByteString b = + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((String) ref); ownerActorAddress_ = b; return b; @@ -9888,7 +9888,7 @@ public final class RemoteProtocol { return (com.google.protobuf.ByteString) ref; } } - + // optional string senderActorAddress = 2; public static final int SENDERACTORADDRESS_FIELD_NUMBER = 2; private java.lang.Object senderActorAddress_; @@ -9900,7 +9900,7 @@ public final class RemoteProtocol { if (ref instanceof String) { return (String) ref; } else { - com.google.protobuf.ByteString bs = + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; String s = bs.toStringUtf8(); if (com.google.protobuf.Internal.isValidUtf8(bs)) { @@ -9912,7 +9912,7 @@ public final class RemoteProtocol { private com.google.protobuf.ByteString getSenderActorAddressBytes() { java.lang.Object ref = senderActorAddress_; if (ref instanceof String) { - com.google.protobuf.ByteString b = + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((String) ref); senderActorAddress_ = b; return b; @@ -9920,7 +9920,7 @@ public final class RemoteProtocol { return (com.google.protobuf.ByteString) ref; } } - + // optional .UuidProtocol futureUuid = 3; public static final int FUTUREUUID_FIELD_NUMBER = 3; private akka.remote.RemoteProtocol.UuidProtocol futureUuid_; @@ -9933,7 +9933,7 @@ public final class RemoteProtocol { public akka.remote.RemoteProtocol.UuidProtocolOrBuilder getFutureUuidOrBuilder() { return futureUuid_; } - + // required bytes message = 4; public static final int MESSAGE_FIELD_NUMBER = 4; private com.google.protobuf.ByteString message_; @@ -9943,7 +9943,7 @@ public final class RemoteProtocol { public com.google.protobuf.ByteString getMessage() { return message_; } - + private void initFields() { ownerActorAddress_ = ""; senderActorAddress_ = ""; @@ -9954,7 +9954,7 @@ public final class RemoteProtocol { public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized != -1) return isInitialized == 1; - + if (!hasOwnerActorAddress()) { memoizedIsInitialized = 0; return false; @@ -9972,7 +9972,7 @@ public final class RemoteProtocol { memoizedIsInitialized = 1; return true; } - + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); @@ -9990,12 +9990,12 @@ public final class RemoteProtocol { } getUnknownFields().writeTo(output); } - + private int memoizedSerializedSize = -1; public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; - + size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream @@ -10017,14 +10017,14 @@ public final class RemoteProtocol { memoizedSerializedSize = size; return size; } - + private static final long serialVersionUID = 0L; @java.lang.Override protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { return super.writeReplace(); } - + public static akka.remote.RemoteProtocol.DurableMailboxMessageProtocol parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { @@ -10091,14 +10091,14 @@ public final class RemoteProtocol { return newBuilder().mergeFrom(input, extensionRegistry) .buildParsed(); } - + public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(akka.remote.RemoteProtocol.DurableMailboxMessageProtocol prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } - + @java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessage.BuilderParent parent) { @@ -10112,17 +10112,17 @@ public final class RemoteProtocol { getDescriptor() { return akka.remote.RemoteProtocol.internal_static_DurableMailboxMessageProtocol_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return akka.remote.RemoteProtocol.internal_static_DurableMailboxMessageProtocol_fieldAccessorTable; } - + // Construct using akka.remote.RemoteProtocol.DurableMailboxMessageProtocol.newBuilder() private Builder() { maybeForceBuilderInitialization(); } - + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); @@ -10135,7 +10135,7 @@ public final class RemoteProtocol { private static Builder create() { return new Builder(); } - + public Builder clear() { super.clear(); ownerActorAddress_ = ""; @@ -10152,20 +10152,20 @@ public final class RemoteProtocol { bitField0_ = (bitField0_ & ~0x00000008); return this; } - + public Builder clone() { return create().mergeFrom(buildPartial()); } - + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return akka.remote.RemoteProtocol.DurableMailboxMessageProtocol.getDescriptor(); } - + public akka.remote.RemoteProtocol.DurableMailboxMessageProtocol getDefaultInstanceForType() { return akka.remote.RemoteProtocol.DurableMailboxMessageProtocol.getDefaultInstance(); } - + public akka.remote.RemoteProtocol.DurableMailboxMessageProtocol build() { akka.remote.RemoteProtocol.DurableMailboxMessageProtocol result = buildPartial(); if (!result.isInitialized()) { @@ -10173,7 +10173,7 @@ public final class RemoteProtocol { } return result; } - + private akka.remote.RemoteProtocol.DurableMailboxMessageProtocol buildParsed() throws com.google.protobuf.InvalidProtocolBufferException { akka.remote.RemoteProtocol.DurableMailboxMessageProtocol result = buildPartial(); @@ -10183,7 +10183,7 @@ public final class RemoteProtocol { } return result; } - + public akka.remote.RemoteProtocol.DurableMailboxMessageProtocol buildPartial() { akka.remote.RemoteProtocol.DurableMailboxMessageProtocol result = new akka.remote.RemoteProtocol.DurableMailboxMessageProtocol(this); int from_bitField0_ = bitField0_; @@ -10212,7 +10212,7 @@ public final class RemoteProtocol { onBuilt(); return result; } - + public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof akka.remote.RemoteProtocol.DurableMailboxMessageProtocol) { return mergeFrom((akka.remote.RemoteProtocol.DurableMailboxMessageProtocol)other); @@ -10221,7 +10221,7 @@ public final class RemoteProtocol { return this; } } - + public Builder mergeFrom(akka.remote.RemoteProtocol.DurableMailboxMessageProtocol other) { if (other == akka.remote.RemoteProtocol.DurableMailboxMessageProtocol.getDefaultInstance()) return this; if (other.hasOwnerActorAddress()) { @@ -10239,25 +10239,25 @@ public final class RemoteProtocol { this.mergeUnknownFields(other.getUnknownFields()); return this; } - + public final boolean isInitialized() { if (!hasOwnerActorAddress()) { - + return false; } if (!hasMessage()) { - + return false; } if (hasFutureUuid()) { if (!getFutureUuid().isInitialized()) { - + return false; } } return true; } - + public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) @@ -10308,9 +10308,9 @@ public final class RemoteProtocol { } } } - + private int bitField0_; - + // required string ownerActorAddress = 1; private java.lang.Object ownerActorAddress_ = ""; public boolean hasOwnerActorAddress() { @@ -10346,7 +10346,7 @@ public final class RemoteProtocol { ownerActorAddress_ = value; onChanged(); } - + // optional string senderActorAddress = 2; private java.lang.Object senderActorAddress_ = ""; public boolean hasSenderActorAddress() { @@ -10382,7 +10382,7 @@ public final class RemoteProtocol { senderActorAddress_ = value; onChanged(); } - + // optional .UuidProtocol futureUuid = 3; private akka.remote.RemoteProtocol.UuidProtocol futureUuid_ = akka.remote.RemoteProtocol.UuidProtocol.getDefaultInstance(); private com.google.protobuf.SingleFieldBuilder< @@ -10460,7 +10460,7 @@ public final class RemoteProtocol { } } private com.google.protobuf.SingleFieldBuilder< - akka.remote.RemoteProtocol.UuidProtocol, akka.remote.RemoteProtocol.UuidProtocol.Builder, akka.remote.RemoteProtocol.UuidProtocolOrBuilder> + akka.remote.RemoteProtocol.UuidProtocol, akka.remote.RemoteProtocol.UuidProtocol.Builder, akka.remote.RemoteProtocol.UuidProtocolOrBuilder> getFutureUuidFieldBuilder() { if (futureUuidBuilder_ == null) { futureUuidBuilder_ = new com.google.protobuf.SingleFieldBuilder< @@ -10472,7 +10472,7 @@ public final class RemoteProtocol { } return futureUuidBuilder_; } - + // required bytes message = 4; private com.google.protobuf.ByteString message_ = com.google.protobuf.ByteString.EMPTY; public boolean hasMessage() { @@ -10496,18 +10496,18 @@ public final class RemoteProtocol { onChanged(); return this; } - + // @@protoc_insertion_point(builder_scope:DurableMailboxMessageProtocol) } - + static { defaultInstance = new DurableMailboxMessageProtocol(true); defaultInstance.initFields(); } - + // @@protoc_insertion_point(class_scope:DurableMailboxMessageProtocol) } - + private static com.google.protobuf.Descriptors.Descriptor internal_static_AkkaRemoteProtocol_descriptor; private static @@ -10583,7 +10583,7 @@ public final class RemoteProtocol { private static com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_DurableMailboxMessageProtocol_fieldAccessorTable; - + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { return descriptor; @@ -10791,6 +10791,6 @@ public final class RemoteProtocol { new com.google.protobuf.Descriptors.FileDescriptor[] { }, assigner); } - + // @@protoc_insertion_point(outer_class_scope) } diff --git a/akka-remote/src/multi-jvm/scala/akka/remote/FileBasedBarrier.scala b/akka-remote/src/multi-jvm/scala/akka/remote/FileBasedBarrier.scala index ac8c5211ba..2b14347e98 100644 --- a/akka-remote/src/multi-jvm/scala/akka/remote/FileBasedBarrier.scala +++ b/akka-remote/src/multi-jvm/scala/akka/remote/FileBasedBarrier.scala @@ -88,4 +88,4 @@ class FileBasedBarrier( def expire(barrier: String) = { throw new BarrierTimeoutException("Timeout (%s) waiting for %s barrier" format (timeout, barrier)) } -} \ No newline at end of file +} diff --git a/akka-remote/src/test/java/akka/actor/ProtobufProtocol.java b/akka-remote/src/test/java/akka/actor/ProtobufProtocol.java index 38d929f4e5..4307c64e3f 100644 --- a/akka-remote/src/test/java/akka/actor/ProtobufProtocol.java +++ b/akka-remote/src/test/java/akka/actor/ProtobufProtocol.java @@ -10,15 +10,15 @@ public final class ProtobufProtocol { } public interface MyMessageOrBuilder extends com.google.protobuf.MessageOrBuilder { - + // required uint64 id = 1; boolean hasId(); long getId(); - + // required string name = 2; boolean hasName(); String getName(); - + // required bool status = 3; boolean hasStatus(); boolean getStatus(); @@ -31,26 +31,26 @@ public final class ProtobufProtocol { super(builder); } private MyMessage(boolean noInit) {} - + private static final MyMessage defaultInstance; public static MyMessage getDefaultInstance() { return defaultInstance; } - + public MyMessage getDefaultInstanceForType() { return defaultInstance; } - + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return akka.actor.ProtobufProtocol.internal_static_akka_actor_MyMessage_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return akka.actor.ProtobufProtocol.internal_static_akka_actor_MyMessage_fieldAccessorTable; } - + private int bitField0_; // required uint64 id = 1; public static final int ID_FIELD_NUMBER = 1; @@ -61,7 +61,7 @@ public final class ProtobufProtocol { public long getId() { return id_; } - + // required string name = 2; public static final int NAME_FIELD_NUMBER = 2; private java.lang.Object name_; @@ -73,7 +73,7 @@ public final class ProtobufProtocol { if (ref instanceof String) { return (String) ref; } else { - com.google.protobuf.ByteString bs = + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; String s = bs.toStringUtf8(); if (com.google.protobuf.Internal.isValidUtf8(bs)) { @@ -85,7 +85,7 @@ public final class ProtobufProtocol { private com.google.protobuf.ByteString getNameBytes() { java.lang.Object ref = name_; if (ref instanceof String) { - com.google.protobuf.ByteString b = + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((String) ref); name_ = b; return b; @@ -93,7 +93,7 @@ public final class ProtobufProtocol { return (com.google.protobuf.ByteString) ref; } } - + // required bool status = 3; public static final int STATUS_FIELD_NUMBER = 3; private boolean status_; @@ -103,7 +103,7 @@ public final class ProtobufProtocol { public boolean getStatus() { return status_; } - + private void initFields() { id_ = 0L; name_ = ""; @@ -113,7 +113,7 @@ public final class ProtobufProtocol { public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized != -1) return isInitialized == 1; - + if (!hasId()) { memoizedIsInitialized = 0; return false; @@ -129,7 +129,7 @@ public final class ProtobufProtocol { memoizedIsInitialized = 1; return true; } - + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); @@ -144,12 +144,12 @@ public final class ProtobufProtocol { } getUnknownFields().writeTo(output); } - + private int memoizedSerializedSize = -1; public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; - + size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream @@ -167,14 +167,14 @@ public final class ProtobufProtocol { memoizedSerializedSize = size; return size; } - + private static final long serialVersionUID = 0L; @java.lang.Override protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { return super.writeReplace(); } - + public static akka.actor.ProtobufProtocol.MyMessage parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { @@ -241,14 +241,14 @@ public final class ProtobufProtocol { return newBuilder().mergeFrom(input, extensionRegistry) .buildParsed(); } - + public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(akka.actor.ProtobufProtocol.MyMessage prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } - + @java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessage.BuilderParent parent) { @@ -262,17 +262,17 @@ public final class ProtobufProtocol { getDescriptor() { return akka.actor.ProtobufProtocol.internal_static_akka_actor_MyMessage_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return akka.actor.ProtobufProtocol.internal_static_akka_actor_MyMessage_fieldAccessorTable; } - + // Construct using akka.actor.ProtobufProtocol.MyMessage.newBuilder() private Builder() { maybeForceBuilderInitialization(); } - + private Builder(BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); @@ -284,7 +284,7 @@ public final class ProtobufProtocol { private static Builder create() { return new Builder(); } - + public Builder clear() { super.clear(); id_ = 0L; @@ -295,20 +295,20 @@ public final class ProtobufProtocol { bitField0_ = (bitField0_ & ~0x00000004); return this; } - + public Builder clone() { return create().mergeFrom(buildPartial()); } - + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return akka.actor.ProtobufProtocol.MyMessage.getDescriptor(); } - + public akka.actor.ProtobufProtocol.MyMessage getDefaultInstanceForType() { return akka.actor.ProtobufProtocol.MyMessage.getDefaultInstance(); } - + public akka.actor.ProtobufProtocol.MyMessage build() { akka.actor.ProtobufProtocol.MyMessage result = buildPartial(); if (!result.isInitialized()) { @@ -316,7 +316,7 @@ public final class ProtobufProtocol { } return result; } - + private akka.actor.ProtobufProtocol.MyMessage buildParsed() throws com.google.protobuf.InvalidProtocolBufferException { akka.actor.ProtobufProtocol.MyMessage result = buildPartial(); @@ -326,7 +326,7 @@ public final class ProtobufProtocol { } return result; } - + public akka.actor.ProtobufProtocol.MyMessage buildPartial() { akka.actor.ProtobufProtocol.MyMessage result = new akka.actor.ProtobufProtocol.MyMessage(this); int from_bitField0_ = bitField0_; @@ -347,7 +347,7 @@ public final class ProtobufProtocol { onBuilt(); return result; } - + public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof akka.actor.ProtobufProtocol.MyMessage) { return mergeFrom((akka.actor.ProtobufProtocol.MyMessage)other); @@ -356,7 +356,7 @@ public final class ProtobufProtocol { return this; } } - + public Builder mergeFrom(akka.actor.ProtobufProtocol.MyMessage other) { if (other == akka.actor.ProtobufProtocol.MyMessage.getDefaultInstance()) return this; if (other.hasId()) { @@ -371,23 +371,23 @@ public final class ProtobufProtocol { this.mergeUnknownFields(other.getUnknownFields()); return this; } - + public final boolean isInitialized() { if (!hasId()) { - + return false; } if (!hasName()) { - + return false; } if (!hasStatus()) { - + return false; } return true; } - + public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) @@ -429,9 +429,9 @@ public final class ProtobufProtocol { } } } - + private int bitField0_; - + // required uint64 id = 1; private long id_ ; public boolean hasId() { @@ -452,7 +452,7 @@ public final class ProtobufProtocol { onChanged(); return this; } - + // required string name = 2; private java.lang.Object name_ = ""; public boolean hasName() { @@ -488,7 +488,7 @@ public final class ProtobufProtocol { name_ = value; onChanged(); } - + // required bool status = 3; private boolean status_ ; public boolean hasStatus() { @@ -509,24 +509,24 @@ public final class ProtobufProtocol { onChanged(); return this; } - + // @@protoc_insertion_point(builder_scope:akka.actor.MyMessage) } - + static { defaultInstance = new MyMessage(true); defaultInstance.initFields(); } - + // @@protoc_insertion_point(class_scope:akka.actor.MyMessage) } - + private static com.google.protobuf.Descriptors.Descriptor internal_static_akka_actor_MyMessage_descriptor; private static com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_akka_actor_MyMessage_fieldAccessorTable; - + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { return descriptor; @@ -560,6 +560,6 @@ public final class ProtobufProtocol { new com.google.protobuf.Descriptors.FileDescriptor[] { }, assigner); } - + // @@protoc_insertion_point(outer_class_scope) } diff --git a/akka-remote/src/test/scala/akka/remote/AccrualFailureDetectorSpec.scala b/akka-remote/src/test/scala/akka/remote/AccrualFailureDetectorSpec.scala index e639cdc9f1..6a28415636 100644 --- a/akka-remote/src/test/scala/akka/remote/AccrualFailureDetectorSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/AccrualFailureDetectorSpec.scala @@ -91,4 +91,4 @@ class AccrualFailureDetectorSpec extends WordSpec with MustMatchers { fd.isAvailable(conn) must be(true) } } -} \ No newline at end of file +} diff --git a/akka-remote/src/test/scala/akka/remote/GossiperSpec.scala b/akka-remote/src/test/scala/akka/remote/GossiperSpec.scala index 61c190a59a..06d0b73c5b 100644 --- a/akka-remote/src/test/scala/akka/remote/GossiperSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/GossiperSpec.scala @@ -12,4 +12,4 @@ class GossiperSpec extends WordSpec with MustMatchers { "..." in { } } -} \ No newline at end of file +} diff --git a/akka-remote/src/test/scala/akka/remote/VectorClockSpec.scala b/akka-remote/src/test/scala/akka/remote/VectorClockSpec.scala index 1a65a4cb78..6cb4414b6c 100644 --- a/akka-remote/src/test/scala/akka/remote/VectorClockSpec.scala +++ b/akka-remote/src/test/scala/akka/remote/VectorClockSpec.scala @@ -123,4 +123,4 @@ class VectorClockSpec extends WordSpec with MustMatchers { clock5_1.compare(clock3_2) must be(After) } } -} \ No newline at end of file +} diff --git a/akka-samples/akka-sample-camel/config/akka.conf b/akka-samples/akka-sample-camel/config/akka.conf index 0bd7bd16a2..574df278c4 100644 --- a/akka-samples/akka-sample-camel/config/akka.conf +++ b/akka-samples/akka-sample-camel/config/akka.conf @@ -8,7 +8,7 @@ akka { enabled-modules = ["camel", "http"] time-unit = "seconds" - + event-handlers = ["akka.event.EventHandler$DefaultListener"] boot = ["sample.camel.Boot"] diff --git a/akka-samples/akka-sample-hello/config/akka.conf b/akka-samples/akka-sample-hello/config/akka.conf index 1278bd0e70..5b8920874f 100644 --- a/akka-samples/akka-sample-hello/config/akka.conf +++ b/akka-samples/akka-sample-hello/config/akka.conf @@ -8,7 +8,7 @@ akka { enabled-modules = ["http"] time-unit = "seconds" - + event-handlers = ["akka.event.EventHandler$DefaultListener"] boot = ["sample.hello.Boot"] diff --git a/akka-spring/src/test/java/akka/spring/RemoteTypedSessionActorImpl.java b/akka-spring/src/test/java/akka/spring/RemoteTypedSessionActorImpl.java index 6633fc5fae..bb00690795 100644 --- a/akka-spring/src/test/java/akka/spring/RemoteTypedSessionActorImpl.java +++ b/akka-spring/src/test/java/akka/spring/RemoteTypedSessionActorImpl.java @@ -26,7 +26,7 @@ public class RemoteTypedSessionActorImpl extends TypedActor implements RemoteTyp instantiatedSessionActors.remove(this); } - + private String user="anonymous"; @Override diff --git a/akka-spring/src/test/java/akka/spring/foo/StatefulPojo.java b/akka-spring/src/test/java/akka/spring/foo/StatefulPojo.java index 738d552485..3879dc2b53 100644 --- a/akka-spring/src/test/java/akka/spring/foo/StatefulPojo.java +++ b/akka-spring/src/test/java/akka/spring/foo/StatefulPojo.java @@ -53,4 +53,4 @@ public class StatefulPojo extends TypedActor { return isInitialized; } } -*/ \ No newline at end of file +*/ diff --git a/akka-spring/src/test/resources/akka-test.conf b/akka-spring/src/test/resources/akka-test.conf index 0bf7e613be..e6c019e24c 100644 --- a/akka-spring/src/test/resources/akka-test.conf +++ b/akka-spring/src/test/resources/akka-test.conf @@ -11,7 +11,7 @@ akka { enabled-modules = ["remote"] # Comma separated list of the enabled modules. Options: ["remote", "camel", "http"] time-unit = "seconds" # Time unit for all timeout properties throughout the config - + event-handlers = ["akka.event.EventHandler$DefaultListener"] # event handlers to register at boot time (EventHandler$DefaultListener logs to STDOUT) # These boot classes are loaded (and created) automatically when the Akka Microkernel boots up diff --git a/akka-stm/src/test/java/akka/transactor/test/Increment.java b/akka-stm/src/test/java/akka/transactor/test/Increment.java index 1d1e3399fc..e66fab1318 100644 --- a/akka-stm/src/test/java/akka/transactor/test/Increment.java +++ b/akka-stm/src/test/java/akka/transactor/test/Increment.java @@ -20,4 +20,4 @@ public class Increment { public CountDownLatch getLatch() { return latch; } -} \ No newline at end of file +} diff --git a/akka-testkit/src/test/scala/akka/testkit/AkkaSpec.scala b/akka-testkit/src/test/scala/akka/testkit/AkkaSpec.scala index b4341e949d..a3a7c86beb 100644 --- a/akka-testkit/src/test/scala/akka/testkit/AkkaSpec.scala +++ b/akka-testkit/src/test/scala/akka/testkit/AkkaSpec.scala @@ -39,4 +39,4 @@ abstract class AkkaSpec(_application: AkkaApplication = AkkaApplication()) def spawn(body: ⇒ Unit)(implicit dispatcher: MessageDispatcher) { actorOf(Props(ctx ⇒ { case "go" ⇒ try body finally ctx.self.stop() }).withDispatcher(dispatcher)) ! "go" } -} \ No newline at end of file +} From 7cde84b5dbc200e63c41bb30f37d49d90c4a38d2 Mon Sep 17 00:00:00 2001 From: Patrik Nordwall Date: Thu, 20 Oct 2011 17:45:16 +0200 Subject: [PATCH 08/57] Fixed benchmark reporting, which was broken in AkkaApplication refactoring. Repo must be global to keep results --- .../trading/common/PerformanceTest.scala | 54 ++++++++++--------- .../workbench/BenchResultRepository.scala | 16 +++--- 2 files changed, 36 insertions(+), 34 deletions(-) diff --git a/akka-actor-tests/src/test/scala/akka/performance/trading/common/PerformanceTest.scala b/akka-actor-tests/src/test/scala/akka/performance/trading/common/PerformanceTest.scala index fb6610a75e..2ac7d88ca7 100644 --- a/akka-actor-tests/src/test/scala/akka/performance/trading/common/PerformanceTest.scala +++ b/akka-actor-tests/src/test/scala/akka/performance/trading/common/PerformanceTest.scala @@ -56,7 +56,7 @@ trait PerformanceTest extends JUnitSuite { var stat: DescriptiveStatistics = _ - val resultRepository = BenchResultRepository(app) + val resultRepository = BenchResultRepository() lazy val report = new Report(app, resultRepository, compareResultWith) type TS <: TradingSystem @@ -107,34 +107,38 @@ trait PerformanceTest extends JUnitSuite { def compareResultWith: Option[String] = None def logMeasurement(scenario: String, numberOfClients: Int, durationNs: Long) { + try { + val name = simpleName(this) + val durationS = durationNs.toDouble / 1000000000.0 + + val percentiles = TreeMap[Int, Long]( + 5 -> (stat.getPercentile(5.0) / 1000).toLong, + 25 -> (stat.getPercentile(25.0) / 1000).toLong, + 50 -> (stat.getPercentile(50.0) / 1000).toLong, + 75 -> (stat.getPercentile(75.0) / 1000).toLong, + 95 -> (stat.getPercentile(95.0) / 1000).toLong) - val name = simpleName(this) - val durationS = durationNs.toDouble / 1000000000.0 + val n = stat.getN * sampling - val percentiles = TreeMap[Int, Long]( - 5 -> (stat.getPercentile(5.0) / 1000).toLong, - 25 -> (stat.getPercentile(25.0) / 1000).toLong, - 50 -> (stat.getPercentile(50.0) / 1000).toLong, - 75 -> (stat.getPercentile(75.0) / 1000).toLong, - 95 -> (stat.getPercentile(95.0) / 1000).toLong) + val stats = Stats( + name, + load = numberOfClients, + timestamp = TestStart.startTime, + durationNanos = durationNs, + n = n, + min = (stat.getMin / 1000).toLong, + max = (stat.getMax / 1000).toLong, + mean = (stat.getMean / 1000).toLong, + tps = (n.toDouble / durationS), + percentiles) - val n = stat.getN * sampling + resultRepository.add(stats) - val stats = Stats( - name, - load = numberOfClients, - timestamp = TestStart.startTime, - durationNanos = durationNs, - n = n, - min = (stat.getMin / 1000).toLong, - max = (stat.getMax / 1000).toLong, - mean = (stat.getMean / 1000).toLong, - tps = (n.toDouble / durationS), - percentiles) - - resultRepository.add(stats) - - report.html(resultRepository.get(name)) + report.html(resultRepository.get(name)) + } catch { + // don't fail test due to problems saving bench report + case e: Exception ⇒ app.eventHandler.error(this, e.getMessage) + } } def delay(delayMs: Int) { diff --git a/akka-actor-tests/src/test/scala/akka/performance/workbench/BenchResultRepository.scala b/akka-actor-tests/src/test/scala/akka/performance/workbench/BenchResultRepository.scala index bc9d6593f3..887de2e455 100644 --- a/akka-actor-tests/src/test/scala/akka/performance/workbench/BenchResultRepository.scala +++ b/akka-actor-tests/src/test/scala/akka/performance/workbench/BenchResultRepository.scala @@ -12,7 +12,6 @@ import java.io.PrintWriter import java.text.SimpleDateFormat import java.util.Date import scala.collection.mutable.{ Map ⇒ MutableMap } -import akka.AkkaApplication trait BenchResultRepository { def add(stats: Stats) @@ -30,10 +29,11 @@ trait BenchResultRepository { } object BenchResultRepository { - def apply(app: AkkaApplication): BenchResultRepository = new FileBenchResultRepository(app) + private val repository = new FileBenchResultRepository + def apply(): BenchResultRepository = repository } -class FileBenchResultRepository(val app: AkkaApplication) extends BenchResultRepository { +class FileBenchResultRepository extends BenchResultRepository { private val statsByName = MutableMap[String, Seq[Stats]]() private val baselineStats = MutableMap[Key, Stats]() private val historicalStats = MutableMap[Key, Seq[Stats]]() @@ -102,8 +102,8 @@ class FileBenchResultRepository(val app: AkkaApplication) extends BenchResultRep out.writeObject(stats) } catch { case e: Exception ⇒ - app.eventHandler.error(this, "Failed to save [%s] to [%s], due to [%s]". - format(stats, f.getAbsolutePath, e.getMessage)) + val errMsg = "Failed to save [%s] to [%s], due to [%s]".format(stats, f.getAbsolutePath, e.getMessage) + throw new RuntimeException(errMsg) } finally { if (out ne null) try { out.close() } catch { case ignore: Exception ⇒ } } @@ -119,8 +119,6 @@ class FileBenchResultRepository(val app: AkkaApplication) extends BenchResultRep Some(stats) } catch { case e: Throwable ⇒ - app.eventHandler.error(this, "Failed to load from [%s], due to [%s]". - format(f.getAbsolutePath, e.getMessage)) None } finally { if (in ne null) try { in.close() } catch { case ignore: Exception ⇒ } @@ -143,8 +141,8 @@ class FileBenchResultRepository(val app: AkkaApplication) extends BenchResultRep writer.flush() } catch { case e: Exception ⇒ - app.eventHandler.error(this, "Failed to save report to [%s], due to [%s]". - format(f.getAbsolutePath, e.getMessage)) + val errMsg = "Failed to save report to [%s], due to [%s]".format(f.getAbsolutePath, e.getMessage) + throw new RuntimeException(errMsg) } finally { if (writer ne null) try { writer.close() } catch { case ignore: Exception ⇒ } } From 38d2108b6cec3de784563963e026504b0ac85304 Mon Sep 17 00:00:00 2001 From: Patrik Nordwall Date: Thu, 20 Oct 2011 17:45:43 +0200 Subject: [PATCH 09/57] Add chart for comparing throughput to benchmark. Fixes #1318 * Sample: http://bit.ly/tskstz --- .../trading/common/PerformanceTest.scala | 2 +- .../workbench/BenchResultRepository.scala | 9 ++- .../workbench/GoogleChartBuilder.scala | 71 +++++++++++++++++++ .../akka/performance/workbench/Report.scala | 41 +++++++++-- .../akka/performance/workbench/Stats.scala | 14 ++-- 5 files changed, 123 insertions(+), 14 deletions(-) diff --git a/akka-actor-tests/src/test/scala/akka/performance/trading/common/PerformanceTest.scala b/akka-actor-tests/src/test/scala/akka/performance/trading/common/PerformanceTest.scala index 2ac7d88ca7..1722d2cf8e 100644 --- a/akka-actor-tests/src/test/scala/akka/performance/trading/common/PerformanceTest.scala +++ b/akka-actor-tests/src/test/scala/akka/performance/trading/common/PerformanceTest.scala @@ -110,7 +110,7 @@ trait PerformanceTest extends JUnitSuite { try { val name = simpleName(this) val durationS = durationNs.toDouble / 1000000000.0 - + val percentiles = TreeMap[Int, Long]( 5 -> (stat.getPercentile(5.0) / 1000).toLong, 25 -> (stat.getPercentile(25.0) / 1000).toLong, diff --git a/akka-actor-tests/src/test/scala/akka/performance/workbench/BenchResultRepository.scala b/akka-actor-tests/src/test/scala/akka/performance/workbench/BenchResultRepository.scala index 887de2e455..a21cced8e8 100644 --- a/akka-actor-tests/src/test/scala/akka/performance/workbench/BenchResultRepository.scala +++ b/akka-actor-tests/src/test/scala/akka/performance/workbench/BenchResultRepository.scala @@ -22,6 +22,8 @@ trait BenchResultRepository { def getWithHistorical(name: String, load: Int): Seq[Stats] + def isBaseline(stats: Stats): Boolean + def saveHtmlReport(content: String, name: String): Unit def htmlReportUrl(name: String): String @@ -59,13 +61,18 @@ class FileBenchResultRepository extends BenchResultRepository { get(name).find(_.load == load) } + def isBaseline(stats: Stats): Boolean = { + baselineStats.get(Key(stats.name, stats.load)) == Some(stats) + } + def getWithHistorical(name: String, load: Int): Seq[Stats] = { val key = Key(name, load) val historical = historicalStats.getOrElse(key, IndexedSeq.empty) val baseline = baselineStats.get(key) val current = get(name, load) - (IndexedSeq.empty ++ historical ++ baseline ++ current).takeRight(maxHistorical) + val limited = (IndexedSeq.empty ++ historical ++ baseline ++ current).takeRight(maxHistorical) + limited.sortBy(_.timestamp) } private def loadFiles() { diff --git a/akka-actor-tests/src/test/scala/akka/performance/workbench/GoogleChartBuilder.scala b/akka-actor-tests/src/test/scala/akka/performance/workbench/GoogleChartBuilder.scala index 75785938eb..c513200310 100644 --- a/akka-actor-tests/src/test/scala/akka/performance/workbench/GoogleChartBuilder.scala +++ b/akka-actor-tests/src/test/scala/akka/performance/workbench/GoogleChartBuilder.scala @@ -13,6 +13,72 @@ object GoogleChartBuilder { val ChartWidth = 750 val ChartHeight = 400 + /** + * Builds a bar chart for tps in the statistics. + */ + def tpsChartUrl(statsByTimestamp: TreeMap[Long, Seq[Stats]], title: String, legend: Stats ⇒ String): String = { + if (statsByTimestamp.isEmpty) return "" + + val loads = statsByTimestamp.values.head.map(_.load) + val allStats = statsByTimestamp.values.flatten + + val sb = new StringBuilder + sb.append(BaseUrl) + // bar chart + sb.append("cht=bvg") + sb.append("&") + // size + sb.append("chs=").append(ChartWidth).append("x").append(ChartHeight) + sb.append("&") + // title + sb.append("chtt=").append(urlEncode(title)) + sb.append("&") + // axis locations + sb.append("chxt=y,x") + sb.append("&") + // labels + sb.append("chxl=1:|") + sb.append(loads.mkString("|")) + sb.append("&") + + // label color and font + //sb.append("chxs=2,D65D82,11.5,0,lt,D65D82") + //sb.append("&") + + // legend + val legendStats = statsByTimestamp.values.map(_.head).toSeq + appendLegend(legendStats, sb, legend) + sb.append("&") + // bar spacing + sb.append("chbh=a,4,20") + sb.append("&") + // bar colors + barColors(statsByTimestamp.size, sb) + sb.append("&") + + // data series + val loadStr = loads.mkString(",") + sb.append("chd=t:") + val maxValue = allStats.map(_.tps).max + val tpsSeries: Iterable[String] = + for (statsSeq ← statsByTimestamp.values) yield { + statsSeq.map(_.tps).mkString(",") + } + sb.append(tpsSeries.mkString("|")) + + // y range + sb.append("&") + sb.append("chxr=0,0,").append(maxValue) + sb.append("&") + sb.append("chds=0,").append(maxValue) + sb.append("&") + + // grid lines + appendGridSpacing(maxValue.toLong, sb) + + return sb.toString + } + /** * Builds a bar chart for all percentiles and the mean in the statistics. */ @@ -113,6 +179,11 @@ object GoogleChartBuilder { sb.append(series.mkString("|")) } + private def dataSeries(values: Seq[Double], sb: StringBuilder) { + val series = values.map(formatDouble(_)) + sb.append(series.mkString("|")) + } + private def appendGridSpacing(maxValue: Long, sb: StringBuilder) { sb.append("chg=0,10") } diff --git a/akka-actor-tests/src/test/scala/akka/performance/workbench/Report.scala b/akka-actor-tests/src/test/scala/akka/performance/workbench/Report.scala index d3a5f020d0..9e13b032c5 100644 --- a/akka-actor-tests/src/test/scala/akka/performance/workbench/Report.scala +++ b/akka-actor-tests/src/test/scala/akka/performance/workbench/Report.scala @@ -6,10 +6,12 @@ import java.util.Date import scala.collection.JavaConversions.asScalaBuffer import scala.collection.JavaConversions.enumerationAsScalaIterator import akka.AkkaApplication +import scala.collection.immutable.TreeMap -class Report(app: AkkaApplication, - resultRepository: BenchResultRepository, - compareResultWith: Option[String] = None) { +class Report( + app: AkkaApplication, + resultRepository: BenchResultRepository, + compareResultWith: Option[String] = None) { private def log = System.getProperty("benchmark.logResult", "true").toBoolean @@ -34,6 +36,8 @@ class Report(app: AkkaApplication, sb.append(img(percentilesAndMeanChart(current))) sb.append(img(latencyAndThroughputChart(current))) + compareWithHistoricalTpsChart(statistics).foreach(url ⇒ sb.append(img(url))) + for (stats ← statistics) { compareWithHistoricalPercentiliesAndMeanChart(stats).foreach(url ⇒ sb.append(img(url))) } @@ -62,6 +66,11 @@ class Report(app: AkkaApplication, url, GoogleChartBuilder.ChartWidth, GoogleChartBuilder.ChartHeight) + "\n" } + protected def timeLegend(stats: Stats): String = { + val baseline = if (resultRepository.isBaseline(stats)) " *" else "" + legendTimeFormat.format(new Date(stats.timestamp)) + baseline + } + def percentilesAndMeanChart(stats: Stats): String = { val chartTitle = stats.name + " Percentiles and Mean (microseconds)" val chartUrl = GoogleChartBuilder.percentilesAndMeanChartUrl(resultRepository.get(stats.name), chartTitle, _.load + " clients") @@ -83,14 +92,36 @@ class Report(app: AkkaApplication, val withHistorical = resultRepository.getWithHistorical(stats.name, stats.load) if (withHistorical.size > 1) { val chartTitle = stats.name + " vs. historical, " + stats.load + " clients" + ", Percentiles and Mean (microseconds)" - val chartUrl = GoogleChartBuilder.percentilesAndMeanChartUrl(withHistorical, chartTitle, - stats ⇒ legendTimeFormat.format(new Date(stats.timestamp))) + val chartUrl = GoogleChartBuilder.percentilesAndMeanChartUrl(withHistorical, chartTitle, timeLegend) Some(chartUrl) } else { None } } + def compareWithHistoricalTpsChart(statistics: Seq[Stats]): Option[String] = { + + if (statistics.isEmpty) { + None + } else { + val histTimestamps = resultRepository.getWithHistorical(statistics.head.name, statistics.head.load).map(_.timestamp) + val statsByTimestamp = TreeMap[Long, Seq[Stats]]() ++ + (for (ts ← histTimestamps) yield { + val seq = + for (stats ← statistics) yield { + val withHistorical: Seq[Stats] = resultRepository.getWithHistorical(stats.name, stats.load) + val cell = withHistorical.find(_.timestamp == ts) + cell.getOrElse(Stats(stats.name, stats.load, ts)) + } + (ts, seq) + }) + + val chartTitle = statistics.last.name + " vs. historical, Throughput (TPS)" + val chartUrl = GoogleChartBuilder.tpsChartUrl(statsByTimestamp, chartTitle, timeLegend) + Some(chartUrl) + } + } + def latencyAndThroughputChart(stats: Stats): String = { val chartTitle = stats.name + " Latency (microseconds) and Throughput (TPS)" val chartUrl = GoogleChartBuilder.latencyAndThroughputChartUrl(resultRepository.get(stats.name), chartTitle) diff --git a/akka-actor-tests/src/test/scala/akka/performance/workbench/Stats.scala b/akka-actor-tests/src/test/scala/akka/performance/workbench/Stats.scala index c307d997e3..786c5e389f 100644 --- a/akka-actor-tests/src/test/scala/akka/performance/workbench/Stats.scala +++ b/akka-actor-tests/src/test/scala/akka/performance/workbench/Stats.scala @@ -7,13 +7,13 @@ case class Stats( name: String, load: Int, timestamp: Long = System.currentTimeMillis, - durationNanos: Long, - n: Long, - min: Long, - max: Long, - mean: Double, - tps: Double, - percentiles: TreeMap[Int, Long]) { + durationNanos: Long = 0L, + n: Long = 0L, + min: Long = 0L, + max: Long = 0L, + mean: Double = 0.0, + tps: Double = 0.0, + percentiles: TreeMap[Int, Long] = TreeMap.empty) { def median: Long = percentiles(50) } From 84da9726f231e71bbb113ab31a6cf6d9fe90a735 Mon Sep 17 00:00:00 2001 From: Patrik Nordwall Date: Sun, 30 Oct 2011 10:29:42 +0100 Subject: [PATCH 10/57] Changed so that clients doesn't wait for each message to be processed before sending next --- .../trading/common/AkkaPerformanceTest.scala | 12 ++++++---- .../trading/common/BenchmarkScenarios.scala | 6 ++--- .../trading/common/PerformanceTest.scala | 11 ++++----- .../oneway/OneWayPerformanceTest.scala | 23 ++++++++++++++----- .../trading/response/RspPerformanceTest.scala | 2 +- 5 files changed, 33 insertions(+), 21 deletions(-) diff --git a/akka-actor-tests/src/test/scala/akka/performance/trading/common/AkkaPerformanceTest.scala b/akka-actor-tests/src/test/scala/akka/performance/trading/common/AkkaPerformanceTest.scala index 3bd7ea96d9..697b8b299f 100644 --- a/akka-actor-tests/src/test/scala/akka/performance/trading/common/AkkaPerformanceTest.scala +++ b/akka-actor-tests/src/test/scala/akka/performance/trading/common/AkkaPerformanceTest.scala @@ -22,7 +22,7 @@ abstract class AkkaPerformanceTest(val app: AkkaApplication) extends BenchmarkSc /** * Implemented in subclass */ - def placeOrder(orderReceiver: ActorRef, order: Order): Rsp + def placeOrder(orderReceiver: ActorRef, order: Order, await: Boolean): Rsp override def runScenario(scenario: String, orders: List[Order], repeat: Int, numberOfClients: Int, delayMs: Int) = { val totalNumberOfRequests = orders.size * repeat @@ -59,15 +59,17 @@ abstract class AkkaPerformanceTest(val app: AkkaApplication) extends BenchmarkSc var n = 0 for (r ← 1 to repeat; o ← orders) { n += 1 + val rsp = - if (n % sampling == 0) { + if (measureLatency(n)) { val t0 = System.nanoTime - val rsp = placeOrder(orderReceiver, o) + val rsp = placeOrder(orderReceiver, o, await = true) val duration = System.nanoTime - t0 stat.addValue(duration) rsp } else { - placeOrder(orderReceiver, o) + val await = measureLatency(n + 1) || (r == repeat) + placeOrder(orderReceiver, o, await) } if (!rsp.status) { app.eventHandler.error(this, "Invalid rsp") @@ -76,6 +78,8 @@ abstract class AkkaPerformanceTest(val app: AkkaApplication) extends BenchmarkSc } latch.countDown() } + + def measureLatency(n: Int) = (n % sampling == 0) } } diff --git a/akka-actor-tests/src/test/scala/akka/performance/trading/common/BenchmarkScenarios.scala b/akka-actor-tests/src/test/scala/akka/performance/trading/common/BenchmarkScenarios.scala index 5442deacd5..54c6f36ce8 100644 --- a/akka-actor-tests/src/test/scala/akka/performance/trading/common/BenchmarkScenarios.scala +++ b/akka-actor-tests/src/test/scala/akka/performance/trading/common/BenchmarkScenarios.scala @@ -44,14 +44,14 @@ trait BenchmarkScenarios extends PerformanceTest { val repeat = 500 * repeatFactor - val prefixes = "A" :: "B" :: "C" :: Nil + val prefixes = "A" :: "B" :: "C" :: "D" :: "E" :: Nil val askOrders = for { s ← prefixes - i ← 1 to 5 + i ← 1 to 3 } yield new Ask(s + i, 100 - i, 1000) val bidOrders = for { s ← prefixes - i ← 1 to 5 + i ← 1 to 3 } yield new Bid(s + i, 100 - i, 1000) val orders = askOrders ::: bidOrders diff --git a/akka-actor-tests/src/test/scala/akka/performance/trading/common/PerformanceTest.scala b/akka-actor-tests/src/test/scala/akka/performance/trading/common/PerformanceTest.scala index 1722d2cf8e..dd400dc82e 100644 --- a/akka-actor-tests/src/test/scala/akka/performance/trading/common/PerformanceTest.scala +++ b/akka-actor-tests/src/test/scala/akka/performance/trading/common/PerformanceTest.scala @@ -21,9 +21,6 @@ trait PerformanceTest extends JUnitSuite { def app: AkkaApplication - // jvm parameters - // -server -Xms512m -Xmx1024m -XX:+UseConcMarkSweepGC - var isWarm = false def isBenchmark() = System.getProperty("benchmark") == "true" @@ -51,7 +48,7 @@ trait PerformanceTest extends JUnitSuite { } def sampling = { - System.getProperty("benchmark.sampling", "100").toInt + System.getProperty("benchmark.sampling", "200").toInt } var stat: DescriptiveStatistics = _ @@ -66,7 +63,7 @@ trait PerformanceTest extends JUnitSuite { def createTradingSystem(): TS - def placeOrder(orderReceiver: TS#OR, order: Order): Rsp + def placeOrder(orderReceiver: TS#OR, order: Order, await: Boolean): Rsp def runScenario(scenario: String, orders: List[Order], repeat: Int, numberOfClients: Int, delayMs: Int) @@ -94,8 +91,8 @@ trait PerformanceTest extends JUnitSuite { val loopCount = if (isWarm) 1 else 10 * warmupRepeatFactor for (i ← 1 to loopCount) { - placeOrder(orderReceiver, bid) - placeOrder(orderReceiver, ask) + placeOrder(orderReceiver, bid, true) + placeOrder(orderReceiver, ask, true) } isWarm = true } diff --git a/akka-actor-tests/src/test/scala/akka/performance/trading/oneway/OneWayPerformanceTest.scala b/akka-actor-tests/src/test/scala/akka/performance/trading/oneway/OneWayPerformanceTest.scala index 320254fdc9..ef0d97ece2 100644 --- a/akka-actor-tests/src/test/scala/akka/performance/trading/oneway/OneWayPerformanceTest.scala +++ b/akka-actor-tests/src/test/scala/akka/performance/trading/oneway/OneWayPerformanceTest.scala @@ -8,8 +8,11 @@ import akka.performance.trading.domain._ import akka.actor.{ Props, ActorRef } import akka.AkkaApplication +// -server -Xms512M -Xmx1024M -XX:+UseConcMarkSweepGC -Dbenchmark.useDummyOrderbook=true -Dbenchmark=true -Dbenchmark.minClients=1 -Dbenchmark.maxClients=40 -Dbenchmark.repeatFactor=500 class OneWayPerformanceTest extends AkkaPerformanceTest(AkkaApplication()) { + val Ok = new Rsp(true) + override def createTradingSystem: TS = new OneWayTradingSystem(app) { override def createMatchingEngine(meId: String, orderbooks: List[Orderbook]) = meDispatcher match { case Some(d) ⇒ app.actorOf(Props(new OneWayMatchingEngine(meId, orderbooks) with LatchMessageCountDown).withDispatcher(d)) @@ -17,11 +20,16 @@ class OneWayPerformanceTest extends AkkaPerformanceTest(AkkaApplication()) { } } - override def placeOrder(orderReceiver: ActorRef, order: Order): Rsp = { - val newOrder = LatchOrder(order) - orderReceiver ! newOrder - val ok = newOrder.latch.await(10, TimeUnit.SECONDS) - new Rsp(ok) + override def placeOrder(orderReceiver: ActorRef, order: Order, await: Boolean): Rsp = { + if (await) { + val newOrder = LatchOrder(order) + orderReceiver ! newOrder + val ok = newOrder.latch.await(10, TimeUnit.SECONDS) + new Rsp(ok) + } else { + orderReceiver ! order + Ok + } } // need this so that junit will detect this as a test case @@ -41,7 +49,10 @@ trait LatchMessageCountDown extends OneWayMatchingEngine { override def handleOrder(order: Order) { super.handleOrder(order) - order.asInstanceOf[LatchMessage].latch.countDown + order match { + case x: LatchMessage ⇒ x.latch.countDown + case _ ⇒ + } } } diff --git a/akka-actor-tests/src/test/scala/akka/performance/trading/response/RspPerformanceTest.scala b/akka-actor-tests/src/test/scala/akka/performance/trading/response/RspPerformanceTest.scala index b036cd29d7..47d0a69e41 100644 --- a/akka-actor-tests/src/test/scala/akka/performance/trading/response/RspPerformanceTest.scala +++ b/akka-actor-tests/src/test/scala/akka/performance/trading/response/RspPerformanceTest.scala @@ -11,7 +11,7 @@ class RspPerformanceTest extends AkkaPerformanceTest(AkkaApplication()) { implicit def appl = app - override def placeOrder(orderReceiver: ActorRef, order: Order): Rsp = { + override def placeOrder(orderReceiver: ActorRef, order: Order, await: Boolean): Rsp = { (orderReceiver ? order).get.asInstanceOf[Rsp] } From bb51bfdc725fd417d6ae29e80caf0c63c1f57018 Mon Sep 17 00:00:00 2001 From: Patrik Nordwall Date: Sun, 30 Oct 2011 10:31:27 +0100 Subject: [PATCH 11/57] Added a simple performance test, without domain complexity --- .../microbench/PerformanceSpec.scala | 90 +++++++++++++ .../microbench/TellPerformanceSpec.scala | 125 ++++++++++++++++++ 2 files changed, 215 insertions(+) create mode 100644 akka-actor-tests/src/test/scala/akka/performance/microbench/PerformanceSpec.scala create mode 100644 akka-actor-tests/src/test/scala/akka/performance/microbench/TellPerformanceSpec.scala diff --git a/akka-actor-tests/src/test/scala/akka/performance/microbench/PerformanceSpec.scala b/akka-actor-tests/src/test/scala/akka/performance/microbench/PerformanceSpec.scala new file mode 100644 index 0000000000..a2bbdc9a22 --- /dev/null +++ b/akka-actor-tests/src/test/scala/akka/performance/microbench/PerformanceSpec.scala @@ -0,0 +1,90 @@ +package akka.performance.microbench + +import scala.collection.immutable.TreeMap + +import org.apache.commons.math.stat.descriptive.DescriptiveStatistics +import org.apache.commons.math.stat.descriptive.SynchronizedDescriptiveStatistics +import org.scalatest.BeforeAndAfterEach + +import akka.actor.simpleName +import akka.performance.workbench.BenchResultRepository +import akka.performance.workbench.Report +import akka.performance.workbench.Stats +import akka.testkit.AkkaSpec +import akka.AkkaApplication + +trait PerformanceSpec extends AkkaSpec with BeforeAndAfterEach { + + def app: AkkaApplication + + def isBenchmark() = System.getProperty("benchmark") == "true" + + def minClients() = System.getProperty("benchmark.minClients", "1").toInt; + + def maxClients() = System.getProperty("benchmark.maxClients", "40").toInt; + + def repeatFactor() = { + val defaultRepeatFactor = if (isBenchmark) "150" else "2" + System.getProperty("benchmark.repeatFactor", defaultRepeatFactor).toInt + } + + def sampling = { + System.getProperty("benchmark.sampling", "200").toInt + } + + var stat: DescriptiveStatistics = _ + + override def beforeEach() { + stat = new SynchronizedDescriptiveStatistics + } + + val resultRepository = BenchResultRepository() + lazy val report = new Report(app, resultRepository, compareResultWith) + + /** + * To compare two tests with each other you can override this method, in + * the test. For example Some("OneWayPerformanceTest") + */ + def compareResultWith: Option[String] = None + + def logMeasurement(scenario: String, numberOfClients: Int, durationNs: Long) { + try { + val name = simpleName(this) + val durationS = durationNs.toDouble / 1000000000.0 + + val percentiles = TreeMap[Int, Long]( + 5 -> (stat.getPercentile(5.0) / 1000).toLong, + 25 -> (stat.getPercentile(25.0) / 1000).toLong, + 50 -> (stat.getPercentile(50.0) / 1000).toLong, + 75 -> (stat.getPercentile(75.0) / 1000).toLong, + 95 -> (stat.getPercentile(95.0) / 1000).toLong) + + val n = stat.getN * sampling + + val stats = Stats( + name, + load = numberOfClients, + timestamp = TestStart.startTime, + durationNanos = durationNs, + n = n, + min = (stat.getMin / 1000).toLong, + max = (stat.getMax / 1000).toLong, + mean = (stat.getMean / 1000).toLong, + tps = (n.toDouble / durationS), + percentiles) + + resultRepository.add(stats) + + report.html(resultRepository.get(name)) + } catch { + // don't fail test due to problems saving bench report + case e: Exception ⇒ app.eventHandler.error(this, e.getMessage) + } + } + +} + +object TestStart { + val startTime = System.currentTimeMillis +} + diff --git a/akka-actor-tests/src/test/scala/akka/performance/microbench/TellPerformanceSpec.scala b/akka-actor-tests/src/test/scala/akka/performance/microbench/TellPerformanceSpec.scala new file mode 100644 index 0000000000..72c2f016c2 --- /dev/null +++ b/akka-actor-tests/src/test/scala/akka/performance/microbench/TellPerformanceSpec.scala @@ -0,0 +1,125 @@ +package akka.performance.microbench + +import java.util.concurrent.CountDownLatch +import java.util.concurrent.TimeUnit + +import org.apache.commons.math.stat.descriptive.DescriptiveStatistics +import org.junit.runner.RunWith + +import akka.actor.Actor +import akka.actor.ActorRef +import akka.actor.PoisonPill +import akka.actor.Props + +// -server -Xms512M -Xmx1024M -XX:+UseConcMarkSweepGC -Dbenchmark=true -Dbenchmark.repeatFactor=500 +@org.junit.runner.RunWith(classOf[org.scalatest.junit.JUnitRunner]) +class TellPerformanceSpec extends PerformanceSpec { + import TellPerformanceSpec._ + + val clientDispatcher = app.dispatcherFactory.newDispatcher("client-dispatcher") + .withNewThreadPoolWithLinkedBlockingQueueWithUnboundedCapacity + .setCorePoolSize(maxClients) + .build + + val repeat = repeatFactor * 30000 + + "Tell" must { + "warmup" in { + runScenario(2, warmup = true) + } + "perform with load 1" in { + runScenario(1) + } + "perform with load 2" in { + runScenario(2) + } + "perform with load 4" in { + runScenario(4) + } + "perform with load 6" in { + runScenario(6) + } + "perform with load 8" in { + runScenario(8) + } + + def runScenario(numberOfClients: Int, warmup: Boolean = false) { + if (numberOfClients <= maxClients) { + + val latch = new CountDownLatch(numberOfClients) + val repeatsPerClient = repeat / numberOfClients + val clients = (for (i ← 0 until numberOfClients) yield { + val c = app.actorOf[Destination] + val b = app.actorOf(new Waypoint(c)) + val a = app.actorOf(new Waypoint(b)) + Props(new Client(a, latch, repeatsPerClient, sampling, stat)).withDispatcher(clientDispatcher) + }).toList.map(app.actorOf(_)) + + val start = System.nanoTime + clients.foreach(_ ! Run) + latch.await(30, TimeUnit.SECONDS) must be(true) + val durationNs = (System.nanoTime - start) + + if (!warmup) { + logMeasurement("one-way tell", numberOfClients, durationNs) + } + clients.foreach(_ ! PoisonPill) + + } + } + } +} + +object TellPerformanceSpec { + + case object Run + case class Msg(latch: Option[CountDownLatch]) + + class Waypoint(next: ActorRef) extends Actor { + def receive = { + case msg: Msg ⇒ next ! msg + } + } + + class Destination extends Actor { + def receive = { + case Msg(latch) ⇒ latch.foreach(_.countDown()) + } + } + + class Client( + actor: ActorRef, + latch: CountDownLatch, + repeat: Int, + sampling: Int, + stat: DescriptiveStatistics) extends Actor { + + def receive = { + case Run ⇒ + val msgWithoutLatch = Msg(None) + for (n ← 1 to repeat) { + if (measureLatency(n)) { + val t0 = System.nanoTime + tellAndAwait() + val duration = System.nanoTime - t0 + stat.addValue(duration) + } else if (measureLatency(n + 1) || n == repeat) { + tellAndAwait() + } else { + actor ! msgWithoutLatch + } + } + latch.countDown() + } + + def tellAndAwait() { + val msgLatch = new CountDownLatch(1) + actor ! Msg(Some(msgLatch)) + val ok = msgLatch.await(10, TimeUnit.SECONDS) + if (!ok) app.eventHandler.error(this, "Too long delay") + } + + def measureLatency(n: Int) = (n % sampling == 0) + } + +} \ No newline at end of file From cccf6b4ed9ed3da036241b389d2b594ad822b028 Mon Sep 17 00:00:00 2001 From: Roland Date: Sun, 30 Oct 2011 11:39:10 +0100 Subject: [PATCH 12/57] remove references to !! from docs (apart from camel internals) --- akka-docs/cluster/durable-mailbox.rst | 7 +++---- akka-docs/java/remote-actors.rst | 2 +- akka-docs/java/serialization.rst | 14 +++++++------- akka-docs/java/untyped-actors.rst | 26 +------------------------- akka-docs/modules/camel.rst | 8 ++++---- 5 files changed, 16 insertions(+), 41 deletions(-) diff --git a/akka-docs/cluster/durable-mailbox.rst b/akka-docs/cluster/durable-mailbox.rst index 4965eeff8a..774008c6da 100644 --- a/akka-docs/cluster/durable-mailbox.rst +++ b/akka-docs/cluster/durable-mailbox.rst @@ -18,10 +18,9 @@ in its mailbox. .. sidebar:: **IMPORTANT** None of these mailboxes work with blocking message send, e.g. the message - send operations that are relying on futures; ``!!``, ``?``, - ``sendRequestReply`` and ``ask``. If the node has crashed - and then restarted, the thread that was blocked waiting for the reply is gone - and there is no way we can deliver the message. + send operations that are relying on futures; ``?`` or ``ask``. If the node + has crashed and then restarted, the thread that was blocked waiting for the + reply is gone and there is no way we can deliver the message. The durable mailboxes currently supported are: diff --git a/akka-docs/java/remote-actors.rst b/akka-docs/java/remote-actors.rst index 98ad91e8b5..8abedb1c3c 100644 --- a/akka-docs/java/remote-actors.rst +++ b/akka-docs/java/remote-actors.rst @@ -353,7 +353,7 @@ Client side usage import static akka.actor.Actors.*; ActorRef actor = remote().actorFor("hello-service", "localhost", 2552); - Object result = actor.sendRequestReply("Hello"); + Object result = actor.ask("Hello").get(); There are many variations on the 'remote()#actorFor' method. Here are some of them: diff --git a/akka-docs/java/serialization.rst b/akka-docs/java/serialization.rst index 51ccd278ec..2a10a813bb 100644 --- a/akka-docs/java/serialization.rst +++ b/akka-docs/java/serialization.rst @@ -62,7 +62,7 @@ The following JUnit snippet first creates an actor using the default constructor ActorRef ref = Actors.actorOf(SerializationTestActor.class); assertNotNull(ref); try { - Object result = ref.sendRequestReply("Hello"); + Object result = ref.ask("Hello").get(); assertEquals("got it!", result); } catch (ActorTimeoutException ex) { fail("actor should not time out"); @@ -74,7 +74,7 @@ The following JUnit snippet first creates an actor using the default constructor assertNotNull(r); try { - Object result = r.sendRequestReply("Hello"); + Object result = r.ask("Hello").get(); assertEquals("got it!", result); } catch (ActorTimeoutException ex) { fail("actor should not time out"); @@ -151,10 +151,10 @@ Step 3: Serialize and de-serialize ActorRef ref = Actors.actorOf(MyUntypedActor.class); assertNotNull(ref); try { - Object result = ref.sendRequestReply("hello"); + Object result = ref.ask("hello").get(); assertEquals("world 1", result); - result = ref.sendRequestReply("hello"); - assertEquals("world 2", result); + result = ref.ask("hello").get(); + assertEquals("world 2", result); } catch (ActorTimeoutException ex) { fail("actor should not time out"); } @@ -164,9 +164,9 @@ Step 3: Serialize and de-serialize ActorRef r = fromBinaryJ(bytes, f); assertNotNull(r); try { - Object result = r.sendRequestReply("hello"); + Object result = r.ask("hello").get(); assertEquals("world 3", result); - result = r.sendRequestReply("hello"); + result = r.ask("hello").get(); assertEquals("world 4", result); } catch (ActorTimeoutException ex) { fail("actor should not time out"); diff --git a/akka-docs/java/untyped-actors.rst b/akka-docs/java/untyped-actors.rst index 2a7af7faad..9defdf4607 100644 --- a/akka-docs/java/untyped-actors.rst +++ b/akka-docs/java/untyped-actors.rst @@ -107,7 +107,6 @@ Send messages Messages are sent to an Actor through one of the 'send' methods. * 'tell' means “fire-and-forget”, e.g. send a message asynchronously and return immediately. -* 'sendRequestReply' means “send-and-reply-eventually”, e.g. send a message asynchronously and wait for a reply through a Future. Here you can specify a timeout. Using timeouts is very important. If no timeout is specified then the actor’s default timeout (set by the 'getContext().setTimeout(..)' method in the 'ActorRef') is used. This method throws an 'ActorTimeoutException' if the call timed out. * 'ask' sends a message asynchronously and returns a 'Future'. In all these methods you have the option of passing along your 'ActorRef' context variable. Make it a practice of doing so because it will allow the receiver actors to be able to respond to your message, since the sender reference is sent along with the message. @@ -131,29 +130,6 @@ If invoked from within an Actor, then the sending actor reference will be implic If invoked from an instance that is **not** an Actor there will be no implicit sender passed along the message and you will get an 'IllegalStateException' if you call 'getContext().reply(..)'. -Send-And-Receive-Eventually -^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -Using 'sendRequestReply' will send a message to the receiving Actor asynchronously but it will wait for a reply on a 'Future', blocking the sender Actor until either: - -* A reply is received, or -* The Future times out and an 'ActorTimeoutException' is thrown. - -You can pass an explicit time-out to the 'sendRequestReply' method and if none is specified then the default time-out defined in the sender Actor will be used. - -Here are some examples: - -.. code-block:: java - - UntypedActorRef actorRef = ... - - try { - Object result = actorRef.sendRequestReply("Hello", getContext(), 1000); - ... // handle reply - } catch(ActorTimeoutException e) { - ... // handle timeout - } - Send-And-Receive-Future ^^^^^^^^^^^^^^^^^^^^^^^ @@ -239,7 +215,7 @@ which you do by Channel.tell(msg) String msg = (String)message; if (msg.equals("Hello")) { // Reply to original sender of message using the channel - getContext().channel().tryTell(msg + " from " + getContext().getUuid()); + getContext().channel().tell(msg + " from " + getContext().getUuid()); } } } diff --git a/akka-docs/modules/camel.rst b/akka-docs/modules/camel.rst index 39b289a88e..b3c07e56dd 100644 --- a/akka-docs/modules/camel.rst +++ b/akka-docs/modules/camel.rst @@ -1017,7 +1017,7 @@ Any message sent to a Producer actor (or UntypedProducerActor) will be sent to the associated Camel endpoint, in the above example to ``http://localhost:8080/news``. Response messages (if supported by the configured endpoint) will, by default, be returned to the original sender. The -following example uses the ``!!`` operator (Scala) to send a message to a +following example uses the ``?`` operator (Scala) to send a message to a Producer actor and waits for a response. In Java, the sendRequestReply method is used. @@ -1029,7 +1029,7 @@ used. import akka.actor.ActorRef val producer = actorOf[Producer1] - val response = producer !! "akka rocks" + val response = (producer ? "akka rocks").get val body = response.bodyAs[String] **Java** @@ -1283,14 +1283,14 @@ Matching responses ^^^^^^^^^^^^^^^^^^ The following code snippet shows how to best match responses when sending -messages with the !! operator (Scala) or with the sendRequestReply method +messages with the ``?`` operator (Scala) or with the ``ask`` method (Java). **Scala** .. code-block:: scala - val response = producer !! message + val response = (producer ? message).get response match { case Some(Message(body, headers)) => ... From 1b730b5c8266f06646cf916b7b3477195b5d4f19 Mon Sep 17 00:00:00 2001 From: Viktor Klang Date: Sat, 22 Oct 2011 16:06:20 +0200 Subject: [PATCH 13/57] Removing Channel(s), tryTell etc, everything compiles but all tests are semibroken --- .../src/test/java/akka/actor/JavaAPI.java | 4 +- .../java/akka/actor/JavaAPITestActor.java | 2 +- .../ActorFireForgetRequestReplySpec.scala | 4 +- .../scala/akka/actor/ActorLifeCycleSpec.scala | 2 +- .../test/scala/akka/actor/ActorRefSpec.scala | 32 ++-- .../src/test/scala/akka/actor/Bench.scala | 2 +- .../test/scala/akka/actor/ChannelSpec.scala | 49 ------ .../scala/akka/actor/DeathWatchSpec.scala | 2 +- .../scala/akka/actor/ForwardActorSpec.scala | 2 +- .../src/test/scala/akka/actor/IOActor.scala | 10 +- .../scala/akka/actor/LoggingReceiveSpec.scala | 4 +- .../akka/actor/RestartStrategySpec.scala | 2 +- .../test/scala/akka/actor/Supervisor.scala | 2 +- .../akka/actor/SupervisorHierarchySpec.scala | 2 +- .../scala/akka/actor/SupervisorMiscSpec.scala | 2 +- .../scala/akka/actor/SupervisorSpec.scala | 8 +- .../scala/akka/actor/SupervisorTreeSpec.scala | 2 +- .../test/scala/akka/actor/Ticket669Spec.scala | 8 +- .../scala/akka/actor/TypedActorSpec.scala | 2 +- .../akka/actor/dispatch/ActorModelSpec.scala | 4 +- .../actor/dispatch/DispatcherActorSpec.scala | 18 +-- .../akka/actor/dispatch/PinnedActorSpec.scala | 15 +- .../scala/akka/dataflow/Future2Actor.scala | 4 +- .../test/scala/akka/dispatch/FutureSpec.scala | 30 ++-- .../akka/dispatch/MailboxConfigSpec.scala | 4 +- .../dispatch/PriorityDispatcherSpec.scala | 2 +- .../test/scala/akka/event/EventBusSpec.scala | 4 +- .../trading/common/MatchingEngine.scala | 2 +- .../trading/common/OrderReceiver.scala | 2 +- .../scala/akka/routing/ActorPoolSpec.scala | 12 +- .../routing/ConfiguredLocalRoutingSpec.scala | 4 +- .../test/scala/akka/routing/RoutingSpec.scala | 2 +- .../scala/akka/ticket/Ticket703Spec.scala | 2 +- .../src/main/scala/akka/actor/Actor.scala | 20 +-- .../src/main/scala/akka/actor/ActorCell.scala | 32 +--- .../src/main/scala/akka/actor/ActorRef.scala | 125 ++++++--------- .../scala/akka/actor/ActorRefProvider.scala | 11 +- .../src/main/scala/akka/actor/Channel.scala | 146 ------------------ .../src/main/scala/akka/actor/FSM.scala | 8 +- .../main/scala/akka/actor/TypedActor.scala | 11 +- .../main/scala/akka/actor/UntypedActor.scala | 9 +- .../src/main/scala/akka/actor/package.scala | 9 +- .../akka/dispatch/AbstractDispatcher.scala | 4 +- .../src/main/scala/akka/dispatch/Future.scala | 32 +--- .../src/main/scala/akka/routing/Pool.scala | 12 +- .../src/main/scala/akka/routing/Routing.scala | 47 ++---- .../akka/camel/TypedCamelTestSupport.scala | 8 +- .../scala/akka/camel/ConsumerPublisher.scala | 4 +- .../src/main/scala/akka/camel/Producer.scala | 6 +- .../akka/camel/component/ActorComponent.scala | 11 +- .../akka/camel/SampleUntypedConsumer.java | 2 +- .../camel/SampleUntypedConsumerBlocking.java | 2 +- .../scala/akka/camel/CamelTestSupport.scala | 8 +- .../scala/akka/camel/ConsumerScalaTest.scala | 12 +- .../akka/camel/ProducerFeatureTest.scala | 8 +- .../component/ActorComponentFeatureTest.scala | 4 +- .../src/main/scala/akka/cluster/Cluster.scala | 4 +- akka-docs/intro/code/tutorials/first/Pi.scala | 2 +- .../actor/mailbox/DurableDispatcher.scala | 2 +- .../akka/actor/mailbox/DurableMailbox.scala | 2 +- .../actor/mailbox/BSONSerialization.scala | 2 +- .../actor/mailbox/MongoBasedMailbox.scala | 2 +- .../actor/mailbox/MongoDurableMessage.scala | 4 +- akka-http/src/main/scala/akka/http/Mist.scala | 8 +- .../akka/remote/NetworkEventStream.scala | 8 +- .../src/main/scala/akka/remote/Remote.scala | 16 +- .../akka/remote/RemoteActorRefProvider.scala | 30 ++-- .../remote/netty/NettyRemoteSupport.scala | 38 +---- .../serialization/SerializationProtocol.scala | 20 +-- .../DirectRoutedRemoteActorMultiJvmSpec.scala | 2 +- .../NewRemoteActorMultiJvmSpec.scala | 2 +- .../RandomRoutedRemoteActorMultiJvmSpec.scala | 2 +- ...ndRobinRoutedRemoteActorMultiJvmSpec.scala | 2 +- .../serialization/ActorSerializeSpec.scala | 8 +- .../java/sample/camel/UntypedConsumer1.java | 2 +- .../src/main/scala/sample/camel/Actors.scala | 22 +-- .../camel/SampleRemoteUntypedConsumer.java | 2 +- .../camel/HttpConcurrencyTestStress.scala | 4 +- .../sample/camel/RemoteConsumerTest.scala | 4 +- .../src/main/scala/DiningHakkersOnFsm.scala | 12 +- .../src/main/scala/akka/agent/Agent.scala | 9 +- .../example/UntypedCoordinatedCounter.java | 2 +- .../transactor/example/UntypedCounter.java | 2 +- .../test/UntypedCoordinatedCounter.java | 2 +- .../akka/transactor/test/UntypedCounter.java | 2 +- .../transactor/CoordinatedIncrementSpec.scala | 2 +- .../scala/transactor/FickleFriendsSpec.scala | 4 +- .../scala/transactor/TransactorSpec.scala | 2 +- .../testkit/CallingThreadDispatcher.scala | 15 +- .../src/main/scala/akka/testkit/TestKit.scala | 14 +- .../scala/akka/testkit/TestActorRefSpec.scala | 35 ++--- .../scala/akka/testkit/TestProbeSpec.scala | 6 +- .../java/akka/tutorial/first/java/Pi.java | 2 +- .../src/main/scala/Pi.scala | 3 +- .../java/akka/tutorial/java/second/Pi.java | 9 +- .../src/main/scala/Pi.scala | 9 +- 96 files changed, 353 insertions(+), 742 deletions(-) delete mode 100644 akka-actor-tests/src/test/scala/akka/actor/ChannelSpec.scala delete mode 100644 akka-actor/src/main/scala/akka/actor/Channel.scala diff --git a/akka-actor-tests/src/test/java/akka/actor/JavaAPI.java b/akka-actor-tests/src/test/java/akka/actor/JavaAPI.java index d0388cb9c0..70f45e4c8f 100644 --- a/akka-actor-tests/src/test/java/akka/actor/JavaAPI.java +++ b/akka-actor-tests/src/test/java/akka/actor/JavaAPI.java @@ -27,7 +27,7 @@ public class JavaAPI { @Test void mustAcceptSingleArgTryTell() { ActorRef ref = app.actorOf(JavaAPITestActor.class); - ref.tryTell("hallo"); - ref.tryTell("hallo", ref); + ref.tell("hallo"); + ref.tell("hallo", ref); } } diff --git a/akka-actor-tests/src/test/java/akka/actor/JavaAPITestActor.java b/akka-actor-tests/src/test/java/akka/actor/JavaAPITestActor.java index 4952d1b2c9..7b4c5a48bb 100644 --- a/akka-actor-tests/src/test/java/akka/actor/JavaAPITestActor.java +++ b/akka-actor-tests/src/test/java/akka/actor/JavaAPITestActor.java @@ -2,6 +2,6 @@ package akka.actor; public class JavaAPITestActor extends UntypedActor { public void onReceive(Object msg) { - getChannel().tryTell("got it!"); + getSender().tell("got it!"); } } diff --git a/akka-actor-tests/src/test/scala/akka/actor/ActorFireForgetRequestReplySpec.scala b/akka-actor-tests/src/test/scala/akka/actor/ActorFireForgetRequestReplySpec.scala index 2a327a35d9..727d2bbbec 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/ActorFireForgetRequestReplySpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/ActorFireForgetRequestReplySpec.scala @@ -15,9 +15,9 @@ object ActorFireForgetRequestReplySpec { class ReplyActor extends Actor { def receive = { case "Send" ⇒ - channel ! "Reply" + sender ! "Reply" case "SendImplicit" ⇒ - channel ! "ReplyImplicit" + sender ! "ReplyImplicit" } } diff --git a/akka-actor-tests/src/test/scala/akka/actor/ActorLifeCycleSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/ActorLifeCycleSpec.scala index aca8ae829b..23373a8af6 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/ActorLifeCycleSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/ActorLifeCycleSpec.scala @@ -26,7 +26,7 @@ class ActorLifeCycleSpec extends AkkaSpec with BeforeAndAfterEach with ImplicitS val currentGen = generationProvider.getAndIncrement() override def preStart() { report("preStart") } override def postStop() { report("postStop") } - def receive = { case "status" ⇒ channel ! message("OK") } + def receive = { case "status" ⇒ sender ! message("OK") } } "An Actor" must { diff --git a/akka-actor-tests/src/test/scala/akka/actor/ActorRefSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/ActorRefSpec.scala index 5fdf0487e5..d4ffc2a517 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/ActorRefSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/ActorRefSpec.scala @@ -18,24 +18,24 @@ import java.util.concurrent.{ CountDownLatch, TimeUnit } object ActorRefSpec { - case class ReplyTo(channel: Channel[Any]) + case class ReplyTo(sender: ActorRef) val latch = TestLatch(4) class ReplyActor extends Actor { - var replyTo: Channel[Any] = null + var replyTo: ActorRef = null def receive = { case "complexRequest" ⇒ { - replyTo = channel + replyTo = sender val worker = context.actorOf(Props[WorkerActor]) worker ! "work" } case "complexRequest2" ⇒ val worker = context.actorOf(Props[WorkerActor]) - worker ! ReplyTo(channel) + worker ! ReplyTo(sender) case "workDone" ⇒ replyTo ! "complexReply" - case "simpleRequest" ⇒ channel ! "simpleReply" + case "simpleRequest" ⇒ sender ! "simpleReply" } } @@ -43,7 +43,7 @@ object ActorRefSpec { def receive = { case "work" ⇒ { work - channel ! "workDone" + sender ! "workDone" self.stop() } case ReplyTo(replyTo) ⇒ { @@ -74,7 +74,7 @@ object ActorRefSpec { class OuterActor(val inner: ActorRef) extends Actor { def receive = { - case "self" ⇒ channel ! self + case "self" ⇒ sender ! self case x ⇒ inner forward x } } @@ -83,7 +83,7 @@ object ActorRefSpec { val fail = new InnerActor def receive = { - case "self" ⇒ channel ! self + case "self" ⇒ sender ! self case x ⇒ inner forward x } } @@ -94,8 +94,8 @@ object ActorRefSpec { class InnerActor extends Actor { def receive = { - case "innerself" ⇒ channel ! self - case other ⇒ channel ! other + case "innerself" ⇒ sender ! self + case other ⇒ sender ! other } } @@ -103,8 +103,8 @@ object ActorRefSpec { val fail = new InnerActor def receive = { - case "innerself" ⇒ channel ! self - case other ⇒ channel ! other + case "innerself" ⇒ sender ! self + case other ⇒ sender ! other } } @@ -322,7 +322,7 @@ class ActorRefSpec extends AkkaSpec { "support nested actorOfs" in { val a = actorOf(new Actor { val nested = actorOf(new Actor { def receive = { case _ ⇒ } }) - def receive = { case _ ⇒ channel ! nested } + def receive = { case _ ⇒ sender ! nested } }) val nested = (a ? "any").as[ActorRef].get @@ -342,7 +342,7 @@ class ActorRefSpec extends AkkaSpec { (a ? "msg").as[String] must be === Some("msg") } - "support reply via channel" in { + "support reply via sender" in { val serverRef = actorOf(Props[ReplyActor]) val clientRef = actorOf(Props(new SenderActor(serverRef))) @@ -370,8 +370,8 @@ class ActorRefSpec extends AkkaSpec { val timeout = Timeout(20000) val ref = actorOf(Props(new Actor { def receive = { - case 5 ⇒ channel.tryTell("five") - case null ⇒ channel.tryTell("null") + case 5 ⇒ sender.tell("five") + case null ⇒ sender.tell("null") } })) diff --git a/akka-actor-tests/src/test/scala/akka/actor/Bench.scala b/akka-actor-tests/src/test/scala/akka/actor/Bench.scala index 492a3e6680..5b0edc835e 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/Bench.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/Bench.scala @@ -101,7 +101,7 @@ object Chameneos { } } else { waitingChameneo.foreach(_ ! Exit) - channel ! Exit + sender ! Exit } } } diff --git a/akka-actor-tests/src/test/scala/akka/actor/ChannelSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/ChannelSpec.scala deleted file mode 100644 index 8461b4f39c..0000000000 --- a/akka-actor-tests/src/test/scala/akka/actor/ChannelSpec.scala +++ /dev/null @@ -1,49 +0,0 @@ -/** - * Copyright (C) 2009-2011 Typesafe Inc. - */ - -package akka.actor - -import akka.dispatch._ -import akka.testkit.TestActorRef -import akka.testkit.AkkaSpec - -@org.junit.runner.RunWith(classOf[org.scalatest.junit.JUnitRunner]) -class ChannelSpec extends AkkaSpec { - - "A Channel" must { - - "be contravariant" in { - val ap = new ActorPromise(1000) - val p: Promise[Any] = ap - val c: Channel[Any] = ap - val cs: Channel[String] = c - } - - "find implicit sender actors" in { - var s: (String, UntypedChannel) = null - val ch = new Channel[String] { - def !(msg: String)(implicit sender: UntypedChannel) = { s = (msg, sender) } - } - val a = TestActorRef(new Actor { - def receive = { - case str: String ⇒ ch ! str - } - }) - a ! "hallo" - s must be(("hallo", a)) - - { - implicit val actor = a - ch tryTell "buh" - } - s must be(("buh", a)) - ch.!("world")(a) - s must be(("world", a)) - ch.tryTell("bippy")(a) - s must be(("bippy", a)) - } - - } - -} diff --git a/akka-actor-tests/src/test/scala/akka/actor/DeathWatchSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/DeathWatchSpec.scala index 485de60d42..db51993b34 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/DeathWatchSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/DeathWatchSpec.scala @@ -82,7 +82,7 @@ class DeathWatchSpec extends AkkaSpec with BeforeAndAfterEach with ImplicitSende "notify with a Terminated message once when an Actor is stopped but not when restarted" in { filterException[ActorKilledException] { val supervisor = actorOf(Props[Supervisor].withFaultHandler(OneForOneStrategy(List(classOf[Exception]), Some(2)))) - val terminalProps = Props(context ⇒ { case x ⇒ context.channel ! x }) + val terminalProps = Props(context ⇒ { case x ⇒ context.sender ! x }) val terminal = (supervisor ? terminalProps).as[ActorRef].get val monitor = actorOf(Props(new Actor { diff --git a/akka-actor-tests/src/test/scala/akka/actor/ForwardActorSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/ForwardActorSpec.scala index 1aff230560..1390cbf965 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/ForwardActorSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/ForwardActorSpec.scala @@ -15,7 +15,7 @@ object ForwardActorSpec { def createForwardingChain(app: AkkaApplication): ActorRef = { val replier = app.actorOf(new Actor { - def receive = { case x ⇒ channel ! x } + def receive = { case x ⇒ sender ! x } }) def mkforwarder(forwardTo: ActorRef) = app.actorOf( diff --git a/akka-actor-tests/src/test/scala/akka/actor/IOActor.scala b/akka-actor-tests/src/test/scala/akka/actor/IOActor.scala index 107df964ae..d4f08e40c2 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/IOActor.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/IOActor.scala @@ -48,7 +48,7 @@ object IOActorSpec { def receiveIO = { case length: Int ⇒ val bytes = socket.read(length) - channel ! bytes + sender ! bytes } } } @@ -108,9 +108,9 @@ object IOActorSpec { case msg: NewClient ⇒ createWorker forward msg case ('set, key: String, value: ByteString) ⇒ kvs += (key -> value) - channel.tryTell(())(self) - case ('get, key: String) ⇒ channel.tryTell(kvs.get(key))(self) - case 'getall ⇒ channel.tryTell(kvs)(self) + sender.tell((), self) + case ('get, key: String) ⇒ sender.tell(kvs.get(key), self) + case 'getall ⇒ sender.tell(kvs, self) } } @@ -123,7 +123,7 @@ object IOActorSpec { socket = connect(ioManager, host, port) } - def reply(msg: Any) = channel.tryTell(msg)(self) + def reply(msg: Any) = sender.tell(msg, self) def receiveIO = { case ('set, key: String, value: ByteString) ⇒ diff --git a/akka-actor-tests/src/test/scala/akka/actor/LoggingReceiveSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/LoggingReceiveSpec.scala index 5ea68924d1..170183d2c8 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/LoggingReceiveSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/LoggingReceiveSpec.scala @@ -62,7 +62,7 @@ class LoggingReceiveSpec extends WordSpec with BeforeAndAfterEach with BeforeAnd app.eventHandler.addListener(testActor) val actor = TestActorRef(new Actor { def receive = loggable(this) { - case _ ⇒ channel ! "x" + case _ ⇒ sender ! "x" } }) actor ! "buh" @@ -91,7 +91,7 @@ class LoggingReceiveSpec extends WordSpec with BeforeAndAfterEach with BeforeAnd app.eventHandler.addListener(testActor) val actor = TestActorRef(new Actor { def receive = loggable(this)(loggable(this) { - case _ ⇒ channel ! "x" + case _ ⇒ sender ! "x" }) }) actor ! "buh" diff --git a/akka-actor-tests/src/test/scala/akka/actor/RestartStrategySpec.scala b/akka-actor-tests/src/test/scala/akka/actor/RestartStrategySpec.scala index 1fa42ac61b..38a223d29a 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/RestartStrategySpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/RestartStrategySpec.scala @@ -210,7 +210,7 @@ class RestartStrategySpec extends AkkaSpec { val boss = actorOf(Props(new Actor { def receive = { - case p: Props ⇒ channel ! context.actorOf(p) + case p: Props ⇒ sender ! context.actorOf(p) case t: Terminated ⇒ maxNoOfRestartsLatch.open } }).withFaultHandler(OneForOneStrategy(List(classOf[Throwable]), None, Some(1000)))) diff --git a/akka-actor-tests/src/test/scala/akka/actor/Supervisor.scala b/akka-actor-tests/src/test/scala/akka/actor/Supervisor.scala index 14c70933f7..6c438f1776 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/Supervisor.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/Supervisor.scala @@ -5,6 +5,6 @@ package akka.actor class Supervisor extends Actor { def receive = { - case x: Props ⇒ channel ! context.actorOf(x) + case x: Props ⇒ sender ! context.actorOf(x) } } diff --git a/akka-actor-tests/src/test/scala/akka/actor/SupervisorHierarchySpec.scala b/akka-actor-tests/src/test/scala/akka/actor/SupervisorHierarchySpec.scala index 860478f862..567acfd6f8 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/SupervisorHierarchySpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/SupervisorHierarchySpec.scala @@ -13,7 +13,7 @@ object SupervisorHierarchySpec { class CountDownActor(countDown: CountDownLatch) extends Actor { protected def receive = { - case p: Props ⇒ channel ! context.actorOf(p) + case p: Props ⇒ sender ! context.actorOf(p) } override def postRestart(reason: Throwable) = { countDown.countDown() diff --git a/akka-actor-tests/src/test/scala/akka/actor/SupervisorMiscSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/SupervisorMiscSpec.scala index e33b7ab878..99068ed76e 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/SupervisorMiscSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/SupervisorMiscSpec.scala @@ -22,7 +22,7 @@ class SupervisorMiscSpec extends AkkaSpec { val workerProps = Props(new Actor { override def postRestart(cause: Throwable) { countDownLatch.countDown() } protected def receive = { - case "status" ⇒ this.channel ! "OK" + case "status" ⇒ this.sender ! "OK" case _ ⇒ this.self.stop() } }) diff --git a/akka-actor-tests/src/test/scala/akka/actor/SupervisorSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/SupervisorSpec.scala index 20b1f92aea..c38290eeec 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/SupervisorSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/SupervisorSpec.scala @@ -39,7 +39,7 @@ object SupervisorSpec { def receive = { case Ping ⇒ messageLog.put(PingMessage) - channel.tryTell(PongMessage) + sender.tell(PongMessage) case Die ⇒ throw new RuntimeException(ExceptionMessage) } @@ -53,10 +53,10 @@ object SupervisorSpec { val temp = context.actorOf(Props[PingPongActor]) self startsMonitoring temp - var s: UntypedChannel = _ + var s: ActorRef = _ def receive = { - case Die ⇒ temp ! Die; s = context.channel + case Die ⇒ temp ! Die; s = sender case Terminated(`temp`) ⇒ s ! "terminated" } } @@ -294,7 +294,7 @@ class SupervisorSpec extends AkkaSpec with BeforeAndAfterEach with ImplicitSende if (inits.get % 2 == 0) throw new IllegalStateException("Don't wanna!") def receive = { - case Ping ⇒ channel.tryTell(PongMessage) + case Ping ⇒ sender.tell(PongMessage) case Die ⇒ throw new RuntimeException("Expected") } }) diff --git a/akka-actor-tests/src/test/scala/akka/actor/SupervisorTreeSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/SupervisorTreeSpec.scala index e5b6283c36..f2c3d36081 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/SupervisorTreeSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/SupervisorTreeSpec.scala @@ -23,7 +23,7 @@ class SupervisorTreeSpec extends AkkaSpec with ImplicitSender { within(5 seconds) { val p = Props(new Actor { def receive = { - case p: Props ⇒ channel ! context.actorOf(p) + case p: Props ⇒ sender ! context.actorOf(p) } override def preRestart(cause: Throwable, msg: Option[Any]) { testActor ! self.address } }).withFaultHandler(OneForOneStrategy(List(classOf[Exception]), 3, 1000)) diff --git a/akka-actor-tests/src/test/scala/akka/actor/Ticket669Spec.scala b/akka-actor-tests/src/test/scala/akka/actor/Ticket669Spec.scala index c864af36fa..758f44848b 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/Ticket669Spec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/Ticket669Spec.scala @@ -25,7 +25,7 @@ class Ticket669Spec extends AkkaSpec with BeforeAndAfterAll with ImplicitSender val supervisor = actorOf(Props[Supervisor].withFaultHandler(AllForOneStrategy(List(classOf[Exception]), 5, 10000))) val supervised = (supervisor ? Props[Supervised]).as[ActorRef].get - supervised.!("test")(Some(testActor)) + supervised.!("test")(testActor) expectMsg("failure1") supervisor.stop() } @@ -36,7 +36,7 @@ class Ticket669Spec extends AkkaSpec with BeforeAndAfterAll with ImplicitSender val supervisor = actorOf(Props[Supervisor].withFaultHandler(AllForOneStrategy(List(classOf[Exception]), Some(0), None))) val supervised = (supervisor ? Props[Supervised]).as[ActorRef].get - supervised.!("test")(Some(testActor)) + supervised.!("test")(testActor) expectMsg("failure2") supervisor.stop() } @@ -51,11 +51,11 @@ object Ticket669Spec { } override def preRestart(reason: scala.Throwable, msg: Option[Any]) { - channel.tryTell("failure1") + sender.tell("failure1") } override def postStop() { - channel.tryTell("failure2") + sender.tell("failure2") } } } diff --git a/akka-actor-tests/src/test/scala/akka/actor/TypedActorSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/TypedActorSpec.scala index 4727825b9f..2af08fbe6f 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/TypedActorSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/TypedActorSpec.scala @@ -263,7 +263,7 @@ class TypedActorSpec extends AkkaSpec with BeforeAndAfterEach with BeforeAndAfte "be able to handle exceptions when calling methods" in { filterEvents(EventFilter[IllegalStateException]("expected")) { val boss = actorOf(Props(context ⇒ { - case p: Props ⇒ context.channel ! context.typedActorOf(classOf[Foo], classOf[Bar], p) + case p: Props ⇒ context.sender ! context.typedActorOf(classOf[Foo], classOf[Bar], p) }).withFaultHandler(OneForOneStrategy { case e: IllegalStateException if e.getMessage == "expected" ⇒ FaultHandlingStrategy.Resume })) diff --git a/akka-actor-tests/src/test/scala/akka/actor/dispatch/ActorModelSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/dispatch/ActorModelSpec.scala index 318120a2a4..50b1b69838 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/dispatch/ActorModelSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/dispatch/ActorModelSpec.scala @@ -71,8 +71,8 @@ object ActorModelSpec { case Meet(sign, wait) ⇒ ack; sign.countDown(); wait.await(); busy.switchOff() case Wait(time) ⇒ ack; Thread.sleep(time); busy.switchOff() case WaitAck(time, l) ⇒ ack; Thread.sleep(time); l.countDown(); busy.switchOff() - case Reply(msg) ⇒ ack; channel ! msg; busy.switchOff() - case TryReply(msg) ⇒ ack; channel.tryTell(msg); busy.switchOff() + case Reply(msg) ⇒ ack; sender ! msg; busy.switchOff() + case TryReply(msg) ⇒ ack; sender.tell(msg); busy.switchOff() case Forward(to, msg) ⇒ ack; to.forward(msg); busy.switchOff() case CountDown(latch) ⇒ ack; latch.countDown(); busy.switchOff() case Increment(count) ⇒ ack; count.incrementAndGet(); busy.switchOff() diff --git a/akka-actor-tests/src/test/scala/akka/actor/dispatch/DispatcherActorSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/dispatch/DispatcherActorSpec.scala index 02fa4b0689..2ce2171438 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/dispatch/DispatcherActorSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/dispatch/DispatcherActorSpec.scala @@ -9,7 +9,7 @@ import akka.actor.{ Props, Actor } object DispatcherActorSpec { class TestActor extends Actor { def receive = { - case "Hello" ⇒ channel ! "World" + case "Hello" ⇒ sender ! "World" case "Failure" ⇒ throw new RuntimeException("Expected exception; to test fault-tolerance") } } @@ -46,20 +46,6 @@ class DispatcherActorSpec extends AkkaSpec { actor.stop() } - "support ask/exception" in { - filterEvents(EventFilter[RuntimeException]("Expected")) { - val actor = actorOf(Props[TestActor].withDispatcher(app.dispatcherFactory.newDispatcher("test").build)) - try { - (actor ? "Failure").get - fail("Should have thrown an exception") - } catch { - case e ⇒ - assert("Expected exception; to test fault-tolerance" === e.getMessage()) - } - actor.stop() - } - } - "respect the throughput setting" in { val throughputDispatcher = app.dispatcherFactory. newDispatcher("THROUGHPUT", 101, 0, app.dispatcherFactory.MailboxType). @@ -74,7 +60,7 @@ class DispatcherActorSpec extends AkkaSpec { val slowOne = actorOf( Props(context ⇒ { - case "hogexecutor" ⇒ context.channel ! "OK"; start.await + case "hogexecutor" ⇒ context.sender ! "OK"; start.await case "ping" ⇒ if (works.get) latch.countDown() }).withDispatcher(throughputDispatcher)) diff --git a/akka-actor-tests/src/test/scala/akka/actor/dispatch/PinnedActorSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/dispatch/PinnedActorSpec.scala index a2f0a785de..fc0e240a50 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/dispatch/PinnedActorSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/dispatch/PinnedActorSpec.scala @@ -12,7 +12,7 @@ import org.scalatest.BeforeAndAfterEach object PinnedActorSpec { class TestActor extends Actor { def receive = { - case "Hello" ⇒ channel ! "World" + case "Hello" ⇒ sender ! "World" case "Failure" ⇒ throw new RuntimeException("Expected exception; to test fault-tolerance") } } @@ -48,18 +48,5 @@ class PinnedActorSpec extends AkkaSpec with BeforeAndAfterEach { assert("World" === result.get) actor.stop() } - - "support ask/exception" in { - val actor = actorOf(Props[TestActor].withDispatcher(app.dispatcherFactory.newPinnedDispatcher("test"))) - app.eventHandler.notify(Mute(EventFilter[RuntimeException]("Expected exception; to test fault-tolerance"))) - try { - (actor ? "Failure").get - fail("Should have thrown an exception") - } catch { - case e ⇒ - assert("Expected exception; to test fault-tolerance" === e.getMessage()) - } - actor.stop() - } } } diff --git a/akka-actor-tests/src/test/scala/akka/dataflow/Future2Actor.scala b/akka-actor-tests/src/test/scala/akka/dataflow/Future2Actor.scala index 948af64106..227a29ddc2 100644 --- a/akka-actor-tests/src/test/scala/akka/dataflow/Future2Actor.scala +++ b/akka-actor-tests/src/test/scala/akka/dataflow/Future2Actor.scala @@ -21,8 +21,8 @@ class Future2ActorSpec extends AkkaSpec { "support reply via channel" in { val actor = app.actorOf(Props(new Actor { def receive = { - case "do" ⇒ Future(31) pipeTo context.channel - case "ex" ⇒ Future(throw new AssertionError) pipeTo context.channel + case "do" ⇒ Future(31) pipeTo context.sender + case "ex" ⇒ Future(throw new AssertionError) pipeTo context.sender } })) (actor ? "do").as[Int] must be(Some(31)) diff --git a/akka-actor-tests/src/test/scala/akka/dispatch/FutureSpec.scala b/akka-actor-tests/src/test/scala/akka/dispatch/FutureSpec.scala index 3b6b147ec5..b2505f4a41 100644 --- a/akka-actor-tests/src/test/scala/akka/dispatch/FutureSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/dispatch/FutureSpec.scala @@ -17,7 +17,7 @@ import org.scalatest.junit.JUnitSuite object FutureSpec { class TestActor extends Actor { def receive = { - case "Hello" ⇒ channel ! "World" + case "Hello" ⇒ sender ! "World" case "Failure" ⇒ throw new RuntimeException("Expected exception; to test fault-tolerance") case "NoReply" ⇒ } @@ -25,7 +25,7 @@ object FutureSpec { class TestDelayActor(await: StandardLatch) extends Actor { def receive = { - case "Hello" ⇒ await.await; channel ! "World" + case "Hello" ⇒ await.await; sender ! "World" case "NoReply" ⇒ await.await case "Failure" ⇒ await.await @@ -137,7 +137,7 @@ class FutureSpec extends AkkaSpec with Checkers with BeforeAndAfterAll { "will return a result" must { behave like futureWithResult { test ⇒ val actor1 = actorOf[TestActor] - val actor2 = actorOf(new Actor { def receive = { case s: String ⇒ channel ! s.toUpperCase } }) + val actor2 = actorOf(new Actor { def receive = { case s: String ⇒ sender ! s.toUpperCase } }) val future = actor1 ? "Hello" flatMap { case s: String ⇒ actor2 ? s } future.await test(future, "WORLD") @@ -149,7 +149,7 @@ class FutureSpec extends AkkaSpec with Checkers with BeforeAndAfterAll { behave like futureWithException[ArithmeticException] { test ⇒ filterException[ArithmeticException] { val actor1 = actorOf[TestActor] - val actor2 = actorOf(new Actor { def receive = { case s: String ⇒ channel ! s.length / 0 } }) + val actor2 = actorOf(new Actor { def receive = { case s: String ⇒ sender ! s.length / 0 } }) val future = actor1 ? "Hello" flatMap { case s: String ⇒ actor2 ? s } future.await test(future, "/ by zero") @@ -162,7 +162,7 @@ class FutureSpec extends AkkaSpec with Checkers with BeforeAndAfterAll { behave like futureWithException[MatchError] { test ⇒ filterException[MatchError] { val actor1 = actorOf[TestActor] - val actor2 = actorOf(new Actor { def receive = { case s: String ⇒ channel ! s.toUpperCase } }) + val actor2 = actorOf(new Actor { def receive = { case s: String ⇒ sender ! s.toUpperCase } }) val future = actor1 ? "Hello" flatMap { case i: Int ⇒ actor2 ? i } future.await test(future, "World (of class java.lang.String)") @@ -179,8 +179,8 @@ class FutureSpec extends AkkaSpec with Checkers with BeforeAndAfterAll { filterException[ClassCastException] { val actor = actorOf(new Actor { def receive = { - case s: String ⇒ channel ! s.length - case i: Int ⇒ channel ! (i * 2).toString + case s: String ⇒ sender ! s.length + case i: Int ⇒ sender ! (i * 2).toString } }) @@ -211,8 +211,8 @@ class FutureSpec extends AkkaSpec with Checkers with BeforeAndAfterAll { case class Res[T](res: T) val actor = actorOf(new Actor { def receive = { - case Req(s: String) ⇒ channel ! Res(s.length) - case Req(i: Int) ⇒ channel ! Res((i * 2).toString) + case Req(s: String) ⇒ sender ! Res(s.length) + case Req(i: Int) ⇒ sender ! Res((i * 2).toString) } }) @@ -298,7 +298,7 @@ class FutureSpec extends AkkaSpec with Checkers with BeforeAndAfterAll { "fold" in { val actors = (1 to 10).toList map { _ ⇒ actorOf(new Actor { - def receive = { case (add: Int, wait: Int) ⇒ Thread.sleep(wait); channel.tryTell(add) } + def receive = { case (add: Int, wait: Int) ⇒ Thread.sleep(wait); sender.tell(add) } }) } val timeout = 10000 @@ -309,7 +309,7 @@ class FutureSpec extends AkkaSpec with Checkers with BeforeAndAfterAll { "fold by composing" in { val actors = (1 to 10).toList map { _ ⇒ actorOf(new Actor { - def receive = { case (add: Int, wait: Int) ⇒ Thread.sleep(wait); channel.tryTell(add) } + def receive = { case (add: Int, wait: Int) ⇒ Thread.sleep(wait); sender.tell(add) } }) } def futures = actors.zipWithIndex map { case (actor: ActorRef, idx: Int) ⇒ actor.?((idx, idx * 200), 10000).mapTo[Int] } @@ -324,7 +324,7 @@ class FutureSpec extends AkkaSpec with Checkers with BeforeAndAfterAll { case (add: Int, wait: Int) ⇒ Thread.sleep(wait) if (add == 6) throw new IllegalArgumentException("shouldFoldResultsWithException: expected") - channel.tryTell(add) + sender.tell(add) } }) } @@ -356,7 +356,7 @@ class FutureSpec extends AkkaSpec with Checkers with BeforeAndAfterAll { "shouldReduceResults" in { val actors = (1 to 10).toList map { _ ⇒ actorOf(new Actor { - def receive = { case (add: Int, wait: Int) ⇒ Thread.sleep(wait); channel.tryTell(add) } + def receive = { case (add: Int, wait: Int) ⇒ Thread.sleep(wait); sender.tell(add) } }) } val timeout = 10000 @@ -372,7 +372,7 @@ class FutureSpec extends AkkaSpec with Checkers with BeforeAndAfterAll { case (add: Int, wait: Int) ⇒ Thread.sleep(wait) if (add == 6) throw new IllegalArgumentException("shouldFoldResultsWithException: expected") - channel.tryTell(add) + sender.tell(add) } }) } @@ -401,7 +401,7 @@ class FutureSpec extends AkkaSpec with Checkers with BeforeAndAfterAll { var counter = 1 def receive = { case 'GetNext ⇒ - channel ! counter + sender ! counter counter += 2 } }) diff --git a/akka-actor-tests/src/test/scala/akka/dispatch/MailboxConfigSpec.scala b/akka-actor-tests/src/test/scala/akka/dispatch/MailboxConfigSpec.scala index a19898a502..8e1bc597d9 100644 --- a/akka-actor-tests/src/test/scala/akka/dispatch/MailboxConfigSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/dispatch/MailboxConfigSpec.scala @@ -8,7 +8,7 @@ import java.util.concurrent.{ TimeUnit, CountDownLatch, BlockingQueue } import java.util.{ Queue } import akka.util._ import akka.util.Duration._ -import akka.actor.{ LocalActorRef, Actor, NullChannel } +import akka.actor.{ LocalActorRef, Actor } import akka.testkit.AkkaSpec @org.junit.runner.RunWith(classOf[org.scalatest.junit.JUnitRunner]) @@ -80,7 +80,7 @@ abstract class MailboxSpec extends AkkaSpec with BeforeAndAfterAll with BeforeAn result } - def createMessageInvocation(msg: Any): Envelope = Envelope(msg, NullChannel) + def createMessageInvocation(msg: Any): Envelope = Envelope(msg, app.deadLetters) def ensureInitialMailboxState(config: MailboxType, q: Mailbox) { q must not be null diff --git a/akka-actor-tests/src/test/scala/akka/dispatch/PriorityDispatcherSpec.scala b/akka-actor-tests/src/test/scala/akka/dispatch/PriorityDispatcherSpec.scala index 0c599937d2..ebc42c92d9 100644 --- a/akka-actor-tests/src/test/scala/akka/dispatch/PriorityDispatcherSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/dispatch/PriorityDispatcherSpec.scala @@ -30,7 +30,7 @@ class PriorityDispatcherSpec extends AkkaSpec { def receive = { case i: Int ⇒ acc = i :: acc - case 'Result ⇒ channel.tryTell(acc) + case 'Result ⇒ sender.tell(acc) } }).withDispatcher(dispatcher)).asInstanceOf[LocalActorRef] diff --git a/akka-actor-tests/src/test/scala/akka/event/EventBusSpec.scala b/akka-actor-tests/src/test/scala/akka/event/EventBusSpec.scala index 4861dd9ea5..4c43e17d83 100644 --- a/akka-actor-tests/src/test/scala/akka/event/EventBusSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/event/EventBusSpec.scala @@ -61,13 +61,13 @@ abstract class EventBusSpec(busName: String) extends AkkaSpec with BeforeAndAfte disposeSubscriber(sub) } - "not allow for the same subscriber to subscribe to the same channel twice" in { + "not allow for the same subscriber to subscribe to the same sender twice" in { bus.subscribe(subscriber, classifier) must be === true bus.subscribe(subscriber, classifier) must be === false bus.unsubscribe(subscriber, classifier) must be === true } - "not allow for the same subscriber to unsubscribe to the same channel twice" in { + "not allow for the same subscriber to unsubscribe to the same sender twice" in { bus.subscribe(subscriber, classifier) must be === true bus.unsubscribe(subscriber, classifier) must be === true bus.unsubscribe(subscriber, classifier) must be === false diff --git a/akka-actor-tests/src/test/scala/akka/performance/trading/common/MatchingEngine.scala b/akka-actor-tests/src/test/scala/akka/performance/trading/common/MatchingEngine.scala index 5f2989fa97..9c88e67902 100644 --- a/akka-actor-tests/src/test/scala/akka/performance/trading/common/MatchingEngine.scala +++ b/akka-actor-tests/src/test/scala/akka/performance/trading/common/MatchingEngine.scala @@ -47,7 +47,7 @@ class AkkaMatchingEngine(val meId: String, val orderbooks: List[Orderbook]) } def done(status: Boolean) { - channel ! new Rsp(status) + sender ! new Rsp(status) } def waitForStandby(pendingStandbyFuture: Future[_]) { diff --git a/akka-actor-tests/src/test/scala/akka/performance/trading/common/OrderReceiver.scala b/akka-actor-tests/src/test/scala/akka/performance/trading/common/OrderReceiver.scala index c1f811b425..114fe7e349 100644 --- a/akka-actor-tests/src/test/scala/akka/performance/trading/common/OrderReceiver.scala +++ b/akka-actor-tests/src/test/scala/akka/performance/trading/common/OrderReceiver.scala @@ -41,7 +41,7 @@ class AkkaOrderReceiver extends Actor with OrderReceiver { m.forward(order) case None ⇒ app.eventHandler.warning(this, "Unknown orderbook: " + order.orderbookSymbol) - channel ! new Rsp(false) + sender ! new Rsp(false) } } } diff --git a/akka-actor-tests/src/test/scala/akka/routing/ActorPoolSpec.scala b/akka-actor-tests/src/test/scala/akka/routing/ActorPoolSpec.scala index ad48435996..01fd35ba42 100644 --- a/akka-actor-tests/src/test/scala/akka/routing/ActorPoolSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/routing/ActorPoolSpec.scala @@ -42,7 +42,7 @@ class ActorPoolSpec extends AkkaSpec { case _ ⇒ count.incrementAndGet latch.countDown() - channel.tryTell("success") + sender.tell("success") } })) @@ -89,7 +89,7 @@ class ActorPoolSpec extends AkkaSpec { def receive = { case req: String ⇒ { sleepFor(10 millis) - channel.tryTell("Response") + sender.tell("Response") } } })) @@ -112,7 +112,7 @@ class ActorPoolSpec extends AkkaSpec { val count = new AtomicInteger(0) val pool = actorOf( - Props(new Actor with DefaultActorPool with BoundedCapacityStrategy with ActiveFuturesPressureCapacitor with SmallestMailboxSelector with BasicNoBackoffFilter { + Props(new Actor with DefaultActorPool with BoundedCapacityStrategy with ActiveActorsPressureCapacitor with SmallestMailboxSelector with BasicNoBackoffFilter { def instance(p: Props) = actorOf(p.withCreator(new Actor { def receive = { case n: Int ⇒ @@ -359,7 +359,7 @@ class ActorPoolSpec extends AkkaSpec { val keepDying = new AtomicBoolean(false) val pool1, pool2 = actorOf( - Props(new Actor with DefaultActorPool with BoundedCapacityStrategy with ActiveFuturesPressureCapacitor with SmallestMailboxSelector with BasicFilter { + Props(new Actor with DefaultActorPool with BoundedCapacityStrategy with ActiveActorsPressureCapacitor with SmallestMailboxSelector with BasicFilter { def lowerBound = 2 def upperBound = 5 def rampupRate = 0.1 @@ -382,7 +382,7 @@ class ActorPoolSpec extends AkkaSpec { }).withFaultHandler(faultHandler)) val pool3 = actorOf( - Props(new Actor with DefaultActorPool with BoundedCapacityStrategy with ActiveFuturesPressureCapacitor with RoundRobinSelector with BasicFilter { + Props(new Actor with DefaultActorPool with BoundedCapacityStrategy with ActiveActorsPressureCapacitor with RoundRobinSelector with BasicFilter { def lowerBound = 2 def upperBound = 5 def rampupRate = 0.1 @@ -480,7 +480,7 @@ class ActorPoolSpec extends AkkaSpec { object BadState val pool1 = actorOf( - Props(new Actor with DefaultActorPool with BoundedCapacityStrategy with ActiveFuturesPressureCapacitor with SmallestMailboxSelector with BasicFilter { + Props(new Actor with DefaultActorPool with BoundedCapacityStrategy with ActiveActorsPressureCapacitor with SmallestMailboxSelector with BasicFilter { def lowerBound = 2 def upperBound = 5 def rampupRate = 0.1 diff --git a/akka-actor-tests/src/test/scala/akka/routing/ConfiguredLocalRoutingSpec.scala b/akka-actor-tests/src/test/scala/akka/routing/ConfiguredLocalRoutingSpec.scala index 0650aec50e..6d1d5e1da0 100644 --- a/akka-actor-tests/src/test/scala/akka/routing/ConfiguredLocalRoutingSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/routing/ConfiguredLocalRoutingSpec.scala @@ -74,7 +74,7 @@ class ConfiguredLocalRoutingSpec extends AkkaSpec { val actor = app.actorOf(Props(new Actor { lazy val id = counter.getAndIncrement() def receive = { - case "hit" ⇒ channel ! id + case "hit" ⇒ sender ! id case "end" ⇒ doneLatch.countDown() } }), address) @@ -188,7 +188,7 @@ class ConfiguredLocalRoutingSpec extends AkkaSpec { val actor = app.actorOf(Props(new Actor { lazy val id = counter.getAndIncrement() def receive = { - case "hit" ⇒ channel ! id + case "hit" ⇒ sender ! id case "end" ⇒ doneLatch.countDown() } }), address) diff --git a/akka-actor-tests/src/test/scala/akka/routing/RoutingSpec.scala b/akka-actor-tests/src/test/scala/akka/routing/RoutingSpec.scala index 1313694260..510b6ecbef 100644 --- a/akka-actor-tests/src/test/scala/akka/routing/RoutingSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/routing/RoutingSpec.scala @@ -459,7 +459,7 @@ class RoutingSpec extends AkkaSpec { case Stop(None) ⇒ self.stop() case Stop(Some(_id)) if (_id == id) ⇒ self.stop() case _id: Int if (_id == id) ⇒ - case _ ⇒ Thread sleep 100 * id; channel.tryTell(id) + case _ ⇒ Thread sleep 100 * id; sender.tell(id) } override def postStop = { diff --git a/akka-actor-tests/src/test/scala/akka/ticket/Ticket703Spec.scala b/akka-actor-tests/src/test/scala/akka/ticket/Ticket703Spec.scala index 1b54c709d8..1e1768019e 100644 --- a/akka-actor-tests/src/test/scala/akka/ticket/Ticket703Spec.scala +++ b/akka-actor-tests/src/test/scala/akka/ticket/Ticket703Spec.scala @@ -22,7 +22,7 @@ class Ticket703Spec extends AkkaSpec { def receive = { case req: String ⇒ Thread.sleep(6000L) - channel.tryTell("Response") + sender.tell("Response") } })) }).withFaultHandler(OneForOneStrategy(List(classOf[Exception]), 5, 1000))) diff --git a/akka-actor/src/main/scala/akka/actor/Actor.scala b/akka-actor/src/main/scala/akka/actor/Actor.scala index a6cb36443d..2cce44bec8 100644 --- a/akka-actor/src/main/scala/akka/actor/Actor.scala +++ b/akka-actor/src/main/scala/akka/actor/Actor.scala @@ -209,16 +209,15 @@ trait Actor { * Stores the context for this actor, including self, sender, and hotswap. */ @transient - private[akka] val context: ActorContext = { + private[akka] implicit val context: ActorContext = { val contextStack = ActorCell.contextStack.get - def noContextError = { + def noContextError = throw new ActorInitializationException( "\n\tYou cannot create an instance of " + getClass.getName + " explicitly using the constructor (new)." + "\n\tYou have to use one of the factory methods to create a new actor. Either use:" + "\n\t\t'val actor = Actor.actorOf[MyActor]', or" + "\n\t\t'val actor = Actor.actorOf(new MyActor(..))'") - } if (contextStack.isEmpty) noContextError val context = contextStack.head @@ -283,14 +282,6 @@ trait Actor { @inline final def sender: ActorRef = context.sender - /** - * Abstraction for unification of sender and senderFuture for later reply - */ - def channel: UntypedChannel = context.channel - - // TODO FIXME REMOVE ME just for current compatibility - implicit def forwardable: ForwardableChannel = ForwardableChannel(channel) - /** * Gets the current receive timeout * When specified, the receive method should be able to handle a 'ReceiveTimeout' message. @@ -326,7 +317,7 @@ trait Actor { * def receive = { * case Ping => * println("got a 'Ping' message") - * channel ! "pong" + * sender ! "pong" * * case OneWay => * println("got a 'OneWay' message") @@ -427,10 +418,7 @@ trait Actor { case f: Failed ⇒ context.handleFailure(f) case ct: ChildTerminated ⇒ context.handleChildTerminated(ct.child) case Kill ⇒ throw new ActorKilledException("Kill") - case PoisonPill ⇒ - val ch = channel - self.stop() - ch.sendException(new ActorKilledException("PoisonPill")) + case PoisonPill ⇒ self.stop() } } diff --git a/akka-actor/src/main/scala/akka/actor/ActorCell.scala b/akka-actor/src/main/scala/akka/actor/ActorCell.scala index 75c7d1f02e..6b1e8f2504 100644 --- a/akka-actor/src/main/scala/akka/actor/ActorCell.scala +++ b/akka-actor/src/main/scala/akka/actor/ActorCell.scala @@ -36,8 +36,6 @@ private[akka] trait ActorContext extends ActorRefFactory with TypedActorFactory def sender: ActorRef - def channel: UntypedChannel - def children: Iterable[ActorRef] def dispatcher: MessageDispatcher @@ -126,29 +124,12 @@ private[akka] class ActorCell( def children: Iterable[ActorRef] = _children.keys - def postMessageToMailbox(message: Any, channel: UntypedChannel): Unit = dispatcher.dispatch(this, Envelope(message, channel)) - - def postMessageToMailboxAndCreateFutureResultWithTimeout( - message: Any, - timeout: Timeout, - channel: UntypedChannel): Future[Any] = { - val future = channel match { - case f: ActorPromise ⇒ f - case _ ⇒ new ActorPromise(timeout)(dispatcher) - } - dispatcher.dispatch(this, Envelope(message, future)) - future - } + def postMessageToMailbox(message: Any, sender: ActorRef): Unit = dispatcher.dispatch(this, Envelope(message, sender)) def sender: ActorRef = currentMessage match { - case null ⇒ app.deadLetters - case msg if msg.channel.isInstanceOf[ActorRef] ⇒ msg.channel.asInstanceOf[ActorRef] - case _ ⇒ app.deadLetters - } - - def channel: UntypedChannel = currentMessage match { - case null ⇒ NullChannel - case msg ⇒ msg.channel + case null ⇒ app.deadLetters + case msg if msg.sender ne null ⇒ msg.sender + case _ ⇒ app.deadLetters } //This method is in charge of setting up the contextStack and create a new instance of the Actor @@ -308,12 +289,10 @@ private[akka] class ActorCell( // make sure that InterruptedException does not leave this thread if (e.isInstanceOf[InterruptedException]) { val ex = ActorInterruptedException(e) - channel.sendException(ex) props.faultHandler.handleSupervisorFailing(self, children) supervisor ! Failed(self, ex) throw e //Re-throw InterruptedExceptions as expected } else { - channel.sendException(e) props.faultHandler.handleSupervisorFailing(self, children) supervisor ! Failed(self, e) } @@ -325,9 +304,6 @@ private[akka] class ActorCell( app.eventHandler.error(e, self, e.getMessage) throw e } - } else { - messageHandle.channel sendException new ActorKilledException("Actor has been stopped") - // throwing away message if actor is shut down, no use throwing an exception in receiving actor's thread, isShutdown is enforced on caller side } } } diff --git a/akka-actor/src/main/scala/akka/actor/ActorRef.scala b/akka-actor/src/main/scala/akka/actor/ActorRef.scala index 43fb856afb..3c9d2144ec 100644 --- a/akka-actor/src/main/scala/akka/actor/ActorRef.scala +++ b/akka-actor/src/main/scala/akka/actor/ActorRef.scala @@ -41,7 +41,7 @@ import akka.event.ActorEventBus * * @author Jonas Bonér */ -abstract class ActorRef extends UntypedChannel with ReplyChannel[Any] with java.lang.Comparable[ActorRef] with Serializable { +abstract class ActorRef extends java.lang.Comparable[ActorRef] with Serializable { scalaRef: ScalaActorRef ⇒ // Only mutable for RemoteServer in order to maintain identity across nodes @@ -58,11 +58,23 @@ abstract class ActorRef extends UntypedChannel with ReplyChannel[Any] with java. def compareTo(other: ActorRef) = this.address compareTo other.address /** - * Akka Java API.

- * @see ask(message: AnyRef, sender: ActorRef): Future[_] - * Uses the specified timeout (milliseconds) + * Sends the specified message to the sender, i.e. fire-and-forget semantics.

+ *

+   * actor.tell(message);
+   * 
*/ - def ask(message: AnyRef, timeout: Long): Future[Any] = ask(message, timeout, null) + def tell(msg: Any): Unit = this.!(msg) + + /** + * Java API.

+ * Sends the specified message to the sender, i.e. fire-and-forget + * semantics, including the sender reference if possible (not supported on + * all senders).

+ *

+   * actor.tell(message, context);
+   * 
+ */ + def tell(msg: Any, sender: ActorRef): Unit = this.!(msg)(sender) /** * Akka Java API.

@@ -72,20 +84,17 @@ abstract class ActorRef extends UntypedChannel with ReplyChannel[Any] with java. * Use this method with care. In most cases it is better to use 'tell' together with the 'getContext().getSender()' to * implement request/response message exchanges. *

- * If you are sending messages using ask then you have to use getContext().channel().tell(...) + * If you are sending messages using ask then you have to use getContext().sender().tell(...) * to send a reply message to the original sender. If not then the sender will block until the timeout expires. */ - def ask(message: AnyRef, timeout: Long, sender: ActorRef): Future[AnyRef] = - ?(message, Timeout(timeout))(sender).asInstanceOf[Future[AnyRef]] + def ask(message: AnyRef, timeout: Long): Future[AnyRef] = ?(message, Timeout(timeout)).asInstanceOf[Future[AnyRef]] /** - * Akka Java API.

- * Forwards the message specified to this actor and preserves the original sender of the message + * Forwards the message and passes the original sender actor as the sender. + *

+ * Works with '!' and '?'/'ask'. */ - def forward(message: AnyRef, sender: ActorRef) { - if (sender eq null) throw new IllegalArgumentException("The 'sender' argument to 'forward' can't be null") - else forward(message)(ForwardableChannel(sender)) - } + def forward(message: Any)(implicit context: ActorContext) = postMessageToMailbox(message, context.sender) /** * Suspends the actor. It will not process messages while suspended. @@ -222,15 +231,9 @@ class LocalActorRef private[akka] ( protected[akka] def sendSystemMessage(message: SystemMessage) { underlying.dispatcher.systemDispatch(underlying, message) } - protected[akka] def postMessageToMailbox(message: Any, channel: UntypedChannel): Unit = - actorCell.postMessageToMailbox(message, channel) + protected[akka] def postMessageToMailbox(message: Any, sender: ActorRef): Unit = actorCell.postMessageToMailbox(message, sender) - protected[akka] def postMessageToMailboxAndCreateFutureResultWithTimeout( - message: Any, - timeout: Timeout, - channel: UntypedChannel): Future[Any] = { - actorCell.postMessageToMailboxAndCreateFutureResultWithTimeout(message, timeout, channel) - } + def ?(message: Any)(implicit timeout: Timeout): Future[Any] = app.provider.ask(message, this, timeout) protected[akka] def handleFailure(fail: Failed): Unit = actorCell.handleFailure(fail) @@ -251,7 +254,7 @@ class LocalActorRef private[akka] ( * There are implicit conversions in ../actor/Implicits.scala * from ActorRef -> ScalaActorRef and back */ -trait ScalaActorRef extends ReplyChannel[Any] { ref: ActorRef ⇒ +trait ScalaActorRef { ref: ActorRef ⇒ protected[akka] def sendSystemMessage(message: SystemMessage): Unit @@ -269,28 +272,16 @@ trait ScalaActorRef extends ReplyChannel[Any] { ref: ActorRef ⇒ * *

*/ - def !(message: Any)(implicit channel: UntypedChannel): Unit = postMessageToMailbox(message, channel) + def !(message: Any)(implicit sender: ActorRef = null): Unit = postMessageToMailbox(message, sender) /** * Sends a message asynchronously, returning a future which may eventually hold the reply. */ - def ?(message: Any)(implicit channel: UntypedChannel, timeout: Timeout): Future[Any] = postMessageToMailboxAndCreateFutureResultWithTimeout(message, timeout, channel) + def ?(message: Any)(implicit timeout: Timeout): Future[Any] - def ?(message: Any, timeout: Timeout)(implicit channel: UntypedChannel): Future[Any] = ?(message)(channel, timeout) + def ?(message: Any, timeout: Timeout)(implicit ignore: Int = 0): Future[Any] = ?(message)(timeout) - /** - * Forwards the message and passes the original sender actor as the sender. - *

- * Works with '!' and '?'/'ask'. - */ - def forward(message: Any)(implicit forwardable: ForwardableChannel) = postMessageToMailbox(message, forwardable.channel) - - protected[akka] def postMessageToMailbox(message: Any, channel: UntypedChannel): Unit - - protected[akka] def postMessageToMailboxAndCreateFutureResultWithTimeout( - message: Any, - timeout: Timeout, - channel: UntypedChannel): Future[Any] + protected[akka] def postMessageToMailbox(message: Any, sender: ActorRef): Unit protected[akka] def restart(cause: Throwable): Unit } @@ -320,31 +311,24 @@ case class SerializedActorRef(uuid: Uuid, address: String, hostname: String, por */ trait UnsupportedActorRef extends ActorRef with ScalaActorRef { - private[akka] def uuid: Uuid = unsupported + private[akka] final val uuid: akka.actor.Uuid = newUuid() - def startsMonitoring(actorRef: ActorRef): ActorRef = unsupported + def startsMonitoring(actorRef: ActorRef): ActorRef = actorRef - def stopsMonitoring(actorRef: ActorRef): ActorRef = unsupported + def stopsMonitoring(actorRef: ActorRef): ActorRef = actorRef - def suspend(): Unit = unsupported + def suspend(): Unit = () - def resume(): Unit = unsupported + def resume(): Unit = () - protected[akka] def restart(cause: Throwable): Unit = unsupported + protected[akka] def restart(cause: Throwable): Unit = () - def stop(): Unit = unsupported + protected[akka] def sendSystemMessage(message: SystemMessage): Unit = () - def address: String = unsupported + protected[akka] def postMessageToMailbox(msg: Any, sender: ActorRef): Unit = () - def isShutdown = false - - protected[akka] def sendSystemMessage(message: SystemMessage) {} - - protected[akka] def postMessageToMailbox(msg: Any, channel: UntypedChannel) {} - - protected[akka] def postMessageToMailboxAndCreateFutureResultWithTimeout(msg: Any, timeout: Timeout, channel: UntypedChannel): Future[Any] = unsupported - - private def unsupported = throw new UnsupportedOperationException("Not supported for %s".format(getClass.getName)) + def ?(message: Any)(implicit timeout: Timeout): Future[Any] = + throw new UnsupportedOperationException("Not supported for %s".format(getClass.getName)) } /** @@ -352,7 +336,7 @@ trait UnsupportedActorRef extends ActorRef with ScalaActorRef { */ trait MinimalActorRef extends ActorRef with ScalaActorRef { - private[akka] val uuid: Uuid = new com.eaio.uuid.UUID(0L, 0L) //Nil UUID + private[akka] val uuid: Uuid = newUuid() def address = uuid.toString def startsMonitoring(actorRef: ActorRef): ActorRef = actorRef @@ -368,14 +352,10 @@ trait MinimalActorRef extends ActorRef with ScalaActorRef { protected[akka] def sendSystemMessage(message: SystemMessage) {} - protected[akka] def postMessageToMailbox(msg: Any, channel: UntypedChannel) {} - - protected[akka] def postMessageToMailboxAndCreateFutureResultWithTimeout(msg: Any, timeout: Timeout, channel: UntypedChannel): Future[Any] = unsupported - - private def unsupported = throw new UnsupportedOperationException("Not supported for %s".format(getClass.getName)) + protected[akka] def postMessageToMailbox(msg: Any, sender: ActorRef) {} } -case class DeadLetter(message: Any, channel: UntypedChannel) +case class DeadLetter(message: Any, sender: ActorRef) class DeadLetterActorRef(app: AkkaApplication) extends MinimalActorRef { val brokenPromise = new KeptPromise[Any](Left(new ActorKilledException("In DeadLetterActorRef, promises are always broken.")))(app.dispatcher) @@ -383,12 +363,9 @@ class DeadLetterActorRef(app: AkkaApplication) extends MinimalActorRef { override def isShutdown(): Boolean = true - protected[akka] override def postMessageToMailbox(message: Any, channel: UntypedChannel): Unit = app.eventHandler.notify(DeadLetter(message, channel)) + protected[akka] override def postMessageToMailbox(message: Any, sender: ActorRef): Unit = app.eventHandler.notify(DeadLetter(message, sender)) - protected[akka] override def postMessageToMailboxAndCreateFutureResultWithTimeout( - message: Any, - timeout: Timeout, - channel: UntypedChannel): Future[Any] = { app.eventHandler.notify(DeadLetter(message, channel)); brokenPromise } + def ?(message: Any)(implicit timeout: Timeout): Future[Any] = brokenPromise } abstract class AskActorRef(promise: Promise[Any], app: AkkaApplication) extends MinimalActorRef { @@ -398,22 +375,16 @@ abstract class AskActorRef(promise: Promise[Any], app: AkkaApplication) extends protected def whenDone(): Unit - override protected[akka] def postMessageToMailbox(message: Any, channel: UntypedChannel): Unit = message match { + override protected[akka] def postMessageToMailbox(message: Any, sender: ActorRef): Unit = message match { case akka.actor.Status.Success(r) ⇒ promise.completeWithResult(r) case akka.actor.Status.Failure(f) ⇒ promise.completeWithException(f) case other ⇒ promise.completeWithResult(other) } - override protected[akka] def postMessageToMailboxAndCreateFutureResultWithTimeout( - message: Any, - timeout: Timeout, - channel: UntypedChannel): Future[Any] = { - postMessageToMailbox(message, channel) - promise - } + def ?(message: Any)(implicit timeout: Timeout): Future[Any] = + new KeptPromise[Any](Left(new ActorKilledException("Not possible to ask/? a reference to an ask/?.")))(app.dispatcher) override def isShutdown = promise.isCompleted || promise.isExpired override def stop(): Unit = if (!isShutdown) promise.completeWithException(new ActorKilledException("Stopped")) - } diff --git a/akka-actor/src/main/scala/akka/actor/ActorRefProvider.scala b/akka-actor/src/main/scala/akka/actor/ActorRefProvider.scala index aa84ef2711..e823b7d1f6 100644 --- a/akka-actor/src/main/scala/akka/actor/ActorRefProvider.scala +++ b/akka-actor/src/main/scala/akka/actor/ActorRefProvider.scala @@ -97,11 +97,18 @@ class LocalActorRefProvider(val app: AkkaApplication) extends ActorRefProvider { * receive only Supervise/ChildTerminated system messages or Failure message. */ private[akka] val theOneWhoWalksTheBubblesOfSpaceTime: ActorRef = new UnsupportedActorRef { + @volatile + var stopped = false + override def address = app.name + ":BubbleWalker" override def toString = address - protected[akka] override def postMessageToMailbox(msg: Any, channel: UntypedChannel) { + def stop() = stopped = true + + def isShutdown = stopped + + protected[akka] override def postMessageToMailbox(msg: Any, sender: ActorRef) { msg match { case Failed(child, ex) ⇒ child.stop() case ChildTerminated(child) ⇒ terminationFuture.completeWithResult(AkkaApplication.Stopped) @@ -205,7 +212,7 @@ class LocalActorRefProvider(val app: AkkaApplication) extends ActorRefProvider { // val localOnly = props.localOnly // if (clusteringEnabled && !props.localOnly) ReflectiveAccess.ClusterModule.newClusteredActorRef(props) // else new RoutedActorRef(props, address) - new RoutedActorRef(props, address) + new RoutedActorRef(app, props, address) } private[akka] def deserialize(actor: SerializedActorRef): Option[ActorRef] = actorFor(actor.address) diff --git a/akka-actor/src/main/scala/akka/actor/Channel.scala b/akka-actor/src/main/scala/akka/actor/Channel.scala deleted file mode 100644 index ce2beb224b..0000000000 --- a/akka-actor/src/main/scala/akka/actor/Channel.scala +++ /dev/null @@ -1,146 +0,0 @@ -/** - * Copyright (C) 2009-2011 Typesafe Inc. - */ - -package akka.actor - -/* - * This package is just used to hide the tryTell method from the Scala parts: - * it will be public to javac's eyes by virtue of §5.2 of the SLS. - */ -package japi { - trait Channel[-T] { self: akka.actor.Channel[T] ⇒ - private[japi] def tryTell(msg: T): Boolean = { - try { - self.!(msg)(NullChannel) - true - } catch { - case _: Exception ⇒ false - } - } - } -} - -/** - * Abstraction for unification of sender and senderFuture for later reply. - * Can be stored away and used at a later point in time. - * - * The possible reply channel which can be passed into ! and tryTell is always - * untyped, as there is no way to utilize its real static type without - * requiring runtime-costly manifests. - */ -trait Channel[-T] extends japi.Channel[T] { - - /** - * Scala API.

- * Sends the specified message to the channel. - */ - def !(msg: T)(implicit sender: UntypedChannel): Unit - - /** - * Scala and Java API.

- * Try to send the specified message to the channel, i.e. fire-and-forget - * semantics, including the sender reference if possible (not supported on - * all channels).

- * From Java: - *

-   * actor.tryTell(message);
-   * actor.tryTell(message, context);
-   * 
- *

- * From Scala: - *

-   * actor tryTell message
-   * actor.tryTell(message)(sender)
-   * 
- */ - def tryTell(msg: T)(implicit sender: UntypedChannel): Boolean = { - try { - this.!(msg)(sender) - true - } catch { - case _: Exception ⇒ false - } - } - - /** - * Try to send an exception. Not all channel types support this, one notable - * positive example is Future. Failure to send is silent. - * - * @return whether sending was successful - */ - def sendException(ex: Throwable): Boolean = false - - /** - * Sends the specified message to the channel, i.e. fire-and-forget semantics.

- *

-   * actor.tell(message);
-   * 
- */ - def tell(msg: T): Unit = this.!(msg) - - /** - * Java API.

- * Sends the specified message to the channel, i.e. fire-and-forget - * semantics, including the sender reference if possible (not supported on - * all channels).

- *

-   * actor.tell(message, context);
-   * 
- */ - def tell(msg: T, sender: UntypedChannel): Unit = this.!(msg)(sender) - -} - -/** - * This trait marks a channel that a priori does have sending capability, - * i.e. ! is not guaranteed to fail (e.g. NullChannel would be a - * counter-example). - */ -trait AvailableChannel[-T] extends Channel[T] - -/** - * This trait marks a channel which is capable of sending exceptions. - */ -trait ExceptionChannel[-T] extends AvailableChannel[T] - -/** - * This trait marks a channel which carries reply information when tell()ing. - */ -trait ReplyChannel[-T] extends AvailableChannel[T] - -/** - * All channels used in conjunction with MessageInvocation are untyped by - * design, so make this explicit. - */ -trait UntypedChannel extends Channel[Any] - -object UntypedChannel { - implicit def senderOption2Channel(sender: Option[ActorRef]): UntypedChannel = - sender match { - case Some(actor) ⇒ actor - case None ⇒ NullChannel - } - - implicit final val default: UntypedChannel = NullChannel -} - -/** - * Default channel when none available. - */ -case object NullChannel extends UntypedChannel { - def !(msg: Any)(implicit channel: UntypedChannel) { - throw new IllegalActorStateException(""" - No sender in scope, can't reply. - You have probably: - 1. Sent a message to an Actor from an instance that is NOT an Actor. - 2. Invoked a method on an TypedActor from an instance NOT an TypedActor. - You may want to have a look at tryTell for a variant returning a Boolean""") - } - override def tryTell(msg: Any)(implicit channel: UntypedChannel): Boolean = false -} - -/** - * Wraps a forwardable channel. Used implicitly by ScalaActorRef.forward - */ -case class ForwardableChannel(val channel: UntypedChannel) diff --git a/akka-actor/src/main/scala/akka/actor/FSM.scala b/akka-actor/src/main/scala/akka/actor/FSM.scala index 3ea53364ac..2e1202365f 100644 --- a/akka-actor/src/main/scala/akka/actor/FSM.scala +++ b/akka-actor/src/main/scala/akka/actor/FSM.scala @@ -478,7 +478,7 @@ trait FSM[S, D] extends ListenerManagement { timeoutFuture = None } generation += 1 - processMsg(value, channel) + processMsg(value, sender) } } @@ -502,7 +502,7 @@ trait FSM[S, D] extends ListenerManagement { nextState.stopReason match { case None ⇒ makeTransition(nextState) case _ ⇒ - nextState.replies.reverse foreach { r ⇒ channel ! r } + nextState.replies.reverse foreach { r ⇒ sender ! r } terminate(nextState) self.stop() } @@ -512,7 +512,7 @@ trait FSM[S, D] extends ListenerManagement { if (!stateFunctions.contains(nextState.stateName)) { terminate(stay withStopReason Failure("Next state %s does not exist".format(nextState.stateName))) } else { - nextState.replies.reverse foreach { r ⇒ channel ! r } + nextState.replies.reverse foreach { r ⇒ sender ! r } if (currentState.stateName != nextState.stateName) { handleTransition(currentState.stateName, nextState.stateName) notifyListeners(Transition(self, currentState.stateName, nextState.stateName)) @@ -599,7 +599,7 @@ trait LoggingFSM[S, D] extends FSM[S, D] { this: Actor ⇒ val srcstr = source match { case s: String ⇒ s case Timer(name, _, _, _) ⇒ "timer " + name - case c: UntypedChannel ⇒ c.toString + case a: ActorRef ⇒ a.toString case _ ⇒ "unknown" } app.eventHandler.debug(context.self, "processing " + event + " from " + srcstr) diff --git a/akka-actor/src/main/scala/akka/actor/TypedActor.scala b/akka-actor/src/main/scala/akka/actor/TypedActor.scala index bb8cf568f0..c07cb7a128 100644 --- a/akka-actor/src/main/scala/akka/actor/TypedActor.scala +++ b/akka-actor/src/main/scala/akka/actor/TypedActor.scala @@ -340,11 +340,14 @@ class TypedActor(val app: AkkaApplication) { try { if (m.isOneWay) m(me) else if (m.returnsFuture_?) { - channel match { - case p: ActorPromise ⇒ p completeWith m(me).asInstanceOf[Future[Any]] - case _ ⇒ throw new IllegalStateException("Future-returning TypedActor didn't use ?/ask so cannot reply") + val s = sender + m(me).asInstanceOf[Future[Any]] onComplete { + _.value.get match { + case Left(f) ⇒ s ! akka.actor.Status.Failure(f) + case Right(r) ⇒ s ! r + } } - } else channel ! m(me) + } else sender ! m(me) } finally { TypedActor.selfReference set null diff --git a/akka-actor/src/main/scala/akka/actor/UntypedActor.scala b/akka-actor/src/main/scala/akka/actor/UntypedActor.scala index ce7ce1a3f2..c0deb28c81 100644 --- a/akka-actor/src/main/scala/akka/actor/UntypedActor.scala +++ b/akka-actor/src/main/scala/akka/actor/UntypedActor.scala @@ -21,7 +21,7 @@ import akka.dispatch.{ MessageDispatcher, Promise } * * if (msg.equals("UseReply")) { * // Reply to original sender of message using the 'reply' method - * getContext().getChannel().tell(msg + ":" + getSelf().getAddress()); + * getContext().getSender().tell(msg + ":" + getSelf().getAddress()); * * } else if (msg.equals("UseSender") && getSender().isDefined()) { * // Reply to original sender of message using the sender reference @@ -67,12 +67,7 @@ abstract class UntypedActor extends Actor { * The reference sender Actor of the last received message. * Is defined if the message was sent from another Actor, else None. */ - def getSender: ActorRef = sender - - /** - * Abstraction for unification of sender and senderFuture for later reply - */ - def getChannel: UntypedChannel = channel + def getSender(): ActorRef = sender /** * Gets the current receive timeout diff --git a/akka-actor/src/main/scala/akka/actor/package.scala b/akka-actor/src/main/scala/akka/actor/package.scala index a87ad02861..0178db875f 100644 --- a/akka-actor/src/main/scala/akka/actor/package.scala +++ b/akka-actor/src/main/scala/akka/actor/package.scala @@ -23,12 +23,9 @@ package object actor { } implicit def future2actor[T](f: akka.dispatch.Future[T]) = new { - def pipeTo(channel: Channel[T]): this.type = { - if (f.isCompleted) { - f.value.get.fold(channel.sendException(_), channel.tryTell(_)) - } else { - f onComplete { _.value.get.fold(channel.sendException(_), channel.tryTell(_)) } - } + def pipeTo(actor: ActorRef): this.type = { + def send(f: akka.dispatch.Future[T]) { f.value.get.fold(f ⇒ actor ! Status.Failure(f), r ⇒ actor ! r) } + if (f.isCompleted) send(f) else f onComplete send this } } diff --git a/akka-actor/src/main/scala/akka/dispatch/AbstractDispatcher.scala b/akka-actor/src/main/scala/akka/dispatch/AbstractDispatcher.scala index f89451b962..baf972a5b2 100644 --- a/akka-actor/src/main/scala/akka/dispatch/AbstractDispatcher.scala +++ b/akka-actor/src/main/scala/akka/dispatch/AbstractDispatcher.scala @@ -17,7 +17,7 @@ import scala.annotation.tailrec /** * @author Jonas Bonér */ -final case class Envelope(val message: Any, val channel: UntypedChannel) { +final case class Envelope(val message: Any, val sender: ActorRef) { if (message.isInstanceOf[AnyRef] && (message.asInstanceOf[AnyRef] eq null)) throw new InvalidMessageException("Message is null") } @@ -107,7 +107,7 @@ abstract class MessageDispatcher(val app: AkkaApplication) extends Serializable object DeadLetterMailbox extends Mailbox(null) { becomeClosed() override def dispatcher = null //MessageDispatcher.this - override def enqueue(envelope: Envelope) { envelope.channel sendException new ActorKilledException("Actor has been stopped") } + override def enqueue(envelope: Envelope) = () override def dequeue() = null override def systemEnqueue(handle: SystemMessage): Unit = () override def systemDrain(): SystemMessage = null diff --git a/akka-actor/src/main/scala/akka/dispatch/Future.scala b/akka-actor/src/main/scala/akka/dispatch/Future.scala index a41463999b..86a998b350 100644 --- a/akka-actor/src/main/scala/akka/dispatch/Future.scala +++ b/akka-actor/src/main/scala/akka/dispatch/Future.scala @@ -7,7 +7,7 @@ package akka.dispatch import akka.AkkaException import akka.event.EventHandler -import akka.actor.{ UntypedChannel, Timeout, ExceptionChannel } +import akka.actor.{ Timeout } import scala.Option import akka.japi.{ Procedure, Function ⇒ JFunc, Option ⇒ JOption } @@ -758,11 +758,6 @@ object Promise { * Creates a non-completed, new, Promise with the default timeout (akka.actor.timeout in conf) */ def apply[A]()(implicit dispatcher: MessageDispatcher, timeout: Timeout): Promise[A] = apply(timeout) - - /** - * Construct a completable channel - */ - def channel(timeout: Long)(implicit dispatcher: MessageDispatcher): ActorPromise = new ActorPromise(timeout) } /** @@ -1024,31 +1019,6 @@ class DefaultPromise[T](val timeout: Timeout)(implicit val dispatcher: MessageDi private def timeLeftNoinline(): Long = timeLeft() } -class ActorPromise(timeout: Timeout)(implicit dispatcher: MessageDispatcher) extends DefaultPromise[Any](timeout)(dispatcher) with UntypedChannel with ExceptionChannel[Any] { - - def !(message: Any)(implicit channel: UntypedChannel) = completeWithResult(message) - - override def sendException(ex: Throwable) = { - completeWithException(ex) - value == Some(Left(ex)) - } - - def channel: UntypedChannel = this - -} - -object ActorPromise { - def apply(f: Promise[Any])(timeout: Timeout = f.timeout): ActorPromise = - new ActorPromise(timeout)(f.dispatcher) { - completeWith(f) - override def !(message: Any)(implicit channel: UntypedChannel) = f completeWithResult message - override def sendException(ex: Throwable) = { - f completeWithException ex - f.value == Some(Left(ex)) - } - } -} - /** * An already completed Future is seeded with it's result at creation, is useful for when you are participating in * a Future-composition but you already have a value to contribute. diff --git a/akka-actor/src/main/scala/akka/routing/Pool.scala b/akka-actor/src/main/scala/akka/routing/Pool.scala index 9ea8dc78a8..8a26c25a84 100644 --- a/akka-actor/src/main/scala/akka/routing/Pool.scala +++ b/akka-actor/src/main/scala/akka/routing/Pool.scala @@ -103,7 +103,7 @@ trait DefaultActorPool extends ActorPool { this: Actor ⇒ protected def _route(): Actor.Receive = { // for testing... case Stat ⇒ - channel.tryTell(Stats(_delegates length)) + sender ! Stats(_delegates length) case Terminated(victim) ⇒ _delegates = _delegates filterNot { victim == } case msg ⇒ @@ -285,16 +285,14 @@ trait MailboxPressureCapacitor { /** * Implements pressure() to return the number of actors currently processing a - * message whose reply will be sent to a [[akka.dispatch.Future]]. + * message. * In other words, this capacitor counts how many - * delegates are tied up actively processing a message, as long as the - * messages have somebody waiting on the result. "One way" messages with - * no reply would not be counted. + * delegates are tied up actively processing a message */ -trait ActiveFuturesPressureCapacitor { +trait ActiveActorsPressureCapacitor { def pressure(delegates: Seq[ActorRef]): Int = delegates count { - case a: LocalActorRef ⇒ a.underlying.channel.isInstanceOf[Promise[_]] + case a: LocalActorRef ⇒ !a.underlying.sender.isShutdown case _ ⇒ false } } diff --git a/akka-actor/src/main/scala/akka/routing/Routing.scala b/akka-actor/src/main/scala/akka/routing/Routing.scala index b68c6016ae..ca7c60a619 100644 --- a/akka-actor/src/main/scala/akka/routing/Routing.scala +++ b/akka-actor/src/main/scala/akka/routing/Routing.scala @@ -42,7 +42,7 @@ trait Router { * * @throws RoutingException if something goes wrong while routing the message */ - def route(message: Any)(implicit sender: Option[ActorRef]) + def route(message: Any)(implicit sender: ActorRef) /** * Routes the message using a timeout to one of the connections and returns a Future to synchronize on the @@ -50,7 +50,7 @@ trait Router { * * @throws RoutingExceptionif something goes wrong while routing the message. */ - def route[T](message: Any, timeout: Timeout)(implicit sender: Option[ActorRef]): Future[T] + def route[T](message: Any, timeout: Timeout)(implicit sender: ActorRef): Future[T] } /** @@ -93,34 +93,19 @@ object Routing { /** * An Abstract convenience implementation for building an ActorReference that uses a Router. */ -abstract private[akka] class AbstractRoutedActorRef(val props: RoutedProps) extends UnsupportedActorRef { - private[akka] override val uuid: Uuid = newUuid - +abstract private[akka] class AbstractRoutedActorRef(val app: AkkaApplication, val props: RoutedProps) extends UnsupportedActorRef { val router = props.routerFactory() - override def postMessageToMailbox(message: Any, channel: UntypedChannel) = { - val sender = channel match { - case ref: ActorRef ⇒ Some(ref) - case _ ⇒ None - } - router.route(message)(sender) - } + override def postMessageToMailbox(message: Any, sender: ActorRef) = router.route(message)(sender) - override def postMessageToMailboxAndCreateFutureResultWithTimeout( - message: Any, timeout: Timeout, channel: UntypedChannel): Future[Any] = { - val sender = channel match { - case ref: ActorRef ⇒ Some(ref) - case _ ⇒ None - } - router.route[Any](message, timeout)(sender) - } + override def ?(message: Any)(implicit timeout: Timeout): Future[Any] = app.provider.ask(message, this, timeout) } /** * A RoutedActorRef is an ActorRef that has a set of connected ActorRef and it uses a Router to send a message to * on (or more) of these actors. */ -private[akka] class RoutedActorRef(val routedProps: RoutedProps, override val address: String) extends AbstractRoutedActorRef(routedProps) { +private[akka] class RoutedActorRef(app: AkkaApplication, val routedProps: RoutedProps, override val address: String) extends AbstractRoutedActorRef(app, routedProps) { @volatile private var running: Boolean = true @@ -131,7 +116,7 @@ private[akka] class RoutedActorRef(val routedProps: RoutedProps, override val ad synchronized { if (running) { running = false - router.route(Routing.Broadcast(PoisonPill))(Some(this)) + router.route(Routing.Broadcast(PoisonPill))(this) } } } @@ -152,7 +137,7 @@ trait BasicRouter extends Router { this.connectionManager = connectionManager } - def route(message: Any)(implicit sender: Option[ActorRef]) = message match { + def route(message: Any)(implicit sender: ActorRef) = message match { case Routing.Broadcast(message) ⇒ //it is a broadcast message, we are going to send to message to all connections. connectionManager.connections.iterable foreach { connection ⇒ @@ -180,7 +165,7 @@ trait BasicRouter extends Router { } } - def route[T](message: Any, timeout: Timeout)(implicit sender: Option[ActorRef]): Future[T] = message match { + def route[T](message: Any, timeout: Timeout)(implicit sender: ActorRef): Future[T] = message match { case Routing.Broadcast(message) ⇒ throw new RoutingException("Broadcasting using '?'/'ask' is for the time being is not supported. Use ScatterGatherRouter.") case _ ⇒ @@ -188,8 +173,7 @@ trait BasicRouter extends Router { next match { case Some(connection) ⇒ try { - // FIXME is this not wrong? it will not pass on and use the original Future but create a new one. Should reuse 'channel: UntypedChannel' in the AbstractRoutedActorRef - connection.?(message, timeout)(sender).asInstanceOf[Future[T]] + connection.?(message, timeout).asInstanceOf[Future[T]] //FIXME this does not preserve the original sender, shouldn't it? } catch { case e: Exception ⇒ connectionManager.remove(connection) @@ -202,10 +186,7 @@ trait BasicRouter extends Router { protected def next: Option[ActorRef] - private def throwNoConnectionsError = { - val error = new RoutingException("No replica connections for router") - throw error - } + private def throwNoConnectionsError = throw new RoutingException("No replica connections for router") } /** @@ -359,11 +340,11 @@ trait ScatterGatherRouter extends BasicRouter with Serializable { */ protected def gather[S, G >: S](results: Iterable[Future[S]]): Future[G] - private def scatterGather[S, G >: S](message: Any, timeout: Timeout)(implicit sender: Option[ActorRef]): Future[G] = { + private def scatterGather[S, G >: S](message: Any, timeout: Timeout)(implicit sender: ActorRef): Future[G] = { val responses = connectionManager.connections.iterable.flatMap { actor ⇒ try { if (actor.isShutdown) throw ActorInitializationException(actor, "For compatability - check death first", new Exception) // for stack trace - Some(actor.?(message, timeout)(sender).asInstanceOf[Future[S]]) + Some(actor.?(message, timeout).asInstanceOf[Future[S]]) } catch { case e: Exception ⇒ connectionManager.remove(actor) @@ -376,7 +357,7 @@ trait ScatterGatherRouter extends BasicRouter with Serializable { else gather(responses) } - override def route[T](message: Any, timeout: Timeout)(implicit sender: Option[ActorRef]): Future[T] = message match { + override def route[T](message: Any, timeout: Timeout)(implicit sender: ActorRef): Future[T] = message match { case Routing.Broadcast(message) ⇒ scatterGather(message, timeout) case message ⇒ super.route(message, timeout)(sender) } diff --git a/akka-camel-typed/src/test/scala/akka/camel/TypedCamelTestSupport.scala b/akka-camel-typed/src/test/scala/akka/camel/TypedCamelTestSupport.scala index eb4204ce0e..42b38e5bb3 100644 --- a/akka-camel-typed/src/test/scala/akka/camel/TypedCamelTestSupport.scala +++ b/akka-camel-typed/src/test/scala/akka/camel/TypedCamelTestSupport.scala @@ -24,7 +24,7 @@ object TypedCamelTestSupport { def countdown: Handler = { case SetExpectedMessageCount(num) ⇒ { latch = new CountDownLatch(num) - channel ! latch + sender ! latch } case msg ⇒ latch.countDown } @@ -32,7 +32,7 @@ object TypedCamelTestSupport { trait Respond { this: Actor ⇒ def respond: Handler = { - case msg: Message ⇒ channel ! response(msg) + case msg: Message ⇒ sender ! response(msg) } def response(msg: Message): Any = "Hello %s" format msg.body @@ -42,8 +42,8 @@ object TypedCamelTestSupport { val messages = Buffer[Any]() def retain: Handler = { - case GetRetainedMessage ⇒ channel ! messages.last - case GetRetainedMessages(p) ⇒ channel ! messages.filter(p).toList + case GetRetainedMessage ⇒ sender ! messages.last + case GetRetainedMessages(p) ⇒ sender ! messages.filter(p).toList case msg ⇒ { messages += msg msg diff --git a/akka-camel/src/main/scala/akka/camel/ConsumerPublisher.scala b/akka-camel/src/main/scala/akka/camel/ConsumerPublisher.scala index 062c6246b5..eef98f4f25 100644 --- a/akka-camel/src/main/scala/akka/camel/ConsumerPublisher.scala +++ b/akka-camel/src/main/scala/akka/camel/ConsumerPublisher.scala @@ -127,11 +127,11 @@ private[camel] class ActivationTracker extends Actor { def receive = { case SetExpectedActivationCount(num) ⇒ { activationLatch = new CountDownLatch(num) - channel ! activationLatch + sender ! activationLatch } case SetExpectedDeactivationCount(num) ⇒ { deactivationLatch = new CountDownLatch(num) - channel ! deactivationLatch + sender ! deactivationLatch } case EndpointActivated ⇒ activationLatch.countDown case EndpointDeactivated ⇒ deactivationLatch.countDown diff --git a/akka-camel/src/main/scala/akka/camel/Producer.scala b/akka-camel/src/main/scala/akka/camel/Producer.scala index bdc0079251..8c65d71c66 100644 --- a/akka-camel/src/main/scala/akka/camel/Producer.scala +++ b/akka-camel/src/main/scala/akka/camel/Producer.scala @@ -97,9 +97,9 @@ trait ProducerSupport { this: Actor ⇒ val exchange = createExchange(pattern).fromRequestMessage(cmsg) processor.process(exchange, new AsyncCallback { val producer = self - // Need copies of channel reference here since the callback could be done + // Need copies of sender reference here since the callback could be done // later by another thread. - val replyChannel = channel + val replyChannel = sender def done(doneSync: Boolean) { (doneSync, exchange.isFailed) match { @@ -159,7 +159,7 @@ trait ProducerSupport { this: Actor ⇒ * actor). */ protected def receiveAfterProduce: Receive = { - case msg ⇒ if (!oneway) channel ! msg + case msg ⇒ if (!oneway) sender ! msg } /** diff --git a/akka-camel/src/main/scala/akka/camel/component/ActorComponent.scala b/akka-camel/src/main/scala/akka/camel/component/ActorComponent.scala index 7ebbcc9a13..7a941679f1 100644 --- a/akka-camel/src/main/scala/akka/camel/component/ActorComponent.scala +++ b/akka-camel/src/main/scala/akka/camel/component/ActorComponent.scala @@ -16,7 +16,7 @@ import akka.actor._ import akka.camel.{ Ack, Failure, Message } import akka.camel.CamelMessageConversion.toExchangeAdapter import scala.reflect.BeanProperty -import akka.dispatch.{ FutureTimeoutException, Promise, MessageDispatcher } +import akka.dispatch._ /** * @author Martin Krasser @@ -274,9 +274,7 @@ private[akka] class AsyncCallbackAdapter(exchange: Exchange, callback: AsyncCall def resume(): Unit = () - def stop() { - running = false - } + def stop() { running = false } /** * Populates the initial exchange with the reply message and uses the @@ -286,7 +284,7 @@ private[akka] class AsyncCallbackAdapter(exchange: Exchange, callback: AsyncCall * @param message reply message * @param sender ignored */ - protected[akka] def postMessageToMailbox(message: Any, channel: UntypedChannel) = if(running) { + protected[akka] def postMessageToMailbox(message: Any, sender: ActorRef) = if(running) { message match { case Ack ⇒ { /* no response message to set */ } case msg: Failure ⇒ exchange.fromFailureMessage(msg) @@ -298,7 +296,8 @@ private[akka] class AsyncCallbackAdapter(exchange: Exchange, callback: AsyncCall def startsMonitoring(actorRef: ActorRef): ActorRef = unsupported def stopsMonitoring(actorRef: ActorRef): ActorRef = unsupported - protected[akka] def postMessageToMailboxAndCreateFutureResultWithTimeout(message: Any, timeout: Timeout, channel: UntypedChannel) = unsupported + def ?(message: Any)(implicit timeout: Timeout): Future[Any] = + new KeptPromise[Any](Left(new UnsupportedOperationException("Ask/? is not supported for %s".format(getClass.getName)))) def restart(reason: Throwable): Unit = unsupported private def unsupported = throw new UnsupportedOperationException("Not supported for %s" format classOf[AsyncCallbackAdapter].getName) diff --git a/akka-camel/src/test/java/akka/camel/SampleUntypedConsumer.java b/akka-camel/src/test/java/akka/camel/SampleUntypedConsumer.java index 93d0427902..0a0c0c7c35 100644 --- a/akka-camel/src/test/java/akka/camel/SampleUntypedConsumer.java +++ b/akka-camel/src/test/java/akka/camel/SampleUntypedConsumer.java @@ -15,7 +15,7 @@ public class SampleUntypedConsumer extends UntypedConsumerActor { Message msg = (Message)message; String body = msg.getBodyAs(String.class); String header = msg.getHeaderAs("test", String.class); - channel.tryTell(String.format("%s %s", body, header)); + sender.tell(String.format("%s %s", body, header)); } } diff --git a/akka-camel/src/test/java/akka/camel/SampleUntypedConsumerBlocking.java b/akka-camel/src/test/java/akka/camel/SampleUntypedConsumerBlocking.java index db3ea7665d..5b29ab2300 100644 --- a/akka-camel/src/test/java/akka/camel/SampleUntypedConsumerBlocking.java +++ b/akka-camel/src/test/java/akka/camel/SampleUntypedConsumerBlocking.java @@ -17,7 +17,7 @@ public class SampleUntypedConsumerBlocking extends UntypedConsumerActor { Message msg = (Message)message; String body = msg.getBodyAs(String.class); String header = msg.getHeaderAs("test", String.class); - channel.tryTell(String.format("%s %s", body, header)); + sender.tell(String.format("%s %s", body, header)); } } diff --git a/akka-camel/src/test/scala/akka/camel/CamelTestSupport.scala b/akka-camel/src/test/scala/akka/camel/CamelTestSupport.scala index d099dba708..01247ced2c 100644 --- a/akka-camel/src/test/scala/akka/camel/CamelTestSupport.scala +++ b/akka-camel/src/test/scala/akka/camel/CamelTestSupport.scala @@ -36,7 +36,7 @@ object CamelTestSupport { def countdown: Handler = { case SetExpectedMessageCount(num) ⇒ { latch = new CountDownLatch(num) - channel ! latch + sender ! latch } case msg ⇒ latch.countDown } @@ -44,7 +44,7 @@ object CamelTestSupport { trait Respond { this: Actor ⇒ def respond: Handler = { - case msg: Message ⇒ channel ! response(msg) + case msg: Message ⇒ sender ! response(msg) } def response(msg: Message): Any = "Hello %s" format msg.body @@ -54,8 +54,8 @@ object CamelTestSupport { val messages = Buffer[Any]() def retain: Handler = { - case GetRetainedMessage ⇒ channel ! messages.last - case GetRetainedMessages(p) ⇒ channel ! messages.filter(p).toList + case GetRetainedMessage ⇒ sender ! messages.last + case GetRetainedMessages(p) ⇒ sender ! messages.filter(p).toList case msg ⇒ { messages += msg msg diff --git a/akka-camel/src/test/scala/akka/camel/ConsumerScalaTest.scala b/akka-camel/src/test/scala/akka/camel/ConsumerScalaTest.scala index 7a83e09de7..97eb8b49a3 100644 --- a/akka-camel/src/test/scala/akka/camel/ConsumerScalaTest.scala +++ b/akka-camel/src/test/scala/akka/camel/ConsumerScalaTest.scala @@ -211,7 +211,7 @@ object ConsumerScalaTest { class TestConsumer(uri: String) extends Actor with Consumer { def endpointUri = uri protected def receive = { - case msg: Message ⇒ channel ! "received %s" format msg.body + case msg: Message ⇒ sender ! "received %s" format msg.body } } @@ -226,7 +226,7 @@ object ConsumerScalaTest { def endpointUri = uri override def autoack = false protected def receive = { - case msg: Message ⇒ channel ! Ack + case msg: Message ⇒ sender ! Ack } } @@ -247,15 +247,15 @@ object ConsumerScalaTest { protected def receive = { case "fail" ⇒ { throw new Exception("test") } - case "succeed" ⇒ channel ! "ok" + case "succeed" ⇒ sender ! "ok" } override def preRestart(reason: scala.Throwable, msg: Option[Any]) { - channel.tryTell("pr") + sender.tell("pr") } override def postStop { - channel.tryTell("ps") + sender.tell("ps") } } @@ -288,7 +288,7 @@ object ConsumerScalaTest { } private def respondTo(msg: Message) = - if (valid) channel ! ("accepted: %s" format msg.body) + if (valid) sender ! ("accepted: %s" format msg.body) else throw new Exception("rejected: %s" format msg.body) } diff --git a/akka-camel/src/test/scala/akka/camel/ProducerFeatureTest.scala b/akka-camel/src/test/scala/akka/camel/ProducerFeatureTest.scala index ad1ec6b5cf..c2614d2263 100644 --- a/akka-camel/src/test/scala/akka/camel/ProducerFeatureTest.scala +++ b/akka-camel/src/test/scala/akka/camel/ProducerFeatureTest.scala @@ -253,16 +253,16 @@ object ProducerFeatureTest { class TestResponder extends Actor { protected def receive = { case msg: Message ⇒ msg.body match { - case "fail" ⇒ channel ! Failure(new Exception("failure"), msg.headers) - case _ ⇒ channel ! (msg.transformBody { body: String ⇒ "received %s" format body }) + case "fail" ⇒ sender ! Failure(new Exception("failure"), msg.headers) + case _ ⇒ sender ! (msg.transformBody { body: String ⇒ "received %s" format body }) } } } class ReplyingForwardTarget extends Actor { protected def receive = { - case msg: Message ⇒ channel ! msg.addHeader("test" -> "result") - case msg: Failure ⇒ channel ! Failure(msg.cause, msg.headers + ("test" -> "failure")) + case msg: Message ⇒ sender ! msg.addHeader("test" -> "result") + case msg: Failure ⇒ sender ! Failure(msg.cause, msg.headers + ("test" -> "failure")) } } diff --git a/akka-camel/src/test/scala/akka/camel/component/ActorComponentFeatureTest.scala b/akka-camel/src/test/scala/akka/camel/component/ActorComponentFeatureTest.scala index c05ceffaaa..24fc306268 100644 --- a/akka-camel/src/test/scala/akka/camel/component/ActorComponentFeatureTest.scala +++ b/akka-camel/src/test/scala/akka/camel/component/ActorComponentFeatureTest.scala @@ -96,13 +96,13 @@ class ActorComponentFeatureTest extends FeatureSpec with BeforeAndAfterAll with object ActorComponentFeatureTest { class CustomIdActor extends Actor { protected def receive = { - case msg: Message ⇒ channel ! ("Received %s" format msg.body) + case msg: Message ⇒ sender ! ("Received %s" format msg.body) } } class FailWithMessage extends Actor { protected def receive = { - case msg: Message ⇒ channel ! Failure(new Exception("test")) + case msg: Message ⇒ sender ! Failure(new Exception("test")) } } diff --git a/akka-cluster/src/main/scala/akka/cluster/Cluster.scala b/akka-cluster/src/main/scala/akka/cluster/Cluster.scala index 79f740b3b7..db5f5306d9 100644 --- a/akka-cluster/src/main/scala/akka/cluster/Cluster.scala +++ b/akka-cluster/src/main/scala/akka/cluster/Cluster.scala @@ -300,7 +300,7 @@ class DefaultClusterNode private[akka] ( val remote = new akka.cluster.netty.NettyRemoteSupport remote.start(hostname, port) remote.register(RemoteClusterDaemon.Address, remoteDaemon) - remote.addListener(RemoteFailureDetector.channel) + remote.addListener(RemoteFailureDetector.sender) remote.addListener(remoteClientLifeCycleHandler) remote } @@ -427,7 +427,7 @@ class DefaultClusterNode private[akka] ( remoteService.shutdown() // shutdown server - RemoteFailureDetector.channel.stop() + RemoteFailureDetector.sender.stop() remoteClientLifeCycleHandler.stop() remoteDaemon.stop() diff --git a/akka-docs/intro/code/tutorials/first/Pi.scala b/akka-docs/intro/code/tutorials/first/Pi.scala index c346db3820..142f598dad 100644 --- a/akka-docs/intro/code/tutorials/first/Pi.scala +++ b/akka-docs/intro/code/tutorials/first/Pi.scala @@ -50,7 +50,7 @@ object Pi extends App { //#calculatePiFor def receive = { - case Work(start, nrOfElements) ⇒ channel ! Result(calculatePiFor(start, nrOfElements)) // perform the work + case Work(start, nrOfElements) ⇒ sender ! Result(calculatePiFor(start, nrOfElements)) // perform the work } } //#worker diff --git a/akka-durable-mailboxes/akka-mailboxes-common/src/main/scala/akka/actor/mailbox/DurableDispatcher.scala b/akka-durable-mailboxes/akka-mailboxes-common/src/main/scala/akka/actor/mailbox/DurableDispatcher.scala index af7ab12983..dba7f16958 100644 --- a/akka-durable-mailboxes/akka-mailboxes-common/src/main/scala/akka/actor/mailbox/DurableDispatcher.scala +++ b/akka-durable-mailboxes/akka-mailboxes-common/src/main/scala/akka/actor/mailbox/DurableDispatcher.scala @@ -91,7 +91,7 @@ case class DurableDispatcher( override def createMailbox(actorRef: LocalActorRef): AnyRef = _storage.createFor(actorRef) protected[akka] override def dispatch(invocation: MessageInvocation) { - if (invocation.channel.isInstanceOf[ActorPromise]) + if (invocation.sender.isInstanceOf[ActorPromise]) throw new IllegalArgumentException("Durable mailboxes do not support Future-based messages from ?") super.dispatch(invocation) } diff --git a/akka-durable-mailboxes/akka-mailboxes-common/src/main/scala/akka/actor/mailbox/DurableMailbox.scala b/akka-durable-mailboxes/akka-mailboxes-common/src/main/scala/akka/actor/mailbox/DurableMailbox.scala index 69b553ac03..b6410b2c86 100644 --- a/akka-durable-mailboxes/akka-mailboxes-common/src/main/scala/akka/actor/mailbox/DurableMailbox.scala +++ b/akka-durable-mailboxes/akka-mailboxes-common/src/main/scala/akka/actor/mailbox/DurableMailbox.scala @@ -50,7 +50,7 @@ abstract class DurableExecutableMailbox(owner: LocalActorRef) extends MessageQue val builder = DurableMailboxMessageProtocol.newBuilder .setOwnerAddress(ownerAddress) .setMessage(message.toByteString) - durableMessage.channel match { + durableMessage.sender match { case a: ActorRef ⇒ builder.setSenderAddress(a.address) case _ ⇒ } diff --git a/akka-durable-mailboxes/akka-mongo-mailbox/src/main/scala/akka/actor/mailbox/BSONSerialization.scala b/akka-durable-mailboxes/akka-mongo-mailbox/src/main/scala/akka/actor/mailbox/BSONSerialization.scala index 18f47bf0d4..0f852a2e8e 100644 --- a/akka-durable-mailboxes/akka-mongo-mailbox/src/main/scala/akka/actor/mailbox/BSONSerialization.scala +++ b/akka-durable-mailboxes/akka-mongo-mailbox/src/main/scala/akka/actor/mailbox/BSONSerialization.scala @@ -35,7 +35,7 @@ object BSONSerializableMailbox extends SerializableBSONObject[MongoDurableMessag b += "_id" -> msg._id b += "ownerAddress" -> msg.ownerAddress - msg.channel match { + msg.sender match { case a: ActorRef ⇒ { b += "senderAddress" -> a.address } case _ ⇒ () } diff --git a/akka-durable-mailboxes/akka-mongo-mailbox/src/main/scala/akka/actor/mailbox/MongoBasedMailbox.scala b/akka-durable-mailboxes/akka-mongo-mailbox/src/main/scala/akka/actor/mailbox/MongoBasedMailbox.scala index e8ce6957b3..8582f881af 100644 --- a/akka-durable-mailboxes/akka-mongo-mailbox/src/main/scala/akka/actor/mailbox/MongoBasedMailbox.scala +++ b/akka-durable-mailboxes/akka-mongo-mailbox/src/main/scala/akka/actor/mailbox/MongoBasedMailbox.scala @@ -47,7 +47,7 @@ class MongoBasedNaiveMailbox(val owner: LocalActorRef) extends DurableExecutable EventHandler.debug(this, "\nENQUEUING message in mongodb-based mailbox [%s]".format(msg)) /* TODO - Test if a BSON serializer is registered for the message and only if not, use toByteString? */ - val durableMessage = MongoDurableMessage(ownerAddress, msg.receiver, msg.message, msg.channel) + val durableMessage = MongoDurableMessage(ownerAddress, msg.receiver, msg.message, msg.sender) // todo - do we need to filter the actor name at all for safe collection naming? val result = new DefaultPromise[Boolean](writeTimeout) mongo.insert(durableMessage, false)(RequestFutures.write { wr: Either[Throwable, (Option[AnyRef], WriteResult)] ⇒ diff --git a/akka-durable-mailboxes/akka-mongo-mailbox/src/main/scala/akka/actor/mailbox/MongoDurableMessage.scala b/akka-durable-mailboxes/akka-mongo-mailbox/src/main/scala/akka/actor/mailbox/MongoDurableMessage.scala index 93d4951fe7..5678feba03 100644 --- a/akka-durable-mailboxes/akka-mongo-mailbox/src/main/scala/akka/actor/mailbox/MongoDurableMessage.scala +++ b/akka-durable-mailboxes/akka-mongo-mailbox/src/main/scala/akka/actor/mailbox/MongoDurableMessage.scala @@ -35,10 +35,10 @@ import org.bson.collection._ case class MongoDurableMessage(val ownerAddress: String, val receiver: LocalActorRef, val message: Any, - val channel: UntypedChannel, + val sender: UntypedChannel, val _id: ObjectId = new ObjectId) { - def messageInvocation() = MessageInvocation(this.receiver, this.message, this.channel) + def messageInvocation() = MessageInvocation(this.receiver, this.message, this.sender) } // vim: set ts=2 sw=2 sts=2 et: diff --git a/akka-http/src/main/scala/akka/http/Mist.scala b/akka-http/src/main/scala/akka/http/Mist.scala index a079ee8ecd..109804f73f 100644 --- a/akka-http/src/main/scala/akka/http/Mist.scala +++ b/akka-http/src/main/scala/akka/http/Mist.scala @@ -10,7 +10,7 @@ import javax.servlet.http.{ HttpServletResponse, HttpServletRequest } import javax.servlet.http.HttpServlet import javax.servlet.Filter import java.lang.UnsupportedOperationException -import akka.actor.{ NullChannel, ActorRef, Actor } +import akka.actor.{ ActorRef, Actor } import Types._ import akka.AkkaApplication @@ -246,10 +246,8 @@ trait Endpoint { this: Actor ⇒ if (!endpoints.isEmpty) endpoints.foreach { _.apply(uri) ! req } else { - channel match { - case null | NullChannel ⇒ _na(uri, req) - case channel ⇒ channel ! NoneAvailable(uri, req) - } + if (sender.isShutdown) _na(uri, req) + else sender ! NoneAvailable(uri, req) } } } diff --git a/akka-remote/src/main/scala/akka/remote/NetworkEventStream.scala b/akka-remote/src/main/scala/akka/remote/NetworkEventStream.scala index efd645cefd..872b2c23f3 100644 --- a/akka-remote/src/main/scala/akka/remote/NetworkEventStream.scala +++ b/akka-remote/src/main/scala/akka/remote/NetworkEventStream.scala @@ -13,7 +13,7 @@ import akka.AkkaApplication /** * Stream of all kinds of network events, remote failure and connection events, cluster failure and connection events etc. - * Also provides API for channel listener management. + * Also provides API for sender listener management. * * @author Jonas Bonér */ @@ -65,7 +65,7 @@ class NetworkEventStream(val app: AkkaApplication) { import NetworkEventStream._ // FIXME: check that this supervision is correct - private[akka] val channel = app.provider.actorOf( + private[akka] val sender = app.provider.actorOf( Props[Channel].copy(dispatcher = app.dispatcherFactory.newPinnedDispatcher("NetworkEventStream")), app.guardian, Props.randomAddress, systemService = true) @@ -73,11 +73,11 @@ class NetworkEventStream(val app: AkkaApplication) { * Registers a network event stream listener (asyncronously). */ def register(listener: Listener, connectionAddress: InetSocketAddress) = - channel ! Register(listener, connectionAddress) + sender ! Register(listener, connectionAddress) /** * Unregisters a network event stream listener (asyncronously) . */ def unregister(listener: Listener, connectionAddress: InetSocketAddress) = - channel ! Unregister(listener, connectionAddress) + sender ! Unregister(listener, connectionAddress) } diff --git a/akka-remote/src/main/scala/akka/remote/Remote.scala b/akka-remote/src/main/scala/akka/remote/Remote.scala index 550b1a20c7..82c3ea823d 100644 --- a/akka-remote/src/main/scala/akka/remote/Remote.scala +++ b/akka-remote/src/main/scala/akka/remote/Remote.scala @@ -75,8 +75,10 @@ class Remote(val app: AkkaApplication) extends RemoteService { val remote = new akka.remote.netty.NettyRemoteSupport(app) remote.start(hostname, port) remote.register(remoteDaemonServiceName, remoteDaemon) - app.eventHandler.addListener(eventStream.channel) + + app.eventHandler.addListener(eventStream.sender) app.eventHandler.addListener(remoteClientLifeCycleHandler) + // TODO actually register this provider in app in remote mode //provider.register(ActorRefProvider.RemoteProvider, new RemoteActorRefProvider) remote @@ -161,10 +163,10 @@ class RemoteSystemDaemon(remote: Remote) extends Actor { eventHandler.error(this, "Actor 'address' for actor to instantiate is not defined, ignoring remote system daemon command [%s]".format(message)) } - channel ! Success(address.toString) + sender ! Success(address.toString) } catch { case error: Throwable ⇒ - channel ! Failure(error) + sender ! Failure(error) throw error } } @@ -182,10 +184,10 @@ class RemoteSystemDaemon(remote: Remote) extends Actor { // gossiper tell gossip - // channel ! Success(address.toString) + // sender ! Success(address.toString) // } catch { // case error: Throwable ⇒ - // channel ! Failure(error) + // sender ! Failure(error) // throw error // } } @@ -204,7 +206,7 @@ class RemoteSystemDaemon(remote: Remote) extends Actor { new LocalActorRef(app, Props( context ⇒ { - case f: Function0[_] ⇒ try { channel ! f() } finally { context.self.stop() } + case f: Function0[_] ⇒ try { sender ! f() } finally { context.self.stop() } }).copy(dispatcher = computeGridDispatcher), app.guardian, Props.randomAddress, systemService = true) forward payloadFor(message, classOf[Function0[Any]]) } @@ -222,7 +224,7 @@ class RemoteSystemDaemon(remote: Remote) extends Actor { new LocalActorRef(app, Props( context ⇒ { - case (fun: Function[_, _], param: Any) ⇒ try { channel ! fun.asInstanceOf[Any ⇒ Any](param) } finally { context.self.stop() } + case (fun: Function[_, _], param: Any) ⇒ try { sender ! fun.asInstanceOf[Any ⇒ Any](param) } finally { context.self.stop() } }).copy(dispatcher = computeGridDispatcher), app.guardian, Props.randomAddress, systemService = true) forward payloadFor(message, classOf[Tuple2[Function1[Any, Any], Any]]) } diff --git a/akka-remote/src/main/scala/akka/remote/RemoteActorRefProvider.scala b/akka-remote/src/main/scala/akka/remote/RemoteActorRefProvider.scala index b87eae50aa..c65c05bff6 100644 --- a/akka-remote/src/main/scala/akka/remote/RemoteActorRefProvider.scala +++ b/akka-remote/src/main/scala/akka/remote/RemoteActorRefProvider.scala @@ -33,7 +33,7 @@ class RemoteActorRefProvider(val app: AkkaApplication) extends ActorRefProvider import java.util.concurrent.ConcurrentHashMap import akka.dispatch.Promise - private[akka] val theOneWhoWalksTheBubblesOfSpaceTime: ActorRef = new UnsupportedActorRef {} + private[akka] val theOneWhoWalksTheBubblesOfSpaceTime: ActorRef = local.theOneWhoWalksTheBubblesOfSpaceTime private[akka] def terminationFuture = new DefaultPromise[AkkaApplication.ExitStatus](Timeout.never)(app.dispatcher) val local = new LocalActorRefProvider(app) @@ -143,7 +143,7 @@ class RemoteActorRefProvider(val app: AkkaApplication) extends ActorRefProvider // FIXME: implement supervision def actorOf(props: RoutedProps, supervisor: ActorRef, address: String): ActorRef = { if (props.connectionManager.isEmpty) throw new ConfigurationException("RoutedProps used for creating actor [" + address + "] has zero connections configured; can't create a router") - new RoutedActorRef(props, address) + new RoutedActorRef(app, props, address) } def actorFor(address: String): Option[ActorRef] = actors.get(address) match { @@ -231,9 +231,9 @@ class RemoteActorRefProvider(val app: AkkaApplication) extends ActorRefProvider * @author Jonas Bonér */ private[akka] case class RemoteActorRef private[akka] ( - val remote: RemoteSupport, - val remoteAddress: InetSocketAddress, - val address: String, + remote: RemoteSupport, + remoteAddress: InetSocketAddress, + address: String, loader: Option[ClassLoader]) extends ActorRef with ScalaActorRef { @@ -246,23 +246,11 @@ private[akka] case class RemoteActorRef private[akka] ( protected[akka] def sendSystemMessage(message: SystemMessage): Unit = unsupported - def postMessageToMailbox(message: Any, channel: UntypedChannel) { - val chSender = if (channel.isInstanceOf[ActorRef]) Some(channel.asInstanceOf[ActorRef]) else None - remote.send[Any](message, chSender, None, remoteAddress, true, this, loader) + def postMessageToMailbox(message: Any, sender: ActorRef) { + remote.send[Any](message, Some(sender), None, remoteAddress, true, this, loader) } - def postMessageToMailboxAndCreateFutureResultWithTimeout( - message: Any, - timeout: Timeout, - channel: UntypedChannel): Future[Any] = { - - val chSender = if (channel.isInstanceOf[ActorRef]) Some(channel.asInstanceOf[ActorRef]) else None - val chFuture = if (channel.isInstanceOf[Promise[_]]) Some(channel.asInstanceOf[Promise[Any]]) else None - val future = remote.send[Any](message, chSender, chFuture, remoteAddress, false, this, loader) - - if (future.isDefined) ActorPromise(future.get)(timeout) - else throw new IllegalActorStateException("Expected a future from remote call to actor " + toString) - } + def ?(message: Any)(implicit timeout: Timeout): Future[Any] = remote.app.provider.ask(message, this, timeout) def suspend(): Unit = unsupported @@ -272,7 +260,7 @@ private[akka] case class RemoteActorRef private[akka] ( synchronized { if (running) { running = false - postMessageToMailbox(Terminate, None) + postMessageToMailbox(new Terminate(), remote.app.deadLetters) } } } diff --git a/akka-remote/src/main/scala/akka/remote/netty/NettyRemoteSupport.scala b/akka-remote/src/main/scala/akka/remote/netty/NettyRemoteSupport.scala index d143b20013..ac29e0d5b1 100644 --- a/akka-remote/src/main/scala/akka/remote/netty/NettyRemoteSupport.scala +++ b/akka-remote/src/main/scala/akka/remote/netty/NettyRemoteSupport.scala @@ -27,7 +27,7 @@ import java.util.concurrent.atomic._ import akka.AkkaException import akka.AkkaApplication import akka.serialization.RemoteActorSerialization -import akka.dispatch.{ Terminate, ActorPromise, DefaultPromise, Promise } +import akka.dispatch.{ Terminate, DefaultPromise, Promise } class RemoteClientMessageBufferException(message: String, cause: Throwable = null) extends AkkaException(message, cause) { def this(msg: String) = this(msg, null); @@ -147,7 +147,7 @@ abstract class RemoteClient private[akka] ( remoteAddress.getAddress.getHostAddress + "::" + remoteAddress.getPort - val serialization = new RemoteActorSerialization(app, remoteSupport) + val serialization = new RemoteActorSerialization(remoteSupport) protected val futures = new ConcurrentHashMap[Uuid, Promise[_]] @@ -587,7 +587,7 @@ class NettyRemoteServer(app: AkkaApplication, serverModule: NettyRemoteServerMod val settings = new RemoteServerSettings(app) import settings._ - val serialization = new RemoteActorSerialization(app, serverModule.remoteSupport) + val serialization = new RemoteActorSerialization(serverModule.remoteSupport) val name = "NettyRemoteServer@" + host + ":" + port val address = new InetSocketAddress(host, port) @@ -952,42 +952,18 @@ class RemoteServerHandler( } val message = MessageSerializer.deserialize(app, request.getMessage) - val sender = - if (request.hasSender) Some(serialization.fromProtobufToRemoteActorRef(request.getSender, applicationLoader)) - else None + val sender = if (request.hasSender) serialization.fromProtobufToRemoteActorRef(request.getSender, applicationLoader) else app.deadLetters message match { // first match on system messages - case Terminate ⇒ - if (UNTRUSTED_MODE) throw new SecurityException("RemoteModule server is operating is untrusted mode, can not stop the actor") - else actorRef.stop() + case _: Terminate ⇒ + if (UNTRUSTED_MODE) throw new SecurityException("RemoteModule server is operating is untrusted mode, can not stop the actor") else actorRef.stop() case _: AutoReceivedMessage if (UNTRUSTED_MODE) ⇒ throw new SecurityException("RemoteModule server is operating is untrusted mode, can not pass on a AutoReceivedMessage to the remote actor") case _ ⇒ // then match on user defined messages - if (request.getOneWay) actorRef.!(message)(sender) - else actorRef.postMessageToMailboxAndCreateFutureResultWithTimeout( - message, - request.getActorInfo.getTimeout, - new ActorPromise(request.getActorInfo.getTimeout). - onComplete(_.value.get match { - case Left(exception) ⇒ write(channel, createErrorReplyMessage(exception, request)) - case r: Right[_, _] ⇒ - val messageBuilder = serialization.createRemoteMessageProtocolBuilder( - Some(actorRef), - Right(request.getUuid), - actorInfo.getAddress, - actorInfo.getTimeout, - r.asInstanceOf[Either[Throwable, Any]], - isOneWay = true, - Some(actorRef)) - - // FIXME lift in the supervisor uuid management into toh createRemoteMessageProtocolBuilder method - if (request.hasSupervisorUuid) messageBuilder.setSupervisorUuid(request.getSupervisorUuid) - - write(channel, RemoteEncoder.encode(messageBuilder.build)) - })) + actorRef.!(message)(sender) } } diff --git a/akka-remote/src/main/scala/akka/serialization/SerializationProtocol.scala b/akka-remote/src/main/scala/akka/serialization/SerializationProtocol.scala index c4bcfce6ab..c49e8c5dbe 100644 --- a/akka-remote/src/main/scala/akka/serialization/SerializationProtocol.scala +++ b/akka-remote/src/main/scala/akka/serialization/SerializationProtocol.scala @@ -28,7 +28,7 @@ import com.eaio.uuid.UUID class ActorSerialization(val app: AkkaApplication, remote: RemoteSupport) { implicit val defaultSerializer = akka.serialization.JavaSerializer // Format.Default - val remoteActorSerialization = new RemoteActorSerialization(app, remote) + val remoteActorSerialization = new RemoteActorSerialization(remote) def fromBinary[T <: Actor](bytes: Array[Byte], homeAddress: InetSocketAddress): ActorRef = fromBinaryToLocalActorRef(bytes, None, Some(homeAddress)) @@ -107,7 +107,7 @@ class ActorSerialization(val app: AkkaApplication, remote: RemoteSupport) { app.AkkaConfig.ActorTimeoutMillis, Right(m.message), false, - m.channel match { + m.sender match { case a: ActorRef ⇒ Some(a) case _ ⇒ None }) @@ -221,7 +221,7 @@ class ActorSerialization(val app: AkkaApplication, remote: RemoteSupport) { } } -class RemoteActorSerialization(val app: AkkaApplication, remote: RemoteSupport) { +class RemoteActorSerialization(remote: RemoteSupport) { /** * Deserializes a byte array (Array[Byte]) into an RemoteActorRef instance. @@ -239,7 +239,7 @@ class RemoteActorSerialization(val app: AkkaApplication, remote: RemoteSupport) * Deserializes a RemoteActorRefProtocol Protocol Buffers (protobuf) Message into an RemoteActorRef instance. */ private[akka] def fromProtobufToRemoteActorRef(protocol: RemoteActorRefProtocol, loader: Option[ClassLoader]): ActorRef = { - app.eventHandler.debug(this, "Deserializing RemoteActorRefProtocol to RemoteActorRef:\n %s".format(protocol)) + remote.app.eventHandler.debug(this, "Deserializing RemoteActorRefProtocol to RemoteActorRef:\n %s".format(protocol)) val ref = RemoteActorRef( remote, @@ -247,7 +247,7 @@ class RemoteActorSerialization(val app: AkkaApplication, remote: RemoteSupport) protocol.getAddress, loader) - app.eventHandler.debug(this, "Newly deserialized RemoteActorRef has uuid: %s".format(ref.uuid)) + remote.app.eventHandler.debug(this, "Newly deserialized RemoteActorRef has uuid: %s".format(ref.uuid)) ref } @@ -261,17 +261,17 @@ class RemoteActorSerialization(val app: AkkaApplication, remote: RemoteSupport) ar.remoteAddress case ar: LocalActorRef ⇒ remote.registerByUuid(ar) - app.defaultAddress + remote.app.defaultAddress case _ ⇒ - app.defaultAddress + remote.app.defaultAddress } - app.eventHandler.debug(this, "Register serialized Actor [%s] as remote @ [%s]".format(actor.uuid, remoteAddress)) + remote.app.eventHandler.debug(this, "Register serialized Actor [%s] as remote @ [%s]".format(actor.uuid, remoteAddress)) RemoteActorRefProtocol.newBuilder .setInetSocketAddress(ByteString.copyFrom(JavaSerializer.toBinary(remoteAddress))) .setAddress(actor.address) - .setTimeout(app.AkkaConfig.ActorTimeoutMillis) + .setTimeout(remote.app.AkkaConfig.ActorTimeoutMillis) .build } @@ -305,7 +305,7 @@ class RemoteActorSerialization(val app: AkkaApplication, remote: RemoteSupport) message match { case Right(message) ⇒ - messageBuilder.setMessage(MessageSerializer.serialize(app, message.asInstanceOf[AnyRef])) + messageBuilder.setMessage(MessageSerializer.serialize(remote.app, message.asInstanceOf[AnyRef])) case Left(exception) ⇒ messageBuilder.setException(ExceptionProtocol.newBuilder .setClassname(exception.getClass.getName) diff --git a/akka-remote/src/multi-jvm/scala/akka/remote/direct_routed/DirectRoutedRemoteActorMultiJvmSpec.scala b/akka-remote/src/multi-jvm/scala/akka/remote/direct_routed/DirectRoutedRemoteActorMultiJvmSpec.scala index c3cfedfc0b..1577066d67 100644 --- a/akka-remote/src/multi-jvm/scala/akka/remote/direct_routed/DirectRoutedRemoteActorMultiJvmSpec.scala +++ b/akka-remote/src/multi-jvm/scala/akka/remote/direct_routed/DirectRoutedRemoteActorMultiJvmSpec.scala @@ -10,7 +10,7 @@ object DirectRoutedRemoteActorMultiJvmSpec { class SomeActor extends Actor with Serializable { def receive = { - case "identify" ⇒ channel ! app.nodename + case "identify" ⇒ sender ! app.nodename } } } diff --git a/akka-remote/src/multi-jvm/scala/akka/remote/new_remote_actor/NewRemoteActorMultiJvmSpec.scala b/akka-remote/src/multi-jvm/scala/akka/remote/new_remote_actor/NewRemoteActorMultiJvmSpec.scala index 375b380f8c..b1e8f793b9 100644 --- a/akka-remote/src/multi-jvm/scala/akka/remote/new_remote_actor/NewRemoteActorMultiJvmSpec.scala +++ b/akka-remote/src/multi-jvm/scala/akka/remote/new_remote_actor/NewRemoteActorMultiJvmSpec.scala @@ -8,7 +8,7 @@ object NewRemoteActorMultiJvmSpec { class SomeActor extends Actor with Serializable { def receive = { - case "identify" ⇒ channel ! app.nodename + case "identify" ⇒ sender ! app.nodename } } } diff --git a/akka-remote/src/multi-jvm/scala/akka/remote/random_routed/RandomRoutedRemoteActorMultiJvmSpec.scala b/akka-remote/src/multi-jvm/scala/akka/remote/random_routed/RandomRoutedRemoteActorMultiJvmSpec.scala index 5001227865..380f4d1712 100644 --- a/akka-remote/src/multi-jvm/scala/akka/remote/random_routed/RandomRoutedRemoteActorMultiJvmSpec.scala +++ b/akka-remote/src/multi-jvm/scala/akka/remote/random_routed/RandomRoutedRemoteActorMultiJvmSpec.scala @@ -9,7 +9,7 @@ object RandomRoutedRemoteActorMultiJvmSpec { val NrOfNodes = 4 class SomeActor extends Actor with Serializable { def receive = { - case "hit" ⇒ channel ! app.nodename + case "hit" ⇒ sender ! app.nodename case "end" ⇒ self.stop() } } diff --git a/akka-remote/src/multi-jvm/scala/akka/remote/round_robin_routed/RoundRobinRoutedRemoteActorMultiJvmSpec.scala b/akka-remote/src/multi-jvm/scala/akka/remote/round_robin_routed/RoundRobinRoutedRemoteActorMultiJvmSpec.scala index afc8fa13fa..a076a91786 100644 --- a/akka-remote/src/multi-jvm/scala/akka/remote/round_robin_routed/RoundRobinRoutedRemoteActorMultiJvmSpec.scala +++ b/akka-remote/src/multi-jvm/scala/akka/remote/round_robin_routed/RoundRobinRoutedRemoteActorMultiJvmSpec.scala @@ -9,7 +9,7 @@ object RoundRobinRoutedRemoteActorMultiJvmSpec { val NrOfNodes = 4 class SomeActor extends Actor with Serializable { def receive = { - case "hit" ⇒ channel ! app.nodename + case "hit" ⇒ sender ! app.nodename case "end" ⇒ self.stop() } } diff --git a/akka-remote/src/test/scala/akka/serialization/ActorSerializeSpec.scala b/akka-remote/src/test/scala/akka/serialization/ActorSerializeSpec.scala index 9eeab66c7a..a7d8b374e7 100644 --- a/akka-remote/src/test/scala/akka/serialization/ActorSerializeSpec.scala +++ b/akka-remote/src/test/scala/akka/serialization/ActorSerializeSpec.scala @@ -129,7 +129,7 @@ class MyJavaSerializableActor extends Actor with scala.Serializable { def receive = { case "hello" ⇒ count = count + 1 - channel ! "world " + count + sender ! "world " + count } } @@ -137,7 +137,7 @@ class MyStatelessActorWithMessagesInMailbox extends Actor with scala.Serializabl def receive = { case "hello" ⇒ Thread.sleep(500) - case "hello-reply" ⇒ channel ! "world" + case "hello-reply" ⇒ sender ! "world" } } @@ -145,7 +145,7 @@ class MyActorWithProtobufMessagesInMailbox extends Actor with scala.Serializable def receive = { case m: Message ⇒ Thread.sleep(500) - case "hello-reply" ⇒ channel ! "world" + case "hello-reply" ⇒ sender ! "world" } } @@ -153,6 +153,6 @@ class PersonActorWithMessagesInMailbox extends Actor with scala.Serializable { def receive = { case p: Person ⇒ Thread.sleep(500) - case "hello-reply" ⇒ channel ! "hello" + case "hello-reply" ⇒ sender ! "hello" } } diff --git a/akka-samples/akka-sample-camel/src/main/java/sample/camel/UntypedConsumer1.java b/akka-samples/akka-sample-camel/src/main/java/sample/camel/UntypedConsumer1.java index dc89a22ceb..718f8f9606 100644 --- a/akka-samples/akka-sample-camel/src/main/java/sample/camel/UntypedConsumer1.java +++ b/akka-samples/akka-sample-camel/src/main/java/sample/camel/UntypedConsumer1.java @@ -15,6 +15,6 @@ public class UntypedConsumer1 extends UntypedConsumerActor { public void onReceive(Object message) { Message msg = (Message)message; String body = msg.getBodyAs(String.class); - channel.tryTell(String.format("received %s", body)); + sender.tell(String.format("received %s", body)); } } diff --git a/akka-samples/akka-sample-camel/src/main/scala/sample/camel/Actors.scala b/akka-samples/akka-sample-camel/src/main/scala/sample/camel/Actors.scala index 35654bc264..f4655c3985 100644 --- a/akka-samples/akka-sample-camel/src/main/scala/sample/camel/Actors.scala +++ b/akka-samples/akka-sample-camel/src/main/scala/sample/camel/Actors.scala @@ -12,7 +12,7 @@ class RemoteActor1 extends Actor with Consumer { def endpointUri = "jetty:http://localhost:6644/camel/remote-actor-1" protected def receive = { - case msg: Message ⇒ channel ! Message("hello %s" format msg.bodyAs[String], Map("sender" -> "remote1")) + case msg: Message ⇒ sender ! Message("hello %s" format msg.bodyAs[String], Map("sender" -> "remote1")) } } @@ -23,7 +23,7 @@ class RemoteActor2 extends Actor with Consumer { def endpointUri = "jetty:http://localhost:6644/camel/remote-actor-2" protected def receive = { - case msg: Message ⇒ channel ! Message("hello %s" format msg.bodyAs[String], Map("sender" -> "remote2")) + case msg: Message ⇒ sender ! Message("hello %s" format msg.bodyAs[String], Map("sender" -> "remote2")) } } @@ -44,7 +44,7 @@ class Consumer2 extends Actor with Consumer { def endpointUri = "jetty:http://0.0.0.0:8877/camel/default" def receive = { - case msg: Message ⇒ channel ! ("Hello %s" format msg.bodyAs[String]) + case msg: Message ⇒ sender ! ("Hello %s" format msg.bodyAs[String]) } } @@ -62,10 +62,10 @@ class Consumer4 extends Actor with Consumer { def receive = { case msg: Message ⇒ msg.bodyAs[String] match { case "stop" ⇒ { - channel ! "Consumer4 stopped" + sender ! "Consumer4 stopped" self.stop } - case body ⇒ channel ! body + case body ⇒ sender ! body } } } @@ -76,7 +76,7 @@ class Consumer5 extends Actor with Consumer { def receive = { case _ ⇒ { Actor.actorOf[Consumer4] - channel ! "Consumer4 started" + sender ! "Consumer4 started" } } } @@ -106,7 +106,7 @@ class PublisherBridge(uri: String, publisher: ActorRef) extends Actor with Consu protected def receive = { case msg: Message ⇒ { publisher ! msg.bodyAs[String] - channel ! "message published" + sender ! "message published" } } } @@ -135,8 +135,8 @@ class HttpProducer(transformer: ActorRef) extends Actor with Producer { class HttpTransformer extends Actor { protected def receive = { - case msg: Message ⇒ channel ! (msg.transformBody { body: String ⇒ body replaceAll ("Akka ", "AKKA ") }) - case msg: Failure ⇒ channel ! msg + case msg: Message ⇒ sender ! (msg.transformBody { body: String ⇒ body replaceAll ("Akka ", "AKKA ") }) + case msg: Failure ⇒ sender ! msg } } @@ -150,11 +150,11 @@ class FileConsumer extends Actor with Consumer { case msg: Message ⇒ { if (counter == 2) { println("received %s" format msg.bodyAs[String]) - channel ! Ack + sender ! Ack } else { println("rejected %s" format msg.bodyAs[String]) counter += 1 - channel ! Failure(new Exception("message number %s not accepted" format counter)) + sender ! Failure(new Exception("message number %s not accepted" format counter)) } } } diff --git a/akka-samples/akka-sample-camel/src/test/java/sample/camel/SampleRemoteUntypedConsumer.java b/akka-samples/akka-sample-camel/src/test/java/sample/camel/SampleRemoteUntypedConsumer.java index cc4c5d8c48..4d90518a11 100644 --- a/akka-samples/akka-sample-camel/src/test/java/sample/camel/SampleRemoteUntypedConsumer.java +++ b/akka-samples/akka-sample-camel/src/test/java/sample/camel/SampleRemoteUntypedConsumer.java @@ -15,7 +15,7 @@ public class SampleRemoteUntypedConsumer extends UntypedConsumerActor { Message msg = (Message)message; String body = msg.getBodyAs(String.class); String header = msg.getHeaderAs("test", String.class); - channel.tryTell(String.format("%s %s", body, header)); + sender().tell(String.format("%s %s", body, header)); } } diff --git a/akka-samples/akka-sample-camel/src/test/scala/sample/camel/HttpConcurrencyTestStress.scala b/akka-samples/akka-sample-camel/src/test/scala/sample/camel/HttpConcurrencyTestStress.scala index f10f050633..6fca5b42f8 100644 --- a/akka-samples/akka-sample-camel/src/test/scala/sample/camel/HttpConcurrencyTestStress.scala +++ b/akka-samples/akka-sample-camel/src/test/scala/sample/camel/HttpConcurrencyTestStress.scala @@ -66,7 +66,7 @@ object HttpConcurrencyTestStress { var correlationIds = Set[Any]() override protected def receive = { - case "getCorrelationIdCount" ⇒ channel ! correlationIds.size + case "getCorrelationIdCount" ⇒ sender ! correlationIds.size case msg ⇒ super.receive(msg) } @@ -93,7 +93,7 @@ object HttpConcurrencyTestStress { class HttpServerWorker extends Actor { protected def receive = { - case msg ⇒ channel ! msg + case msg ⇒ sender ! msg } } } diff --git a/akka-samples/akka-sample-camel/src/test/scala/sample/camel/RemoteConsumerTest.scala b/akka-samples/akka-sample-camel/src/test/scala/sample/camel/RemoteConsumerTest.scala index e5433b1096..aec3a92804 100644 --- a/akka-samples/akka-sample-camel/src/test/scala/sample/camel/RemoteConsumerTest.scala +++ b/akka-samples/akka-sample-camel/src/test/scala/sample/camel/RemoteConsumerTest.scala @@ -94,8 +94,8 @@ object RemoteConsumerTest { def endpointUri = "direct:remote-consumer" protected def receive = { - case "init" ⇒ channel ! "done" - case m: Message ⇒ channel ! ("remote actor: %s" format m.body) + case "init" ⇒ sender ! "done" + case m: Message ⇒ sender ! ("remote actor: %s" format m.body) } } } diff --git a/akka-samples/akka-sample-fsm/src/main/scala/DiningHakkersOnFsm.scala b/akka-samples/akka-sample-fsm/src/main/scala/DiningHakkersOnFsm.scala index 937bb2488c..a54939e789 100644 --- a/akka-samples/akka-sample-fsm/src/main/scala/DiningHakkersOnFsm.scala +++ b/akka-samples/akka-sample-fsm/src/main/scala/DiningHakkersOnFsm.scala @@ -1,6 +1,6 @@ package sample.fsm.dining.fsm -import akka.actor.{ ActorRef, Actor, FSM, UntypedChannel, NullChannel } +import akka.actor.{ ActorRef, Actor, FSM } import akka.actor.FSM._ import akka.util.Duration import akka.util.duration._ @@ -25,7 +25,7 @@ case object Taken extends ChopstickState /** * Some state container for the chopstick */ -case class TakenBy(hakker: UntypedChannel) +case class TakenBy(hakker: ActorRef) /* * A chopstick is an actor, it can be taken, and put back @@ -33,12 +33,12 @@ case class TakenBy(hakker: UntypedChannel) class Chopstick(name: String) extends Actor with FSM[ChopstickState, TakenBy] { // A chopstick begins its existence as available and taken by no one - startWith(Available, TakenBy(NullChannel)) + startWith(Available, TakenBy(app.deadLetters)) // When a chopstick is available, it can be taken by a some hakker when(Available) { case Event(Take, _) ⇒ - goto(Taken) using TakenBy(channel) replying Taken(self) + goto(Taken) using TakenBy(sender) replying Taken(self) } // When a chopstick is taken by a hakker @@ -47,8 +47,8 @@ class Chopstick(name: String) extends Actor with FSM[ChopstickState, TakenBy] { when(Taken) { case Event(Take, currentState) ⇒ stay replying Busy(self) - case Event(Put, TakenBy(hakker)) if channel == hakker ⇒ - goto(Available) using TakenBy(NullChannel) + case Event(Put, TakenBy(hakker)) if sender == hakker ⇒ + goto(Available) using TakenBy(app.deadLetters) } // Initialze the chopstick diff --git a/akka-stm/src/main/scala/akka/agent/Agent.scala b/akka-stm/src/main/scala/akka/agent/Agent.scala index 175bd87c5c..c2d0e1b485 100644 --- a/akka-stm/src/main/scala/akka/agent/Agent.scala +++ b/akka-stm/src/main/scala/akka/agent/Agent.scala @@ -287,10 +287,9 @@ class AgentUpdater[T](agent: Agent[T]) extends Actor { val txFactory = TransactionFactory(familyName = "AgentUpdater", readonly = false) def receive = { - case update: Update[_] ⇒ - channel.tryTell(atomic(txFactory) { agent.ref alter update.function.asInstanceOf[T ⇒ T] }) - case Get ⇒ channel ! agent.get - case _ ⇒ () + case update: Update[_] ⇒ sender.tell(atomic(txFactory) { agent.ref alter update.function.asInstanceOf[T ⇒ T] }) + case Get ⇒ sender ! agent.get + case _ ⇒ } } @@ -302,7 +301,7 @@ class ThreadBasedAgentUpdater[T](agent: Agent[T]) extends Actor { def receive = { case update: Update[_] ⇒ try { - channel.tryTell(atomic(txFactory) { agent.ref alter update.function.asInstanceOf[T ⇒ T] }) + sender.tell(atomic(txFactory) { agent.ref alter update.function.asInstanceOf[T ⇒ T] }) } finally { agent.resume() self.stop() diff --git a/akka-stm/src/test/java/akka/transactor/example/UntypedCoordinatedCounter.java b/akka-stm/src/test/java/akka/transactor/example/UntypedCoordinatedCounter.java index 035c195c7e..3d76ff37c2 100644 --- a/akka-stm/src/test/java/akka/transactor/example/UntypedCoordinatedCounter.java +++ b/akka-stm/src/test/java/akka/transactor/example/UntypedCoordinatedCounter.java @@ -32,7 +32,7 @@ public class UntypedCoordinatedCounter extends UntypedActor { } else if (incoming instanceof String) { String message = (String) incoming; if (message.equals("GetCount")) { - getChannel().tell(count.get()); + getSender().tell(count.get()); } } } diff --git a/akka-stm/src/test/java/akka/transactor/example/UntypedCounter.java b/akka-stm/src/test/java/akka/transactor/example/UntypedCounter.java index 377e3560da..b580ee88f8 100644 --- a/akka-stm/src/test/java/akka/transactor/example/UntypedCounter.java +++ b/akka-stm/src/test/java/akka/transactor/example/UntypedCounter.java @@ -26,7 +26,7 @@ public class UntypedCounter extends UntypedTransactor { @Override public boolean normally(Object message) { if ("GetCount".equals(message)) { - getChannel().tell(count.get()); + getSender().tell(count.get()); return true; } else return false; } diff --git a/akka-stm/src/test/java/akka/transactor/test/UntypedCoordinatedCounter.java b/akka-stm/src/test/java/akka/transactor/test/UntypedCoordinatedCounter.java index 90636b99f3..2ac3731f06 100644 --- a/akka-stm/src/test/java/akka/transactor/test/UntypedCoordinatedCounter.java +++ b/akka-stm/src/test/java/akka/transactor/test/UntypedCoordinatedCounter.java @@ -57,7 +57,7 @@ public class UntypedCoordinatedCounter extends UntypedActor { } else if (incoming instanceof String) { String message = (String) incoming; if (message.equals("GetCount")) { - getChannel().tell(count.get()); + getSender().tell(count.get()); } } } diff --git a/akka-stm/src/test/java/akka/transactor/test/UntypedCounter.java b/akka-stm/src/test/java/akka/transactor/test/UntypedCounter.java index 4e3f3fde71..d4d53b084c 100644 --- a/akka-stm/src/test/java/akka/transactor/test/UntypedCounter.java +++ b/akka-stm/src/test/java/akka/transactor/test/UntypedCounter.java @@ -70,7 +70,7 @@ public class UntypedCounter extends UntypedTransactor { @Override public boolean normally(Object message) { if ("GetCount".equals(message)) { - getChannel().tell(count.get()); + getSender().tell(count.get()); return true; } else return false; } diff --git a/akka-stm/src/test/scala/transactor/CoordinatedIncrementSpec.scala b/akka-stm/src/test/scala/transactor/CoordinatedIncrementSpec.scala index 284786ef5a..41d6f787a5 100644 --- a/akka-stm/src/test/scala/transactor/CoordinatedIncrementSpec.scala +++ b/akka-stm/src/test/scala/transactor/CoordinatedIncrementSpec.scala @@ -34,7 +34,7 @@ object CoordinatedIncrement { } } - case GetCount ⇒ channel ! count.get + case GetCount ⇒ sender ! count.get } } diff --git a/akka-stm/src/test/scala/transactor/FickleFriendsSpec.scala b/akka-stm/src/test/scala/transactor/FickleFriendsSpec.scala index e4b0eed68e..2d54032413 100644 --- a/akka-stm/src/test/scala/transactor/FickleFriendsSpec.scala +++ b/akka-stm/src/test/scala/transactor/FickleFriendsSpec.scala @@ -56,7 +56,7 @@ object FickleFriends { } } - case GetCount ⇒ channel ! count.get + case GetCount ⇒ sender ! count.get } } @@ -93,7 +93,7 @@ object FickleFriends { } } - case GetCount ⇒ channel ! count.get + case GetCount ⇒ sender ! count.get } } } diff --git a/akka-stm/src/test/scala/transactor/TransactorSpec.scala b/akka-stm/src/test/scala/transactor/TransactorSpec.scala index 7c8dda761a..fef06f91e1 100644 --- a/akka-stm/src/test/scala/transactor/TransactorSpec.scala +++ b/akka-stm/src/test/scala/transactor/TransactorSpec.scala @@ -49,7 +49,7 @@ object TransactorIncrement { } override def normally = { - case GetCount ⇒ channel ! count.get + case GetCount ⇒ sender ! count.get } } diff --git a/akka-testkit/src/main/scala/akka/testkit/CallingThreadDispatcher.scala b/akka-testkit/src/main/scala/akka/testkit/CallingThreadDispatcher.scala index ea38de78a1..b65af2be6c 100644 --- a/akka-testkit/src/main/scala/akka/testkit/CallingThreadDispatcher.scala +++ b/akka-testkit/src/main/scala/akka/testkit/CallingThreadDispatcher.scala @@ -165,18 +165,12 @@ class CallingThreadDispatcher(_app: AkkaApplication, val name: String = "calling val queue = mbox.queue val execute = mbox.suspendSwitch.fold { queue.push(handle) - if (warnings && handle.channel.isInstanceOf[Promise[_]]) { - app.eventHandler.warning(this, "suspendSwitch, creating Future could deadlock; target: %s" format receiver) - } false } { queue.push(handle) - if (queue.isActive) { - if (warnings && handle.channel.isInstanceOf[Promise[_]]) { - app.eventHandler.warning(this, "blocked on this thread, creating Future could deadlock; target: %s" format receiver) - } + if (queue.isActive) false - } else { + else { queue.enter true } @@ -214,11 +208,6 @@ class CallingThreadDispatcher(_app: AkkaApplication, val name: String = "calling try { if (Mailbox.debug) println(mbox.actor + " processing message " + handle) mbox.actor.invoke(handle) - if (warnings) handle.channel match { - case f: ActorPromise if !f.isCompleted ⇒ - app.eventHandler.warning(this, "calling %s with message %s did not reply as expected, might deadlock" format (mbox.actor, handle.message)) - case _ ⇒ - } true } catch { case ie: InterruptedException ⇒ diff --git a/akka-testkit/src/main/scala/akka/testkit/TestKit.scala b/akka-testkit/src/main/scala/akka/testkit/TestKit.scala index c7fc73bb05..c3df4e1177 100644 --- a/akka-testkit/src/main/scala/akka/testkit/TestKit.scala +++ b/akka-testkit/src/main/scala/akka/testkit/TestKit.scala @@ -20,12 +20,12 @@ object TestActor { trait Message { def msg: AnyRef - def channel: UntypedChannel + def sender: ActorRef } - case class RealMessage(msg: AnyRef, channel: UntypedChannel) extends Message + case class RealMessage(msg: AnyRef, sender: ActorRef) extends Message case object NullMessage extends Message { override def msg: AnyRef = throw new IllegalActorStateException("last receive did not dequeue a message") - override def channel: UntypedChannel = throw new IllegalActorStateException("last receive did not dequeue a message") + override def sender: ActorRef = throw new IllegalActorStateException("last receive did not dequeue a message") } } @@ -44,7 +44,7 @@ class TestActor(queue: BlockingDeque[TestActor.Message]) extends Actor with FSM[ case Event(x: AnyRef, data) ⇒ val observe = data map (ignoreFunc ⇒ if (ignoreFunc isDefinedAt x) !ignoreFunc(x) else true) getOrElse true if (observe) - queue.offerLast(RealMessage(x, channel)) + queue.offerLast(RealMessage(x, sender)) stay } @@ -579,13 +579,13 @@ class TestProbe(_application: AkkaApplication) extends TestKit(_application) { * Forward this message as if in the TestActor's receive method with self.forward. */ def forward(actor: ActorRef, msg: AnyRef = lastMessage.msg) { - actor.!(msg)(lastMessage.channel) + actor.!(msg)(lastMessage.sender) } /** - * Get channel of last received message. + * Get sender of last received message. */ - def channel = lastMessage.channel + def sender = lastMessage.sender } diff --git a/akka-testkit/src/test/scala/akka/testkit/TestActorRefSpec.scala b/akka-testkit/src/test/scala/akka/testkit/TestActorRefSpec.scala index 3fb594a91e..c5a989c17e 100644 --- a/akka-testkit/src/test/scala/akka/testkit/TestActorRefSpec.scala +++ b/akka-testkit/src/test/scala/akka/testkit/TestActorRefSpec.scala @@ -8,6 +8,7 @@ import org.scalatest.{ BeforeAndAfterEach, WordSpec } import akka.actor._ import akka.event.EventHandler import akka.dispatch.{ Future, Promise } +import akka.util.duration._ import akka.AkkaApplication /** @@ -36,31 +37,27 @@ object TestActorRefSpec { } class ReplyActor extends TActor { - var replyTo: Channel[Any] = null + var replyTo: ActorRef = null def receiveT = { case "complexRequest" ⇒ { - replyTo = channel + replyTo = sender val worker = TestActorRef(Props[WorkerActor]) worker ! "work" } case "complexRequest2" ⇒ val worker = TestActorRef(Props[WorkerActor]) - worker ! channel + worker ! sender case "workDone" ⇒ replyTo ! "complexReply" - case "simpleRequest" ⇒ channel ! "simpleReply" + case "simpleRequest" ⇒ sender ! "simpleReply" } } class WorkerActor() extends TActor { def receiveT = { - case "work" ⇒ { - channel ! "workDone" - self.stop() - } - case replyTo: UntypedChannel ⇒ { - replyTo ! "complexReply" - } + case "work" ⇒ sender ! "workDone"; self.stop() + case replyTo: Promise[Any] ⇒ replyTo.completeWithResult("complexReply") + case replyTo: ActorRef ⇒ replyTo ! "complexReply" } } @@ -110,7 +107,7 @@ class TestActorRefSpec extends AkkaSpec with BeforeAndAfterEach { "used with TestActorRef" in { val a = TestActorRef(Props(new Actor { val nested = TestActorRef(Props(self ⇒ { case _ ⇒ })) - def receive = { case _ ⇒ channel ! nested } + def receive = { case _ ⇒ sender ! nested } })) a must not be (null) val nested = (a ? "any").as[ActorRef].get @@ -121,7 +118,7 @@ class TestActorRefSpec extends AkkaSpec with BeforeAndAfterEach { "used with ActorRef" in { val a = TestActorRef(Props(new Actor { val nested = context.actorOf(Props(self ⇒ { case _ ⇒ })) - def receive = { case _ ⇒ channel ! nested } + def receive = { case _ ⇒ sender ! nested } })) a must not be (null) val nested = (a ? "any").as[ActorRef].get @@ -131,7 +128,7 @@ class TestActorRefSpec extends AkkaSpec with BeforeAndAfterEach { } - "support reply via channel" in { + "support reply via sender" in { val serverRef = TestActorRef(Props[ReplyActor]) val clientRef = TestActorRef(Props(new SenderActor(serverRef))) @@ -159,8 +156,10 @@ class TestActorRefSpec extends AkkaSpec with BeforeAndAfterEach { "stop when sent a poison pill" in { filterEvents(EventFilter[ActorKilledException]) { val a = TestActorRef(Props[WorkerActor]) - intercept[ActorKilledException] { - (a ? PoisonPill).get + testActor startsMonitoring a + a.!(PoisonPill)(testActor) + expectMsgPF(5 seconds) { + case Terminated(`a`) ⇒ true } a must be('shutdown) assertThread @@ -224,8 +223,8 @@ class TestActorRefSpec extends AkkaSpec with BeforeAndAfterEach { "proxy apply for the underlying actor" in { val ref = TestActorRef[WorkerActor] - intercept[IllegalActorStateException] { ref("work") } - val ch = Promise.channel(5000) + ref("work") + val ch = Promise[String](5000) ref ! ch ch must be('completed) ch.get must be("complexReply") diff --git a/akka-testkit/src/test/scala/akka/testkit/TestProbeSpec.scala b/akka-testkit/src/test/scala/akka/testkit/TestProbeSpec.scala index 930e5c1454..c2842df0d6 100644 --- a/akka-testkit/src/test/scala/akka/testkit/TestProbeSpec.scala +++ b/akka-testkit/src/test/scala/akka/testkit/TestProbeSpec.scala @@ -17,7 +17,7 @@ class TestProbeSpec extends AkkaSpec { val tk = TestProbe() val future = tk.ref ? "hello" tk.expectMsg(0 millis, "hello") // TestActor runs on CallingThreadDispatcher - tk.lastMessage.channel ! "world" + tk.lastMessage.sender ! "world" future must be('completed) future.get must equal("world") } @@ -27,7 +27,7 @@ class TestProbeSpec extends AkkaSpec { val tk2 = TestProbe() tk1.ref.!("hello")(tk2.ref) tk1.expectMsg(0 millis, "hello") - tk1.lastMessage.channel ! "world" + tk1.lastMessage.sender ! "world" tk2.expectMsg(0 millis, "world") } @@ -36,7 +36,7 @@ class TestProbeSpec extends AkkaSpec { val probe2 = TestProbe() probe1.send(probe2.ref, "hello") probe2.expectMsg(0 millis, "hello") - probe2.lastMessage.channel ! "world" + probe2.lastMessage.sender ! "world" probe1.expectMsg(0 millis, "world") } diff --git a/akka-tutorials/akka-tutorial-first/src/main/java/akka/tutorial/first/java/Pi.java b/akka-tutorials/akka-tutorial-first/src/main/java/akka/tutorial/first/java/Pi.java index 1a179052ec..fbb3a2cc14 100644 --- a/akka-tutorials/akka-tutorial-first/src/main/java/akka/tutorial/first/java/Pi.java +++ b/akka-tutorials/akka-tutorial-first/src/main/java/akka/tutorial/first/java/Pi.java @@ -83,7 +83,7 @@ public class Pi { double result = calculatePiFor(work.getStart(), work.getNrOfElements()); // reply with the result - getChannel().tell(new Result(result)); + getSender().tell(new Result(result)); } else throw new IllegalArgumentException("Unknown message [" + message + "]"); } diff --git a/akka-tutorials/akka-tutorial-first/src/main/scala/Pi.scala b/akka-tutorials/akka-tutorial-first/src/main/scala/Pi.scala index 05e05abf20..eff1767bbf 100644 --- a/akka-tutorials/akka-tutorial-first/src/main/scala/Pi.scala +++ b/akka-tutorials/akka-tutorial-first/src/main/scala/Pi.scala @@ -42,8 +42,7 @@ object Pi extends App { } def receive = { - case Work(start, nrOfElements) ⇒ - channel ! Result(calculatePiFor(start, nrOfElements)) // perform the work + case Work(start, nrOfElements) ⇒ sender ! Result(calculatePiFor(start, nrOfElements)) // perform the work } } diff --git a/akka-tutorials/akka-tutorial-second/src/main/java/akka/tutorial/java/second/Pi.java b/akka-tutorials/akka-tutorial-second/src/main/java/akka/tutorial/java/second/Pi.java index 55cd4dbe66..b1e3071237 100644 --- a/akka-tutorials/akka-tutorial-second/src/main/java/akka/tutorial/java/second/Pi.java +++ b/akka-tutorials/akka-tutorial-second/src/main/java/akka/tutorial/java/second/Pi.java @@ -15,7 +15,6 @@ import akka.routing.LocalConnectionManager; import scala.Option; import akka.actor.ActorRef; import akka.actor.Actors; -import akka.actor.Channel; import akka.actor.UntypedActor; import akka.actor.UntypedActorFactory; import akka.dispatch.Future; @@ -80,7 +79,7 @@ public class Pi { public void onReceive(Object message) { if (message instanceof Work) { Work work = (Work) message; - getChannel().tell(new Result(calculatePiFor(work.getArg(), work.getNrOfElements()))); // perform the work + getSender().tell(new Result(calculatePiFor(work.getArg(), work.getNrOfElements()))); // perform the work } else throw new IllegalArgumentException("Unknown message [" + message + "]"); } } @@ -127,11 +126,11 @@ public class Pi { router.tell(new Work(arg, nrOfElements), getSelf()); } // Assume the gathering behavior - become(gather(getChannel())); + become(gather(getSender())); } }; - private Procedure gather(final Channel recipient) { + private Procedure gather(final ActorRef recipient) { return new Procedure() { public void apply(Object msg) { // handle result from the worker @@ -174,7 +173,7 @@ public class Pi { // send calculate message long timeout = 60000; - Future replyFuture = master.ask(new Calculate(), timeout, null); + Future replyFuture = master.ask(new Calculate(), timeout); Option result = replyFuture.await().resultOrException(); if (result.isDefined()) { double pi = (Double) result.get(); diff --git a/akka-tutorials/akka-tutorial-second/src/main/scala/Pi.scala b/akka-tutorials/akka-tutorial-second/src/main/scala/Pi.scala index 67841c7a60..51d98bf7f9 100644 --- a/akka-tutorials/akka-tutorial-second/src/main/scala/Pi.scala +++ b/akka-tutorials/akka-tutorial-second/src/main/scala/Pi.scala @@ -8,9 +8,9 @@ import akka.actor.Actor._ import akka.event.EventHandler import System.{ currentTimeMillis ⇒ now } import akka.routing.Routing.Broadcast -import akka.actor.{ Timeout, Channel, Actor, PoisonPill } import akka.routing._ import akka.AkkaApplication +import akka.actor.{ ActorRef, Timeout, Actor, PoisonPill } object Pi extends App { @@ -40,8 +40,7 @@ object Pi extends App { } def receive = { - case Work(arg, nrOfElements) ⇒ - channel ! Result(calculatePiFor(arg, nrOfElements)) // perform the work + case Work(arg, nrOfElements) ⇒ sender ! Result(calculatePiFor(arg, nrOfElements)) // perform the work } } @@ -67,11 +66,11 @@ object Pi extends App { for (arg ← 0 until nrOfMessages) router ! Work(arg, nrOfElements) //Assume the gathering behavior - this become gather(channel) + this become gather(sender) } // phase 2, aggregate the results of the Calculation - def gather(recipient: Channel[Any]): Receive = { + def gather(recipient: ActorRef): Receive = { case Result(value) ⇒ // handle result from the worker pi += value From 3e3cf86bdf41c4b53b87983fa749b149d2974d29 Mon Sep 17 00:00:00 2001 From: Viktor Klang Date: Sun, 23 Oct 2011 18:40:00 +0200 Subject: [PATCH 14/57] Removing futures from the remoting --- .../scala/akka/remote/RemoteInterface.scala | 16 +- .../src/main/scala/akka/remote/Remote.scala | 2 +- .../akka/remote/RemoteActorRefProvider.scala | 6 +- .../main/scala/akka/remote/RemoteConfig.scala | 1 - .../remote/netty/NettyRemoteSupport.scala | 136 ++--------- .../serialization/SerializationProtocol.scala | 220 +----------------- .../serialization/ActorSerializeSpec.scala | 158 ------------- 7 files changed, 30 insertions(+), 509 deletions(-) delete mode 100644 akka-remote/src/test/scala/akka/serialization/ActorSerializeSpec.scala diff --git a/akka-actor/src/main/scala/akka/remote/RemoteInterface.scala b/akka-actor/src/main/scala/akka/remote/RemoteInterface.scala index c1050c7842..99cfbccc0c 100644 --- a/akka-actor/src/main/scala/akka/remote/RemoteInterface.scala +++ b/akka-actor/src/main/scala/akka/remote/RemoteInterface.scala @@ -321,16 +321,10 @@ trait RemoteServerModule extends RemoteModule { this: RemoteSupport ⇒ trait RemoteClientModule extends RemoteModule { self: RemoteSupport ⇒ def actorFor(address: String, hostname: String, port: Int): ActorRef = - actorFor(address, app.AkkaConfig.ActorTimeoutMillis, hostname, port, None) + actorFor(address, hostname, port, None) def actorFor(address: String, hostname: String, port: Int, loader: ClassLoader): ActorRef = - actorFor(address, app.AkkaConfig.ActorTimeoutMillis, hostname, port, Some(loader)) - - def actorFor(address: String, timeout: Long, hostname: String, port: Int): ActorRef = - actorFor(address, timeout, hostname, port, None) - - def actorFor(address: String, timeout: Long, hostname: String, port: Int, loader: ClassLoader): ActorRef = - actorFor(address, timeout, hostname, port, Some(loader)) + actorFor(address, hostname, port, Some(loader)) /** * Clean-up all open connections. @@ -349,13 +343,11 @@ trait RemoteClientModule extends RemoteModule { self: RemoteSupport ⇒ /** Methods that needs to be implemented by a transport **/ - protected[akka] def actorFor(address: String, timeout: Long, hostname: String, port: Int, loader: Option[ClassLoader]): ActorRef + protected[akka] def actorFor(address: String, hostname: String, port: Int, loader: Option[ClassLoader]): ActorRef protected[akka] def send[T](message: Any, senderOption: Option[ActorRef], - senderFuture: Option[Promise[T]], remoteAddress: InetSocketAddress, - isOneWay: Boolean, actorRef: ActorRef, - loader: Option[ClassLoader]): Option[Promise[T]] + loader: Option[ClassLoader]): Unit } diff --git a/akka-remote/src/main/scala/akka/remote/Remote.scala b/akka-remote/src/main/scala/akka/remote/Remote.scala index 82c3ea823d..2d78b2f306 100644 --- a/akka-remote/src/main/scala/akka/remote/Remote.scala +++ b/akka-remote/src/main/scala/akka/remote/Remote.scala @@ -13,7 +13,7 @@ import akka.util._ import akka.util.duration._ import akka.util.Helpers._ import akka.actor.DeploymentConfig._ -import akka.serialization.{ Serialization, Serializer, ActorSerialization, Compression } +import akka.serialization.{ Serialization, Serializer, Compression } import akka.serialization.Compression.LZF import akka.remote.RemoteProtocol._ import akka.remote.RemoteProtocol.RemoteSystemDaemonMessageType._ diff --git a/akka-remote/src/main/scala/akka/remote/RemoteActorRefProvider.scala b/akka-remote/src/main/scala/akka/remote/RemoteActorRefProvider.scala index c65c05bff6..4981e5244a 100644 --- a/akka-remote/src/main/scala/akka/remote/RemoteActorRefProvider.scala +++ b/akka-remote/src/main/scala/akka/remote/RemoteActorRefProvider.scala @@ -13,7 +13,7 @@ import akka.dispatch._ import akka.util.duration._ import akka.config.ConfigurationException import akka.event.{ DeathWatch, EventHandler } -import akka.serialization.{ Serialization, Serializer, ActorSerialization, Compression } +import akka.serialization.{ Serialization, Serializer, Compression } import akka.serialization.Compression.LZF import akka.remote.RemoteProtocol._ import akka.remote.RemoteProtocol.RemoteSystemDaemonMessageType._ @@ -247,7 +247,7 @@ private[akka] case class RemoteActorRef private[akka] ( protected[akka] def sendSystemMessage(message: SystemMessage): Unit = unsupported def postMessageToMailbox(message: Any, sender: ActorRef) { - remote.send[Any](message, Some(sender), None, remoteAddress, true, this, loader) + remote.send[Any](message, Some(sender), remoteAddress, this, loader) } def ?(message: Any)(implicit timeout: Timeout): Future[Any] = remote.app.provider.ask(message, this, timeout) @@ -260,7 +260,7 @@ private[akka] case class RemoteActorRef private[akka] ( synchronized { if (running) { running = false - postMessageToMailbox(new Terminate(), remote.app.deadLetters) + remote.send[Any](new Terminate(), None, remoteAddress, this, loader) } } } diff --git a/akka-remote/src/main/scala/akka/remote/RemoteConfig.scala b/akka-remote/src/main/scala/akka/remote/RemoteConfig.scala index a1af20f8bc..4cae594a68 100644 --- a/akka-remote/src/main/scala/akka/remote/RemoteConfig.scala +++ b/akka-remote/src/main/scala/akka/remote/RemoteConfig.scala @@ -21,7 +21,6 @@ class RemoteClientSettings(val app: AkkaApplication) { val RECONNECTION_TIME_WINDOW = Duration(config.getInt("akka.remote.client.reconnection-time-window", 600), DefaultTimeUnit).toMillis val READ_TIMEOUT = Duration(config.getInt("akka.remote.client.read-timeout", 3600), DefaultTimeUnit) val RECONNECT_DELAY = Duration(config.getInt("akka.remote.client.reconnect-delay", 5), DefaultTimeUnit) - val REAP_FUTURES_DELAY = Duration(config.getInt("akka.remote.client.reap-futures-delay", 5), DefaultTimeUnit) val MESSAGE_FRAME_SIZE = config.getInt("akka.remote.client.message-frame-size", 1048576) } diff --git a/akka-remote/src/main/scala/akka/remote/netty/NettyRemoteSupport.scala b/akka-remote/src/main/scala/akka/remote/netty/NettyRemoteSupport.scala index ac29e0d5b1..16c910dfcd 100644 --- a/akka-remote/src/main/scala/akka/remote/netty/NettyRemoteSupport.scala +++ b/akka-remote/src/main/scala/akka/remote/netty/NettyRemoteSupport.scala @@ -57,14 +57,10 @@ trait NettyRemoteClientModule extends RemoteClientModule { protected[akka] def send[T](message: Any, senderOption: Option[ActorRef], - senderFuture: Option[Promise[T]], remoteAddress: InetSocketAddress, - isOneWay: Boolean, actorRef: ActorRef, - loader: Option[ClassLoader]): Option[Promise[T]] = - withClientFor(remoteAddress, loader) { client ⇒ - client.send[T](message, senderOption, senderFuture, remoteAddress, isOneWay, actorRef) - } + loader: Option[ClassLoader]): Unit = + withClientFor(remoteAddress, loader) { _.send[T](message, senderOption, remoteAddress, actorRef) } private[akka] def withClientFor[T]( address: InetSocketAddress, loader: Option[ClassLoader])(body: RemoteClient ⇒ T): T = { @@ -125,9 +121,7 @@ trait NettyRemoteClientModule extends RemoteClientModule { } def shutdownRemoteClients() = lock withWriteGuard { - remoteClients.foreach({ - case (addr, client) ⇒ client.shutdown() - }) + remoteClients foreach { case (_, client) ⇒ client.shutdown() } remoteClients.clear() } } @@ -149,8 +143,6 @@ abstract class RemoteClient private[akka] ( val serialization = new RemoteActorSerialization(remoteSupport) - protected val futures = new ConcurrentHashMap[Uuid, Promise[_]] - private[remote] val runSwitch = new Switch() private[remote] def isRunning = runSwitch.isOn @@ -166,74 +158,28 @@ abstract class RemoteClient private[akka] ( /** * Converts the message to the wireprotocol and sends the message across the wire */ - def send[T]( - message: Any, - senderOption: Option[ActorRef], - senderFuture: Option[Promise[T]], - remoteAddress: InetSocketAddress, - isOneWay: Boolean, - actorRef: ActorRef): Option[Promise[T]] = { - val messageProtocol = serialization.createRemoteMessageProtocolBuilder( - Some(actorRef), Left(actorRef.uuid), actorRef.address, app.AkkaConfig.ActorTimeoutMillis, Right(message), isOneWay, senderOption).build - send(messageProtocol, senderFuture) + def send[T](message: Any, senderOption: Option[ActorRef], remoteAddress: InetSocketAddress, actorRef: ActorRef) { + val messageProtocol = serialization.createRemoteMessageProtocolBuilder(Some(actorRef), Left(actorRef.uuid), actorRef.address, app.AkkaConfig.ActorTimeoutMillis, Right(message), senderOption).build + send(messageProtocol) } /** * Sends the message across the wire */ - def send[T]( - request: RemoteMessageProtocol, - senderFuture: Option[Promise[T]]): Option[Promise[T]] = { - - if (isRunning) { + def send[T](request: RemoteMessageProtocol) { + if (isRunning) { //TODO FIXME RACY app.eventHandler.debug(this, "Sending to connection [%s] message [\n%s]".format(remoteAddress, request)) // tell - if (request.getOneWay) { - try { - val future = currentChannel.write(RemoteEncoder.encode(request)) - future.awaitUninterruptibly() - if (!future.isCancelled && !future.isSuccess) { - notifyListeners(RemoteClientWriteFailed(request, future.getCause, module, remoteAddress)) - } - } catch { - case e: Exception ⇒ notifyListeners(RemoteClientError(e, module, remoteAddress)) + try { + val future = currentChannel.write(RemoteEncoder.encode(request)) + future.awaitUninterruptibly() //TODO FIXME SWITCH TO NONBLOCKING WRITE + if (!future.isCancelled && !future.isSuccess) { + notifyListeners(RemoteClientWriteFailed(request, future.getCause, module, remoteAddress)) } - None - - // ask - } else { - val futureResult = - if (senderFuture.isDefined) senderFuture.get - else new DefaultPromise[T](request.getActorInfo.getTimeout)(app.dispatcher) - - val futureUuid = uuidFrom(request.getUuid.getHigh, request.getUuid.getLow) - futures.put(futureUuid, futureResult) // Add future prematurely, remove it if write fails - - def handleRequestReplyError(future: ChannelFuture) = { - val f = futures.remove(futureUuid) // Clean up future - if (f ne null) f.completeWithException(future.getCause) - } - - var future: ChannelFuture = null - try { - // try to send the original one - future = currentChannel.write(RemoteEncoder.encode(request)) - future.awaitUninterruptibly() - - if (future.isCancelled || !future.isSuccess) { - notifyListeners(RemoteClientWriteFailed(request, future.getCause, module, remoteAddress)) - handleRequestReplyError(future) - } - - } catch { - case e: Exception ⇒ - notifyListeners(RemoteClientWriteFailed(request, e, module, remoteAddress)) - handleRequestReplyError(future) - } - Some(futureResult) + } catch { + case e: Exception ⇒ notifyListeners(RemoteClientError(e, module, remoteAddress)) } - } else { val exception = new RemoteClientException("RemoteModule client is not running, make sure you have invoked 'RemoteClient.connect()' before using it.", module, remoteAddress) notifyListeners(RemoteClientError(exception, module, remoteAddress)) @@ -314,7 +260,7 @@ class ActiveRemoteClient private[akka] ( timer = new HashedWheelTimer bootstrap = new ClientBootstrap(new NioClientSocketChannelFactory(Executors.newCachedThreadPool, Executors.newCachedThreadPool)) - bootstrap.setPipelineFactory(new ActiveRemoteClientPipelineFactory(app, settings, name, futures, bootstrap, remoteAddress, timer, this)) + bootstrap.setPipelineFactory(new ActiveRemoteClientPipelineFactory(app, settings, name, bootstrap, remoteAddress, timer, this)) bootstrap.setOption("tcpNoDelay", true) bootstrap.setOption("keepAlive", true) @@ -329,23 +275,8 @@ class ActiveRemoteClient private[akka] ( notifyListeners(RemoteClientError(connection.getCause, module, remoteAddress)) app.eventHandler.error(connection.getCause, this, "Remote client connection to [%s] has failed".format(remoteAddress)) false - } else { sendSecureCookie(connection) - - //Add a task that does GCing of expired Futures - timer.newTimeout(new TimerTask() { - def run(timeout: Timeout) = { - if (isRunning) { - val i = futures.entrySet.iterator - while (i.hasNext) { - val e = i.next - if (e.getValue.isExpired) - futures.remove(e.getKey) - } - } - } - }, REAP_FUTURES_DELAY.length, REAP_FUTURES_DELAY.unit) notifyListeners(RemoteClientStarted(module, remoteAddress)) true } @@ -400,7 +331,6 @@ class ActiveRemoteClientPipelineFactory( app: AkkaApplication, val settings: RemoteClientSettings, name: String, - futures: ConcurrentMap[Uuid, Promise[_]], bootstrap: ClientBootstrap, remoteAddress: InetSocketAddress, timer: HashedWheelTimer, @@ -414,7 +344,7 @@ class ActiveRemoteClientPipelineFactory( val lenPrep = new LengthFieldPrepender(4) val protobufDec = new ProtobufDecoder(AkkaRemoteProtocol.getDefaultInstance) val protobufEnc = new ProtobufEncoder - val remoteClient = new ActiveRemoteClientHandler(app, settings, name, futures, bootstrap, remoteAddress, timer, client) + val remoteClient = new ActiveRemoteClientHandler(app, settings, name, bootstrap, remoteAddress, timer, client) new StaticChannelPipeline(timeout, lenDec, protobufDec, lenPrep, protobufEnc, remoteClient) } @@ -428,7 +358,6 @@ class ActiveRemoteClientHandler( val app: AkkaApplication, val settings: RemoteClientSettings, val name: String, - val futures: ConcurrentMap[Uuid, Promise[_]], val bootstrap: ClientBootstrap, val remoteAddress: InetSocketAddress, val timer: HashedWheelTimer, @@ -453,20 +382,7 @@ class ActiveRemoteClientHandler( val replyUuid = uuidFrom(reply.getActorInfo.getUuid.getHigh, reply.getActorInfo.getUuid.getLow) app.eventHandler.debug(this, "Remote client received RemoteMessageProtocol[\n%s]\nTrying to map back to future [%s]".format(reply, replyUuid)) - futures.remove(replyUuid).asInstanceOf[Promise[Any]] match { - case null ⇒ - client.notifyListeners(RemoteClientError( - new IllegalActorStateException("Future mapped to UUID " + replyUuid + " does not exist"), client.module, - client.remoteAddress)) - - case future ⇒ - if (reply.hasMessage) { - val message = MessageSerializer.deserialize(app, reply.getMessage) - future.completeWithResult(message) - } else { - future.completeWithException(parseException(reply, client.loader)) - } - } + //TODO FIXME DOESN'T DO ANYTHING ANYMORE case other ⇒ throw new RemoteClientException("Unknown message received in remote client handler: " + other, client.module, client.remoteAddress) @@ -556,12 +472,7 @@ class NettyRemoteSupport(_app: AkkaApplication) extends RemoteSupport(_app) with def optimizeLocalScoped_?() = optimizeLocal.get - protected[akka] def actorFor( - actorAddress: String, - timeout: Long, - host: String, - port: Int, - loader: Option[ClassLoader]): ActorRef = { + protected[akka] def actorFor(actorAddress: String, host: String, port: Int, loader: Option[ClassLoader]): ActorRef = { val homeInetSocketAddress = this.address if (optimizeLocalScoped_?) { @@ -1023,14 +934,7 @@ class RemoteServerHandler( private def createErrorReplyMessage(exception: Throwable, request: RemoteMessageProtocol): AkkaRemoteProtocol = { val actorInfo = request.getActorInfo - val messageBuilder = serialization.createRemoteMessageProtocolBuilder( - None, - Right(request.getUuid), - actorInfo.getAddress, - actorInfo.getTimeout, - Left(exception), - true, - None) + val messageBuilder = serialization.createRemoteMessageProtocolBuilder(None, Right(request.getUuid), actorInfo.getAddress, actorInfo.getTimeout, Left(exception), None) if (request.hasSupervisorUuid) messageBuilder.setSupervisorUuid(request.getSupervisorUuid) RemoteEncoder.encode(messageBuilder.build) } diff --git a/akka-remote/src/main/scala/akka/serialization/SerializationProtocol.scala b/akka-remote/src/main/scala/akka/serialization/SerializationProtocol.scala index c49e8c5dbe..75415b9be1 100644 --- a/akka-remote/src/main/scala/akka/serialization/SerializationProtocol.scala +++ b/akka-remote/src/main/scala/akka/serialization/SerializationProtocol.scala @@ -22,205 +22,6 @@ import com.google.protobuf.ByteString import com.eaio.uuid.UUID -/** - * Module for local actor serialization. - */ -class ActorSerialization(val app: AkkaApplication, remote: RemoteSupport) { - implicit val defaultSerializer = akka.serialization.JavaSerializer // Format.Default - - val remoteActorSerialization = new RemoteActorSerialization(remote) - - def fromBinary[T <: Actor](bytes: Array[Byte], homeAddress: InetSocketAddress): ActorRef = - fromBinaryToLocalActorRef(bytes, None, Some(homeAddress)) - - def fromBinary[T <: Actor](bytes: Array[Byte], uuid: UUID): ActorRef = - fromBinaryToLocalActorRef(bytes, Some(uuid), None) - - def fromBinary[T <: Actor](bytes: Array[Byte]): ActorRef = - fromBinaryToLocalActorRef(bytes, None, None) - - def toBinary[T <: Actor]( - a: ActorRef, - serializeMailBox: Boolean = true, - replicationScheme: ReplicationScheme = Transient): Array[Byte] = - toSerializedActorRefProtocol(a, serializeMailBox, replicationScheme).toByteArray - - // wrapper for implicits to be used by Java - def fromBinaryJ[T <: Actor](bytes: Array[Byte]): ActorRef = - fromBinary(bytes) - - // wrapper for implicits to be used by Java - def toBinaryJ[T <: Actor]( - a: ActorRef, - srlMailBox: Boolean, - replicationScheme: ReplicationScheme): Array[Byte] = - toBinary(a, srlMailBox, replicationScheme) - - @deprecated("BROKEN, REMOVE ME", "NOW") - private[akka] def toSerializedActorRefProtocol[T <: Actor]( - actorRef: ActorRef, - serializeMailBox: Boolean, - replicationScheme: ReplicationScheme): SerializedActorRefProtocol = { - - val localRef: Option[LocalActorRef] = actorRef match { - case l: LocalActorRef ⇒ Some(l) - case _ ⇒ None - } - - val builder = SerializedActorRefProtocol.newBuilder - .setUuid(UuidProtocol.newBuilder.setHigh(actorRef.uuid.getTime).setLow(actorRef.uuid.getClockSeqAndNode).build) - .setAddress(actorRef.address) - .setTimeout(app.AkkaConfig.ActorTimeoutMillis) - - replicationScheme match { - case _: Transient | Transient ⇒ - builder.setReplicationStorage(ReplicationStorageType.TRANSIENT) - - case Replication(storage, strategy) ⇒ - val storageType = storage match { - case _: TransactionLog | TransactionLog ⇒ ReplicationStorageType.TRANSACTION_LOG - case _: DataGrid | DataGrid ⇒ ReplicationStorageType.DATA_GRID - } - builder.setReplicationStorage(storageType) - - val strategyType = strategy match { - case _: WriteBehind ⇒ ReplicationStrategyType.WRITE_BEHIND - case _: WriteThrough ⇒ ReplicationStrategyType.WRITE_THROUGH - } - builder.setReplicationStrategy(strategyType) - } - - localRef foreach { l ⇒ - if (serializeMailBox) { - l.underlying.mailbox match { - case null ⇒ throw new IllegalActorStateException("Can't serialize an actor that has not been started.") - case q: java.util.Queue[_] ⇒ - val l = new scala.collection.mutable.ListBuffer[Envelope] - val it = q.iterator - while (it.hasNext) l += it.next.asInstanceOf[Envelope] - - l map { m ⇒ - remoteActorSerialization.createRemoteMessageProtocolBuilder( - localRef, - Left(actorRef.uuid), - actorRef.address, - app.AkkaConfig.ActorTimeoutMillis, - Right(m.message), - false, - m.sender match { - case a: ActorRef ⇒ Some(a) - case _ ⇒ None - }) - } foreach { - builder.addMessages(_) - } - } - } - - l.underlying.receiveTimeout.foreach(builder.setReceiveTimeout(_)) - val actorInstance = l.underlyingActorInstance - app.serialization.serialize(actorInstance.asInstanceOf[T]) match { - case Right(bytes) ⇒ builder.setActorInstance(ByteString.copyFrom(bytes)) - case Left(exception) ⇒ throw new Exception("Error serializing : " + actorInstance.getClass.getName) - } - val stack = l.underlying.hotswap - if (!stack.isEmpty) - builder.setHotswapStack(ByteString.copyFrom(akka.serialization.JavaSerializer.toBinary(stack))) - } - - builder.build - } - - private def fromBinaryToLocalActorRef[T <: Actor]( - bytes: Array[Byte], - uuid: Option[UUID], - homeAddress: Option[InetSocketAddress]): ActorRef = { - val builder = SerializedActorRefProtocol.newBuilder.mergeFrom(bytes) - fromProtobufToLocalActorRef(builder.build, uuid, None) - } - - private[akka] def fromProtobufToLocalActorRef[T <: Actor]( - protocol: SerializedActorRefProtocol, - overriddenUuid: Option[UUID], - loader: Option[ClassLoader]): ActorRef = { - - app.eventHandler.debug(this, "Deserializing SerializedActorRefProtocol to LocalActorRef:\n%s".format(protocol)) - - // import ReplicationStorageType._ - // import ReplicationStrategyType._ - // val replicationScheme = - // if (protocol.hasReplicationStorage) { - // protocol.getReplicationStorage match { - // case TRANSIENT ⇒ Transient - // case store ⇒ - // val storage = store match { - // case TRANSACTION_LOG ⇒ TransactionLog - // case DATA_GRID ⇒ DataGrid - // } - // val strategy = if (protocol.hasReplicationStrategy) { - // protocol.getReplicationStrategy match { - // case WRITE_THROUGH ⇒ WriteThrough - // case WRITE_BEHIND ⇒ WriteBehind - // } - // } else throw new IllegalActorStateException( - // "Expected replication strategy for replication storage [" + storage + "]") - // Replication(storage, strategy) - // } - // } else Transient - - val storedHotswap = - try { - app.serialization.deserialize( - protocol.getHotswapStack.toByteArray, - classOf[Stack[PartialFunction[Any, Unit]]], - loader) match { - case Right(r) ⇒ r.asInstanceOf[Stack[PartialFunction[Any, Unit]]] - case Left(ex) ⇒ throw new Exception("Cannot de-serialize hotswapstack") - } - } catch { - case e: Exception ⇒ Stack[PartialFunction[Any, Unit]]() - } - - val storedSupervisor = - if (protocol.hasSupervisor) Some(remoteActorSerialization.fromProtobufToRemoteActorRef(protocol.getSupervisor, loader)) - else None - - val classLoader = loader.getOrElse(this.getClass.getClassLoader) - val bytes = protocol.getActorInstance.toByteArray - val actorClass = classLoader.loadClass(protocol.getActorClassname) - val factory = () ⇒ { - app.serialization.deserialize(bytes, actorClass, loader) match { - case Right(r) ⇒ r.asInstanceOf[Actor] - case Left(ex) ⇒ throw new Exception("Cannot de-serialize : " + actorClass) - } - } - - val actorUuid = overriddenUuid match { - case Some(uuid) ⇒ uuid - case None ⇒ uuidFrom(protocol.getUuid.getHigh, protocol.getUuid.getLow) - } - - val props = Props(creator = factory, - timeout = if (protocol.hasTimeout) protocol.getTimeout else app.AkkaConfig.ActorTimeout //TODO what dispatcher should it use? - //TODO what faultHandler should it use? - ) - - val receiveTimeout = if (protocol.hasReceiveTimeout) Some(protocol.getReceiveTimeout) else None //TODO FIXME, I'm expensive and slow - - // FIXME: what to do if storedSupervisor is empty? - val ar = new LocalActorRef(app, props, storedSupervisor getOrElse app.guardian, protocol.getAddress, false, actorUuid, receiveTimeout, storedHotswap) - - //Deserialize messages - { - val iterator = protocol.getMessagesList.iterator() - while (iterator.hasNext()) - ar ! MessageSerializer.deserialize(app, iterator.next().getMessage, Some(classLoader)) //TODO This is broken, why aren't we preserving the sender? - } - - ar - } -} - class RemoteActorSerialization(remote: RemoteSupport) { /** @@ -281,7 +82,6 @@ class RemoteActorSerialization(remote: RemoteSupport) { actorAddress: String, timeout: Long, message: Either[Throwable, Any], - isOneWay: Boolean, senderOption: Option[ActorRef]): RemoteMessageProtocol.Builder = { val uuidProtocol = replyUuid match { @@ -301,7 +101,7 @@ class RemoteActorSerialization(remote: RemoteSupport) { UuidProtocol.newBuilder.setHigh(messageUuid.getTime).setLow(messageUuid.getClockSeqAndNode).build }) .setActorInfo(actorInfo) - .setOneWay(isOneWay) + .setOneWay(true) message match { case Right(message) ⇒ @@ -309,26 +109,10 @@ class RemoteActorSerialization(remote: RemoteSupport) { case Left(exception) ⇒ messageBuilder.setException(ExceptionProtocol.newBuilder .setClassname(exception.getClass.getName) - .setMessage(empty(exception.getMessage)) + .setMessage(Option(exception.getMessage).getOrElse("")) .build) } - def empty(s: String): String = s match { - case null ⇒ "" - case s ⇒ s - } - - /* TODO invent new supervision strategy - actorRef.foreach { ref => - ref.registerSupervisorAsRemoteActor.foreach { id => - messageBuilder.setSupervisorUuid( - UuidProtocol.newBuilder - .setHigh(id.getTime) - .setLow(id.getClockSeqAndNode) - .build) - } - } */ - if (senderOption.isDefined) messageBuilder.setSender(toRemoteActorRefProtocol(senderOption.get)) diff --git a/akka-remote/src/test/scala/akka/serialization/ActorSerializeSpec.scala b/akka-remote/src/test/scala/akka/serialization/ActorSerializeSpec.scala deleted file mode 100644 index a7d8b374e7..0000000000 --- a/akka-remote/src/test/scala/akka/serialization/ActorSerializeSpec.scala +++ /dev/null @@ -1,158 +0,0 @@ -package akka.serialization - -import org.scalatest.BeforeAndAfterAll -import com.google.protobuf.Message -import akka.actor._ -import akka.remote._ -import akka.testkit.AkkaSpec -import akka.serialization.SerializeSpec.Person - -case class MyMessage(id: Long, name: String, status: Boolean) - -@org.junit.runner.RunWith(classOf[org.scalatest.junit.JUnitRunner]) -class ActorSerializeSpec extends AkkaSpec with BeforeAndAfterAll { - - lazy val remote: Remote = { - app.provider match { - case r: RemoteActorRefProvider ⇒ r.remote - case _ ⇒ throw new Exception("Remoting is not enabled") - } - } - - lazy val serialization = new ActorSerialization(app, remote.server) - - "Serializable actor" must { - "must be able to serialize and de-serialize a stateful actor with a given serializer" ignore { - - val actor1 = new LocalActorRef(app, Props[MyJavaSerializableActor], app.guardian, Props.randomAddress, systemService = true) - - (actor1 ? "hello").get must equal("world 1") - (actor1 ? "hello").get must equal("world 2") - - val bytes = serialization.toBinary(actor1) - val actor2 = serialization.fromBinary(bytes).asInstanceOf[LocalActorRef] - (actor2 ? "hello").get must equal("world 3") - - actor2.underlying.receiveTimeout must equal(Some(1000)) - actor1.stop() - actor2.stop() - } - - "must be able to serialize and deserialize a MyStatelessActorWithMessagesInMailbox" ignore { - - val actor1 = new LocalActorRef(app, Props[MyStatelessActorWithMessagesInMailbox], app.guardian, Props.randomAddress, systemService = true) - for (i ← 1 to 10) actor1 ! "hello" - - actor1.underlying.dispatcher.mailboxSize(actor1.underlying) must be > (0) - val actor2 = serialization.fromBinary(serialization.toBinary(actor1)).asInstanceOf[LocalActorRef] - Thread.sleep(1000) - actor2.underlying.dispatcher.mailboxSize(actor1.underlying) must be > (0) - (actor2 ? "hello-reply").get must equal("world") - - val actor3 = serialization.fromBinary(serialization.toBinary(actor1, false)).asInstanceOf[LocalActorRef] - Thread.sleep(1000) - actor3.underlying.dispatcher.mailboxSize(actor1.underlying) must equal(0) - (actor3 ? "hello-reply").get must equal("world") - } - - "must be able to serialize and deserialize a PersonActorWithMessagesInMailbox" ignore { - - val p1 = Person("debasish ghosh", 25, SerializeSpec.Address("120", "Monroe Street", "Santa Clara", "95050")) - val actor1 = new LocalActorRef(app, Props[PersonActorWithMessagesInMailbox], app.guardian, Props.randomAddress, systemService = true) - (actor1 ! p1) - (actor1 ! p1) - (actor1 ! p1) - (actor1 ! p1) - (actor1 ! p1) - (actor1 ! p1) - (actor1 ! p1) - (actor1 ! p1) - (actor1 ! p1) - (actor1 ! p1) - actor1.underlying.dispatcher.mailboxSize(actor1.underlying) must be > (0) - val actor2 = serialization.fromBinary(serialization.toBinary(actor1)).asInstanceOf[LocalActorRef] - Thread.sleep(1000) - actor2.underlying.dispatcher.mailboxSize(actor1.underlying) must be > (0) - (actor2 ? "hello-reply").get must equal("hello") - - val actor3 = serialization.fromBinary(serialization.toBinary(actor1, false)).asInstanceOf[LocalActorRef] - Thread.sleep(1000) - actor3.underlying.dispatcher.mailboxSize(actor1.underlying) must equal(0) - (actor3 ? "hello-reply").get must equal("hello") - } - } - - "serialize protobuf" must { - "must serialize" ignore { - val msg = MyMessage(123, "debasish ghosh", true) - - val ser = new Serialization(app) - - val b = ser.serialize(ProtobufProtocol.MyMessage.newBuilder.setId(msg.id).setName(msg.name).setStatus(msg.status).build) match { - case Left(exception) ⇒ fail(exception) - case Right(bytes) ⇒ bytes - } - val in = ser.deserialize(b, classOf[ProtobufProtocol.MyMessage], None) match { - case Left(exception) ⇒ fail(exception) - case Right(i) ⇒ i - } - val m = in.asInstanceOf[ProtobufProtocol.MyMessage] - MyMessage(m.getId, m.getName, m.getStatus) must equal(msg) - } - } - - "serialize actor that accepts protobuf message" ignore { - "must serialize" ignore { - - val actor1 = new LocalActorRef(app, Props[MyActorWithProtobufMessagesInMailbox], app.guardian, Props.randomAddress, systemService = true) - val msg = MyMessage(123, "debasish ghosh", true) - val b = ProtobufProtocol.MyMessage.newBuilder.setId(msg.id).setName(msg.name).setStatus(msg.status).build - for (i ← 1 to 10) actor1 ! b - actor1.underlying.dispatcher.mailboxSize(actor1.underlying) must be > (0) - val actor2 = serialization.fromBinary(serialization.toBinary(actor1)).asInstanceOf[LocalActorRef] - Thread.sleep(1000) - actor2.underlying.dispatcher.mailboxSize(actor1.underlying) must be > (0) - (actor2 ? "hello-reply").get must equal("world") - - val actor3 = serialization.fromBinary(serialization.toBinary(actor1, false)).asInstanceOf[LocalActorRef] - Thread.sleep(1000) - actor3.underlying.dispatcher.mailboxSize(actor1.underlying) must equal(0) - (actor3 ? "hello-reply").get must equal("world") - } - } -} - -class MyJavaSerializableActor extends Actor with scala.Serializable { - var count = 0 - receiveTimeout = Some(1000) - - def receive = { - case "hello" ⇒ - count = count + 1 - sender ! "world " + count - } -} - -class MyStatelessActorWithMessagesInMailbox extends Actor with scala.Serializable { - def receive = { - case "hello" ⇒ - Thread.sleep(500) - case "hello-reply" ⇒ sender ! "world" - } -} - -class MyActorWithProtobufMessagesInMailbox extends Actor with scala.Serializable { - def receive = { - case m: Message ⇒ - Thread.sleep(500) - case "hello-reply" ⇒ sender ! "world" - } -} - -class PersonActorWithMessagesInMailbox extends Actor with scala.Serializable { - def receive = { - case p: Person ⇒ - Thread.sleep(500) - case "hello-reply" ⇒ sender ! "hello" - } -} From 26f45a599b9043ff682b8ca414245c84b4c5f15f Mon Sep 17 00:00:00 2001 From: Viktor Klang Date: Wed, 26 Oct 2011 16:12:48 +0200 Subject: [PATCH 15/57] Making walker a def in remote --- .../src/main/scala/akka/remote/RemoteActorRefProvider.scala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/akka-remote/src/main/scala/akka/remote/RemoteActorRefProvider.scala b/akka-remote/src/main/scala/akka/remote/RemoteActorRefProvider.scala index 4981e5244a..32248ef6a7 100644 --- a/akka-remote/src/main/scala/akka/remote/RemoteActorRefProvider.scala +++ b/akka-remote/src/main/scala/akka/remote/RemoteActorRefProvider.scala @@ -33,9 +33,6 @@ class RemoteActorRefProvider(val app: AkkaApplication) extends ActorRefProvider import java.util.concurrent.ConcurrentHashMap import akka.dispatch.Promise - private[akka] val theOneWhoWalksTheBubblesOfSpaceTime: ActorRef = local.theOneWhoWalksTheBubblesOfSpaceTime - private[akka] def terminationFuture = new DefaultPromise[AkkaApplication.ExitStatus](Timeout.never)(app.dispatcher) - val local = new LocalActorRefProvider(app) val remote = new Remote(app) @@ -43,6 +40,9 @@ class RemoteActorRefProvider(val app: AkkaApplication) extends ActorRefProvider private val remoteDaemonConnectionManager = new RemoteConnectionManager(app, remote) + private[akka] def theOneWhoWalksTheBubblesOfSpaceTime: ActorRef = local.theOneWhoWalksTheBubblesOfSpaceTime + private[akka] def terminationFuture = new DefaultPromise[AkkaApplication.ExitStatus](Timeout.never)(app.dispatcher) + def defaultDispatcher = app.dispatcher def defaultTimeout = app.AkkaConfig.ActorTimeout From f8ef63122af542ffe63d8e9bcb705ef8e7d8b2c2 Mon Sep 17 00:00:00 2001 From: Viktor Klang Date: Thu, 27 Oct 2011 14:48:45 +0200 Subject: [PATCH 16/57] Fixing UntypedCoordinatedIncrementTest so it works with computers with less CPUs than 5 :p --- .../src/main/scala/akka/AkkaApplication.scala | 3 +- .../test/UntypedCoordinatedCounter.java | 15 +++------ .../test/UntypedCoordinatedIncrementTest.java | 32 +++++++------------ 3 files changed, 17 insertions(+), 33 deletions(-) diff --git a/akka-actor/src/main/scala/akka/AkkaApplication.scala b/akka-actor/src/main/scala/akka/AkkaApplication.scala index b2bcccb0b5..28cc0a5668 100644 --- a/akka-actor/src/main/scala/akka/AkkaApplication.scala +++ b/akka-actor/src/main/scala/akka/AkkaApplication.scala @@ -101,8 +101,7 @@ class AkkaApplication(val name: String, val config: Configuration) extends Actor val DispatcherThroughput = getInt("akka.actor.throughput", 5) val DispatcherDefaultShutdown = getLong("akka.actor.dispatcher-shutdown-timeout"). - map(time ⇒ Duration(time, DefaultTimeUnit)). - getOrElse(Duration(1000, TimeUnit.MILLISECONDS)) + map(time ⇒ Duration(time, DefaultTimeUnit)).getOrElse(Duration(1000, TimeUnit.MILLISECONDS)) val MailboxCapacity = getInt("akka.actor.default-dispatcher.mailbox-capacity", -1) val MailboxPushTimeout = Duration(getInt("akka.actor.default-dispatcher.mailbox-push-timeout-time", 10), DefaultTimeUnit) val DispatcherThroughputDeadlineTime = Duration(getInt("akka.actor.throughput-deadline-time", -1), DefaultTimeUnit) diff --git a/akka-stm/src/test/java/akka/transactor/test/UntypedCoordinatedCounter.java b/akka-stm/src/test/java/akka/transactor/test/UntypedCoordinatedCounter.java index 2ac3731f06..ecc8a1739d 100644 --- a/akka-stm/src/test/java/akka/transactor/test/UntypedCoordinatedCounter.java +++ b/akka-stm/src/test/java/akka/transactor/test/UntypedCoordinatedCounter.java @@ -45,20 +45,13 @@ public class UntypedCoordinatedCounter extends UntypedActor { coordinated.atomic(new Atomically(txFactory) { public void atomically() { increment(); - StmUtils.scheduleDeferredTask(new Runnable() { - public void run() { latch.countDown(); } - }); - StmUtils.scheduleCompensatingTask(new Runnable() { - public void run() { latch.countDown(); } - }); + StmUtils.scheduleDeferredTask(new Runnable() { public void run() { latch.countDown(); } }); + StmUtils.scheduleCompensatingTask(new Runnable() { public void run() { latch.countDown(); } }); } }); } - } else if (incoming instanceof String) { - String message = (String) incoming; - if (message.equals("GetCount")) { - getSender().tell(count.get()); - } + } else if ("GetCount".equals(incoming)) { + getSender().tell(count.get()); } } } diff --git a/akka-stm/src/test/java/akka/transactor/test/UntypedCoordinatedIncrementTest.java b/akka-stm/src/test/java/akka/transactor/test/UntypedCoordinatedIncrementTest.java index 6eeb1546b5..f975c5e429 100644 --- a/akka-stm/src/test/java/akka/transactor/test/UntypedCoordinatedIncrementTest.java +++ b/akka-stm/src/test/java/akka/transactor/test/UntypedCoordinatedIncrementTest.java @@ -1,6 +1,8 @@ package akka.transactor.test; import static org.junit.Assert.*; + +import org.junit.After; import org.junit.Test; import org.junit.Before; @@ -34,11 +36,12 @@ public class UntypedCoordinatedIncrementTest { List counters; ActorRef failer; - int numCounters = 5; + int numCounters = 3; int timeout = 5; int askTimeout = 5000; @Before public void initialise() { + Props p = new Props().withCreator(UntypedFailer.class); counters = new ArrayList(); for (int i = 1; i <= numCounters; i++) { final String name = "counter" + i; @@ -49,7 +52,7 @@ public class UntypedCoordinatedIncrementTest { })); counters.add(counter); } - failer = application.actorOf(new Props().withCreator(UntypedFailer.class)); + failer = application.actorOf(p); } @Test public void incrementAllCountersWithSuccessfulTransaction() { @@ -61,15 +64,7 @@ public class UntypedCoordinatedIncrementTest { } catch (InterruptedException exception) {} for (ActorRef counter : counters) { Future future = counter.ask("GetCount", askTimeout); - future.await(); - if (future.isCompleted()) { - Option resultOption = future.result(); - if (resultOption.isDefined()) { - Object result = resultOption.get(); - int count = (Integer) result; - assertEquals(1, count); - } - } + assertEquals(1, ((Integer)future.get()).intValue()); } } @@ -88,15 +83,7 @@ public class UntypedCoordinatedIncrementTest { } catch (InterruptedException exception) {} for (ActorRef counter : counters) { Future future = counter.ask("GetCount", askTimeout); - future.await(); - if (future.isCompleted()) { - Option resultOption = future.result(); - if (resultOption.isDefined()) { - Object result = resultOption.get(); - int count = (Integer) result; - assertEquals(0, count); - } - } + assertEquals(0, ((Integer)future.get()).intValue()); } application.eventHandler().notify(new TestEvent.UnMute(ignoreExceptions)); } @@ -104,6 +91,11 @@ public class UntypedCoordinatedIncrementTest { public Seq seq(A... args) { return JavaConverters.collectionAsScalaIterableConverter(Arrays.asList(args)).asScala().toSeq(); } + + @After + public void stop() { + application.stop(); + } } From 0c3091729d6d69e30b5bea9c94fa31bee47966f7 Mon Sep 17 00:00:00 2001 From: Viktor Klang Date: Thu, 27 Oct 2011 14:51:19 +0200 Subject: [PATCH 17/57] Making sure that the JavaUntypedTransactorSpec works with tinier machines --- .../test/java/akka/transactor/test/UntypedTransactorTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/akka-stm/src/test/java/akka/transactor/test/UntypedTransactorTest.java b/akka-stm/src/test/java/akka/transactor/test/UntypedTransactorTest.java index 8dc2c2beae..83845a940a 100644 --- a/akka-stm/src/test/java/akka/transactor/test/UntypedTransactorTest.java +++ b/akka-stm/src/test/java/akka/transactor/test/UntypedTransactorTest.java @@ -33,7 +33,7 @@ public class UntypedTransactorTest { List counters; ActorRef failer; - int numCounters = 5; + int numCounters = 3; int timeout = 5; int askTimeout = 5000; From 8a7290ba7e0589df55fb4b1c18e706a96c196aa3 Mon Sep 17 00:00:00 2001 From: Viktor Klang Date: Thu, 27 Oct 2011 14:52:48 +0200 Subject: [PATCH 18/57] Making sure that akka.transactor.test.TransactorSpec works with machines with less than 4 cores --- akka-stm/src/test/scala/transactor/TransactorSpec.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/akka-stm/src/test/scala/transactor/TransactorSpec.scala b/akka-stm/src/test/scala/transactor/TransactorSpec.scala index fef06f91e1..0e50ebce5e 100644 --- a/akka-stm/src/test/scala/transactor/TransactorSpec.scala +++ b/akka-stm/src/test/scala/transactor/TransactorSpec.scala @@ -82,7 +82,7 @@ class TransactorSpec extends AkkaSpec { implicit val timeout = Timeout(5.seconds.dilated) - val numCounters = 5 + val numCounters = 3 def createTransactors = { def createCounter(i: Int) = app.actorOf(Props(new Counter("counter" + i))) From 4ac7f4d858fa9fa254917d5afc3fd725646ba6dd Mon Sep 17 00:00:00 2001 From: Viktor Klang Date: Thu, 27 Oct 2011 15:15:20 +0200 Subject: [PATCH 19/57] Making sure that akka.transactor.test.CoordinatedIncrementSpec works with machines with less than 4 cores --- .../src/test/scala/transactor/CoordinatedIncrementSpec.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/akka-stm/src/test/scala/transactor/CoordinatedIncrementSpec.scala b/akka-stm/src/test/scala/transactor/CoordinatedIncrementSpec.scala index 41d6f787a5..f0cc8e5401 100644 --- a/akka-stm/src/test/scala/transactor/CoordinatedIncrementSpec.scala +++ b/akka-stm/src/test/scala/transactor/CoordinatedIncrementSpec.scala @@ -59,7 +59,7 @@ class CoordinatedIncrementSpec extends AkkaSpec with BeforeAndAfterAll { implicit val timeout = Timeout(5.seconds.dilated) - val numCounters = 5 + val numCounters = 4 def actorOfs = { def createCounter(i: Int) = app.actorOf(Props(new Counter("counter" + i))) From cb1b4619967464d837f79723bd39b24c0f0af7fc Mon Sep 17 00:00:00 2001 From: Viktor Klang Date: Thu, 27 Oct 2011 15:30:41 +0200 Subject: [PATCH 20/57] Fixing ActorRefSpec that depended on the semantics of ?/Ask to get ActorKilledException from PoisonPill --- .../src/test/scala/akka/actor/ActorRefSpec.scala | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/akka-actor-tests/src/test/scala/akka/actor/ActorRefSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/ActorRefSpec.scala index d4ffc2a517..800b7b642c 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/ActorRefSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/ActorRefSpec.scala @@ -377,16 +377,12 @@ class ActorRefSpec extends AkkaSpec { val ffive = (ref ? (5, timeout)).mapTo[String] val fnull = (ref ? (null, timeout)).mapTo[String] - - intercept[ActorKilledException] { - (ref ? PoisonPill).get - fail("shouldn't get here") - } + ref ! PoisonPill ffive.get must be("five") fnull.get must be("null") - awaitCond(ref.isShutdown, 100 millis) + awaitCond(ref.isShutdown, 2000 millis) } "restart when Kill:ed" in { From e71d9f79f9c03775cab3de44e4b595bbfab4f70b Mon Sep 17 00:00:00 2001 From: Viktor Klang Date: Thu, 27 Oct 2011 15:48:50 +0200 Subject: [PATCH 21/57] Fixing TypedActors so that exceptions are propagated back --- .../scala/akka/actor/TypedActorSpec.scala | 8 ++---- .../main/scala/akka/actor/TypedActor.scala | 27 ++++++++++++------- 2 files changed, 20 insertions(+), 15 deletions(-) diff --git a/akka-actor-tests/src/test/scala/akka/actor/TypedActorSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/TypedActorSpec.scala index 2af08fbe6f..59ce3d4952 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/TypedActorSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/TypedActorSpec.scala @@ -276,14 +276,10 @@ class TypedActorSpec extends AkkaSpec with BeforeAndAfterEach with BeforeAndAfte t.failingFuturePigdog.await.exception.get.getMessage must be("expected") t.read() must be(1) //Make sure state is not reset after failure - (intercept[IllegalStateException] { - t.failingJOptionPigdog - }).getMessage must be("expected") + (intercept[IllegalStateException] { t.failingJOptionPigdog }).getMessage must be("expected") t.read() must be(1) //Make sure state is not reset after failure - (intercept[IllegalStateException] { - t.failingOptionPigdog - }).getMessage must be("expected") + (intercept[IllegalStateException] { t.failingOptionPigdog }).getMessage must be("expected") t.read() must be(1) //Make sure state is not reset after failure diff --git a/akka-actor/src/main/scala/akka/actor/TypedActor.scala b/akka-actor/src/main/scala/akka/actor/TypedActor.scala index c07cb7a128..fb3269249c 100644 --- a/akka-actor/src/main/scala/akka/actor/TypedActor.scala +++ b/akka-actor/src/main/scala/akka/actor/TypedActor.scala @@ -339,15 +339,23 @@ class TypedActor(val app: AkkaApplication) { TypedActor.appReference set app try { if (m.isOneWay) m(me) - else if (m.returnsFuture_?) { + else { val s = sender - m(me).asInstanceOf[Future[Any]] onComplete { - _.value.get match { - case Left(f) ⇒ s ! akka.actor.Status.Failure(f) - case Right(r) ⇒ s ! r + try { + if (m.returnsFuture_?) { + m(me).asInstanceOf[Future[Any]] onComplete { + _.value.get match { + case Left(f) ⇒ s ! akka.actor.Status.Failure(f) + case Right(r) ⇒ s ! r + } + } + } else { + s ! m(me) } + } catch { + case e: Exception ⇒ s ! akka.actor.Status.Failure(e) } - } else sender ! m(me) + } } finally { TypedActor.selfReference set null @@ -366,17 +374,18 @@ class TypedActor(val app: AkkaApplication) { case _ ⇒ MethodCall(app, method, args) match { case m if m.isOneWay ⇒ actor ! m; null //Null return value - case m if m.returnsFuture_? ⇒ actor ? m + case m if m.returnsFuture_? ⇒ actor.?(m, timeout) case m if m.returnsJOption_? || m.returnsOption_? ⇒ - val f = actor ? m + val f = actor.?(m, timeout) try { f.await } catch { case _: FutureTimeoutException ⇒ } + println("JOption result: " + f.value) f.value match { case None | Some(Right(null)) ⇒ if (m.returnsJOption_?) JOption.none[Any] else None case Some(Right(joption: AnyRef)) ⇒ joption case Some(Left(ex)) ⇒ throw ex } case m ⇒ - (actor ? m).get.asInstanceOf[AnyRef] + (actor.?(m, timeout)).get.asInstanceOf[AnyRef] } } } From c99848586530cf99c79d5d16859fe3525b07ed3d Mon Sep 17 00:00:00 2001 From: Viktor Klang Date: Thu, 27 Oct 2011 18:04:12 +0200 Subject: [PATCH 22/57] Fixing ask/? for the routers so that tests pass and stuff --- .../test/scala/akka/routing/RoutingSpec.scala | 10 ++---- .../src/main/scala/akka/actor/ActorRef.scala | 31 ++++++++++++------- .../scala/akka/actor/ActorRefProvider.scala | 7 ++--- .../src/main/scala/akka/routing/Routing.scala | 13 ++++---- 4 files changed, 32 insertions(+), 29 deletions(-) diff --git a/akka-actor-tests/src/test/scala/akka/routing/RoutingSpec.scala b/akka-actor-tests/src/test/scala/akka/routing/RoutingSpec.scala index 510b6ecbef..2bb7575d2b 100644 --- a/akka-actor-tests/src/test/scala/akka/routing/RoutingSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/routing/RoutingSpec.scala @@ -194,15 +194,9 @@ class RoutingSpec extends AkkaSpec { } }) - val props = RoutedProps().withRoundRobinRouter.withLocalConnections(List(connection1)) - val actor = app.actorOf(props, "foo") + val actor = app.actorOf(RoutedProps().withRoundRobinRouter.withLocalConnections(List(connection1)), "foo") - try { - actor ? Broadcast(1) - fail() - } catch { - case e: RoutingException ⇒ - } + intercept[RoutingException] { actor ? Broadcast(1) } actor ! "end" doneLatch.await(5, TimeUnit.SECONDS) must be(true) diff --git a/akka-actor/src/main/scala/akka/actor/ActorRef.scala b/akka-actor/src/main/scala/akka/actor/ActorRef.scala index 3c9d2144ec..6d6e738602 100644 --- a/akka-actor/src/main/scala/akka/actor/ActorRef.scala +++ b/akka-actor/src/main/scala/akka/actor/ActorRef.scala @@ -368,23 +368,32 @@ class DeadLetterActorRef(app: AkkaApplication) extends MinimalActorRef { def ?(message: Any)(implicit timeout: Timeout): Future[Any] = brokenPromise } -abstract class AskActorRef(promise: Promise[Any], app: AkkaApplication) extends MinimalActorRef { +abstract class AskActorRef(app: AkkaApplication)(timeout: Timeout = app.AkkaConfig.ActorTimeout, dispatcher: MessageDispatcher = app.dispatcher) extends MinimalActorRef { + final val result = new DefaultPromise[Any](timeout)(dispatcher) - promise onComplete { _ ⇒ app.deathWatch.publish(Terminated(AskActorRef.this)); whenDone() } - promise onTimeout { _ ⇒ app.deathWatch.publish(Terminated(AskActorRef.this)); whenDone() } + { + val callback: Future[Any] ⇒ Unit = { _ ⇒ app.deathWatch.publish(Terminated(AskActorRef.this)); whenDone() } + result onComplete callback + result onTimeout callback + } protected def whenDone(): Unit - override protected[akka] def postMessageToMailbox(message: Any, sender: ActorRef): Unit = message match { - case akka.actor.Status.Success(r) ⇒ promise.completeWithResult(r) - case akka.actor.Status.Failure(f) ⇒ promise.completeWithException(f) - case other ⇒ promise.completeWithResult(other) + protected[akka] override def postMessageToMailbox(message: Any, sender: ActorRef): Unit = message match { + case akka.actor.Status.Success(r) ⇒ result.completeWithResult(r) + case akka.actor.Status.Failure(f) ⇒ result.completeWithException(f) + case other ⇒ result.completeWithResult(other) } - def ?(message: Any)(implicit timeout: Timeout): Future[Any] = - new KeptPromise[Any](Left(new ActorKilledException("Not possible to ask/? a reference to an ask/?.")))(app.dispatcher) + protected[akka] override def sendSystemMessage(message: SystemMessage): Unit = message match { + case _: Terminate ⇒ stop() + case _ ⇒ + } - override def isShutdown = promise.isCompleted || promise.isExpired + override def ?(message: Any)(implicit timeout: Timeout): Future[Any] = + new KeptPromise[Any](Left(new UnsupportedOperationException("Ask/? is not supported for %s".format(getClass.getName))))(dispatcher) - override def stop(): Unit = if (!isShutdown) promise.completeWithException(new ActorKilledException("Stopped")) + override def isShutdown = result.isCompleted || result.isExpired + + override def stop(): Unit = if (!isShutdown) result.completeWithException(new ActorKilledException("Stopped")) } diff --git a/akka-actor/src/main/scala/akka/actor/ActorRefProvider.scala b/akka-actor/src/main/scala/akka/actor/ActorRefProvider.scala index e823b7d1f6..81c4b66afc 100644 --- a/akka-actor/src/main/scala/akka/actor/ActorRefProvider.scala +++ b/akka-actor/src/main/scala/akka/actor/ActorRefProvider.scala @@ -223,12 +223,11 @@ class LocalActorRefProvider(val app: AkkaApplication) extends ActorRefProvider { import akka.dispatch.{ Future, Promise, DefaultPromise } (if (within == null) app.AkkaConfig.ActorTimeout else within) match { case t if t.duration.length <= 0 ⇒ new DefaultPromise[Any](0)(app.dispatcher) //Abort early if nonsensical timeout - case other ⇒ - val result = new DefaultPromise[Any](other)(app.dispatcher) - val a = new AskActorRef(result, app) { def whenDone() = actors.remove(this) } + case t ⇒ + val a = new AskActorRef(app)(timeout = t) { def whenDone() = actors.remove(this) } assert(actors.putIfAbsent(a.address, a) eq null) //If this fails, we're in deep trouble recipient.tell(message, a) - result + a.result } } } diff --git a/akka-actor/src/main/scala/akka/routing/Routing.scala b/akka-actor/src/main/scala/akka/routing/Routing.scala index ca7c60a619..899dcb7f5a 100644 --- a/akka-actor/src/main/scala/akka/routing/Routing.scala +++ b/akka-actor/src/main/scala/akka/routing/Routing.scala @@ -50,7 +50,7 @@ trait Router { * * @throws RoutingExceptionif something goes wrong while routing the message. */ - def route[T](message: Any, timeout: Timeout)(implicit sender: ActorRef): Future[T] + def route[T](message: Any, timeout: Timeout): Future[T] } /** @@ -98,7 +98,7 @@ abstract private[akka] class AbstractRoutedActorRef(val app: AkkaApplication, va override def postMessageToMailbox(message: Any, sender: ActorRef) = router.route(message)(sender) - override def ?(message: Any)(implicit timeout: Timeout): Future[Any] = app.provider.ask(message, this, timeout) + override def ?(message: Any)(implicit timeout: Timeout): Future[Any] = router.route(message, timeout) } /** @@ -139,6 +139,7 @@ trait BasicRouter extends Router { def route(message: Any)(implicit sender: ActorRef) = message match { case Routing.Broadcast(message) ⇒ + //it is a broadcast message, we are going to send to message to all connections. connectionManager.connections.iterable foreach { connection ⇒ try { @@ -165,7 +166,7 @@ trait BasicRouter extends Router { } } - def route[T](message: Any, timeout: Timeout)(implicit sender: ActorRef): Future[T] = message match { + def route[T](message: Any, timeout: Timeout): Future[T] = message match { case Routing.Broadcast(message) ⇒ throw new RoutingException("Broadcasting using '?'/'ask' is for the time being is not supported. Use ScatterGatherRouter.") case _ ⇒ @@ -340,7 +341,7 @@ trait ScatterGatherRouter extends BasicRouter with Serializable { */ protected def gather[S, G >: S](results: Iterable[Future[S]]): Future[G] - private def scatterGather[S, G >: S](message: Any, timeout: Timeout)(implicit sender: ActorRef): Future[G] = { + private def scatterGather[S, G >: S](message: Any, timeout: Timeout): Future[G] = { val responses = connectionManager.connections.iterable.flatMap { actor ⇒ try { if (actor.isShutdown) throw ActorInitializationException(actor, "For compatability - check death first", new Exception) // for stack trace @@ -357,9 +358,9 @@ trait ScatterGatherRouter extends BasicRouter with Serializable { else gather(responses) } - override def route[T](message: Any, timeout: Timeout)(implicit sender: ActorRef): Future[T] = message match { + override def route[T](message: Any, timeout: Timeout): Future[T] = message match { case Routing.Broadcast(message) ⇒ scatterGather(message, timeout) - case message ⇒ super.route(message, timeout)(sender) + case message ⇒ super.route(message, timeout) } } From c37d673e146ad9b6e3909c574d18682c28638ee3 Mon Sep 17 00:00:00 2001 From: Viktor Klang Date: Thu, 27 Oct 2011 18:44:33 +0200 Subject: [PATCH 23/57] Fixing ActorModelSpec to work with the new ask/? --- .../akka/actor/dispatch/ActorModelSpec.scala | 20 ++++++------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/akka-actor-tests/src/test/scala/akka/actor/dispatch/ActorModelSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/dispatch/ActorModelSpec.scala index 50b1b69838..eff4600e53 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/dispatch/ActorModelSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/dispatch/ActorModelSpec.scala @@ -395,14 +395,10 @@ abstract class ActorModelSpec extends AkkaSpec { assert(f1.get === "foo") assert(f2.get === "bar") - assert((intercept[ActorInterruptedException] { - f3.get - }).getMessage === "Ping!") assert(f4.get === "foo2") - assert((intercept[ActorInterruptedException] { - f5.get - }).getMessage === "Ping!") + assert(f3.value === None) assert(f6.get === "bar2") + assert(f5.value === None) } } @@ -412,21 +408,17 @@ abstract class ActorModelSpec extends AkkaSpec { val a = newTestActor(dispatcher) val f1 = a ? Reply("foo") val f2 = a ? Reply("bar") - val f3 = a ? new ThrowException(new IndexOutOfBoundsException("IndexOutOfBoundsException")) + val f3 = a ? ThrowException(new IndexOutOfBoundsException("IndexOutOfBoundsException")) val f4 = a ? Reply("foo2") - val f5 = a ? new ThrowException(new RemoteException("RemoteException")) + val f5 = a ? ThrowException(new RemoteException("RemoteException")) val f6 = a ? Reply("bar2") assert(f1.get === "foo") assert(f2.get === "bar") - assert((intercept[IndexOutOfBoundsException] { - f3.get - }).getMessage === "IndexOutOfBoundsException") assert(f4.get === "foo2") - assert((intercept[RemoteException] { - f5.get - }).getMessage === "RemoteException") assert(f6.get === "bar2") + assert(f3.result === None) + assert(f5.result === None) } } } From 36c591926132f7b53541c5e489c3447537faa858 Mon Sep 17 00:00:00 2001 From: Viktor Klang Date: Thu, 27 Oct 2011 20:19:16 +0200 Subject: [PATCH 24/57] Porting the Supervisor spec --- .../scala/akka/actor/SupervisorSpec.scala | 119 +++++++++--------- .../src/main/scala/akka/actor/ActorCell.scala | 2 +- 2 files changed, 60 insertions(+), 61 deletions(-) diff --git a/akka-actor-tests/src/test/scala/akka/actor/SupervisorSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/SupervisorSpec.scala index c38290eeec..4e3d495b94 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/SupervisorSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/SupervisorSpec.scala @@ -19,6 +19,8 @@ object SupervisorSpec { val Timeout = 5 seconds val TimeoutMillis = Timeout.dilated.toMillis.toInt + case object DieReply + // ===================================================== // Message logs // ===================================================== @@ -27,37 +29,38 @@ object SupervisorSpec { val PongMessage = "pong" val ExceptionMessage = "Expected exception; to test fault-tolerance" - var messageLog = new LinkedBlockingQueue[String] - - def messageLogPoll = messageLog.poll(Timeout.length, Timeout.unit) - // ===================================================== // Actors // ===================================================== - class PingPongActor extends Actor { + class PingPongActor(sendTo: ActorRef) extends Actor { def receive = { case Ping ⇒ - messageLog.put(PingMessage) - sender.tell(PongMessage) + sendTo ! PingMessage + if (sender != sendTo) + sender ! PongMessage case Die ⇒ throw new RuntimeException(ExceptionMessage) + case DieReply ⇒ + val e = new RuntimeException(ExceptionMessage) + sender ! Status.Failure(e) + throw e } override def postRestart(reason: Throwable) { - messageLog.put(reason.getMessage) + sendTo ! reason.getMessage } } - class Master extends Actor { + class Master(sendTo: ActorRef) extends Actor { + val temp = watch(context.actorOf(Props(new PingPongActor(sendTo)))) - val temp = context.actorOf(Props[PingPongActor]) - self startsMonitoring temp var s: ActorRef = _ def receive = { - case Die ⇒ temp ! Die; s = sender - case Terminated(`temp`) ⇒ s ! "terminated" + case Die ⇒ temp forward Die + case Terminated(`temp`) ⇒ sendTo ! "terminated" + case Status.Failure(_) ⇒ /*Ignore*/ } } } @@ -75,45 +78,45 @@ class SupervisorSpec extends AkkaSpec with BeforeAndAfterEach with ImplicitSende def temporaryActorAllForOne = { val supervisor = actorOf(Props[Supervisor].withFaultHandler(AllForOneStrategy(List(classOf[Exception]), Some(0)))) - val temporaryActor = child(supervisor, Props[PingPongActor]) + val temporaryActor = child(supervisor, Props(new PingPongActor(testActor))) (temporaryActor, supervisor) } def singleActorAllForOne = { val supervisor = actorOf(Props[Supervisor].withFaultHandler(AllForOneStrategy(List(classOf[Exception]), 3, TimeoutMillis))) - val pingpong = child(supervisor, Props[PingPongActor]) + val pingpong = child(supervisor, Props(new PingPongActor(testActor))) (pingpong, supervisor) } def singleActorOneForOne = { val supervisor = actorOf(Props[Supervisor].withFaultHandler(OneForOneStrategy(List(classOf[Exception]), 3, TimeoutMillis))) - val pingpong = child(supervisor, Props[PingPongActor]) + val pingpong = child(supervisor, Props(new PingPongActor(testActor))) (pingpong, supervisor) } def multipleActorsAllForOne = { val supervisor = actorOf(Props[Supervisor].withFaultHandler(AllForOneStrategy(List(classOf[Exception]), 3, TimeoutMillis))) - val pingpong1, pingpong2, pingpong3 = child(supervisor, Props[PingPongActor]) + val pingpong1, pingpong2, pingpong3 = child(supervisor, Props(new PingPongActor(testActor))) (pingpong1, pingpong2, pingpong3, supervisor) } def multipleActorsOneForOne = { val supervisor = actorOf(Props[Supervisor].withFaultHandler(OneForOneStrategy(List(classOf[Exception]), 3, TimeoutMillis))) - val pingpong1, pingpong2, pingpong3 = child(supervisor, Props[PingPongActor]) + val pingpong1, pingpong2, pingpong3 = child(supervisor, Props(new PingPongActor(testActor))) (pingpong1, pingpong2, pingpong3, supervisor) } def nestedSupervisorsAllForOne = { val topSupervisor = actorOf(Props[Supervisor].withFaultHandler(AllForOneStrategy(List(classOf[Exception]), 3, TimeoutMillis))) - val pingpong1 = child(topSupervisor, Props[PingPongActor]) + val pingpong1 = child(topSupervisor, Props(new PingPongActor(testActor))) val middleSupervisor = child(topSupervisor, Props[Supervisor].withFaultHandler(AllForOneStrategy(Nil, 3, TimeoutMillis))) - val pingpong2, pingpong3 = child(middleSupervisor, Props[PingPongActor]) + val pingpong2, pingpong3 = child(middleSupervisor, Props(new PingPongActor(testActor))) (pingpong1, pingpong2, pingpong3, topSupervisor) } @@ -129,49 +132,46 @@ class SupervisorSpec extends AkkaSpec with BeforeAndAfterEach with ImplicitSende } override def beforeEach() = { - messageLog.clear + } def ping(pingPongActor: ActorRef) = { - (pingPongActor.?(Ping, TimeoutMillis)).as[String].getOrElse("nil") must be === PongMessage - messageLogPoll must be === PingMessage + (pingPongActor.?(Ping, TimeoutMillis)).as[String] must be === Some(PongMessage) + expectMsg(Timeout, PingMessage) } def kill(pingPongActor: ActorRef) = { - intercept[RuntimeException] { (pingPongActor ? (Die, TimeoutMillis)).as[Any] } - messageLogPoll must be === ExceptionMessage + val result = (pingPongActor ? (DieReply, TimeoutMillis)) + expectMsg(Timeout, ExceptionMessage) + intercept[RuntimeException] { result.get } } "A supervisor" must { - "not restart programmatically linked temporary actor" in { - val master = actorOf(Props[Master].withFaultHandler(OneForOneStrategy(List(classOf[Exception]), Some(0)))) + "not restart child more times than permitted" in { + val master = actorOf(Props(new Master(testActor)).withFaultHandler(OneForOneStrategy(List(classOf[Exception]), Some(0)))) master ! Die expectMsg(3 seconds, "terminated") - - sleepFor(1 second) - messageLogPoll must be(null) + expectNoMsg(1 second) } "not restart temporary actor" in { - val (temporaryActor, supervisor) = temporaryActorAllForOne + val (temporaryActor, _) = temporaryActorAllForOne - intercept[RuntimeException] { - (temporaryActor.?(Die, TimeoutMillis)).get - } + intercept[RuntimeException] { (temporaryActor.?(DieReply, TimeoutMillis)).get } - sleepFor(1 second) - messageLog.size must be(0) + expectNoMsg(1 second) } "start server for nested supervisor hierarchy" in { - val (actor1, actor2, actor3, supervisor) = nestedSupervisorsAllForOne + val (actor1, _, _, _) = nestedSupervisorsAllForOne ping(actor1) + expectNoMsg(1 second) } "kill single actor OneForOne" in { - val (actor, supervisor) = singleActorOneForOne + val (actor, _) = singleActorOneForOne kill(actor) } @@ -224,8 +224,8 @@ class SupervisorSpec extends AkkaSpec with BeforeAndAfterEach with ImplicitSende kill(actor2) // and two more exception messages - messageLogPoll must be(ExceptionMessage) - messageLogPoll must be(ExceptionMessage) + expectMsg(Timeout, ExceptionMessage) + expectMsg(Timeout, ExceptionMessage) } "call-kill-call multiple actors AllForOne" in { @@ -238,8 +238,8 @@ class SupervisorSpec extends AkkaSpec with BeforeAndAfterEach with ImplicitSende kill(actor2) // and two more exception messages - messageLogPoll must be(ExceptionMessage) - messageLogPoll must be(ExceptionMessage) + expectMsg(Timeout, ExceptionMessage) + expectMsg(Timeout, ExceptionMessage) ping(actor1) ping(actor2) @@ -247,27 +247,26 @@ class SupervisorSpec extends AkkaSpec with BeforeAndAfterEach with ImplicitSende } "one-way kill single actor OneForOne" in { - val (actor, supervisor) = singleActorOneForOne + val (actor, _) = singleActorOneForOne actor ! Die - messageLogPoll must be(ExceptionMessage) + expectMsg(Timeout, ExceptionMessage) } "one-way call-kill-call single actor OneForOne" in { - val (actor, supervisor) = singleActorOneForOne + val (actor, _) = singleActorOneForOne actor ! Ping - messageLogPoll must be(PingMessage) - actor ! Die - messageLogPoll must be(ExceptionMessage) - actor ! Ping - messageLogPoll must be(PingMessage) + + expectMsg(Timeout, PingMessage) + expectMsg(Timeout, ExceptionMessage) + expectMsg(Timeout, PingMessage) } "restart killed actors in nested superviser hierarchy" in { - val (actor1, actor2, actor3, supervisor) = nestedSupervisorsAllForOne + val (actor1, actor2, actor3, _) = nestedSupervisorsAllForOne ping(actor1) ping(actor2) @@ -276,8 +275,8 @@ class SupervisorSpec extends AkkaSpec with BeforeAndAfterEach with ImplicitSende kill(actor2) // and two more exception messages - messageLogPoll must be(ExceptionMessage) - messageLogPoll must be(ExceptionMessage) + expectMsg(Timeout, ExceptionMessage) + expectMsg(Timeout, ExceptionMessage) ping(actor1) ping(actor2) @@ -294,20 +293,20 @@ class SupervisorSpec extends AkkaSpec with BeforeAndAfterEach with ImplicitSende if (inits.get % 2 == 0) throw new IllegalStateException("Don't wanna!") def receive = { - case Ping ⇒ sender.tell(PongMessage) - case Die ⇒ throw new RuntimeException("Expected") + case Ping ⇒ sender ! PongMessage + case DieReply ⇒ + val e = new RuntimeException("Expected") + sender ! Status.Failure(e) + throw e } }) val dyingActor = (supervisor ? dyingProps).as[ActorRef].get intercept[RuntimeException] { - (dyingActor.?(Die, TimeoutMillis)).get + (dyingActor.?(DieReply, TimeoutMillis)).get } - // give time for restart - sleepFor(3 seconds) - - (dyingActor.?(Ping, TimeoutMillis)).as[String].getOrElse("nil") must be === PongMessage + (dyingActor.?(Ping, TimeoutMillis)).as[String] must be === Some(PongMessage) inits.get must be(3) diff --git a/akka-actor/src/main/scala/akka/actor/ActorCell.scala b/akka-actor/src/main/scala/akka/actor/ActorCell.scala index 6b1e8f2504..7da0553ae8 100644 --- a/akka-actor/src/main/scala/akka/actor/ActorCell.scala +++ b/akka-actor/src/main/scala/akka/actor/ActorCell.scala @@ -80,7 +80,7 @@ private[akka] class ActorCell( var currentMessage: Envelope = null - var actor: Actor = _ //FIXME We can most probably make this just a regular reference to Actor + var actor: Actor = _ def uuid: Uuid = self.uuid From 029e1f539f9baa71a1bad11e05f6a16949589cc3 Mon Sep 17 00:00:00 2001 From: Viktor Klang Date: Thu, 27 Oct 2011 20:41:48 +0200 Subject: [PATCH 25/57] Removing obsolete test for completing futures in the dispatcher --- .../akka/actor/dispatch/ActorModelSpec.scala | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/akka-actor-tests/src/test/scala/akka/actor/dispatch/ActorModelSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/dispatch/ActorModelSpec.scala index eff4600e53..d69a4e3b45 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/dispatch/ActorModelSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/dispatch/ActorModelSpec.scala @@ -437,21 +437,6 @@ class DispatcherModelSpec extends ActorModelSpec { def dispatcherType = "Dispatcher" "A " + dispatcherType must { - "complete all uncompleted sender futures on deregister" in { - implicit val dispatcher = newInterceptedDispatcher - val a = newTestActor(dispatcher).asInstanceOf[LocalActorRef] - a.suspend - val f1: Future[String] = a ? Reply("foo") mapTo manifest[String] - val stopped = a ? PoisonPill - val shouldBeCompleted = for (i ← 1 to 10) yield a ? Reply(i) - a.resume - assert(f1.get == "foo") - stopped.await - for (each ← shouldBeCompleted) - assert(each.await.exception.get.isInstanceOf[ActorKilledException]) - a.stop() - } - "process messages in parallel" in { implicit val dispatcher = newInterceptedDispatcher val aStart, aStop, bParallel = new CountDownLatch(1) From df27942402778b6f5e873fbe46b7e2d2f8b0729f Mon Sep 17 00:00:00 2001 From: Viktor Klang Date: Fri, 28 Oct 2011 12:32:03 +0200 Subject: [PATCH 26/57] Fixing FutureSpec and adding finals to ActoCell and removing leftover debug print from TypedActor --- .../test/scala/akka/dispatch/FutureSpec.scala | 20 ++++---- .../src/main/scala/akka/actor/ActorCell.scala | 46 +++++++++---------- .../main/scala/akka/actor/TypedActor.scala | 1 - 3 files changed, 34 insertions(+), 33 deletions(-) diff --git a/akka-actor-tests/src/test/scala/akka/dispatch/FutureSpec.scala b/akka-actor-tests/src/test/scala/akka/dispatch/FutureSpec.scala index b2505f4a41..c5d40b8701 100644 --- a/akka-actor-tests/src/test/scala/akka/dispatch/FutureSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/dispatch/FutureSpec.scala @@ -6,19 +6,21 @@ import org.scalacheck._ import org.scalacheck.Arbitrary._ import org.scalacheck.Prop._ import org.scalacheck.Gen._ -import akka.actor.{ Actor, ActorRef, Timeout } +import akka.actor.{ Actor, ActorRef, Status } import akka.testkit.{ EventFilter, filterEvents, filterException } import akka.util.duration._ import org.multiverse.api.latches.StandardLatch import java.util.concurrent.{ TimeUnit, CountDownLatch } import akka.testkit.AkkaSpec import org.scalatest.junit.JUnitSuite +import java.lang.ArithmeticException object FutureSpec { class TestActor extends Actor { def receive = { - case "Hello" ⇒ sender ! "World" - case "Failure" ⇒ throw new RuntimeException("Expected exception; to test fault-tolerance") + case "Hello" ⇒ sender ! "World" + case "Failure" ⇒ + sender ! Status.Failure(new RuntimeException("Expected exception; to test fault-tolerance")) case "NoReply" ⇒ } } @@ -29,7 +31,7 @@ object FutureSpec { case "NoReply" ⇒ await.await case "Failure" ⇒ await.await - throw new RuntimeException("Expected exception; to test fault-tolerance") + sender ! Status.Failure(new RuntimeException("Expected exception; to test fault-tolerance")) } } } @@ -149,7 +151,7 @@ class FutureSpec extends AkkaSpec with Checkers with BeforeAndAfterAll { behave like futureWithException[ArithmeticException] { test ⇒ filterException[ArithmeticException] { val actor1 = actorOf[TestActor] - val actor2 = actorOf(new Actor { def receive = { case s: String ⇒ sender ! s.length / 0 } }) + val actor2 = actorOf(new Actor { def receive = { case s: String ⇒ sender ! Status.Failure(new ArithmeticException("/ by zero")) } }) val future = actor1 ? "Hello" flatMap { case s: String ⇒ actor2 ? s } future.await test(future, "/ by zero") @@ -323,8 +325,8 @@ class FutureSpec extends AkkaSpec with Checkers with BeforeAndAfterAll { def receive = { case (add: Int, wait: Int) ⇒ Thread.sleep(wait) - if (add == 6) throw new IllegalArgumentException("shouldFoldResultsWithException: expected") - sender.tell(add) + if (add == 6) sender ! Status.Failure(new IllegalArgumentException("shouldFoldResultsWithException: expected")) + else sender.tell(add) } }) } @@ -371,8 +373,8 @@ class FutureSpec extends AkkaSpec with Checkers with BeforeAndAfterAll { def receive = { case (add: Int, wait: Int) ⇒ Thread.sleep(wait) - if (add == 6) throw new IllegalArgumentException("shouldFoldResultsWithException: expected") - sender.tell(add) + if (add == 6) sender ! Status.Failure(new IllegalArgumentException("shouldFoldResultsWithException: expected")) + else sender.tell(add) } }) } diff --git a/akka-actor/src/main/scala/akka/actor/ActorCell.scala b/akka-actor/src/main/scala/akka/actor/ActorCell.scala index 7da0553ae8..7a9cf75d1c 100644 --- a/akka-actor/src/main/scala/akka/actor/ActorCell.scala +++ b/akka-actor/src/main/scala/akka/actor/ActorCell.scala @@ -68,11 +68,11 @@ private[akka] class ActorCell( import ActorCell._ - protected def guardian = self + protected final def guardian = self protected def typedActor = app.typedActor - def provider = app.provider + final def provider = app.provider var futureTimeout: Option[ScheduledFuture[AnyRef]] = None @@ -87,12 +87,12 @@ private[akka] class ActorCell( @inline final def dispatcher: MessageDispatcher = if (props.dispatcher == Props.defaultDispatcher) app.dispatcher else props.dispatcher - def isShutdown: Boolean = mailbox.isClosed + final def isShutdown: Boolean = mailbox.isClosed @volatile //This must be volatile since it isn't protected by the mailbox status var mailbox: Mailbox = _ - def start(): Unit = { + final def start(): Unit = { mailbox = dispatcher.createMailbox(this) // ➡➡➡ NEVER SEND THE SAME SYSTEM MESSAGE OBJECT TO TWO ACTORS ⬅⬅⬅ @@ -102,31 +102,31 @@ private[akka] class ActorCell( } // ➡➡➡ NEVER SEND THE SAME SYSTEM MESSAGE OBJECT TO TWO ACTORS ⬅⬅⬅ - def suspend(): Unit = dispatcher.systemDispatch(this, Suspend()) + final def suspend(): Unit = dispatcher.systemDispatch(this, Suspend()) // ➡➡➡ NEVER SEND THE SAME SYSTEM MESSAGE OBJECT TO TWO ACTORS ⬅⬅⬅ - def resume(): Unit = dispatcher.systemDispatch(this, Resume()) + final def resume(): Unit = dispatcher.systemDispatch(this, Resume()) // ➡➡➡ NEVER SEND THE SAME SYSTEM MESSAGE OBJECT TO TWO ACTORS ⬅⬅⬅ private[akka] def stop(): Unit = dispatcher.systemDispatch(this, Terminate()) - def startsMonitoring(subject: ActorRef): ActorRef = { + final def startsMonitoring(subject: ActorRef): ActorRef = { // ➡➡➡ NEVER SEND THE SAME SYSTEM MESSAGE OBJECT TO TWO ACTORS ⬅⬅⬅ dispatcher.systemDispatch(this, Link(subject)) subject } - def stopsMonitoring(subject: ActorRef): ActorRef = { + final def stopsMonitoring(subject: ActorRef): ActorRef = { // ➡➡➡ NEVER SEND THE SAME SYSTEM MESSAGE OBJECT TO TWO ACTORS ⬅⬅⬅ dispatcher.systemDispatch(this, Unlink(subject)) subject } - def children: Iterable[ActorRef] = _children.keys + final def children: Iterable[ActorRef] = _children.keys - def postMessageToMailbox(message: Any, sender: ActorRef): Unit = dispatcher.dispatch(this, Envelope(message, sender)) + final def postMessageToMailbox(message: Any, sender: ActorRef): Unit = dispatcher.dispatch(this, Envelope(message, sender)) - def sender: ActorRef = currentMessage match { + final def sender: ActorRef = currentMessage match { case null ⇒ app.deadLetters case msg if msg.sender ne null ⇒ msg.sender case _ ⇒ app.deadLetters @@ -150,7 +150,7 @@ private[akka] class ActorCell( } } - def systemInvoke(message: SystemMessage) { + final def systemInvoke(message: SystemMessage) { def create(): Unit = try { val created = newActor() @@ -268,7 +268,7 @@ private[akka] class ActorCell( } } - def invoke(messageHandle: Envelope) { + final def invoke(messageHandle: Envelope) { try { val isClosed = mailbox.isClosed //Fence plus volatile read if (!isClosed) { @@ -308,20 +308,20 @@ private[akka] class ActorCell( } } - def handleFailure(fail: Failed): Unit = _children.get(fail.actor) match { + final def handleFailure(fail: Failed): Unit = _children.get(fail.actor) match { case Some(stats) ⇒ if (!props.faultHandler.handleFailure(fail, stats, _children)) throw fail.cause case None ⇒ app.eventHandler.warning(self, "dropping " + fail + " from unknown child") } - def handleChildTerminated(child: ActorRef): Unit = { + final def handleChildTerminated(child: ActorRef): Unit = { _children -= child props.faultHandler.handleChildTerminated(child, children) } // ➡➡➡ NEVER SEND THE SAME SYSTEM MESSAGE OBJECT TO TWO ACTORS ⬅⬅⬅ - def restart(cause: Throwable): Unit = dispatcher.systemDispatch(this, Recreate(cause)) + final def restart(cause: Throwable): Unit = dispatcher.systemDispatch(this, Recreate(cause)) - def checkReceiveTimeout() { + final def checkReceiveTimeout() { cancelReceiveTimeout() val recvtimeout = receiveTimeout if (recvtimeout.isDefined && dispatcher.mailboxIsEmpty(this)) { @@ -330,16 +330,16 @@ private[akka] class ActorCell( } } - def cancelReceiveTimeout() { + final def cancelReceiveTimeout() { if (futureTimeout.isDefined) { futureTimeout.get.cancel(true) futureTimeout = None } } - def clearActorContext(): Unit = setActorContext(null) + final def clearActorContext(): Unit = setActorContext(null) - def setActorContext(newContext: ActorContext) { + final def setActorContext(newContext: ActorContext) { @tailrec def lookupAndSetSelfFields(clazz: Class[_], actor: Actor, newContext: ActorContext): Boolean = { val success = try { @@ -364,11 +364,11 @@ private[akka] class ActorCell( lookupAndSetSelfFields(a.getClass, a, newContext) } - override def hashCode: Int = HashCode.hash(HashCode.SEED, uuid) + override final def hashCode: Int = HashCode.hash(HashCode.SEED, uuid) - override def equals(that: Any): Boolean = { + override final def equals(that: Any): Boolean = { that.isInstanceOf[ActorCell] && that.asInstanceOf[ActorCell].uuid == uuid } - override def toString = "ActorCell[%s]".format(uuid) + override final def toString = "ActorCell[%s]".format(uuid) } diff --git a/akka-actor/src/main/scala/akka/actor/TypedActor.scala b/akka-actor/src/main/scala/akka/actor/TypedActor.scala index fb3269249c..92c523630b 100644 --- a/akka-actor/src/main/scala/akka/actor/TypedActor.scala +++ b/akka-actor/src/main/scala/akka/actor/TypedActor.scala @@ -378,7 +378,6 @@ class TypedActor(val app: AkkaApplication) { case m if m.returnsJOption_? || m.returnsOption_? ⇒ val f = actor.?(m, timeout) try { f.await } catch { case _: FutureTimeoutException ⇒ } - println("JOption result: " + f.value) f.value match { case None | Some(Right(null)) ⇒ if (m.returnsJOption_?) JOption.none[Any] else None case Some(Right(joption: AnyRef)) ⇒ joption From 5d4ef80618d2528e9be5305f26575c68f05ab6a8 Mon Sep 17 00:00:00 2001 From: Viktor Klang Date: Fri, 28 Oct 2011 16:00:06 +0200 Subject: [PATCH 27/57] Fixing ActorModelSpec for CallingThreadDispatcher --- .../akka/actor/dispatch/ActorModelSpec.scala | 19 +++++-------------- .../akka/remote/RemoteActorRefProvider.scala | 2 +- .../src/main/scala/akka/agent/Agent.scala | 6 ++---- 3 files changed, 8 insertions(+), 19 deletions(-) diff --git a/akka-actor-tests/src/test/scala/akka/actor/dispatch/ActorModelSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/dispatch/ActorModelSpec.scala index d69a4e3b45..05473f0f6e 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/dispatch/ActorModelSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/dispatch/ActorModelSpec.scala @@ -78,7 +78,7 @@ object ActorModelSpec { case Increment(count) ⇒ ack; count.incrementAndGet(); busy.switchOff() case CountDownNStop(l) ⇒ ack; l.countDown(); self.stop(); busy.switchOff() case Restart ⇒ ack; busy.switchOff(); throw new Exception("Restart requested") - case Interrupt ⇒ ack; busy.switchOff(); throw new InterruptedException("Ping!") + case Interrupt ⇒ ack; sender ! Status.Failure(new ActorInterruptedException(new InterruptedException("Ping!"))); busy.switchOff(); throw new InterruptedException("Ping!") case ThrowException(e: Throwable) ⇒ ack; busy.switchOff(); throw e } } @@ -379,26 +379,17 @@ abstract class ActorModelSpec extends AkkaSpec { val a = newTestActor(dispatcher) val f1 = a ? Reply("foo") val f2 = a ? Reply("bar") - val f3 = try { - a ? Interrupt - } catch { - // CallingThreadDispatcher throws IE directly - case ie: InterruptedException ⇒ new KeptPromise(Left(ActorInterruptedException(ie))) - } + val f3 = try { a ? Interrupt } catch { case ie: InterruptedException ⇒ new KeptPromise(Left(ActorInterruptedException(ie))) } val f4 = a ? Reply("foo2") - val f5 = try { - a ? Interrupt - } catch { - case ie: InterruptedException ⇒ new KeptPromise(Left(ActorInterruptedException(ie))) - } + val f5 = try { a ? Interrupt } catch { case ie: InterruptedException ⇒ new KeptPromise(Left(ActorInterruptedException(ie))) } val f6 = a ? Reply("bar2") assert(f1.get === "foo") assert(f2.get === "bar") assert(f4.get === "foo2") - assert(f3.value === None) + assert(intercept[ActorInterruptedException](f3.get).getMessage === "Ping!") assert(f6.get === "bar2") - assert(f5.value === None) + assert(intercept[ActorInterruptedException](f5.get).getMessage === "Ping!") } } diff --git a/akka-remote/src/main/scala/akka/remote/RemoteActorRefProvider.scala b/akka-remote/src/main/scala/akka/remote/RemoteActorRefProvider.scala index 32248ef6a7..4bc406a226 100644 --- a/akka-remote/src/main/scala/akka/remote/RemoteActorRefProvider.scala +++ b/akka-remote/src/main/scala/akka/remote/RemoteActorRefProvider.scala @@ -41,7 +41,7 @@ class RemoteActorRefProvider(val app: AkkaApplication) extends ActorRefProvider private val remoteDaemonConnectionManager = new RemoteConnectionManager(app, remote) private[akka] def theOneWhoWalksTheBubblesOfSpaceTime: ActorRef = local.theOneWhoWalksTheBubblesOfSpaceTime - private[akka] def terminationFuture = new DefaultPromise[AkkaApplication.ExitStatus](Timeout.never)(app.dispatcher) + private[akka] def terminationFuture = local.terminationFuture def defaultDispatcher = app.dispatcher def defaultTimeout = app.AkkaConfig.ActorTimeout diff --git a/akka-stm/src/main/scala/akka/agent/Agent.scala b/akka-stm/src/main/scala/akka/agent/Agent.scala index c2d0e1b485..720059b49b 100644 --- a/akka-stm/src/main/scala/akka/agent/Agent.scala +++ b/akka-stm/src/main/scala/akka/agent/Agent.scala @@ -125,9 +125,7 @@ class Agent[T](initialValue: T, app: AkkaApplication) { if (Stm.activeTransaction) { val result = new DefaultPromise[T](timeout)(app.dispatcher) get //Join xa - deferred { - result completeWith dispatch - } //Attach deferred-block to current transaction + deferred { result completeWith dispatch } //Attach deferred-block to current transaction result } else dispatch } @@ -288,7 +286,7 @@ class AgentUpdater[T](agent: Agent[T]) extends Actor { def receive = { case update: Update[_] ⇒ sender.tell(atomic(txFactory) { agent.ref alter update.function.asInstanceOf[T ⇒ T] }) - case Get ⇒ sender ! agent.get + case Get ⇒ sender.tell(agent.get) case _ ⇒ } } From d64b2a7292ff585742fb93a3b5a04a3b92c1ffe0 Mon Sep 17 00:00:00 2001 From: Viktor Klang Date: Fri, 28 Oct 2011 23:11:35 +0200 Subject: [PATCH 28/57] All green, fixing issues with the new ask implementation and remoting --- .../src/main/scala/akka/AkkaApplication.scala | 2 +- .../src/main/scala/akka/actor/ActorRef.scala | 26 +++++------ .../scala/akka/actor/ActorRefProvider.scala | 5 +++ .../src/main/scala/akka/dispatch/Future.scala | 2 +- .../scala/akka/remote/RemoteInterface.scala | 45 ------------------- .../src/main/scala/akka/remote/Remote.scala | 11 ++--- .../akka/remote/RemoteActorRefProvider.scala | 34 +++++++------- .../akka/remote/RemoteConnectionManager.scala | 2 +- .../remote/netty/NettyRemoteSupport.scala | 17 +++---- .../serialization/SerializationProtocol.scala | 13 ++---- 10 files changed, 48 insertions(+), 109 deletions(-) diff --git a/akka-actor/src/main/scala/akka/AkkaApplication.scala b/akka-actor/src/main/scala/akka/AkkaApplication.scala index 28cc0a5668..cd74495a5a 100644 --- a/akka-actor/src/main/scala/akka/AkkaApplication.scala +++ b/akka-actor/src/main/scala/akka/AkkaApplication.scala @@ -156,7 +156,7 @@ class AkkaApplication(val name: String, val config: Configuration) extends Actor case value ⇒ value.toInt } - val defaultAddress = new InetSocketAddress(hostname, AkkaConfig.RemoteServerPort) + val defaultAddress = new InetSocketAddress(hostname, port) // TODO correctly pull its config from the config val dispatcherFactory = new Dispatchers(this) diff --git a/akka-actor/src/main/scala/akka/actor/ActorRef.scala b/akka-actor/src/main/scala/akka/actor/ActorRef.scala index 6d6e738602..89c388ce17 100644 --- a/akka-actor/src/main/scala/akka/actor/ActorRef.scala +++ b/akka-actor/src/main/scala/akka/actor/ActorRef.scala @@ -10,6 +10,7 @@ import scala.collection.immutable.Stack import java.lang.{ UnsupportedOperationException, IllegalStateException } import akka.AkkaApplication import akka.event.ActorEventBus +import akka.serialization.Serialization /** * ActorRef is an immutable and serializable handle to an Actor. @@ -50,8 +51,6 @@ abstract class ActorRef extends java.lang.Comparable[ActorRef] with Serializable */ def address: String - private[akka] def uuid: Uuid //TODO FIXME REMOVE THIS - /** * Comparison only takes address into account. */ @@ -150,7 +149,7 @@ abstract class ActorRef extends java.lang.Comparable[ActorRef] with Serializable * @author Jonas Bonér */ class LocalActorRef private[akka] ( - app: AkkaApplication, + _app: AkkaApplication, props: Props, _supervisor: ActorRef, _givenAddress: String, @@ -165,7 +164,7 @@ class LocalActorRef private[akka] ( case other ⇒ other } - private[this] val actorCell = new ActorCell(app, this, props, _supervisor, receiveTimeout, hotswap) + private[this] val actorCell = new ActorCell(_app, this, props, _supervisor, receiveTimeout, hotswap) actorCell.start() /** @@ -233,20 +232,14 @@ class LocalActorRef private[akka] ( protected[akka] def postMessageToMailbox(message: Any, sender: ActorRef): Unit = actorCell.postMessageToMailbox(message, sender) - def ?(message: Any)(implicit timeout: Timeout): Future[Any] = app.provider.ask(message, this, timeout) + def ?(message: Any)(implicit timeout: Timeout): Future[Any] = actorCell.provider.ask(message, this, timeout) protected[akka] def handleFailure(fail: Failed): Unit = actorCell.handleFailure(fail) protected[akka] def restart(cause: Throwable): Unit = actorCell.restart(cause) - // ========= PRIVATE FUNCTIONS ========= - @throws(classOf[java.io.ObjectStreamException]) - private def writeReplace(): AnyRef = { - // TODO: this was used to really send LocalActorRef across the network, which is broken now - val inetaddr = app.defaultAddress - SerializedActorRef(uuid, address, inetaddr.getAddress.getHostAddress, inetaddr.getPort) - } + private def writeReplace(): AnyRef = actorCell.provider.serialize(this) } /** @@ -284,6 +277,8 @@ trait ScalaActorRef { ref: ActorRef ⇒ protected[akka] def postMessageToMailbox(message: Any, sender: ActorRef): Unit protected[akka] def restart(cause: Throwable): Unit + + private[akka] def uuid: Uuid //TODO FIXME REMOVE THIS } /** @@ -357,7 +352,7 @@ trait MinimalActorRef extends ActorRef with ScalaActorRef { case class DeadLetter(message: Any, sender: ActorRef) -class DeadLetterActorRef(app: AkkaApplication) extends MinimalActorRef { +class DeadLetterActorRef(val app: AkkaApplication) extends MinimalActorRef { val brokenPromise = new KeptPromise[Any](Left(new ActorKilledException("In DeadLetterActorRef, promises are always broken.")))(app.dispatcher) override val address: String = "akka:internal:DeadLetterActorRef" @@ -368,7 +363,7 @@ class DeadLetterActorRef(app: AkkaApplication) extends MinimalActorRef { def ?(message: Any)(implicit timeout: Timeout): Future[Any] = brokenPromise } -abstract class AskActorRef(app: AkkaApplication)(timeout: Timeout = app.AkkaConfig.ActorTimeout, dispatcher: MessageDispatcher = app.dispatcher) extends MinimalActorRef { +abstract class AskActorRef(protected val app: AkkaApplication)(timeout: Timeout = app.AkkaConfig.ActorTimeout, dispatcher: MessageDispatcher = app.dispatcher) extends MinimalActorRef { final val result = new DefaultPromise[Any](timeout)(dispatcher) { @@ -396,4 +391,7 @@ abstract class AskActorRef(app: AkkaApplication)(timeout: Timeout = app.AkkaConf override def isShutdown = result.isCompleted || result.isExpired override def stop(): Unit = if (!isShutdown) result.completeWithException(new ActorKilledException("Stopped")) + + @throws(classOf[java.io.ObjectStreamException]) + private def writeReplace(): AnyRef = app.provider.serialize(this) } diff --git a/akka-actor/src/main/scala/akka/actor/ActorRefProvider.scala b/akka-actor/src/main/scala/akka/actor/ActorRefProvider.scala index 81c4b66afc..f05fbbe86a 100644 --- a/akka-actor/src/main/scala/akka/actor/ActorRefProvider.scala +++ b/akka-actor/src/main/scala/akka/actor/ActorRefProvider.scala @@ -30,6 +30,7 @@ trait ActorRefProvider { private[akka] def evict(address: String): Boolean private[akka] def deserialize(actor: SerializedActorRef): Option[ActorRef] + private[akka] def serialize(actor: ActorRef): AnyRef private[akka] def createDeathWatch(): DeathWatch @@ -100,6 +101,8 @@ class LocalActorRefProvider(val app: AkkaApplication) extends ActorRefProvider { @volatile var stopped = false + def app = LocalActorRefProvider.this.app + override def address = app.name + ":BubbleWalker" override def toString = address @@ -216,6 +219,8 @@ class LocalActorRefProvider(val app: AkkaApplication) extends ActorRefProvider { } private[akka] def deserialize(actor: SerializedActorRef): Option[ActorRef] = actorFor(actor.address) + private[akka] def serialize(actor: ActorRef): AnyRef = + SerializedActorRef(actor.uuid, actor.address, app.hostname, app.port) private[akka] def createDeathWatch(): DeathWatch = new LocalDeathWatch diff --git a/akka-actor/src/main/scala/akka/dispatch/Future.scala b/akka-actor/src/main/scala/akka/dispatch/Future.scala index 86a998b350..6453403ce7 100644 --- a/akka-actor/src/main/scala/akka/dispatch/Future.scala +++ b/akka-actor/src/main/scala/akka/dispatch/Future.scala @@ -464,7 +464,7 @@ sealed trait Future[+T] extends japi.Future[T] { try { Some(BoxedType(m.erasure).cast(v).asInstanceOf[A]) } catch { case c: ClassCastException ⇒ if (v.asInstanceOf[AnyRef] eq null) throw new ClassCastException("null cannot be cast to " + m.erasure) - else throw new ClassCastException("" + v + " of class " + v.asInstanceOf[AnyRef].getClass + " cannot be cast to " + m.erasure) + else throw new ClassCastException("'" + v + "' of class " + v.asInstanceOf[AnyRef].getClass + " cannot be cast to " + m.erasure) } } } diff --git a/akka-actor/src/main/scala/akka/remote/RemoteInterface.scala b/akka-actor/src/main/scala/akka/remote/RemoteInterface.scala index 99cfbccc0c..c0e4a3a730 100644 --- a/akka-actor/src/main/scala/akka/remote/RemoteInterface.scala +++ b/akka-actor/src/main/scala/akka/remote/RemoteInterface.scala @@ -48,51 +48,6 @@ trait RemoteModule { if (actorRefOrNull eq null) actorRefOrNull = findActorByUuid(uuid) actorRefOrNull } - - /* - private[akka] def findActorByAddress(address: String): ActorRef = { - val cachedActorRef = actors.get(address) - if (cachedActorRef ne null) cachedActorRef - else { - val actorRef = - Deployer.lookupDeploymentFor(address) match { - case Some(Deploy(_, router, _, Cluster(home, _, _))) ⇒ - - if (DeploymentConfig.isHomeNode(home)) { // on home node - Actor.registry.actorFor(address) match { // try to look up in actor registry - case Some(actorRef) ⇒ // in registry -> DONE - actorRef - case None ⇒ // not in registry -> check out as 'ref' from cluster (which puts it in actor registry for next time around) - Actor.cluster.ref(address, DeploymentConfig.routerTypeFor(router)) - } - } else throw new IllegalActorStateException("Trying to look up remote actor on non-home node. FIXME: fix this behavior") - - case Some(Deploy(_, _, _, Local)) ⇒ - Actor.registry.actorFor(address).getOrElse(throw new IllegalActorStateException("Could not lookup locally deployed actor in actor registry")) - - case _ ⇒ - actors.get(address) // FIXME do we need to fall back to local here? If it is not clustered then it should not be a remote actor in the first place. Throw exception. - } - - actors.put(address, actorRef) // cache it for next time around - actorRef - } - } - - private[akka] def findActorByUuid(uuid: String): ActorRef = actorsByUuid.get(uuid) - - private[akka] def findActorFactory(address: String): () ⇒ ActorRef = actorsFactories.get(address) - - private[akka] def findActorByAddressOrUuid(address: String, uuid: String): ActorRef = { - // find by address - var actorRefOrNull = - if (address.startsWith(UUID_PREFIX)) findActorByUuid(address.substring(UUID_PREFIX.length)) // FIXME remove lookup by UUID? probably - else findActorByAddress(address) - // find by uuid - if (actorRefOrNull eq null) actorRefOrNull = findActorByUuid(uuid) - actorRefOrNull - } - */ } /** diff --git a/akka-remote/src/main/scala/akka/remote/Remote.scala b/akka-remote/src/main/scala/akka/remote/Remote.scala index 2d78b2f306..7e3bb86a78 100644 --- a/akka-remote/src/main/scala/akka/remote/Remote.scala +++ b/akka-remote/src/main/scala/akka/remote/Remote.scala @@ -55,8 +55,7 @@ class Remote(val app: AkkaApplication) extends RemoteService { private[remote] lazy val remoteDaemon = new LocalActorRef( app, - Props(new RemoteSystemDaemon(this)) - .withDispatcher(dispatcherFactory.newPinnedDispatcher(remoteDaemonServiceName)), + Props(new RemoteSystemDaemon(this)).withDispatcher(dispatcherFactory.newPinnedDispatcher(remoteDaemonServiceName)), remoteDaemonSupervisor, remoteDaemonServiceName, systemService = true) @@ -118,8 +117,7 @@ class RemoteSystemDaemon(remote: Remote) extends Actor { def receive: Actor.Receive = { case message: RemoteSystemDaemonMessageProtocol ⇒ - eventHandler.debug(this, - "Received command [\n%s] to RemoteSystemDaemon on [%s]".format(message, nodename)) + eventHandler.debug(this, "Received command [\n%s] to RemoteSystemDaemon on [%s]".format(message, nodename)) message.getMessageType match { case USE ⇒ handleUse(message) @@ -145,8 +143,7 @@ class RemoteSystemDaemon(remote: Remote) extends Actor { if (message.hasActorAddress) { val actorFactoryBytes = - if (shouldCompressData) LZF.uncompress(message.getPayload.toByteArray) - else message.getPayload.toByteArray + if (shouldCompressData) LZF.uncompress(message.getPayload.toByteArray) else message.getPayload.toByteArray val actorFactory = serialization.deserialize(actorFactoryBytes, classOf[() ⇒ Actor], None) match { @@ -165,7 +162,7 @@ class RemoteSystemDaemon(remote: Remote) extends Actor { sender ! Success(address.toString) } catch { - case error: Throwable ⇒ + case error: Throwable ⇒ //FIXME doesn't seem sensible sender ! Failure(error) throw error } diff --git a/akka-remote/src/main/scala/akka/remote/RemoteActorRefProvider.scala b/akka-remote/src/main/scala/akka/remote/RemoteActorRefProvider.scala index 4bc406a226..dedf5a4044 100644 --- a/akka-remote/src/main/scala/akka/remote/RemoteActorRefProvider.scala +++ b/akka-remote/src/main/scala/akka/remote/RemoteActorRefProvider.scala @@ -156,13 +156,14 @@ class RemoteActorRefProvider(val app: AkkaApplication) extends ActorRefProvider * Returns true if the actor was in the provider's cache and evicted successfully, else false. */ private[akka] def evict(address: String): Boolean = actors.remove(address) ne null - - private[akka] def deserialize(actor: SerializedActorRef): Option[ActorRef] = { - local.actorFor(actor.address) orElse { - Some(RemoteActorRef(remote.server, new InetSocketAddress(actor.hostname, actor.port), actor.address, None)) - } + private[akka] def serialize(actor: ActorRef): AnyRef = actor match { + case r: RemoteActorRef ⇒ SerializedActorRef(actor.uuid, actor.address, r.remoteAddress.getAddress.getHostAddress, r.remoteAddress.getPort) + case other ⇒ local.serialize(actor) } + private[akka] def deserialize(actor: SerializedActorRef): Option[ActorRef] = + local.actorFor(actor.address) orElse Some(RemoteActorRef(remote.server, new InetSocketAddress(actor.hostname, actor.port), actor.address, None)) + /** * Using (checking out) actor on a specific node. */ @@ -171,10 +172,8 @@ class RemoteActorRefProvider(val app: AkkaApplication) extends ActorRefProvider val actorFactoryBytes = app.serialization.serialize(actorFactory) match { - case Left(error) ⇒ throw error - case Right(bytes) ⇒ - if (remote.shouldCompressData) LZF.compress(bytes) - else bytes + case Left(error) ⇒ throw error + case Right(bytes) ⇒ if (remote.shouldCompressData) LZF.compress(bytes) else bytes } val command = RemoteSystemDaemonMessageProtocol.newBuilder @@ -183,9 +182,7 @@ class RemoteActorRefProvider(val app: AkkaApplication) extends ActorRefProvider .setPayload(ByteString.copyFrom(actorFactoryBytes)) .build() - val connectionFactory = - () ⇒ remote.server.actorFor( - remote.remoteDaemonServiceName, remoteAddress.getHostName, remoteAddress.getPort) + val connectionFactory = () ⇒ remote.server.actorFor(remote.remoteDaemonServiceName, remoteAddress.getAddress.getHostAddress, remoteAddress.getPort) // try to get the connection for the remote address, if not already there then create it val connection = remoteDaemonConnectionManager.putIfAbsent(remoteAddress, connectionFactory) @@ -196,11 +193,12 @@ class RemoteActorRefProvider(val app: AkkaApplication) extends ActorRefProvider private def sendCommandToRemoteNode(connection: ActorRef, command: RemoteSystemDaemonMessageProtocol, withACK: Boolean) { if (withACK) { try { - (connection ? (command, remote.remoteSystemDaemonAckTimeout)).as[Status] match { - case Some(Success(receiver)) ⇒ + val f = connection ? (command, remote.remoteSystemDaemonAckTimeout) + (try f.await.value catch { case _: FutureTimeoutException ⇒ None }) match { + case Some(Right(receiver)) ⇒ app.eventHandler.debug(this, "Remote system command sent to [%s] successfully received".format(receiver)) - case Some(Failure(cause)) ⇒ + case Some(Left(cause)) ⇒ app.eventHandler.error(cause, this, cause.toString) throw cause @@ -247,7 +245,7 @@ private[akka] case class RemoteActorRef private[akka] ( protected[akka] def sendSystemMessage(message: SystemMessage): Unit = unsupported def postMessageToMailbox(message: Any, sender: ActorRef) { - remote.send[Any](message, Some(sender), remoteAddress, this, loader) + remote.send[Any](message, Option(sender), remoteAddress, this, loader) } def ?(message: Any)(implicit timeout: Timeout): Future[Any] = remote.app.provider.ask(message, this, timeout) @@ -266,9 +264,7 @@ private[akka] case class RemoteActorRef private[akka] ( } @throws(classOf[java.io.ObjectStreamException]) - private def writeReplace(): AnyRef = { - SerializedActorRef(uuid, address, remoteAddress.getAddress.getHostAddress, remoteAddress.getPort) - } + private def writeReplace(): AnyRef = app.provider.serialize(this) def startsMonitoring(actorRef: ActorRef): ActorRef = unsupported diff --git a/akka-remote/src/main/scala/akka/remote/RemoteConnectionManager.scala b/akka-remote/src/main/scala/akka/remote/RemoteConnectionManager.scala index f8837ec4f4..a2a5ef4a93 100644 --- a/akka-remote/src/main/scala/akka/remote/RemoteConnectionManager.scala +++ b/akka-remote/src/main/scala/akka/remote/RemoteConnectionManager.scala @@ -31,7 +31,7 @@ class RemoteConnectionManager( def iterable: Iterable[ActorRef] = connections.values } - val failureDetector = remote.failureDetector + def failureDetector = remote.failureDetector private val state: AtomicReference[State] = new AtomicReference[State](newState()) diff --git a/akka-remote/src/main/scala/akka/remote/netty/NettyRemoteSupport.scala b/akka-remote/src/main/scala/akka/remote/netty/NettyRemoteSupport.scala index 16c910dfcd..66ce5a5334 100644 --- a/akka-remote/src/main/scala/akka/remote/netty/NettyRemoteSupport.scala +++ b/akka-remote/src/main/scala/akka/remote/netty/NettyRemoteSupport.scala @@ -159,7 +159,7 @@ abstract class RemoteClient private[akka] ( * Converts the message to the wireprotocol and sends the message across the wire */ def send[T](message: Any, senderOption: Option[ActorRef], remoteAddress: InetSocketAddress, actorRef: ActorRef) { - val messageProtocol = serialization.createRemoteMessageProtocolBuilder(Some(actorRef), Left(actorRef.uuid), actorRef.address, app.AkkaConfig.ActorTimeoutMillis, Right(message), senderOption).build + val messageProtocol = serialization.createRemoteMessageProtocolBuilder(Option(actorRef), Left(actorRef.uuid), actorRef.address, app.AkkaConfig.ActorTimeoutMillis, Right(message), senderOption).build send(messageProtocol) } @@ -862,19 +862,12 @@ class RemoteServerHandler( return } - val message = MessageSerializer.deserialize(app, request.getMessage) val sender = if (request.hasSender) serialization.fromProtobufToRemoteActorRef(request.getSender, applicationLoader) else app.deadLetters - message match { - // first match on system messages - case _: Terminate ⇒ - if (UNTRUSTED_MODE) throw new SecurityException("RemoteModule server is operating is untrusted mode, can not stop the actor") else actorRef.stop() - - case _: AutoReceivedMessage if (UNTRUSTED_MODE) ⇒ - throw new SecurityException("RemoteModule server is operating is untrusted mode, can not pass on a AutoReceivedMessage to the remote actor") - - case _ ⇒ // then match on user defined messages - actorRef.!(message)(sender) + MessageSerializer.deserialize(app, request.getMessage) match { + case _: Terminate ⇒ if (UNTRUSTED_MODE) throw new SecurityException("RemoteModule server is operating is untrusted mode, can not stop the actor") else actorRef.stop() + case _: AutoReceivedMessage if (UNTRUSTED_MODE) ⇒ throw new SecurityException("RemoteModule server is operating is untrusted mode, can not pass on a AutoReceivedMessage to the remote actor") + case m ⇒ actorRef.!(m)(sender) } } diff --git a/akka-remote/src/main/scala/akka/serialization/SerializationProtocol.scala b/akka-remote/src/main/scala/akka/serialization/SerializationProtocol.scala index 75415b9be1..bea53aee16 100644 --- a/akka-remote/src/main/scala/akka/serialization/SerializationProtocol.scala +++ b/akka-remote/src/main/scala/akka/serialization/SerializationProtocol.scala @@ -60,11 +60,9 @@ class RemoteActorSerialization(remote: RemoteSupport) { val remoteAddress = actor match { case ar: RemoteActorRef ⇒ ar.remoteAddress - case ar: LocalActorRef ⇒ - remote.registerByUuid(ar) - remote.app.defaultAddress - case _ ⇒ - remote.app.defaultAddress + case ar: ActorRef ⇒ + remote.register(ar) //FIXME stop doing this and delegate to provider.actorFor in the NettyRemoting + remote.app.defaultAddress //FIXME Shouldn't this be the _current_ address of the remoting? } remote.app.eventHandler.debug(this, "Register serialized Actor [%s] as remote @ [%s]".format(actor.uuid, remoteAddress)) @@ -89,10 +87,7 @@ class RemoteActorSerialization(remote: RemoteSupport) { case Right(protocol) ⇒ protocol } - val actorInfoBuilder = ActorInfoProtocol.newBuilder - .setUuid(uuidProtocol) - .setAddress(actorAddress) - .setTimeout(timeout) + val actorInfoBuilder = ActorInfoProtocol.newBuilder.setUuid(uuidProtocol).setAddress(actorAddress).setTimeout(timeout) val actorInfo = actorInfoBuilder.build val messageBuilder = RemoteMessageProtocol.newBuilder From 91545a4b528bc8def7866f63387c199840603211 Mon Sep 17 00:00:00 2001 From: Viktor Klang Date: Sat, 29 Oct 2011 00:36:42 +0200 Subject: [PATCH 29/57] Fixing TestActorRefSpec, now everything's green --- .../src/test/scala/akka/routing/ActorPoolSpec.scala | 2 +- akka-actor/src/main/java/akka/dispatch/AbstractPromise.java | 2 +- akka-actor/src/main/scala/akka/actor/ActorRefProvider.scala | 2 -- akka-actor/src/main/scala/akka/dispatch/Future.scala | 6 +++--- .../src/main/scala/akka/remote/RemoteActorRefProvider.scala | 2 +- .../src/test/scala/akka/testkit/TestActorRefSpec.scala | 5 +---- 6 files changed, 7 insertions(+), 12 deletions(-) diff --git a/akka-actor-tests/src/test/scala/akka/routing/ActorPoolSpec.scala b/akka-actor-tests/src/test/scala/akka/routing/ActorPoolSpec.scala index 01fd35ba42..702f167b40 100644 --- a/akka-actor-tests/src/test/scala/akka/routing/ActorPoolSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/routing/ActorPoolSpec.scala @@ -347,7 +347,7 @@ class ActorPoolSpec extends AkkaSpec { val pool = app.createProxy[Foo](createPool, Props().withFaultHandler(faultHandler)) - val results = for (i ← 1 to 100) yield (i, pool.sq(i, 100)) + val results = for (i ← 1 to 50) yield (i, pool.sq(i, 100)) for ((i, r) ← results) r.get must equal(i * i) } diff --git a/akka-actor/src/main/java/akka/dispatch/AbstractPromise.java b/akka-actor/src/main/java/akka/dispatch/AbstractPromise.java index 98451da1f4..a770a0b27a 100644 --- a/akka-actor/src/main/java/akka/dispatch/AbstractPromise.java +++ b/akka-actor/src/main/java/akka/dispatch/AbstractPromise.java @@ -7,7 +7,7 @@ package akka.dispatch; import java.util.concurrent.atomic.AtomicReferenceFieldUpdater; abstract class AbstractPromise { - private volatile Object _ref = FState.apply(); + private volatile Object _ref = DefaultPromise.EmptyPending(); protected final static AtomicReferenceFieldUpdater updater = AtomicReferenceFieldUpdater.newUpdater(AbstractPromise.class, Object.class, "_ref"); } diff --git a/akka-actor/src/main/scala/akka/actor/ActorRefProvider.scala b/akka-actor/src/main/scala/akka/actor/ActorRefProvider.scala index f05fbbe86a..8881d459ed 100644 --- a/akka-actor/src/main/scala/akka/actor/ActorRefProvider.scala +++ b/akka-actor/src/main/scala/akka/actor/ActorRefProvider.scala @@ -101,8 +101,6 @@ class LocalActorRefProvider(val app: AkkaApplication) extends ActorRefProvider { @volatile var stopped = false - def app = LocalActorRefProvider.this.app - override def address = app.name + ":BubbleWalker" override def toString = address diff --git a/akka-actor/src/main/scala/akka/dispatch/Future.scala b/akka-actor/src/main/scala/akka/dispatch/Future.scala index 6453403ce7..8984c4f085 100644 --- a/akka-actor/src/main/scala/akka/dispatch/Future.scala +++ b/akka-actor/src/main/scala/akka/dispatch/Future.scala @@ -824,8 +824,8 @@ trait Promise[T] extends Future[T] { } //Companion object to FState, just to provide a cheap, immutable default entry -private[akka] object FState { - def apply[T](): FState[T] = EmptyPending.asInstanceOf[FState[T]] +private[dispatch] object DefaultPromise { + def EmptyPending[T](): FState[T] = EmptyPending.asInstanceOf[FState[T]] /** * Represents the internal state of the DefaultCompletableFuture @@ -853,7 +853,7 @@ private[akka] object FState { class DefaultPromise[T](val timeout: Timeout)(implicit val dispatcher: MessageDispatcher) extends AbstractPromise with Promise[T] { self ⇒ - import FState.{ FState, Success, Failure, Pending, Expired } + import DefaultPromise.{ FState, Success, Failure, Pending, Expired } def this()(implicit dispatcher: MessageDispatcher, timeout: Timeout) = this(timeout) diff --git a/akka-remote/src/main/scala/akka/remote/RemoteActorRefProvider.scala b/akka-remote/src/main/scala/akka/remote/RemoteActorRefProvider.scala index dedf5a4044..8a34e8b118 100644 --- a/akka-remote/src/main/scala/akka/remote/RemoteActorRefProvider.scala +++ b/akka-remote/src/main/scala/akka/remote/RemoteActorRefProvider.scala @@ -264,7 +264,7 @@ private[akka] case class RemoteActorRef private[akka] ( } @throws(classOf[java.io.ObjectStreamException]) - private def writeReplace(): AnyRef = app.provider.serialize(this) + private def writeReplace(): AnyRef = remote.app.provider.serialize(this) def startsMonitoring(actorRef: ActorRef): ActorRef = unsupported diff --git a/akka-testkit/src/test/scala/akka/testkit/TestActorRefSpec.scala b/akka-testkit/src/test/scala/akka/testkit/TestActorRefSpec.scala index c5a989c17e..b994d6a956 100644 --- a/akka-testkit/src/test/scala/akka/testkit/TestActorRefSpec.scala +++ b/akka-testkit/src/test/scala/akka/testkit/TestActorRefSpec.scala @@ -224,10 +224,7 @@ class TestActorRefSpec extends AkkaSpec with BeforeAndAfterEach { "proxy apply for the underlying actor" in { val ref = TestActorRef[WorkerActor] ref("work") - val ch = Promise[String](5000) - ref ! ch - ch must be('completed) - ch.get must be("complexReply") + ref.isShutdown must be(true) } } From 631c734d282dd1c579dfdc08a72cb5325aa8b66d Mon Sep 17 00:00:00 2001 From: Viktor Klang Date: Sat, 29 Oct 2011 01:01:24 +0200 Subject: [PATCH 30/57] Increasing the timeout of the ActorPoolSpec for the typed actors --- .../src/test/scala/akka/routing/ActorPoolSpec.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/akka-actor-tests/src/test/scala/akka/routing/ActorPoolSpec.scala b/akka-actor-tests/src/test/scala/akka/routing/ActorPoolSpec.scala index 702f167b40..304ca07ab3 100644 --- a/akka-actor-tests/src/test/scala/akka/routing/ActorPoolSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/routing/ActorPoolSpec.scala @@ -345,7 +345,7 @@ class ActorPoolSpec extends AkkaSpec { def receive = _route } - val pool = app.createProxy[Foo](createPool, Props().withFaultHandler(faultHandler)) + val pool = app.createProxy[Foo](createPool, Props().withTimeout(10 seconds).withFaultHandler(faultHandler)) val results = for (i ← 1 to 50) yield (i, pool.sq(i, 100)) From 24bac14afc3c1e3bf0cdc5399625bf3fbe40c2de Mon Sep 17 00:00:00 2001 From: Viktor Klang Date: Sat, 29 Oct 2011 01:21:29 +0200 Subject: [PATCH 31/57] Removing unused handleFailure-method --- akka-actor/src/main/scala/akka/actor/ActorRef.scala | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/akka-actor/src/main/scala/akka/actor/ActorRef.scala b/akka-actor/src/main/scala/akka/actor/ActorRef.scala index 89c388ce17..bbee6ef5ea 100644 --- a/akka-actor/src/main/scala/akka/actor/ActorRef.scala +++ b/akka-actor/src/main/scala/akka/actor/ActorRef.scala @@ -234,9 +234,7 @@ class LocalActorRef private[akka] ( def ?(message: Any)(implicit timeout: Timeout): Future[Any] = actorCell.provider.ask(message, this, timeout) - protected[akka] def handleFailure(fail: Failed): Unit = actorCell.handleFailure(fail) - - protected[akka] def restart(cause: Throwable): Unit = actorCell.restart(cause) + protected[akka] override def restart(cause: Throwable): Unit = actorCell.restart(cause) @throws(classOf[java.io.ObjectStreamException]) private def writeReplace(): AnyRef = actorCell.provider.serialize(this) From a52e0fa997cf134ee4e57fa1b80927f484af5784 Mon Sep 17 00:00:00 2001 From: Viktor Klang Date: Sat, 29 Oct 2011 11:35:01 +0200 Subject: [PATCH 32/57] Renaming JavaAPI.java:mustAcceptSingleArgTryTell to mustAcceptSingleArgTell --- akka-actor-tests/src/test/java/akka/actor/JavaAPI.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/akka-actor-tests/src/test/java/akka/actor/JavaAPI.java b/akka-actor-tests/src/test/java/akka/actor/JavaAPI.java index 70f45e4c8f..799e66b880 100644 --- a/akka-actor-tests/src/test/java/akka/actor/JavaAPI.java +++ b/akka-actor-tests/src/test/java/akka/actor/JavaAPI.java @@ -25,7 +25,7 @@ public class JavaAPI { assertNotNull(ref); } - @Test void mustAcceptSingleArgTryTell() { + @Test void mustAcceptSingleArgTell() { ActorRef ref = app.actorOf(JavaAPITestActor.class); ref.tell("hallo"); ref.tell("hallo", ref); From f5f2ac0beff16292667a7f981f5a933c3cd9f544 Mon Sep 17 00:00:00 2001 From: Viktor Klang Date: Sat, 29 Oct 2011 15:13:13 +0200 Subject: [PATCH 33/57] Fixing erronous test renames --- .../src/test/scala/akka/dataflow/Future2Actor.scala | 2 +- akka-actor-tests/src/test/scala/akka/event/EventBusSpec.scala | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/akka-actor-tests/src/test/scala/akka/dataflow/Future2Actor.scala b/akka-actor-tests/src/test/scala/akka/dataflow/Future2Actor.scala index 227a29ddc2..94e59ebbf1 100644 --- a/akka-actor-tests/src/test/scala/akka/dataflow/Future2Actor.scala +++ b/akka-actor-tests/src/test/scala/akka/dataflow/Future2Actor.scala @@ -18,7 +18,7 @@ class Future2ActorSpec extends AkkaSpec { expectMsgAllOf(1 second, 42, 42) } - "support reply via channel" in { + "support reply via sender" in { val actor = app.actorOf(Props(new Actor { def receive = { case "do" ⇒ Future(31) pipeTo context.sender diff --git a/akka-actor-tests/src/test/scala/akka/event/EventBusSpec.scala b/akka-actor-tests/src/test/scala/akka/event/EventBusSpec.scala index 4c43e17d83..4861dd9ea5 100644 --- a/akka-actor-tests/src/test/scala/akka/event/EventBusSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/event/EventBusSpec.scala @@ -61,13 +61,13 @@ abstract class EventBusSpec(busName: String) extends AkkaSpec with BeforeAndAfte disposeSubscriber(sub) } - "not allow for the same subscriber to subscribe to the same sender twice" in { + "not allow for the same subscriber to subscribe to the same channel twice" in { bus.subscribe(subscriber, classifier) must be === true bus.subscribe(subscriber, classifier) must be === false bus.unsubscribe(subscriber, classifier) must be === true } - "not allow for the same subscriber to unsubscribe to the same sender twice" in { + "not allow for the same subscriber to unsubscribe to the same channel twice" in { bus.subscribe(subscriber, classifier) must be === true bus.unsubscribe(subscriber, classifier) must be === true bus.unsubscribe(subscriber, classifier) must be === false From a6c4bfa98c092ec57cd3c247d38668f8a7b65f2f Mon Sep 17 00:00:00 2001 From: Viktor Klang Date: Mon, 31 Oct 2011 22:18:21 +0100 Subject: [PATCH 34/57] #1324 - making sure that ActorPools are prefilled --- akka-actor/src/main/scala/akka/routing/Pool.scala | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/akka-actor/src/main/scala/akka/routing/Pool.scala b/akka-actor/src/main/scala/akka/routing/Pool.scala index 8a26c25a84..dbf71bad04 100644 --- a/akka-actor/src/main/scala/akka/routing/Pool.scala +++ b/akka-actor/src/main/scala/akka/routing/Pool.scala @@ -95,6 +95,10 @@ trait DefaultActorPool extends ActorPool { this: Actor ⇒ val defaultProps: Props = Props.default.withDispatcher(this.context.dispatcher) + override def preStart() { + resizeIfAppropriate() + } + override def postStop() { _delegates foreach evict _delegates = Vector.empty @@ -112,7 +116,7 @@ trait DefaultActorPool extends ActorPool { this: Actor ⇒ select(_delegates) foreach { _ forward msg } } - private def resizeIfAppropriate() { + protected def resizeIfAppropriate() { val requestedCapacity = capacity(_delegates) val newDelegates = requestedCapacity match { case qty if qty > 0 ⇒ From 6e5de8bb2363414d018468471e4bb339ac541edd Mon Sep 17 00:00:00 2001 From: Viktor Klang Date: Mon, 31 Oct 2011 22:20:21 +0100 Subject: [PATCH 35/57] Fixing a compilation quirk in Future.scala and switching to explicit timeout in TypedActor internals --- .../scala/akka/routing/ActorPoolSpec.scala | 17 ++++++++-------- .../main/scala/akka/actor/TypedActor.scala | 20 ++++++------------- .../src/main/scala/akka/dispatch/Future.scala | 4 ++-- 3 files changed, 17 insertions(+), 24 deletions(-) diff --git a/akka-actor-tests/src/test/scala/akka/routing/ActorPoolSpec.scala b/akka-actor-tests/src/test/scala/akka/routing/ActorPoolSpec.scala index 304ca07ab3..b871a1c087 100644 --- a/akka-actor-tests/src/test/scala/akka/routing/ActorPoolSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/routing/ActorPoolSpec.scala @@ -332,7 +332,7 @@ class ActorPoolSpec extends AkkaSpec { "support typed actors" in { import RoutingSpec._ - def createPool = new Actor with DefaultActorPool with BoundedCapacityStrategy with MailboxPressureCapacitor with SmallestMailboxSelector with Filter with RunningMeanBackoff with BasicRampup { + val pool = app.createProxy[Foo](new Actor with DefaultActorPool with BoundedCapacityStrategy with MailboxPressureCapacitor with SmallestMailboxSelector with Filter with RunningMeanBackoff with BasicRampup { def lowerBound = 1 def upperBound = 5 def pressureThreshold = 1 @@ -341,15 +341,16 @@ class ActorPoolSpec extends AkkaSpec { def rampupRate = 0.1 def backoffRate = 0.50 def backoffThreshold = 0.50 - def instance(p: Props) = app.typedActor.getActorRefFor(context.typedActorOf[Foo, FooImpl](p)) + def instance(p: Props) = app.typedActor.getActorRefFor(context.typedActorOf[Foo, FooImpl](props = p.withTimeout(10 seconds))) def receive = _route + }, Props().withTimeout(10 seconds).withFaultHandler(faultHandler)) + + val results = for (i ← 1 to 20) yield (i, pool.sq(i, 100)) + + for ((i, r) ← results) { + val value = r.get + value must equal(i * i) } - - val pool = app.createProxy[Foo](createPool, Props().withTimeout(10 seconds).withFaultHandler(faultHandler)) - - val results = for (i ← 1 to 50) yield (i, pool.sq(i, 100)) - - for ((i, r) ← results) r.get must equal(i * i) } "provide default supervision of pooled actors" in { diff --git a/akka-actor/src/main/scala/akka/actor/TypedActor.scala b/akka-actor/src/main/scala/akka/actor/TypedActor.scala index 92c523630b..2974808efc 100644 --- a/akka-actor/src/main/scala/akka/actor/TypedActor.scala +++ b/akka-actor/src/main/scala/akka/actor/TypedActor.scala @@ -317,7 +317,7 @@ class TypedActor(val app: AkkaApplication) { case Props.`defaultTimeout` ⇒ app.AkkaConfig.ActorTimeout case x ⇒ x } - val proxy: T = Proxy.newProxyInstance(loader, interfaces, new TypedActorInvocationHandler(actorVar)(timeout)).asInstanceOf[T] + val proxy: T = Proxy.newProxyInstance(loader, interfaces, new TypedActorInvocationHandler(actorVar, timeout)).asInstanceOf[T] proxyVar.set(proxy) // Chicken and egg situation we needed to solve, set the proxy so that we can set the self-reference inside each receive val ref = supervisor.actorOf(props, address) actorVar.set(ref) //Make sure the InvocationHandler gets ahold of the actor reference, this is not a problem since the proxy hasn't escaped this method yet @@ -327,11 +327,6 @@ class TypedActor(val app: AkkaApplication) { private[akka] def extractInterfaces(clazz: Class[_]): Array[Class[_]] = if (clazz.isInterface) Array[Class[_]](clazz) else clazz.getInterfaces private[akka] class TypedActor[R <: AnyRef, T <: R](val proxyVar: AtomVar[R], createInstance: ⇒ T) extends Actor { - - // FIXME TypedActor register/unregister on postStop/preStart - // override def preStart = app.registry.registerTypedActor(self, proxyVar.get) //Make sure actor registry knows about this actor - // override def postStop = app.registry.unregisterTypedActor(self, proxyVar.get) - val me = createInstance def receive = { case m: MethodCall ⇒ @@ -345,7 +340,7 @@ class TypedActor(val app: AkkaApplication) { if (m.returnsFuture_?) { m(me).asInstanceOf[Future[Any]] onComplete { _.value.get match { - case Left(f) ⇒ s ! akka.actor.Status.Failure(f) + case Left(f) ⇒ s ! Status.Failure(f) case Right(r) ⇒ s ! r } } @@ -353,10 +348,9 @@ class TypedActor(val app: AkkaApplication) { s ! m(me) } } catch { - case e: Exception ⇒ s ! akka.actor.Status.Failure(e) + case e: Exception ⇒ s ! Status.Failure(e) } } - } finally { TypedActor.selfReference set null TypedActor.appReference set null @@ -364,7 +358,7 @@ class TypedActor(val app: AkkaApplication) { } } - private[akka] class TypedActorInvocationHandler(actorVar: AtomVar[ActorRef])(implicit timeout: Timeout) extends InvocationHandler { + private[akka] class TypedActorInvocationHandler(actorVar: AtomVar[ActorRef], timeout: Timeout) extends InvocationHandler { def actor = actorVar.get def invoke(proxy: AnyRef, method: Method, args: Array[AnyRef]): AnyRef = method.getName match { @@ -377,14 +371,12 @@ class TypedActor(val app: AkkaApplication) { case m if m.returnsFuture_? ⇒ actor.?(m, timeout) case m if m.returnsJOption_? || m.returnsOption_? ⇒ val f = actor.?(m, timeout) - try { f.await } catch { case _: FutureTimeoutException ⇒ } - f.value match { + (try { f.await.value } catch { case _: FutureTimeoutException ⇒ None }) match { case None | Some(Right(null)) ⇒ if (m.returnsJOption_?) JOption.none[Any] else None case Some(Right(joption: AnyRef)) ⇒ joption case Some(Left(ex)) ⇒ throw ex } - case m ⇒ - (actor.?(m, timeout)).get.asInstanceOf[AnyRef] + case m ⇒ (actor.?(m, timeout)).get.asInstanceOf[AnyRef] } } } diff --git a/akka-actor/src/main/scala/akka/dispatch/Future.scala b/akka-actor/src/main/scala/akka/dispatch/Future.scala index 8984c4f085..737f2eedef 100644 --- a/akka-actor/src/main/scala/akka/dispatch/Future.scala +++ b/akka-actor/src/main/scala/akka/dispatch/Future.scala @@ -825,7 +825,7 @@ trait Promise[T] extends Future[T] { //Companion object to FState, just to provide a cheap, immutable default entry private[dispatch] object DefaultPromise { - def EmptyPending[T](): FState[T] = EmptyPending.asInstanceOf[FState[T]] + def EmptyPending[T](): FState[T] = emptyPendingValue.asInstanceOf[FState[T]] /** * Represents the internal state of the DefaultCompletableFuture @@ -844,7 +844,7 @@ private[dispatch] object DefaultPromise { case object Expired extends FState[Nothing] { def value: Option[Either[Throwable, Nothing]] = None } - val EmptyPending = Pending[Nothing](Nil) + private val emptyPendingValue = Pending[Nothing](Nil) } /** From 06c66bd325e42a9d63c1046bf36e70fda0c55c73 Mon Sep 17 00:00:00 2001 From: Peter Vlugter Date: Tue, 1 Nov 2011 11:10:14 +0100 Subject: [PATCH 36/57] Fix deprecation warnings in sbt plugin --- akka-sbt-plugin/src/main/scala/AkkaKernelPlugin.scala | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/akka-sbt-plugin/src/main/scala/AkkaKernelPlugin.scala b/akka-sbt-plugin/src/main/scala/AkkaKernelPlugin.scala index 6ff2167977..7ad323aaa6 100644 --- a/akka-sbt-plugin/src/main/scala/AkkaKernelPlugin.scala +++ b/akka-sbt-plugin/src/main/scala/AkkaKernelPlugin.scala @@ -42,11 +42,11 @@ object AkkaKernelPlugin extends Plugin { lazy val distSettings: Seq[Setting[_]] = inConfig(Dist)(Seq( - dist <<= packageBin.identity, + dist <<= packageBin, packageBin <<= distTask, distClean <<= distCleanTask, - dependencyClasspath <<= (dependencyClasspath in Runtime).identity, - unmanagedResourceDirectories <<= (unmanagedResourceDirectories in Runtime).identity, + dependencyClasspath <<= (dependencyClasspath in Runtime), + unmanagedResourceDirectories <<= (unmanagedResourceDirectories in Runtime), outputDirectory <<= target / "dist", configSourceDirs <<= defaultConfigSourceDirs, distJvmOptions := "-Xms1024M -Xmx1024M -Xss1M -XX:MaxPermSize=256M -XX:+UseParallelGC", @@ -54,8 +54,7 @@ object AkkaKernelPlugin extends Plugin { libFilter := { f ⇒ true }, additionalLibs <<= defaultAdditionalLibs, distConfig <<= (outputDirectory, configSourceDirs, distJvmOptions, distMainClass, libFilter, additionalLibs) map DistConfig)) ++ - Seq( - dist <<= (dist in Dist).identity, distNeedsPackageBin) + Seq(dist <<= (dist in Dist), distNeedsPackageBin) private def distTask: Initialize[Task[File]] = (distConfig, sourceDirectory, crossTarget, dependencyClasspath, projectDependencies, allDependencies, buildStructure, state) map { (conf, src, tgt, cp, projDeps, allDeps, buildStruct, st) ⇒ From 3aed09c43d5bb9c578b3543ced2a3c18fdc2fb10 Mon Sep 17 00:00:00 2001 From: Viktor Klang Date: Tue, 1 Nov 2011 11:20:02 +0100 Subject: [PATCH 37/57] #1320 - Implementing readResolve and writeReplace for the DeadLetterActorRef --- .../akka/serialization/SerializeSpec.scala | 18 ++++++++++++++ .../src/main/scala/akka/actor/ActorRef.scala | 24 +++++++++++++++---- .../scala/akka/actor/ActorRefProvider.scala | 1 + 3 files changed, 39 insertions(+), 4 deletions(-) diff --git a/akka-actor-tests/src/test/scala/akka/serialization/SerializeSpec.scala b/akka-actor-tests/src/test/scala/akka/serialization/SerializeSpec.scala index 72cac70ff9..69c39a99d8 100644 --- a/akka-actor-tests/src/test/scala/akka/serialization/SerializeSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/serialization/SerializeSpec.scala @@ -7,6 +7,9 @@ package akka.serialization import akka.serialization.Serialization._ import scala.reflect._ import akka.testkit.AkkaSpec +import akka.AkkaApplication +import java.io.{ ObjectInputStream, ByteArrayInputStream, ByteArrayOutputStream, ObjectOutputStream } +import akka.actor.DeadLetterActorRef object SerializeSpec { @BeanInfo @@ -61,5 +64,20 @@ class SerializeSpec extends AkkaSpec { case Right(p) ⇒ assert(p === r) } } + + "serialize DeadLetterActorRef" in { + val outbuf = new ByteArrayOutputStream() + val out = new ObjectOutputStream(outbuf) + val a = new AkkaApplication() + out.writeObject(a.deadLetters) + out.flush() + out.close() + + val in = new ObjectInputStream(new ByteArrayInputStream(outbuf.toByteArray)) + Serialization.app.withValue(a) { + val deadLetters = in.readObject().asInstanceOf[DeadLetterActorRef] + deadLetters must be(a.deadLetters) + } + } } } diff --git a/akka-actor/src/main/scala/akka/actor/ActorRef.scala b/akka-actor/src/main/scala/akka/actor/ActorRef.scala index bbee6ef5ea..4ea551cce1 100644 --- a/akka-actor/src/main/scala/akka/actor/ActorRef.scala +++ b/akka-actor/src/main/scala/akka/actor/ActorRef.scala @@ -11,6 +11,7 @@ import java.lang.{ UnsupportedOperationException, IllegalStateException } import akka.AkkaApplication import akka.event.ActorEventBus import akka.serialization.Serialization +import akka.actor.DeadLetterActorRef.SerializedDeadLetterActorRef /** * ActorRef is an immutable and serializable handle to an Actor. @@ -350,6 +351,15 @@ trait MinimalActorRef extends ActorRef with ScalaActorRef { case class DeadLetter(message: Any, sender: ActorRef) +object DeadLetterActorRef { + class SerializedDeadLetterActorRef extends Serializable { //TODO implement as Protobuf for performance? + @throws(classOf[java.io.ObjectStreamException]) + private def readResolve(): AnyRef = Serialization.app.value.deadLetters + } + + val serialized = new SerializedDeadLetterActorRef +} + class DeadLetterActorRef(val app: AkkaApplication) extends MinimalActorRef { val brokenPromise = new KeptPromise[Any](Left(new ActorKilledException("In DeadLetterActorRef, promises are always broken.")))(app.dispatcher) override val address: String = "akka:internal:DeadLetterActorRef" @@ -358,7 +368,13 @@ class DeadLetterActorRef(val app: AkkaApplication) extends MinimalActorRef { protected[akka] override def postMessageToMailbox(message: Any, sender: ActorRef): Unit = app.eventHandler.notify(DeadLetter(message, sender)) - def ?(message: Any)(implicit timeout: Timeout): Future[Any] = brokenPromise + def ?(message: Any)(implicit timeout: Timeout): Future[Any] = { + app.eventHandler.notify(DeadLetter(message, this)) + brokenPromise + } + + @throws(classOf[java.io.ObjectStreamException]) + private def writeReplace(): AnyRef = DeadLetterActorRef.serialized } abstract class AskActorRef(protected val app: AkkaApplication)(timeout: Timeout = app.AkkaConfig.ActorTimeout, dispatcher: MessageDispatcher = app.dispatcher) extends MinimalActorRef { @@ -373,9 +389,9 @@ abstract class AskActorRef(protected val app: AkkaApplication)(timeout: Timeout protected def whenDone(): Unit protected[akka] override def postMessageToMailbox(message: Any, sender: ActorRef): Unit = message match { - case akka.actor.Status.Success(r) ⇒ result.completeWithResult(r) - case akka.actor.Status.Failure(f) ⇒ result.completeWithException(f) - case other ⇒ result.completeWithResult(other) + case Status.Success(r) ⇒ result.completeWithResult(r) + case Status.Failure(f) ⇒ result.completeWithException(f) + case other ⇒ result.completeWithResult(other) } protected[akka] override def sendSystemMessage(message: SystemMessage): Unit = message match { diff --git a/akka-actor/src/main/scala/akka/actor/ActorRefProvider.scala b/akka-actor/src/main/scala/akka/actor/ActorRefProvider.scala index 8881d459ed..0d72f9fd09 100644 --- a/akka-actor/src/main/scala/akka/actor/ActorRefProvider.scala +++ b/akka-actor/src/main/scala/akka/actor/ActorRefProvider.scala @@ -30,6 +30,7 @@ trait ActorRefProvider { private[akka] def evict(address: String): Boolean private[akka] def deserialize(actor: SerializedActorRef): Option[ActorRef] + private[akka] def serialize(actor: ActorRef): AnyRef private[akka] def createDeathWatch(): DeathWatch From 2f52f43fa828c2647852fa6b87405f59bc72c3da Mon Sep 17 00:00:00 2001 From: Viktor Klang Date: Tue, 1 Nov 2011 11:31:53 +0100 Subject: [PATCH 38/57] Refining the DeadLetterActorRef serialization test to be a bit more specific --- .../src/test/scala/akka/serialization/SerializeSpec.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/akka-actor-tests/src/test/scala/akka/serialization/SerializeSpec.scala b/akka-actor-tests/src/test/scala/akka/serialization/SerializeSpec.scala index 69c39a99d8..0c58aa9f51 100644 --- a/akka-actor-tests/src/test/scala/akka/serialization/SerializeSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/serialization/SerializeSpec.scala @@ -76,7 +76,7 @@ class SerializeSpec extends AkkaSpec { val in = new ObjectInputStream(new ByteArrayInputStream(outbuf.toByteArray)) Serialization.app.withValue(a) { val deadLetters = in.readObject().asInstanceOf[DeadLetterActorRef] - deadLetters must be(a.deadLetters) + (deadLetters eq a.deadLetters) must be(true) } } } From a040a0c54d06faa2620e4b1c25bc8cf950d8031e Mon Sep 17 00:00:00 2001 From: Viktor Klang Date: Thu, 3 Nov 2011 14:53:38 +0100 Subject: [PATCH 39/57] Profit! Removing Uuids from ActorCells and ActorRefs and essentially replacing the remoting with a new implementation. --- .../test/scala/akka/actor/ActorRefSpec.scala | 6 +- .../actor/LocalActorRefProviderSpec.scala | 55 +- .../scala/akka/routing/ActorPoolSpec.scala | 4 +- .../src/main/scala/akka/AkkaApplication.scala | 14 +- .../src/main/scala/akka/AkkaException.scala | 2 +- .../src/main/scala/akka/actor/ActorCell.scala | 11 - .../src/main/scala/akka/actor/ActorRef.scala | 11 +- .../scala/akka/actor/ActorRefProvider.scala | 7 +- .../src/main/scala/akka/actor/Deployer.scala | 4 +- .../akka/dispatch/BalancingDispatcher.scala | 2 +- .../scala/akka/dispatch/Dispatchers.scala | 4 +- .../scala/akka/remote/RemoteInterface.scala | 128 +- .../akka/camel/TypedConsumerPublisher.scala | 1 - .../main/java/akka/remote/RemoteProtocol.java | 6422 ++++------------- .../src/main/protocol/RemoteProtocol.proto | 99 +- .../src/main/scala/akka/remote/Gossiper.scala | 2 +- .../scala/akka/remote/MessageSerializer.scala | 4 +- .../src/main/scala/akka/remote/Remote.scala | 71 +- .../akka/remote/RemoteActorRefProvider.scala | 45 +- .../remote/netty/NettyRemoteSupport.scala | 281 +- .../serialization/SerializationProtocol.scala | 79 +- 21 files changed, 1393 insertions(+), 5859 deletions(-) diff --git a/akka-actor-tests/src/test/scala/akka/actor/ActorRefSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/ActorRefSpec.scala index 800b7b642c..b445c09e1c 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/ActorRefSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/ActorRefSpec.scala @@ -292,11 +292,7 @@ class ActorRefSpec extends AkkaSpec { val inetAddress = app.defaultAddress - val expectedSerializedRepresentation = SerializedActorRef( - a.uuid, - a.address, - inetAddress.getAddress.getHostAddress, - inetAddress.getPort) + val expectedSerializedRepresentation = new SerializedActorRef(a.address, inetAddress) import java.io._ diff --git a/akka-actor-tests/src/test/scala/akka/actor/LocalActorRefProviderSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/LocalActorRefProviderSpec.scala index 9f43c0232f..cb3758081a 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/LocalActorRefProviderSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/LocalActorRefProviderSpec.scala @@ -6,65 +6,26 @@ package akka.actor import akka.testkit._ import akka.util.duration._ -import akka.testkit.Testing.sleepFor - -import java.util.concurrent.{ TimeUnit, CountDownLatch } - -object LocalActorRefProviderSpec { - - class NewActor extends Actor { - def receive = { - case _ ⇒ {} - } - } -} +import akka.dispatch.Future @org.junit.runner.RunWith(classOf[org.scalatest.junit.JUnitRunner]) class LocalActorRefProviderSpec extends AkkaSpec { - import akka.actor.LocalActorRefProviderSpec._ - "An LocalActorRefProvider" must { "only create one instance of an actor with a specific address in a concurrent environment" in { val provider = app.provider - for (i ← 0 until 100) { // 100 concurrent runs - val latch = new CountDownLatch(4) + provider.isInstanceOf[LocalActorRefProvider] must be(true) - var a1: Option[ActorRef] = None - var a2: Option[ActorRef] = None - var a3: Option[ActorRef] = None - var a4: Option[ActorRef] = None + implicit val timeout = Timeout(30 seconds) - val address = "new-actor" + i - - spawn { - a1 = Some(provider.actorOf(Props(creator = () ⇒ new NewActor), app.guardian, address)) - latch.countDown() - } - spawn { - a2 = Some(provider.actorOf(Props(creator = () ⇒ new NewActor), app.guardian, address)) - latch.countDown() - } - spawn { - a3 = Some(provider.actorOf(Props(creator = () ⇒ new NewActor), app.guardian, address)) - latch.countDown() - } - spawn { - a4 = Some(provider.actorOf(Props(creator = () ⇒ new NewActor), app.guardian, address)) - latch.countDown() + val actors: Seq[Future[ActorRef]] = + (0 until 100) flatMap { i ⇒ // 100 concurrent runs + val address = "new-actor" + i + (1 to 4) map { _ ⇒ Future { provider.actorOf(Props(c ⇒ { case _ ⇒ }), app.guardian, address) } } } - latch.await(5, TimeUnit.SECONDS) must be === true - - a1.isDefined must be(true) - a2.isDefined must be(true) - a3.isDefined must be(true) - a4.isDefined must be(true) - (a1 == a2) must be(true) - (a1 == a3) must be(true) - (a1 == a4) must be(true) - } + actors.map(_.get).distinct.size must be(100) } } } diff --git a/akka-actor-tests/src/test/scala/akka/routing/ActorPoolSpec.scala b/akka-actor-tests/src/test/scala/akka/routing/ActorPoolSpec.scala index b871a1c087..604032e978 100644 --- a/akka-actor-tests/src/test/scala/akka/routing/ActorPoolSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/routing/ActorPoolSpec.scala @@ -234,7 +234,7 @@ class ActorPoolSpec extends AkkaSpec { def instance(p: Props): ActorRef = actorOf(p.withCreator(new Actor { def receive = { case _ ⇒ - delegates put (self.uuid.toString, "") + delegates put (self.address, "") latch1.countDown() } })) @@ -262,7 +262,7 @@ class ActorPoolSpec extends AkkaSpec { def instance(p: Props) = actorOf(p.withCreator(new Actor { def receive = { case _ ⇒ - delegates put (self.uuid.toString, "") + delegates put (self.address, "") latch2.countDown() } })) diff --git a/akka-actor/src/main/scala/akka/AkkaApplication.scala b/akka-actor/src/main/scala/akka/AkkaApplication.scala index cd74495a5a..3e7ac72cda 100644 --- a/akka-actor/src/main/scala/akka/AkkaApplication.scala +++ b/akka-actor/src/main/scala/akka/AkkaApplication.scala @@ -146,17 +146,17 @@ class AkkaApplication(val name: String, val config: Configuration) extends Actor case value ⇒ value } - val hostname: String = System.getProperty("akka.remote.hostname") match { - case null | "" ⇒ InetAddress.getLocalHost.getHostName + val defaultAddress = new InetSocketAddress(System.getProperty("akka.remote.hostname") match { + case null | "" ⇒ InetAddress.getLocalHost.getHostAddress case value ⇒ value - } - - val port: Int = System.getProperty("akka.remote.port") match { + }, System.getProperty("akka.remote.port") match { case null | "" ⇒ AkkaConfig.RemoteServerPort case value ⇒ value.toInt - } + }) - val defaultAddress = new InetSocketAddress(hostname, port) + def hostname: String = defaultAddress.getAddress.getHostAddress + + def port: Int = defaultAddress.getPort // TODO correctly pull its config from the config val dispatcherFactory = new Dispatchers(this) diff --git a/akka-actor/src/main/scala/akka/AkkaException.scala b/akka-actor/src/main/scala/akka/AkkaException.scala index 4ef880d29f..0dc3a81728 100644 --- a/akka-actor/src/main/scala/akka/AkkaException.scala +++ b/akka-actor/src/main/scala/akka/AkkaException.scala @@ -39,7 +39,7 @@ class AkkaException(message: String = "", cause: Throwable = null) extends Runti object AkkaException { val hostname = try { - InetAddress.getLocalHost.getHostName + InetAddress.getLocalHost.getHostAddress } catch { case e: UnknownHostException ⇒ "unknown" } diff --git a/akka-actor/src/main/scala/akka/actor/ActorCell.scala b/akka-actor/src/main/scala/akka/actor/ActorCell.scala index 7a9cf75d1c..fe8a8cec5f 100644 --- a/akka-actor/src/main/scala/akka/actor/ActorCell.scala +++ b/akka-actor/src/main/scala/akka/actor/ActorCell.scala @@ -10,7 +10,6 @@ import scala.annotation.tailrec import scala.collection.immutable.{ Stack, TreeMap } import scala.collection.JavaConverters import java.util.concurrent.{ ScheduledFuture, TimeUnit } -import java.util.{ Collection ⇒ JCollection, Collections ⇒ JCollections } import akka.AkkaApplication /** @@ -82,8 +81,6 @@ private[akka] class ActorCell( var actor: Actor = _ - def uuid: Uuid = self.uuid - @inline final def dispatcher: MessageDispatcher = if (props.dispatcher == Props.defaultDispatcher) app.dispatcher else props.dispatcher @@ -363,12 +360,4 @@ private[akka] class ActorCell( if (a ne null) lookupAndSetSelfFields(a.getClass, a, newContext) } - - override final def hashCode: Int = HashCode.hash(HashCode.SEED, uuid) - - override final def equals(that: Any): Boolean = { - that.isInstanceOf[ActorCell] && that.asInstanceOf[ActorCell].uuid == uuid - } - - override final def toString = "ActorCell[%s]".format(uuid) } diff --git a/akka-actor/src/main/scala/akka/actor/ActorRef.scala b/akka-actor/src/main/scala/akka/actor/ActorRef.scala index 4ea551cce1..8ac11ffbae 100644 --- a/akka-actor/src/main/scala/akka/actor/ActorRef.scala +++ b/akka-actor/src/main/scala/akka/actor/ActorRef.scala @@ -12,6 +12,7 @@ import akka.AkkaApplication import akka.event.ActorEventBus import akka.serialization.Serialization import akka.actor.DeadLetterActorRef.SerializedDeadLetterActorRef +import java.net.InetSocketAddress /** * ActorRef is an immutable and serializable handle to an Actor. @@ -276,18 +277,17 @@ trait ScalaActorRef { ref: ActorRef ⇒ protected[akka] def postMessageToMailbox(message: Any, sender: ActorRef): Unit protected[akka] def restart(cause: Throwable): Unit - - private[akka] def uuid: Uuid //TODO FIXME REMOVE THIS } /** * Memento pattern for serializing ActorRefs transparently */ -case class SerializedActorRef(uuid: Uuid, address: String, hostname: String, port: Int) { - +case class SerializedActorRef(address: String, hostname: String, port: Int) { import akka.serialization.Serialization.app + def this(address: String, inet: InetSocketAddress) = this(address, inet.getAddress.getHostAddress, inet.getPort) + @throws(classOf[java.io.ObjectStreamException]) def readResolve(): AnyRef = { if (app.value eq null) throw new IllegalStateException( @@ -366,7 +366,8 @@ class DeadLetterActorRef(val app: AkkaApplication) extends MinimalActorRef { override def isShutdown(): Boolean = true - protected[akka] override def postMessageToMailbox(message: Any, sender: ActorRef): Unit = app.eventHandler.notify(DeadLetter(message, sender)) + protected[akka] override def postMessageToMailbox(message: Any, sender: ActorRef): Unit = + app.eventHandler.notify(DeadLetter(message, sender)) def ?(message: Any)(implicit timeout: Timeout): Future[Any] = { app.eventHandler.notify(DeadLetter(message, this)) diff --git a/akka-actor/src/main/scala/akka/actor/ActorRefProvider.scala b/akka-actor/src/main/scala/akka/actor/ActorRefProvider.scala index 0d72f9fd09..5c05fd867b 100644 --- a/akka-actor/src/main/scala/akka/actor/ActorRefProvider.scala +++ b/akka-actor/src/main/scala/akka/actor/ActorRefProvider.scala @@ -31,7 +31,7 @@ trait ActorRefProvider { private[akka] def deserialize(actor: SerializedActorRef): Option[ActorRef] - private[akka] def serialize(actor: ActorRef): AnyRef + private[akka] def serialize(actor: ActorRef): SerializedActorRef private[akka] def createDeathWatch(): DeathWatch @@ -177,7 +177,7 @@ class LocalActorRefProvider(val app: AkkaApplication) extends ActorRefProvider { actorOf(RoutedProps(routerFactory = routerFactory, connectionManager = new LocalConnectionManager(connections)), supervisor, address) - case _ ⇒ throw new Exception("Don't know how to create this actor ref! Why?") + case unknown ⇒ throw new Exception("Don't know how to create this actor ref! Why? Got: " + unknown) } } catch { case e: Exception ⇒ @@ -218,8 +218,7 @@ class LocalActorRefProvider(val app: AkkaApplication) extends ActorRefProvider { } private[akka] def deserialize(actor: SerializedActorRef): Option[ActorRef] = actorFor(actor.address) - private[akka] def serialize(actor: ActorRef): AnyRef = - SerializedActorRef(actor.uuid, actor.address, app.hostname, app.port) + private[akka] def serialize(actor: ActorRef): SerializedActorRef = new SerializedActorRef(actor.address, app.defaultAddress) private[akka] def createDeathWatch(): DeathWatch = new LocalDeathWatch diff --git a/akka-actor/src/main/scala/akka/actor/Deployer.scala b/akka-actor/src/main/scala/akka/actor/Deployer.scala index 82af1d9c56..bee5027839 100644 --- a/akka-actor/src/main/scala/akka/actor/Deployer.scala +++ b/akka-actor/src/main/scala/akka/actor/Deployer.scala @@ -13,6 +13,7 @@ import akka.actor.DeploymentConfig._ import akka.{ AkkaException, AkkaApplication } import akka.config.{ Configuration, ConfigurationException } import akka.util.Duration +import java.net.InetSocketAddress trait ActorDeployer { private[akka] def init(deployments: Seq[Deploy]): Unit @@ -248,7 +249,8 @@ class Deployer(val app: AkkaApplication) extends ActorDeployer { case e: Exception ⇒ raiseRemoteNodeParsingError() } if (port == 0) raiseRemoteNodeParsingError() - RemoteAddress(hostname, port) + val inet = new InetSocketAddress(hostname, port) //FIXME switch to non-ip-tied + RemoteAddress(Option(inet.getAddress).map(_.getHostAddress).getOrElse(hostname), inet.getPort) } } diff --git a/akka-actor/src/main/scala/akka/dispatch/BalancingDispatcher.scala b/akka-actor/src/main/scala/akka/dispatch/BalancingDispatcher.scala index 93e7c99e7b..133795cb4d 100644 --- a/akka-actor/src/main/scala/akka/dispatch/BalancingDispatcher.scala +++ b/akka-actor/src/main/scala/akka/dispatch/BalancingDispatcher.scala @@ -37,7 +37,7 @@ class BalancingDispatcher( _timeoutMs: Long) extends Dispatcher(_app, _name, throughput, throughputDeadlineTime, mailboxType, config, _timeoutMs) { - private val buddies = new ConcurrentSkipListSet[ActorCell](new Comparator[ActorCell] { def compare(a: ActorCell, b: ActorCell) = a.uuid.compareTo(b.uuid) }) //new ConcurrentLinkedQueue[ActorCell]() + private val buddies = new ConcurrentSkipListSet[ActorCell](new Comparator[ActorCell] { def compare(a: ActorCell, b: ActorCell) = System.identityHashCode(a) - System.identityHashCode(b) }) //new ConcurrentLinkedQueue[ActorCell]() protected val messageQueue: MessageQueue = mailboxType match { case u: UnboundedMailbox ⇒ new QueueBasedMessageQueue with UnboundedMessageQueueSemantics { diff --git a/akka-actor/src/main/scala/akka/dispatch/Dispatchers.scala b/akka-actor/src/main/scala/akka/dispatch/Dispatchers.scala index f8141925fe..2f9f5b44f4 100644 --- a/akka-actor/src/main/scala/akka/dispatch/Dispatchers.scala +++ b/akka-actor/src/main/scala/akka/dispatch/Dispatchers.scala @@ -61,7 +61,7 @@ class Dispatchers(val app: AkkaApplication) { */ def newPinnedDispatcher(actor: LocalActorRef) = actor match { case null ⇒ new PinnedDispatcher(app, null, "anon", MailboxType, DispatcherShutdownMillis) - case some ⇒ new PinnedDispatcher(app, some.underlying, some.underlying.uuid.toString, MailboxType, DispatcherShutdownMillis) + case some ⇒ new PinnedDispatcher(app, some.underlying, some.address, MailboxType, DispatcherShutdownMillis) } /** @@ -72,7 +72,7 @@ class Dispatchers(val app: AkkaApplication) { */ def newPinnedDispatcher(actor: LocalActorRef, mailboxType: MailboxType) = actor match { case null ⇒ new PinnedDispatcher(app, null, "anon", mailboxType, DispatcherShutdownMillis) - case some ⇒ new PinnedDispatcher(app, some.underlying, some.underlying.uuid.toString, mailboxType, DispatcherShutdownMillis) + case some ⇒ new PinnedDispatcher(app, some.underlying, some.address, mailboxType, DispatcherShutdownMillis) } /** diff --git a/akka-actor/src/main/scala/akka/remote/RemoteInterface.scala b/akka-actor/src/main/scala/akka/remote/RemoteInterface.scala index c0e4a3a730..e32421e989 100644 --- a/akka-actor/src/main/scala/akka/remote/RemoteInterface.scala +++ b/akka-actor/src/main/scala/akka/remote/RemoteInterface.scala @@ -23,31 +23,10 @@ class RemoteException(message: String) extends AkkaException(message) trait RemoteService { def server: RemoteSupport - def address: InetSocketAddress } trait RemoteModule { - val UUID_PREFIX = "uuid:".intern - - def optimizeLocalScoped_?(): Boolean //Apply optimizations for remote operations in local scope protected[akka] def notifyListeners(message: ⇒ Any): Unit - - private[akka] def actors: ConcurrentHashMap[String, ActorRef] // FIXME need to invalidate this cache on replication - private[akka] def actorsByUuid: ConcurrentHashMap[String, ActorRef] // FIXME remove actorsByUuid map? - private[akka] def actorsFactories: ConcurrentHashMap[String, () ⇒ ActorRef] // FIXME what to do wit actorsFactories map? - - private[akka] def findActorByAddress(address: String): ActorRef = actors.get(address) - - private[akka] def findActorByUuid(uuid: String): ActorRef = actorsByUuid.get(uuid) - - private[akka] def findActorFactory(address: String): () ⇒ ActorRef = actorsFactories.get(address) - - private[akka] def findActorByAddressOrUuid(address: String, uuid: String): ActorRef = { - var actorRefOrNull = if (address.startsWith(UUID_PREFIX)) findActorByUuid(address.substring(UUID_PREFIX.length)) - else findActorByAddress(address) - if (actorRefOrNull eq null) actorRefOrNull = findActorByUuid(uuid) - actorRefOrNull - } } /** @@ -145,20 +124,9 @@ abstract class RemoteSupport(val app: AkkaApplication) extends RemoteServerModul def shutdown() { this.shutdownClientModule() this.shutdownServerModule() - clear } protected[akka] override def notifyListeners(message: ⇒ Any): Unit = app.eventHandler.notify(message) - - private[akka] val actors = new ConcurrentHashMap[String, ActorRef] - private[akka] val actorsByUuid = new ConcurrentHashMap[String, ActorRef] - private[akka] val actorsFactories = new ConcurrentHashMap[String, () ⇒ ActorRef] - - def clear { - actors.clear - actorsByUuid.clear - actorsFactories.clear - } } /** @@ -177,39 +145,6 @@ trait RemoteServerModule extends RemoteModule { this: RemoteSupport ⇒ */ def name: String - /** - * Gets the address of the server instance - */ - def address: InetSocketAddress - - /** - * Starts the server up - */ - def start(): RemoteServerModule = - start(app.defaultAddress.getAddress.getHostAddress, - app.defaultAddress.getPort, - None) - - /** - * Starts the server up - */ - def start(loader: ClassLoader): RemoteServerModule = - start(app.defaultAddress.getAddress.getHostAddress, - app.defaultAddress.getPort, - Option(loader)) - - /** - * Starts the server up - */ - def start(host: String, port: Int): RemoteServerModule = - start(host, port, None) - - /** - * Starts the server up - */ - def start(host: String, port: Int, loader: ClassLoader): RemoteServerModule = - start(host, port, Option(loader)) - /** * Starts the server up */ @@ -219,68 +154,9 @@ trait RemoteServerModule extends RemoteModule { this: RemoteSupport ⇒ * Shuts the server down */ def shutdownServerModule(): Unit - - /** - * Register Remote Actor by the Actor's 'id' field. It starts the Actor if it is not started already. - */ - def register(actorRef: ActorRef): Unit = register(actorRef.address, actorRef) - - /** - * Register Remote Actor by the Actor's uuid field. It starts the Actor if it is not started already. - */ - def registerByUuid(actorRef: ActorRef): Unit - - /** - * Register Remote Actor by a specific 'id' passed as argument. The actor is registered by UUID rather than ID - * when prefixing the handle with the “uuid:” protocol. - *

- * NOTE: If you use this method to register your remote actor then you must unregister the actor by this ID yourself. - */ - def register(address: String, actorRef: ActorRef): Unit - - /** - * Register Remote Session Actor by a specific 'id' passed as argument. - *

- * NOTE: If you use this method to register your remote actor then you must unregister the actor by this ID yourself. - */ - def registerPerSession(address: String, factory: ⇒ ActorRef): Unit - - /** - * Register Remote Session Actor by a specific 'id' passed as argument. - *

- * NOTE: If you use this method to register your remote actor then you must unregister the actor by this ID yourself. - * Java API - */ - def registerPerSession(address: String, factory: Creator[ActorRef]): Unit = registerPerSession(address, factory.create) - - /** - * Unregister Remote Actor that is registered using its 'id' field (not custom ID). - */ - def unregister(actorRef: ActorRef): Unit - - /** - * Unregister Remote Actor by specific 'id'. - *

- * NOTE: You need to call this method if you have registered an actor by a custom ID. - */ - def unregister(address: String): Unit - - /** - * Unregister Remote Actor by specific 'id'. - *

- * NOTE: You need to call this method if you have registered an actor by a custom ID. - */ - def unregisterPerSession(address: String): Unit } trait RemoteClientModule extends RemoteModule { self: RemoteSupport ⇒ - - def actorFor(address: String, hostname: String, port: Int): ActorRef = - actorFor(address, hostname, port, None) - - def actorFor(address: String, hostname: String, port: Int, loader: ClassLoader): ActorRef = - actorFor(address, hostname, port, Some(loader)) - /** * Clean-up all open connections. */ @@ -298,11 +174,9 @@ trait RemoteClientModule extends RemoteModule { self: RemoteSupport ⇒ /** Methods that needs to be implemented by a transport **/ - protected[akka] def actorFor(address: String, hostname: String, port: Int, loader: Option[ClassLoader]): ActorRef - protected[akka] def send[T](message: Any, senderOption: Option[ActorRef], remoteAddress: InetSocketAddress, - actorRef: ActorRef, + recipient: ActorRef, loader: Option[ClassLoader]): Unit } diff --git a/akka-camel-typed/src/main/scala/akka/camel/TypedConsumerPublisher.scala b/akka-camel-typed/src/main/scala/akka/camel/TypedConsumerPublisher.scala index c530ded991..850cbd640b 100644 --- a/akka-camel-typed/src/main/scala/akka/camel/TypedConsumerPublisher.scala +++ b/akka-camel-typed/src/main/scala/akka/camel/TypedConsumerPublisher.scala @@ -88,7 +88,6 @@ private[camel] trait ConsumerMethodEvent extends ConsumerEvent { val typedActor: AnyRef val method: Method - val uuid = actorRef.uuid.toString val methodName = method.getName val methodUuid = "%s_%s" format (uuid, methodName) diff --git a/akka-remote/src/main/java/akka/remote/RemoteProtocol.java b/akka-remote/src/main/java/akka/remote/RemoteProtocol.java index 83b8e31da6..dec400def6 100644 --- a/akka-remote/src/main/java/akka/remote/RemoteProtocol.java +++ b/akka-remote/src/main/java/akka/remote/RemoteProtocol.java @@ -13,13 +13,13 @@ public final class RemoteProtocol { CONNECT(0, 1), SHUTDOWN(1, 2), ; - + public static final int CONNECT_VALUE = 1; public static final int SHUTDOWN_VALUE = 2; - - + + public final int getNumber() { return value; } - + public static CommandType valueOf(int value) { switch (value) { case 1: return CONNECT; @@ -27,7 +27,7 @@ public final class RemoteProtocol { default: return null; } } - + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { return internalValueMap; @@ -39,7 +39,7 @@ public final class RemoteProtocol { return CommandType.valueOf(number); } }; - + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { return getDescriptor().getValues().get(index); @@ -52,11 +52,11 @@ public final class RemoteProtocol { getDescriptor() { return akka.remote.RemoteProtocol.getDescriptor().getEnumTypes().get(0); } - + private static final CommandType[] VALUES = { - CONNECT, SHUTDOWN, + CONNECT, SHUTDOWN, }; - + public static CommandType valueOf( com.google.protobuf.Descriptors.EnumValueDescriptor desc) { if (desc.getType() != getDescriptor()) { @@ -65,32 +65,32 @@ public final class RemoteProtocol { } return VALUES[desc.getIndex()]; } - + private final int index; private final int value; - + private CommandType(int index, int value) { this.index = index; this.value = value; } - + // @@protoc_insertion_point(enum_scope:CommandType) } - + public enum ReplicationStorageType implements com.google.protobuf.ProtocolMessageEnum { TRANSIENT(0, 1), TRANSACTION_LOG(1, 2), DATA_GRID(2, 3), ; - + public static final int TRANSIENT_VALUE = 1; public static final int TRANSACTION_LOG_VALUE = 2; public static final int DATA_GRID_VALUE = 3; - - + + public final int getNumber() { return value; } - + public static ReplicationStorageType valueOf(int value) { switch (value) { case 1: return TRANSIENT; @@ -99,7 +99,7 @@ public final class RemoteProtocol { default: return null; } } - + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { return internalValueMap; @@ -111,7 +111,7 @@ public final class RemoteProtocol { return ReplicationStorageType.valueOf(number); } }; - + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { return getDescriptor().getValues().get(index); @@ -124,11 +124,11 @@ public final class RemoteProtocol { getDescriptor() { return akka.remote.RemoteProtocol.getDescriptor().getEnumTypes().get(1); } - + private static final ReplicationStorageType[] VALUES = { - TRANSIENT, TRANSACTION_LOG, DATA_GRID, + TRANSIENT, TRANSACTION_LOG, DATA_GRID, }; - + public static ReplicationStorageType valueOf( com.google.protobuf.Descriptors.EnumValueDescriptor desc) { if (desc.getType() != getDescriptor()) { @@ -137,30 +137,30 @@ public final class RemoteProtocol { } return VALUES[desc.getIndex()]; } - + private final int index; private final int value; - + private ReplicationStorageType(int index, int value) { this.index = index; this.value = value; } - + // @@protoc_insertion_point(enum_scope:ReplicationStorageType) } - + public enum ReplicationStrategyType implements com.google.protobuf.ProtocolMessageEnum { WRITE_THROUGH(0, 1), WRITE_BEHIND(1, 2), ; - + public static final int WRITE_THROUGH_VALUE = 1; public static final int WRITE_BEHIND_VALUE = 2; - - + + public final int getNumber() { return value; } - + public static ReplicationStrategyType valueOf(int value) { switch (value) { case 1: return WRITE_THROUGH; @@ -168,7 +168,7 @@ public final class RemoteProtocol { default: return null; } } - + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { return internalValueMap; @@ -180,7 +180,7 @@ public final class RemoteProtocol { return ReplicationStrategyType.valueOf(number); } }; - + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { return getDescriptor().getValues().get(index); @@ -193,11 +193,11 @@ public final class RemoteProtocol { getDescriptor() { return akka.remote.RemoteProtocol.getDescriptor().getEnumTypes().get(2); } - + private static final ReplicationStrategyType[] VALUES = { - WRITE_THROUGH, WRITE_BEHIND, + WRITE_THROUGH, WRITE_BEHIND, }; - + public static ReplicationStrategyType valueOf( com.google.protobuf.Descriptors.EnumValueDescriptor desc) { if (desc.getType() != getDescriptor()) { @@ -206,59 +206,86 @@ public final class RemoteProtocol { } return VALUES[desc.getIndex()]; } - + private final int index; private final int value; - + private ReplicationStrategyType(int index, int value) { this.index = index; this.value = value; } - + // @@protoc_insertion_point(enum_scope:ReplicationStrategyType) } - - public enum SerializationSchemeType + + public enum RemoteSystemDaemonMessageType implements com.google.protobuf.ProtocolMessageEnum { - JAVA(0, 1), - SBINARY(1, 2), - SCALA_JSON(2, 3), - JAVA_JSON(3, 4), - PROTOBUF(4, 5), + STOP(0, 1), + USE(1, 2), + RELEASE(2, 3), + MAKE_AVAILABLE(3, 4), + MAKE_UNAVAILABLE(4, 5), + DISCONNECT(5, 6), + RECONNECT(6, 7), + RESIGN(7, 8), + GOSSIP(8, 9), + FAIL_OVER_CONNECTIONS(9, 20), + FUNCTION_FUN0_UNIT(10, 21), + FUNCTION_FUN0_ANY(11, 22), + FUNCTION_FUN1_ARG_UNIT(12, 23), + FUNCTION_FUN1_ARG_ANY(13, 24), ; - - public static final int JAVA_VALUE = 1; - public static final int SBINARY_VALUE = 2; - public static final int SCALA_JSON_VALUE = 3; - public static final int JAVA_JSON_VALUE = 4; - public static final int PROTOBUF_VALUE = 5; - - + + public static final int STOP_VALUE = 1; + public static final int USE_VALUE = 2; + public static final int RELEASE_VALUE = 3; + public static final int MAKE_AVAILABLE_VALUE = 4; + public static final int MAKE_UNAVAILABLE_VALUE = 5; + public static final int DISCONNECT_VALUE = 6; + public static final int RECONNECT_VALUE = 7; + public static final int RESIGN_VALUE = 8; + public static final int GOSSIP_VALUE = 9; + public static final int FAIL_OVER_CONNECTIONS_VALUE = 20; + public static final int FUNCTION_FUN0_UNIT_VALUE = 21; + public static final int FUNCTION_FUN0_ANY_VALUE = 22; + public static final int FUNCTION_FUN1_ARG_UNIT_VALUE = 23; + public static final int FUNCTION_FUN1_ARG_ANY_VALUE = 24; + + public final int getNumber() { return value; } - - public static SerializationSchemeType valueOf(int value) { + + public static RemoteSystemDaemonMessageType valueOf(int value) { switch (value) { - case 1: return JAVA; - case 2: return SBINARY; - case 3: return SCALA_JSON; - case 4: return JAVA_JSON; - case 5: return PROTOBUF; + case 1: return STOP; + case 2: return USE; + case 3: return RELEASE; + case 4: return MAKE_AVAILABLE; + case 5: return MAKE_UNAVAILABLE; + case 6: return DISCONNECT; + case 7: return RECONNECT; + case 8: return RESIGN; + case 9: return GOSSIP; + case 20: return FAIL_OVER_CONNECTIONS; + case 21: return FUNCTION_FUN0_UNIT; + case 22: return FUNCTION_FUN0_ANY; + case 23: return FUNCTION_FUN1_ARG_UNIT; + case 24: return FUNCTION_FUN1_ARG_ANY; default: return null; } } - - public static com.google.protobuf.Internal.EnumLiteMap + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { return internalValueMap; } - private static com.google.protobuf.Internal.EnumLiteMap + private static com.google.protobuf.Internal.EnumLiteMap internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public SerializationSchemeType findValueByNumber(int number) { - return SerializationSchemeType.valueOf(number); + new com.google.protobuf.Internal.EnumLiteMap() { + public RemoteSystemDaemonMessageType findValueByNumber(int number) { + return RemoteSystemDaemonMessageType.valueOf(number); } }; - + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { return getDescriptor().getValues().get(index); @@ -271,188 +298,11 @@ public final class RemoteProtocol { getDescriptor() { return akka.remote.RemoteProtocol.getDescriptor().getEnumTypes().get(3); } - - private static final SerializationSchemeType[] VALUES = { - JAVA, SBINARY, SCALA_JSON, JAVA_JSON, PROTOBUF, - }; - - public static SerializationSchemeType valueOf( - com.google.protobuf.Descriptors.EnumValueDescriptor desc) { - if (desc.getType() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "EnumValueDescriptor is not for this type."); - } - return VALUES[desc.getIndex()]; - } - - private final int index; - private final int value; - - private SerializationSchemeType(int index, int value) { - this.index = index; - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:SerializationSchemeType) - } - - public enum LifeCycleType - implements com.google.protobuf.ProtocolMessageEnum { - PERMANENT(0, 1), - TEMPORARY(1, 2), - ; - - public static final int PERMANENT_VALUE = 1; - public static final int TEMPORARY_VALUE = 2; - - - public final int getNumber() { return value; } - - public static LifeCycleType valueOf(int value) { - switch (value) { - case 1: return PERMANENT; - case 2: return TEMPORARY; - default: return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static com.google.protobuf.Internal.EnumLiteMap - internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public LifeCycleType findValueByNumber(int number) { - return LifeCycleType.valueOf(number); - } - }; - - public final com.google.protobuf.Descriptors.EnumValueDescriptor - getValueDescriptor() { - return getDescriptor().getValues().get(index); - } - public final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptorForType() { - return getDescriptor(); - } - public static final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptor() { - return akka.remote.RemoteProtocol.getDescriptor().getEnumTypes().get(4); - } - - private static final LifeCycleType[] VALUES = { - PERMANENT, TEMPORARY, - }; - - public static LifeCycleType valueOf( - com.google.protobuf.Descriptors.EnumValueDescriptor desc) { - if (desc.getType() != getDescriptor()) { - throw new java.lang.IllegalArgumentException( - "EnumValueDescriptor is not for this type."); - } - return VALUES[desc.getIndex()]; - } - - private final int index; - private final int value; - - private LifeCycleType(int index, int value) { - this.index = index; - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:LifeCycleType) - } - - public enum RemoteSystemDaemonMessageType - implements com.google.protobuf.ProtocolMessageEnum { - STOP(0, 1), - USE(1, 2), - RELEASE(2, 3), - MAKE_AVAILABLE(3, 4), - MAKE_UNAVAILABLE(4, 5), - DISCONNECT(5, 6), - RECONNECT(6, 7), - RESIGN(7, 8), - GOSSIP(8, 9), - GOSSIP_ACK(9, 10), - FAIL_OVER_CONNECTIONS(10, 20), - FUNCTION_FUN0_UNIT(11, 21), - FUNCTION_FUN0_ANY(12, 22), - FUNCTION_FUN1_ARG_UNIT(13, 23), - FUNCTION_FUN1_ARG_ANY(14, 24), - ; - - public static final int STOP_VALUE = 1; - public static final int USE_VALUE = 2; - public static final int RELEASE_VALUE = 3; - public static final int MAKE_AVAILABLE_VALUE = 4; - public static final int MAKE_UNAVAILABLE_VALUE = 5; - public static final int DISCONNECT_VALUE = 6; - public static final int RECONNECT_VALUE = 7; - public static final int RESIGN_VALUE = 8; - public static final int GOSSIP_VALUE = 9; - public static final int GOSSIP_ACK_VALUE = 10; - public static final int FAIL_OVER_CONNECTIONS_VALUE = 20; - public static final int FUNCTION_FUN0_UNIT_VALUE = 21; - public static final int FUNCTION_FUN0_ANY_VALUE = 22; - public static final int FUNCTION_FUN1_ARG_UNIT_VALUE = 23; - public static final int FUNCTION_FUN1_ARG_ANY_VALUE = 24; - - - public final int getNumber() { return value; } - - public static RemoteSystemDaemonMessageType valueOf(int value) { - switch (value) { - case 1: return STOP; - case 2: return USE; - case 3: return RELEASE; - case 4: return MAKE_AVAILABLE; - case 5: return MAKE_UNAVAILABLE; - case 6: return DISCONNECT; - case 7: return RECONNECT; - case 8: return RESIGN; - case 9: return GOSSIP; - case 10: return GOSSIP_ACK; - case 20: return FAIL_OVER_CONNECTIONS; - case 21: return FUNCTION_FUN0_UNIT; - case 22: return FUNCTION_FUN0_ANY; - case 23: return FUNCTION_FUN1_ARG_UNIT; - case 24: return FUNCTION_FUN1_ARG_ANY; - default: return null; - } - } - - public static com.google.protobuf.Internal.EnumLiteMap - internalGetValueMap() { - return internalValueMap; - } - private static com.google.protobuf.Internal.EnumLiteMap - internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public RemoteSystemDaemonMessageType findValueByNumber(int number) { - return RemoteSystemDaemonMessageType.valueOf(number); - } - }; - - public final com.google.protobuf.Descriptors.EnumValueDescriptor - getValueDescriptor() { - return getDescriptor().getValues().get(index); - } - public final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptorForType() { - return getDescriptor(); - } - public static final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptor() { - return akka.remote.RemoteProtocol.getDescriptor().getEnumTypes().get(5); - } - + private static final RemoteSystemDaemonMessageType[] VALUES = { - STOP, USE, RELEASE, MAKE_AVAILABLE, MAKE_UNAVAILABLE, DISCONNECT, RECONNECT, RESIGN, GOSSIP, GOSSIP_ACK, FAIL_OVER_CONNECTIONS, FUNCTION_FUN0_UNIT, FUNCTION_FUN0_ANY, FUNCTION_FUN1_ARG_UNIT, FUNCTION_FUN1_ARG_ANY, + STOP, USE, RELEASE, MAKE_AVAILABLE, MAKE_UNAVAILABLE, DISCONNECT, RECONNECT, RESIGN, GOSSIP, FAIL_OVER_CONNECTIONS, FUNCTION_FUN0_UNIT, FUNCTION_FUN0_ANY, FUNCTION_FUN1_ARG_UNIT, FUNCTION_FUN1_ARG_ANY, }; - + public static RemoteSystemDaemonMessageType valueOf( com.google.protobuf.Descriptors.EnumValueDescriptor desc) { if (desc.getType() != getDescriptor()) { @@ -461,26 +311,26 @@ public final class RemoteProtocol { } return VALUES[desc.getIndex()]; } - + private final int index; private final int value; - + private RemoteSystemDaemonMessageType(int index, int value) { this.index = index; this.value = value; } - + // @@protoc_insertion_point(enum_scope:RemoteSystemDaemonMessageType) } - + public interface AkkaRemoteProtocolOrBuilder extends com.google.protobuf.MessageOrBuilder { - + // optional .RemoteMessageProtocol message = 1; boolean hasMessage(); akka.remote.RemoteProtocol.RemoteMessageProtocol getMessage(); akka.remote.RemoteProtocol.RemoteMessageProtocolOrBuilder getMessageOrBuilder(); - + // optional .RemoteControlProtocol instruction = 2; boolean hasInstruction(); akka.remote.RemoteProtocol.RemoteControlProtocol getInstruction(); @@ -494,26 +344,26 @@ public final class RemoteProtocol { super(builder); } private AkkaRemoteProtocol(boolean noInit) {} - + private static final AkkaRemoteProtocol defaultInstance; public static AkkaRemoteProtocol getDefaultInstance() { return defaultInstance; } - + public AkkaRemoteProtocol getDefaultInstanceForType() { return defaultInstance; } - + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return akka.remote.RemoteProtocol.internal_static_AkkaRemoteProtocol_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return akka.remote.RemoteProtocol.internal_static_AkkaRemoteProtocol_fieldAccessorTable; } - + private int bitField0_; // optional .RemoteMessageProtocol message = 1; public static final int MESSAGE_FIELD_NUMBER = 1; @@ -527,7 +377,7 @@ public final class RemoteProtocol { public akka.remote.RemoteProtocol.RemoteMessageProtocolOrBuilder getMessageOrBuilder() { return message_; } - + // optional .RemoteControlProtocol instruction = 2; public static final int INSTRUCTION_FIELD_NUMBER = 2; private akka.remote.RemoteProtocol.RemoteControlProtocol instruction_; @@ -540,7 +390,7 @@ public final class RemoteProtocol { public akka.remote.RemoteProtocol.RemoteControlProtocolOrBuilder getInstructionOrBuilder() { return instruction_; } - + private void initFields() { message_ = akka.remote.RemoteProtocol.RemoteMessageProtocol.getDefaultInstance(); instruction_ = akka.remote.RemoteProtocol.RemoteControlProtocol.getDefaultInstance(); @@ -549,7 +399,7 @@ public final class RemoteProtocol { public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized != -1) return isInitialized == 1; - + if (hasMessage()) { if (!getMessage().isInitialized()) { memoizedIsInitialized = 0; @@ -565,7 +415,7 @@ public final class RemoteProtocol { memoizedIsInitialized = 1; return true; } - + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); @@ -577,12 +427,12 @@ public final class RemoteProtocol { } getUnknownFields().writeTo(output); } - + private int memoizedSerializedSize = -1; public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; - + size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream @@ -596,14 +446,14 @@ public final class RemoteProtocol { memoizedSerializedSize = size; return size; } - + private static final long serialVersionUID = 0L; @java.lang.Override protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { return super.writeReplace(); } - + public static akka.remote.RemoteProtocol.AkkaRemoteProtocol parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { @@ -670,14 +520,14 @@ public final class RemoteProtocol { return newBuilder().mergeFrom(input, extensionRegistry) .buildParsed(); } - + public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(akka.remote.RemoteProtocol.AkkaRemoteProtocol prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } - + @java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessage.BuilderParent parent) { @@ -691,18 +541,18 @@ public final class RemoteProtocol { getDescriptor() { return akka.remote.RemoteProtocol.internal_static_AkkaRemoteProtocol_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return akka.remote.RemoteProtocol.internal_static_AkkaRemoteProtocol_fieldAccessorTable; } - + // Construct using akka.remote.RemoteProtocol.AkkaRemoteProtocol.newBuilder() private Builder() { maybeForceBuilderInitialization(); } - - private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + + private Builder(BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } @@ -715,7 +565,7 @@ public final class RemoteProtocol { private static Builder create() { return new Builder(); } - + public Builder clear() { super.clear(); if (messageBuilder_ == null) { @@ -732,20 +582,20 @@ public final class RemoteProtocol { bitField0_ = (bitField0_ & ~0x00000002); return this; } - + public Builder clone() { return create().mergeFrom(buildPartial()); } - + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return akka.remote.RemoteProtocol.AkkaRemoteProtocol.getDescriptor(); } - + public akka.remote.RemoteProtocol.AkkaRemoteProtocol getDefaultInstanceForType() { return akka.remote.RemoteProtocol.AkkaRemoteProtocol.getDefaultInstance(); } - + public akka.remote.RemoteProtocol.AkkaRemoteProtocol build() { akka.remote.RemoteProtocol.AkkaRemoteProtocol result = buildPartial(); if (!result.isInitialized()) { @@ -753,7 +603,7 @@ public final class RemoteProtocol { } return result; } - + private akka.remote.RemoteProtocol.AkkaRemoteProtocol buildParsed() throws com.google.protobuf.InvalidProtocolBufferException { akka.remote.RemoteProtocol.AkkaRemoteProtocol result = buildPartial(); @@ -763,7 +613,7 @@ public final class RemoteProtocol { } return result; } - + public akka.remote.RemoteProtocol.AkkaRemoteProtocol buildPartial() { akka.remote.RemoteProtocol.AkkaRemoteProtocol result = new akka.remote.RemoteProtocol.AkkaRemoteProtocol(this); int from_bitField0_ = bitField0_; @@ -788,7 +638,7 @@ public final class RemoteProtocol { onBuilt(); return result; } - + public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof akka.remote.RemoteProtocol.AkkaRemoteProtocol) { return mergeFrom((akka.remote.RemoteProtocol.AkkaRemoteProtocol)other); @@ -797,7 +647,7 @@ public final class RemoteProtocol { return this; } } - + public Builder mergeFrom(akka.remote.RemoteProtocol.AkkaRemoteProtocol other) { if (other == akka.remote.RemoteProtocol.AkkaRemoteProtocol.getDefaultInstance()) return this; if (other.hasMessage()) { @@ -809,23 +659,23 @@ public final class RemoteProtocol { this.mergeUnknownFields(other.getUnknownFields()); return this; } - + public final boolean isInitialized() { if (hasMessage()) { if (!getMessage().isInitialized()) { - + return false; } } if (hasInstruction()) { if (!getInstruction().isInitialized()) { - + return false; } } return true; } - + public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) @@ -870,9 +720,9 @@ public final class RemoteProtocol { } } } - + private int bitField0_; - + // optional .RemoteMessageProtocol message = 1; private akka.remote.RemoteProtocol.RemoteMessageProtocol message_ = akka.remote.RemoteProtocol.RemoteMessageProtocol.getDefaultInstance(); private com.google.protobuf.SingleFieldBuilder< @@ -950,7 +800,7 @@ public final class RemoteProtocol { } } private com.google.protobuf.SingleFieldBuilder< - akka.remote.RemoteProtocol.RemoteMessageProtocol, akka.remote.RemoteProtocol.RemoteMessageProtocol.Builder, akka.remote.RemoteProtocol.RemoteMessageProtocolOrBuilder> + akka.remote.RemoteProtocol.RemoteMessageProtocol, akka.remote.RemoteProtocol.RemoteMessageProtocol.Builder, akka.remote.RemoteProtocol.RemoteMessageProtocolOrBuilder> getMessageFieldBuilder() { if (messageBuilder_ == null) { messageBuilder_ = new com.google.protobuf.SingleFieldBuilder< @@ -962,7 +812,7 @@ public final class RemoteProtocol { } return messageBuilder_; } - + // optional .RemoteControlProtocol instruction = 2; private akka.remote.RemoteProtocol.RemoteControlProtocol instruction_ = akka.remote.RemoteProtocol.RemoteControlProtocol.getDefaultInstance(); private com.google.protobuf.SingleFieldBuilder< @@ -1040,7 +890,7 @@ public final class RemoteProtocol { } } private com.google.protobuf.SingleFieldBuilder< - akka.remote.RemoteProtocol.RemoteControlProtocol, akka.remote.RemoteProtocol.RemoteControlProtocol.Builder, akka.remote.RemoteProtocol.RemoteControlProtocolOrBuilder> + akka.remote.RemoteProtocol.RemoteControlProtocol, akka.remote.RemoteProtocol.RemoteControlProtocol.Builder, akka.remote.RemoteProtocol.RemoteControlProtocolOrBuilder> getInstructionFieldBuilder() { if (instructionBuilder_ == null) { instructionBuilder_ = new com.google.protobuf.SingleFieldBuilder< @@ -1052,61 +902,47 @@ public final class RemoteProtocol { } return instructionBuilder_; } - + // @@protoc_insertion_point(builder_scope:AkkaRemoteProtocol) } - + static { defaultInstance = new AkkaRemoteProtocol(true); defaultInstance.initFields(); } - + // @@protoc_insertion_point(class_scope:AkkaRemoteProtocol) } - + public interface RemoteMessageProtocolOrBuilder extends com.google.protobuf.MessageOrBuilder { - - // required .UuidProtocol uuid = 1; - boolean hasUuid(); - akka.remote.RemoteProtocol.UuidProtocol getUuid(); - akka.remote.RemoteProtocol.UuidProtocolOrBuilder getUuidOrBuilder(); - - // required .ActorInfoProtocol actorInfo = 2; - boolean hasActorInfo(); - akka.remote.RemoteProtocol.ActorInfoProtocol getActorInfo(); - akka.remote.RemoteProtocol.ActorInfoProtocolOrBuilder getActorInfoOrBuilder(); - - // required bool oneWay = 3; - boolean hasOneWay(); - boolean getOneWay(); - - // optional .MessageProtocol message = 4; + + // required .ActorRefProtocol recipient = 1; + boolean hasRecipient(); + akka.remote.RemoteProtocol.ActorRefProtocol getRecipient(); + akka.remote.RemoteProtocol.ActorRefProtocolOrBuilder getRecipientOrBuilder(); + + // optional .MessageProtocol message = 2; boolean hasMessage(); akka.remote.RemoteProtocol.MessageProtocol getMessage(); akka.remote.RemoteProtocol.MessageProtocolOrBuilder getMessageOrBuilder(); - - // optional .ExceptionProtocol exception = 5; + + // optional .ExceptionProtocol exception = 3; boolean hasException(); akka.remote.RemoteProtocol.ExceptionProtocol getException(); akka.remote.RemoteProtocol.ExceptionProtocolOrBuilder getExceptionOrBuilder(); - - // optional .UuidProtocol supervisorUuid = 6; - boolean hasSupervisorUuid(); - akka.remote.RemoteProtocol.UuidProtocol getSupervisorUuid(); - akka.remote.RemoteProtocol.UuidProtocolOrBuilder getSupervisorUuidOrBuilder(); - - // optional .RemoteActorRefProtocol sender = 7; + + // optional .ActorRefProtocol sender = 4; boolean hasSender(); - akka.remote.RemoteProtocol.RemoteActorRefProtocol getSender(); - akka.remote.RemoteProtocol.RemoteActorRefProtocolOrBuilder getSenderOrBuilder(); - - // repeated .MetadataEntryProtocol metadata = 8; - java.util.List + akka.remote.RemoteProtocol.ActorRefProtocol getSender(); + akka.remote.RemoteProtocol.ActorRefProtocolOrBuilder getSenderOrBuilder(); + + // repeated .MetadataEntryProtocol metadata = 5; + java.util.List getMetadataList(); akka.remote.RemoteProtocol.MetadataEntryProtocol getMetadata(int index); int getMetadataCount(); - java.util.List + java.util.List getMetadataOrBuilderList(); akka.remote.RemoteProtocol.MetadataEntryProtocolOrBuilder getMetadataOrBuilder( int index); @@ -1119,68 +955,45 @@ public final class RemoteProtocol { super(builder); } private RemoteMessageProtocol(boolean noInit) {} - + private static final RemoteMessageProtocol defaultInstance; public static RemoteMessageProtocol getDefaultInstance() { return defaultInstance; } - + public RemoteMessageProtocol getDefaultInstanceForType() { return defaultInstance; } - + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return akka.remote.RemoteProtocol.internal_static_RemoteMessageProtocol_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return akka.remote.RemoteProtocol.internal_static_RemoteMessageProtocol_fieldAccessorTable; } - + private int bitField0_; - // required .UuidProtocol uuid = 1; - public static final int UUID_FIELD_NUMBER = 1; - private akka.remote.RemoteProtocol.UuidProtocol uuid_; - public boolean hasUuid() { + // required .ActorRefProtocol recipient = 1; + public static final int RECIPIENT_FIELD_NUMBER = 1; + private akka.remote.RemoteProtocol.ActorRefProtocol recipient_; + public boolean hasRecipient() { return ((bitField0_ & 0x00000001) == 0x00000001); } - public akka.remote.RemoteProtocol.UuidProtocol getUuid() { - return uuid_; + public akka.remote.RemoteProtocol.ActorRefProtocol getRecipient() { + return recipient_; } - public akka.remote.RemoteProtocol.UuidProtocolOrBuilder getUuidOrBuilder() { - return uuid_; + public akka.remote.RemoteProtocol.ActorRefProtocolOrBuilder getRecipientOrBuilder() { + return recipient_; } - - // required .ActorInfoProtocol actorInfo = 2; - public static final int ACTORINFO_FIELD_NUMBER = 2; - private akka.remote.RemoteProtocol.ActorInfoProtocol actorInfo_; - public boolean hasActorInfo() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - public akka.remote.RemoteProtocol.ActorInfoProtocol getActorInfo() { - return actorInfo_; - } - public akka.remote.RemoteProtocol.ActorInfoProtocolOrBuilder getActorInfoOrBuilder() { - return actorInfo_; - } - - // required bool oneWay = 3; - public static final int ONEWAY_FIELD_NUMBER = 3; - private boolean oneWay_; - public boolean hasOneWay() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - public boolean getOneWay() { - return oneWay_; - } - - // optional .MessageProtocol message = 4; - public static final int MESSAGE_FIELD_NUMBER = 4; + + // optional .MessageProtocol message = 2; + public static final int MESSAGE_FIELD_NUMBER = 2; private akka.remote.RemoteProtocol.MessageProtocol message_; public boolean hasMessage() { - return ((bitField0_ & 0x00000008) == 0x00000008); + return ((bitField0_ & 0x00000002) == 0x00000002); } public akka.remote.RemoteProtocol.MessageProtocol getMessage() { return message_; @@ -1188,12 +1001,12 @@ public final class RemoteProtocol { public akka.remote.RemoteProtocol.MessageProtocolOrBuilder getMessageOrBuilder() { return message_; } - - // optional .ExceptionProtocol exception = 5; - public static final int EXCEPTION_FIELD_NUMBER = 5; + + // optional .ExceptionProtocol exception = 3; + public static final int EXCEPTION_FIELD_NUMBER = 3; private akka.remote.RemoteProtocol.ExceptionProtocol exception_; public boolean hasException() { - return ((bitField0_ & 0x00000010) == 0x00000010); + return ((bitField0_ & 0x00000004) == 0x00000004); } public akka.remote.RemoteProtocol.ExceptionProtocol getException() { return exception_; @@ -1201,40 +1014,27 @@ public final class RemoteProtocol { public akka.remote.RemoteProtocol.ExceptionProtocolOrBuilder getExceptionOrBuilder() { return exception_; } - - // optional .UuidProtocol supervisorUuid = 6; - public static final int SUPERVISORUUID_FIELD_NUMBER = 6; - private akka.remote.RemoteProtocol.UuidProtocol supervisorUuid_; - public boolean hasSupervisorUuid() { - return ((bitField0_ & 0x00000020) == 0x00000020); - } - public akka.remote.RemoteProtocol.UuidProtocol getSupervisorUuid() { - return supervisorUuid_; - } - public akka.remote.RemoteProtocol.UuidProtocolOrBuilder getSupervisorUuidOrBuilder() { - return supervisorUuid_; - } - - // optional .RemoteActorRefProtocol sender = 7; - public static final int SENDER_FIELD_NUMBER = 7; - private akka.remote.RemoteProtocol.RemoteActorRefProtocol sender_; + + // optional .ActorRefProtocol sender = 4; + public static final int SENDER_FIELD_NUMBER = 4; + private akka.remote.RemoteProtocol.ActorRefProtocol sender_; public boolean hasSender() { - return ((bitField0_ & 0x00000040) == 0x00000040); + return ((bitField0_ & 0x00000008) == 0x00000008); } - public akka.remote.RemoteProtocol.RemoteActorRefProtocol getSender() { + public akka.remote.RemoteProtocol.ActorRefProtocol getSender() { return sender_; } - public akka.remote.RemoteProtocol.RemoteActorRefProtocolOrBuilder getSenderOrBuilder() { + public akka.remote.RemoteProtocol.ActorRefProtocolOrBuilder getSenderOrBuilder() { return sender_; } - - // repeated .MetadataEntryProtocol metadata = 8; - public static final int METADATA_FIELD_NUMBER = 8; + + // repeated .MetadataEntryProtocol metadata = 5; + public static final int METADATA_FIELD_NUMBER = 5; private java.util.List metadata_; public java.util.List getMetadataList() { return metadata_; } - public java.util.List + public java.util.List getMetadataOrBuilderList() { return metadata_; } @@ -1248,39 +1048,24 @@ public final class RemoteProtocol { int index) { return metadata_.get(index); } - + private void initFields() { - uuid_ = akka.remote.RemoteProtocol.UuidProtocol.getDefaultInstance(); - actorInfo_ = akka.remote.RemoteProtocol.ActorInfoProtocol.getDefaultInstance(); - oneWay_ = false; + recipient_ = akka.remote.RemoteProtocol.ActorRefProtocol.getDefaultInstance(); message_ = akka.remote.RemoteProtocol.MessageProtocol.getDefaultInstance(); exception_ = akka.remote.RemoteProtocol.ExceptionProtocol.getDefaultInstance(); - supervisorUuid_ = akka.remote.RemoteProtocol.UuidProtocol.getDefaultInstance(); - sender_ = akka.remote.RemoteProtocol.RemoteActorRefProtocol.getDefaultInstance(); + sender_ = akka.remote.RemoteProtocol.ActorRefProtocol.getDefaultInstance(); metadata_ = java.util.Collections.emptyList(); } private byte memoizedIsInitialized = -1; public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized != -1) return isInitialized == 1; - - if (!hasUuid()) { + + if (!hasRecipient()) { memoizedIsInitialized = 0; return false; } - if (!hasActorInfo()) { - memoizedIsInitialized = 0; - return false; - } - if (!hasOneWay()) { - memoizedIsInitialized = 0; - return false; - } - if (!getUuid().isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - if (!getActorInfo().isInitialized()) { + if (!getRecipient().isInitialized()) { memoizedIsInitialized = 0; return false; } @@ -1296,12 +1081,6 @@ public final class RemoteProtocol { return false; } } - if (hasSupervisorUuid()) { - if (!getSupervisorUuid().isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } if (hasSender()) { if (!getSender().isInitialized()) { memoizedIsInitialized = 0; @@ -1317,87 +1096,66 @@ public final class RemoteProtocol { memoizedIsInitialized = 1; return true; } - + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeMessage(1, uuid_); + output.writeMessage(1, recipient_); } if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeMessage(2, actorInfo_); + output.writeMessage(2, message_); } if (((bitField0_ & 0x00000004) == 0x00000004)) { - output.writeBool(3, oneWay_); + output.writeMessage(3, exception_); } if (((bitField0_ & 0x00000008) == 0x00000008)) { - output.writeMessage(4, message_); - } - if (((bitField0_ & 0x00000010) == 0x00000010)) { - output.writeMessage(5, exception_); - } - if (((bitField0_ & 0x00000020) == 0x00000020)) { - output.writeMessage(6, supervisorUuid_); - } - if (((bitField0_ & 0x00000040) == 0x00000040)) { - output.writeMessage(7, sender_); + output.writeMessage(4, sender_); } for (int i = 0; i < metadata_.size(); i++) { - output.writeMessage(8, metadata_.get(i)); + output.writeMessage(5, metadata_.get(i)); } getUnknownFields().writeTo(output); } - + private int memoizedSerializedSize = -1; public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; - + size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, uuid_); + .computeMessageSize(1, recipient_); } if (((bitField0_ & 0x00000002) == 0x00000002)) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, actorInfo_); + .computeMessageSize(2, message_); } if (((bitField0_ & 0x00000004) == 0x00000004)) { size += com.google.protobuf.CodedOutputStream - .computeBoolSize(3, oneWay_); + .computeMessageSize(3, exception_); } if (((bitField0_ & 0x00000008) == 0x00000008)) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(4, message_); - } - if (((bitField0_ & 0x00000010) == 0x00000010)) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(5, exception_); - } - if (((bitField0_ & 0x00000020) == 0x00000020)) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(6, supervisorUuid_); - } - if (((bitField0_ & 0x00000040) == 0x00000040)) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(7, sender_); + .computeMessageSize(4, sender_); } for (int i = 0; i < metadata_.size(); i++) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(8, metadata_.get(i)); + .computeMessageSize(5, metadata_.get(i)); } size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; return size; } - + private static final long serialVersionUID = 0L; @java.lang.Override protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { return super.writeReplace(); } - + public static akka.remote.RemoteProtocol.RemoteMessageProtocol parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { @@ -1464,14 +1222,14 @@ public final class RemoteProtocol { return newBuilder().mergeFrom(input, extensionRegistry) .buildParsed(); } - + public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(akka.remote.RemoteProtocol.RemoteMessageProtocol prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } - + @java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessage.BuilderParent parent) { @@ -1485,28 +1243,26 @@ public final class RemoteProtocol { getDescriptor() { return akka.remote.RemoteProtocol.internal_static_RemoteMessageProtocol_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return akka.remote.RemoteProtocol.internal_static_RemoteMessageProtocol_fieldAccessorTable; } - + // Construct using akka.remote.RemoteProtocol.RemoteMessageProtocol.newBuilder() private Builder() { maybeForceBuilderInitialization(); } - - private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + + private Builder(BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - getUuidFieldBuilder(); - getActorInfoFieldBuilder(); + getRecipientFieldBuilder(); getMessageFieldBuilder(); getExceptionFieldBuilder(); - getSupervisorUuidFieldBuilder(); getSenderFieldBuilder(); getMetadataFieldBuilder(); } @@ -1514,69 +1270,55 @@ public final class RemoteProtocol { private static Builder create() { return new Builder(); } - + public Builder clear() { super.clear(); - if (uuidBuilder_ == null) { - uuid_ = akka.remote.RemoteProtocol.UuidProtocol.getDefaultInstance(); + if (recipientBuilder_ == null) { + recipient_ = akka.remote.RemoteProtocol.ActorRefProtocol.getDefaultInstance(); } else { - uuidBuilder_.clear(); + recipientBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000001); - if (actorInfoBuilder_ == null) { - actorInfo_ = akka.remote.RemoteProtocol.ActorInfoProtocol.getDefaultInstance(); - } else { - actorInfoBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000002); - oneWay_ = false; - bitField0_ = (bitField0_ & ~0x00000004); if (messageBuilder_ == null) { message_ = akka.remote.RemoteProtocol.MessageProtocol.getDefaultInstance(); } else { messageBuilder_.clear(); } - bitField0_ = (bitField0_ & ~0x00000008); + bitField0_ = (bitField0_ & ~0x00000002); if (exceptionBuilder_ == null) { exception_ = akka.remote.RemoteProtocol.ExceptionProtocol.getDefaultInstance(); } else { exceptionBuilder_.clear(); } - bitField0_ = (bitField0_ & ~0x00000010); - if (supervisorUuidBuilder_ == null) { - supervisorUuid_ = akka.remote.RemoteProtocol.UuidProtocol.getDefaultInstance(); - } else { - supervisorUuidBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000020); + bitField0_ = (bitField0_ & ~0x00000004); if (senderBuilder_ == null) { - sender_ = akka.remote.RemoteProtocol.RemoteActorRefProtocol.getDefaultInstance(); + sender_ = akka.remote.RemoteProtocol.ActorRefProtocol.getDefaultInstance(); } else { senderBuilder_.clear(); } - bitField0_ = (bitField0_ & ~0x00000040); + bitField0_ = (bitField0_ & ~0x00000008); if (metadataBuilder_ == null) { metadata_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000080); + bitField0_ = (bitField0_ & ~0x00000010); } else { metadataBuilder_.clear(); } return this; } - + public Builder clone() { return create().mergeFrom(buildPartial()); } - + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return akka.remote.RemoteProtocol.RemoteMessageProtocol.getDescriptor(); } - + public akka.remote.RemoteProtocol.RemoteMessageProtocol getDefaultInstanceForType() { return akka.remote.RemoteProtocol.RemoteMessageProtocol.getDefaultInstance(); } - + public akka.remote.RemoteProtocol.RemoteMessageProtocol build() { akka.remote.RemoteProtocol.RemoteMessageProtocol result = buildPartial(); if (!result.isInitialized()) { @@ -1584,7 +1326,7 @@ public final class RemoteProtocol { } return result; } - + private akka.remote.RemoteProtocol.RemoteMessageProtocol buildParsed() throws com.google.protobuf.InvalidProtocolBufferException { akka.remote.RemoteProtocol.RemoteMessageProtocol result = buildPartial(); @@ -1594,7 +1336,7 @@ public final class RemoteProtocol { } return result; } - + public akka.remote.RemoteProtocol.RemoteMessageProtocol buildPartial() { akka.remote.RemoteProtocol.RemoteMessageProtocol result = new akka.remote.RemoteProtocol.RemoteMessageProtocol(this); int from_bitField0_ = bitField0_; @@ -1602,49 +1344,29 @@ public final class RemoteProtocol { if (((from_bitField0_ & 0x00000001) == 0x00000001)) { to_bitField0_ |= 0x00000001; } - if (uuidBuilder_ == null) { - result.uuid_ = uuid_; + if (recipientBuilder_ == null) { + result.recipient_ = recipient_; } else { - result.uuid_ = uuidBuilder_.build(); + result.recipient_ = recipientBuilder_.build(); } if (((from_bitField0_ & 0x00000002) == 0x00000002)) { to_bitField0_ |= 0x00000002; } - if (actorInfoBuilder_ == null) { - result.actorInfo_ = actorInfo_; - } else { - result.actorInfo_ = actorInfoBuilder_.build(); - } - if (((from_bitField0_ & 0x00000004) == 0x00000004)) { - to_bitField0_ |= 0x00000004; - } - result.oneWay_ = oneWay_; - if (((from_bitField0_ & 0x00000008) == 0x00000008)) { - to_bitField0_ |= 0x00000008; - } if (messageBuilder_ == null) { result.message_ = message_; } else { result.message_ = messageBuilder_.build(); } - if (((from_bitField0_ & 0x00000010) == 0x00000010)) { - to_bitField0_ |= 0x00000010; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; } if (exceptionBuilder_ == null) { result.exception_ = exception_; } else { result.exception_ = exceptionBuilder_.build(); } - if (((from_bitField0_ & 0x00000020) == 0x00000020)) { - to_bitField0_ |= 0x00000020; - } - if (supervisorUuidBuilder_ == null) { - result.supervisorUuid_ = supervisorUuid_; - } else { - result.supervisorUuid_ = supervisorUuidBuilder_.build(); - } - if (((from_bitField0_ & 0x00000040) == 0x00000040)) { - to_bitField0_ |= 0x00000040; + if (((from_bitField0_ & 0x00000008) == 0x00000008)) { + to_bitField0_ |= 0x00000008; } if (senderBuilder_ == null) { result.sender_ = sender_; @@ -1652,9 +1374,9 @@ public final class RemoteProtocol { result.sender_ = senderBuilder_.build(); } if (metadataBuilder_ == null) { - if (((bitField0_ & 0x00000080) == 0x00000080)) { + if (((bitField0_ & 0x00000010) == 0x00000010)) { metadata_ = java.util.Collections.unmodifiableList(metadata_); - bitField0_ = (bitField0_ & ~0x00000080); + bitField0_ = (bitField0_ & ~0x00000010); } result.metadata_ = metadata_; } else { @@ -1664,7 +1386,7 @@ public final class RemoteProtocol { onBuilt(); return result; } - + public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof akka.remote.RemoteProtocol.RemoteMessageProtocol) { return mergeFrom((akka.remote.RemoteProtocol.RemoteMessageProtocol)other); @@ -1673,17 +1395,11 @@ public final class RemoteProtocol { return this; } } - + public Builder mergeFrom(akka.remote.RemoteProtocol.RemoteMessageProtocol other) { if (other == akka.remote.RemoteProtocol.RemoteMessageProtocol.getDefaultInstance()) return this; - if (other.hasUuid()) { - mergeUuid(other.getUuid()); - } - if (other.hasActorInfo()) { - mergeActorInfo(other.getActorInfo()); - } - if (other.hasOneWay()) { - setOneWay(other.getOneWay()); + if (other.hasRecipient()) { + mergeRecipient(other.getRecipient()); } if (other.hasMessage()) { mergeMessage(other.getMessage()); @@ -1691,9 +1407,6 @@ public final class RemoteProtocol { if (other.hasException()) { mergeException(other.getException()); } - if (other.hasSupervisorUuid()) { - mergeSupervisorUuid(other.getSupervisorUuid()); - } if (other.hasSender()) { mergeSender(other.getSender()); } @@ -1701,7 +1414,7 @@ public final class RemoteProtocol { if (!other.metadata_.isEmpty()) { if (metadata_.isEmpty()) { metadata_ = other.metadata_; - bitField0_ = (bitField0_ & ~0x00000080); + bitField0_ = (bitField0_ & ~0x00000010); } else { ensureMetadataIsMutable(); metadata_.addAll(other.metadata_); @@ -1714,8 +1427,8 @@ public final class RemoteProtocol { metadataBuilder_.dispose(); metadataBuilder_ = null; metadata_ = other.metadata_; - bitField0_ = (bitField0_ & ~0x00000080); - metadataBuilder_ = + bitField0_ = (bitField0_ & ~0x00000010); + metadataBuilder_ = com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? getMetadataFieldBuilder() : null; } else { @@ -1726,61 +1439,43 @@ public final class RemoteProtocol { this.mergeUnknownFields(other.getUnknownFields()); return this; } - + public final boolean isInitialized() { - if (!hasUuid()) { - + if (!hasRecipient()) { + return false; } - if (!hasActorInfo()) { - - return false; - } - if (!hasOneWay()) { - - return false; - } - if (!getUuid().isInitialized()) { - - return false; - } - if (!getActorInfo().isInitialized()) { - + if (!getRecipient().isInitialized()) { + return false; } if (hasMessage()) { if (!getMessage().isInitialized()) { - + return false; } } if (hasException()) { if (!getException().isInitialized()) { - - return false; - } - } - if (hasSupervisorUuid()) { - if (!getSupervisorUuid().isInitialized()) { - + return false; } } if (hasSender()) { if (!getSender().isInitialized()) { - + return false; } } for (int i = 0; i < getMetadataCount(); i++) { if (!getMetadata(i).isInitialized()) { - + return false; } } return true; } - + public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) @@ -1805,29 +1500,15 @@ public final class RemoteProtocol { break; } case 10: { - akka.remote.RemoteProtocol.UuidProtocol.Builder subBuilder = akka.remote.RemoteProtocol.UuidProtocol.newBuilder(); - if (hasUuid()) { - subBuilder.mergeFrom(getUuid()); + akka.remote.RemoteProtocol.ActorRefProtocol.Builder subBuilder = akka.remote.RemoteProtocol.ActorRefProtocol.newBuilder(); + if (hasRecipient()) { + subBuilder.mergeFrom(getRecipient()); } input.readMessage(subBuilder, extensionRegistry); - setUuid(subBuilder.buildPartial()); + setRecipient(subBuilder.buildPartial()); break; } case 18: { - akka.remote.RemoteProtocol.ActorInfoProtocol.Builder subBuilder = akka.remote.RemoteProtocol.ActorInfoProtocol.newBuilder(); - if (hasActorInfo()) { - subBuilder.mergeFrom(getActorInfo()); - } - input.readMessage(subBuilder, extensionRegistry); - setActorInfo(subBuilder.buildPartial()); - break; - } - case 24: { - bitField0_ |= 0x00000004; - oneWay_ = input.readBool(); - break; - } - case 34: { akka.remote.RemoteProtocol.MessageProtocol.Builder subBuilder = akka.remote.RemoteProtocol.MessageProtocol.newBuilder(); if (hasMessage()) { subBuilder.mergeFrom(getMessage()); @@ -1836,7 +1517,7 @@ public final class RemoteProtocol { setMessage(subBuilder.buildPartial()); break; } - case 42: { + case 26: { akka.remote.RemoteProtocol.ExceptionProtocol.Builder subBuilder = akka.remote.RemoteProtocol.ExceptionProtocol.newBuilder(); if (hasException()) { subBuilder.mergeFrom(getException()); @@ -1845,17 +1526,8 @@ public final class RemoteProtocol { setException(subBuilder.buildPartial()); break; } - case 50: { - akka.remote.RemoteProtocol.UuidProtocol.Builder subBuilder = akka.remote.RemoteProtocol.UuidProtocol.newBuilder(); - if (hasSupervisorUuid()) { - subBuilder.mergeFrom(getSupervisorUuid()); - } - input.readMessage(subBuilder, extensionRegistry); - setSupervisorUuid(subBuilder.buildPartial()); - break; - } - case 58: { - akka.remote.RemoteProtocol.RemoteActorRefProtocol.Builder subBuilder = akka.remote.RemoteProtocol.RemoteActorRefProtocol.newBuilder(); + case 34: { + akka.remote.RemoteProtocol.ActorRefProtocol.Builder subBuilder = akka.remote.RemoteProtocol.ActorRefProtocol.newBuilder(); if (hasSender()) { subBuilder.mergeFrom(getSender()); } @@ -1863,7 +1535,7 @@ public final class RemoteProtocol { setSender(subBuilder.buildPartial()); break; } - case 66: { + case 42: { akka.remote.RemoteProtocol.MetadataEntryProtocol.Builder subBuilder = akka.remote.RemoteProtocol.MetadataEntryProtocol.newBuilder(); input.readMessage(subBuilder, extensionRegistry); addMetadata(subBuilder.buildPartial()); @@ -1872,216 +1544,105 @@ public final class RemoteProtocol { } } } - + private int bitField0_; - - // required .UuidProtocol uuid = 1; - private akka.remote.RemoteProtocol.UuidProtocol uuid_ = akka.remote.RemoteProtocol.UuidProtocol.getDefaultInstance(); + + // required .ActorRefProtocol recipient = 1; + private akka.remote.RemoteProtocol.ActorRefProtocol recipient_ = akka.remote.RemoteProtocol.ActorRefProtocol.getDefaultInstance(); private com.google.protobuf.SingleFieldBuilder< - akka.remote.RemoteProtocol.UuidProtocol, akka.remote.RemoteProtocol.UuidProtocol.Builder, akka.remote.RemoteProtocol.UuidProtocolOrBuilder> uuidBuilder_; - public boolean hasUuid() { + akka.remote.RemoteProtocol.ActorRefProtocol, akka.remote.RemoteProtocol.ActorRefProtocol.Builder, akka.remote.RemoteProtocol.ActorRefProtocolOrBuilder> recipientBuilder_; + public boolean hasRecipient() { return ((bitField0_ & 0x00000001) == 0x00000001); } - public akka.remote.RemoteProtocol.UuidProtocol getUuid() { - if (uuidBuilder_ == null) { - return uuid_; + public akka.remote.RemoteProtocol.ActorRefProtocol getRecipient() { + if (recipientBuilder_ == null) { + return recipient_; } else { - return uuidBuilder_.getMessage(); + return recipientBuilder_.getMessage(); } } - public Builder setUuid(akka.remote.RemoteProtocol.UuidProtocol value) { - if (uuidBuilder_ == null) { + public Builder setRecipient(akka.remote.RemoteProtocol.ActorRefProtocol value) { + if (recipientBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - uuid_ = value; + recipient_ = value; onChanged(); } else { - uuidBuilder_.setMessage(value); + recipientBuilder_.setMessage(value); } bitField0_ |= 0x00000001; return this; } - public Builder setUuid( - akka.remote.RemoteProtocol.UuidProtocol.Builder builderForValue) { - if (uuidBuilder_ == null) { - uuid_ = builderForValue.build(); + public Builder setRecipient( + akka.remote.RemoteProtocol.ActorRefProtocol.Builder builderForValue) { + if (recipientBuilder_ == null) { + recipient_ = builderForValue.build(); onChanged(); } else { - uuidBuilder_.setMessage(builderForValue.build()); + recipientBuilder_.setMessage(builderForValue.build()); } bitField0_ |= 0x00000001; return this; } - public Builder mergeUuid(akka.remote.RemoteProtocol.UuidProtocol value) { - if (uuidBuilder_ == null) { + public Builder mergeRecipient(akka.remote.RemoteProtocol.ActorRefProtocol value) { + if (recipientBuilder_ == null) { if (((bitField0_ & 0x00000001) == 0x00000001) && - uuid_ != akka.remote.RemoteProtocol.UuidProtocol.getDefaultInstance()) { - uuid_ = - akka.remote.RemoteProtocol.UuidProtocol.newBuilder(uuid_).mergeFrom(value).buildPartial(); + recipient_ != akka.remote.RemoteProtocol.ActorRefProtocol.getDefaultInstance()) { + recipient_ = + akka.remote.RemoteProtocol.ActorRefProtocol.newBuilder(recipient_).mergeFrom(value).buildPartial(); } else { - uuid_ = value; + recipient_ = value; } onChanged(); } else { - uuidBuilder_.mergeFrom(value); + recipientBuilder_.mergeFrom(value); } bitField0_ |= 0x00000001; return this; } - public Builder clearUuid() { - if (uuidBuilder_ == null) { - uuid_ = akka.remote.RemoteProtocol.UuidProtocol.getDefaultInstance(); + public Builder clearRecipient() { + if (recipientBuilder_ == null) { + recipient_ = akka.remote.RemoteProtocol.ActorRefProtocol.getDefaultInstance(); onChanged(); } else { - uuidBuilder_.clear(); + recipientBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000001); return this; } - public akka.remote.RemoteProtocol.UuidProtocol.Builder getUuidBuilder() { + public akka.remote.RemoteProtocol.ActorRefProtocol.Builder getRecipientBuilder() { bitField0_ |= 0x00000001; onChanged(); - return getUuidFieldBuilder().getBuilder(); + return getRecipientFieldBuilder().getBuilder(); } - public akka.remote.RemoteProtocol.UuidProtocolOrBuilder getUuidOrBuilder() { - if (uuidBuilder_ != null) { - return uuidBuilder_.getMessageOrBuilder(); + public akka.remote.RemoteProtocol.ActorRefProtocolOrBuilder getRecipientOrBuilder() { + if (recipientBuilder_ != null) { + return recipientBuilder_.getMessageOrBuilder(); } else { - return uuid_; + return recipient_; } } private com.google.protobuf.SingleFieldBuilder< - akka.remote.RemoteProtocol.UuidProtocol, akka.remote.RemoteProtocol.UuidProtocol.Builder, akka.remote.RemoteProtocol.UuidProtocolOrBuilder> - getUuidFieldBuilder() { - if (uuidBuilder_ == null) { - uuidBuilder_ = new com.google.protobuf.SingleFieldBuilder< - akka.remote.RemoteProtocol.UuidProtocol, akka.remote.RemoteProtocol.UuidProtocol.Builder, akka.remote.RemoteProtocol.UuidProtocolOrBuilder>( - uuid_, + akka.remote.RemoteProtocol.ActorRefProtocol, akka.remote.RemoteProtocol.ActorRefProtocol.Builder, akka.remote.RemoteProtocol.ActorRefProtocolOrBuilder> + getRecipientFieldBuilder() { + if (recipientBuilder_ == null) { + recipientBuilder_ = new com.google.protobuf.SingleFieldBuilder< + akka.remote.RemoteProtocol.ActorRefProtocol, akka.remote.RemoteProtocol.ActorRefProtocol.Builder, akka.remote.RemoteProtocol.ActorRefProtocolOrBuilder>( + recipient_, getParentForChildren(), isClean()); - uuid_ = null; + recipient_ = null; } - return uuidBuilder_; + return recipientBuilder_; } - - // required .ActorInfoProtocol actorInfo = 2; - private akka.remote.RemoteProtocol.ActorInfoProtocol actorInfo_ = akka.remote.RemoteProtocol.ActorInfoProtocol.getDefaultInstance(); - private com.google.protobuf.SingleFieldBuilder< - akka.remote.RemoteProtocol.ActorInfoProtocol, akka.remote.RemoteProtocol.ActorInfoProtocol.Builder, akka.remote.RemoteProtocol.ActorInfoProtocolOrBuilder> actorInfoBuilder_; - public boolean hasActorInfo() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - public akka.remote.RemoteProtocol.ActorInfoProtocol getActorInfo() { - if (actorInfoBuilder_ == null) { - return actorInfo_; - } else { - return actorInfoBuilder_.getMessage(); - } - } - public Builder setActorInfo(akka.remote.RemoteProtocol.ActorInfoProtocol value) { - if (actorInfoBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - actorInfo_ = value; - onChanged(); - } else { - actorInfoBuilder_.setMessage(value); - } - bitField0_ |= 0x00000002; - return this; - } - public Builder setActorInfo( - akka.remote.RemoteProtocol.ActorInfoProtocol.Builder builderForValue) { - if (actorInfoBuilder_ == null) { - actorInfo_ = builderForValue.build(); - onChanged(); - } else { - actorInfoBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000002; - return this; - } - public Builder mergeActorInfo(akka.remote.RemoteProtocol.ActorInfoProtocol value) { - if (actorInfoBuilder_ == null) { - if (((bitField0_ & 0x00000002) == 0x00000002) && - actorInfo_ != akka.remote.RemoteProtocol.ActorInfoProtocol.getDefaultInstance()) { - actorInfo_ = - akka.remote.RemoteProtocol.ActorInfoProtocol.newBuilder(actorInfo_).mergeFrom(value).buildPartial(); - } else { - actorInfo_ = value; - } - onChanged(); - } else { - actorInfoBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00000002; - return this; - } - public Builder clearActorInfo() { - if (actorInfoBuilder_ == null) { - actorInfo_ = akka.remote.RemoteProtocol.ActorInfoProtocol.getDefaultInstance(); - onChanged(); - } else { - actorInfoBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000002); - return this; - } - public akka.remote.RemoteProtocol.ActorInfoProtocol.Builder getActorInfoBuilder() { - bitField0_ |= 0x00000002; - onChanged(); - return getActorInfoFieldBuilder().getBuilder(); - } - public akka.remote.RemoteProtocol.ActorInfoProtocolOrBuilder getActorInfoOrBuilder() { - if (actorInfoBuilder_ != null) { - return actorInfoBuilder_.getMessageOrBuilder(); - } else { - return actorInfo_; - } - } - private com.google.protobuf.SingleFieldBuilder< - akka.remote.RemoteProtocol.ActorInfoProtocol, akka.remote.RemoteProtocol.ActorInfoProtocol.Builder, akka.remote.RemoteProtocol.ActorInfoProtocolOrBuilder> - getActorInfoFieldBuilder() { - if (actorInfoBuilder_ == null) { - actorInfoBuilder_ = new com.google.protobuf.SingleFieldBuilder< - akka.remote.RemoteProtocol.ActorInfoProtocol, akka.remote.RemoteProtocol.ActorInfoProtocol.Builder, akka.remote.RemoteProtocol.ActorInfoProtocolOrBuilder>( - actorInfo_, - getParentForChildren(), - isClean()); - actorInfo_ = null; - } - return actorInfoBuilder_; - } - - // required bool oneWay = 3; - private boolean oneWay_ ; - public boolean hasOneWay() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - public boolean getOneWay() { - return oneWay_; - } - public Builder setOneWay(boolean value) { - bitField0_ |= 0x00000004; - oneWay_ = value; - onChanged(); - return this; - } - public Builder clearOneWay() { - bitField0_ = (bitField0_ & ~0x00000004); - oneWay_ = false; - onChanged(); - return this; - } - - // optional .MessageProtocol message = 4; + + // optional .MessageProtocol message = 2; private akka.remote.RemoteProtocol.MessageProtocol message_ = akka.remote.RemoteProtocol.MessageProtocol.getDefaultInstance(); private com.google.protobuf.SingleFieldBuilder< akka.remote.RemoteProtocol.MessageProtocol, akka.remote.RemoteProtocol.MessageProtocol.Builder, akka.remote.RemoteProtocol.MessageProtocolOrBuilder> messageBuilder_; public boolean hasMessage() { - return ((bitField0_ & 0x00000008) == 0x00000008); + return ((bitField0_ & 0x00000002) == 0x00000002); } public akka.remote.RemoteProtocol.MessageProtocol getMessage() { if (messageBuilder_ == null) { @@ -2100,7 +1661,7 @@ public final class RemoteProtocol { } else { messageBuilder_.setMessage(value); } - bitField0_ |= 0x00000008; + bitField0_ |= 0x00000002; return this; } public Builder setMessage( @@ -2111,12 +1672,12 @@ public final class RemoteProtocol { } else { messageBuilder_.setMessage(builderForValue.build()); } - bitField0_ |= 0x00000008; + bitField0_ |= 0x00000002; return this; } public Builder mergeMessage(akka.remote.RemoteProtocol.MessageProtocol value) { if (messageBuilder_ == null) { - if (((bitField0_ & 0x00000008) == 0x00000008) && + if (((bitField0_ & 0x00000002) == 0x00000002) && message_ != akka.remote.RemoteProtocol.MessageProtocol.getDefaultInstance()) { message_ = akka.remote.RemoteProtocol.MessageProtocol.newBuilder(message_).mergeFrom(value).buildPartial(); @@ -2127,7 +1688,7 @@ public final class RemoteProtocol { } else { messageBuilder_.mergeFrom(value); } - bitField0_ |= 0x00000008; + bitField0_ |= 0x00000002; return this; } public Builder clearMessage() { @@ -2137,11 +1698,11 @@ public final class RemoteProtocol { } else { messageBuilder_.clear(); } - bitField0_ = (bitField0_ & ~0x00000008); + bitField0_ = (bitField0_ & ~0x00000002); return this; } public akka.remote.RemoteProtocol.MessageProtocol.Builder getMessageBuilder() { - bitField0_ |= 0x00000008; + bitField0_ |= 0x00000002; onChanged(); return getMessageFieldBuilder().getBuilder(); } @@ -2153,7 +1714,7 @@ public final class RemoteProtocol { } } private com.google.protobuf.SingleFieldBuilder< - akka.remote.RemoteProtocol.MessageProtocol, akka.remote.RemoteProtocol.MessageProtocol.Builder, akka.remote.RemoteProtocol.MessageProtocolOrBuilder> + akka.remote.RemoteProtocol.MessageProtocol, akka.remote.RemoteProtocol.MessageProtocol.Builder, akka.remote.RemoteProtocol.MessageProtocolOrBuilder> getMessageFieldBuilder() { if (messageBuilder_ == null) { messageBuilder_ = new com.google.protobuf.SingleFieldBuilder< @@ -2165,13 +1726,13 @@ public final class RemoteProtocol { } return messageBuilder_; } - - // optional .ExceptionProtocol exception = 5; + + // optional .ExceptionProtocol exception = 3; private akka.remote.RemoteProtocol.ExceptionProtocol exception_ = akka.remote.RemoteProtocol.ExceptionProtocol.getDefaultInstance(); private com.google.protobuf.SingleFieldBuilder< akka.remote.RemoteProtocol.ExceptionProtocol, akka.remote.RemoteProtocol.ExceptionProtocol.Builder, akka.remote.RemoteProtocol.ExceptionProtocolOrBuilder> exceptionBuilder_; public boolean hasException() { - return ((bitField0_ & 0x00000010) == 0x00000010); + return ((bitField0_ & 0x00000004) == 0x00000004); } public akka.remote.RemoteProtocol.ExceptionProtocol getException() { if (exceptionBuilder_ == null) { @@ -2190,7 +1751,7 @@ public final class RemoteProtocol { } else { exceptionBuilder_.setMessage(value); } - bitField0_ |= 0x00000010; + bitField0_ |= 0x00000004; return this; } public Builder setException( @@ -2201,12 +1762,12 @@ public final class RemoteProtocol { } else { exceptionBuilder_.setMessage(builderForValue.build()); } - bitField0_ |= 0x00000010; + bitField0_ |= 0x00000004; return this; } public Builder mergeException(akka.remote.RemoteProtocol.ExceptionProtocol value) { if (exceptionBuilder_ == null) { - if (((bitField0_ & 0x00000010) == 0x00000010) && + if (((bitField0_ & 0x00000004) == 0x00000004) && exception_ != akka.remote.RemoteProtocol.ExceptionProtocol.getDefaultInstance()) { exception_ = akka.remote.RemoteProtocol.ExceptionProtocol.newBuilder(exception_).mergeFrom(value).buildPartial(); @@ -2217,7 +1778,7 @@ public final class RemoteProtocol { } else { exceptionBuilder_.mergeFrom(value); } - bitField0_ |= 0x00000010; + bitField0_ |= 0x00000004; return this; } public Builder clearException() { @@ -2227,11 +1788,11 @@ public final class RemoteProtocol { } else { exceptionBuilder_.clear(); } - bitField0_ = (bitField0_ & ~0x00000010); + bitField0_ = (bitField0_ & ~0x00000004); return this; } public akka.remote.RemoteProtocol.ExceptionProtocol.Builder getExceptionBuilder() { - bitField0_ |= 0x00000010; + bitField0_ |= 0x00000004; onChanged(); return getExceptionFieldBuilder().getBuilder(); } @@ -2243,7 +1804,7 @@ public final class RemoteProtocol { } } private com.google.protobuf.SingleFieldBuilder< - akka.remote.RemoteProtocol.ExceptionProtocol, akka.remote.RemoteProtocol.ExceptionProtocol.Builder, akka.remote.RemoteProtocol.ExceptionProtocolOrBuilder> + akka.remote.RemoteProtocol.ExceptionProtocol, akka.remote.RemoteProtocol.ExceptionProtocol.Builder, akka.remote.RemoteProtocol.ExceptionProtocolOrBuilder> getExceptionFieldBuilder() { if (exceptionBuilder_ == null) { exceptionBuilder_ = new com.google.protobuf.SingleFieldBuilder< @@ -2255,112 +1816,22 @@ public final class RemoteProtocol { } return exceptionBuilder_; } - - // optional .UuidProtocol supervisorUuid = 6; - private akka.remote.RemoteProtocol.UuidProtocol supervisorUuid_ = akka.remote.RemoteProtocol.UuidProtocol.getDefaultInstance(); + + // optional .ActorRefProtocol sender = 4; + private akka.remote.RemoteProtocol.ActorRefProtocol sender_ = akka.remote.RemoteProtocol.ActorRefProtocol.getDefaultInstance(); private com.google.protobuf.SingleFieldBuilder< - akka.remote.RemoteProtocol.UuidProtocol, akka.remote.RemoteProtocol.UuidProtocol.Builder, akka.remote.RemoteProtocol.UuidProtocolOrBuilder> supervisorUuidBuilder_; - public boolean hasSupervisorUuid() { - return ((bitField0_ & 0x00000020) == 0x00000020); - } - public akka.remote.RemoteProtocol.UuidProtocol getSupervisorUuid() { - if (supervisorUuidBuilder_ == null) { - return supervisorUuid_; - } else { - return supervisorUuidBuilder_.getMessage(); - } - } - public Builder setSupervisorUuid(akka.remote.RemoteProtocol.UuidProtocol value) { - if (supervisorUuidBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - supervisorUuid_ = value; - onChanged(); - } else { - supervisorUuidBuilder_.setMessage(value); - } - bitField0_ |= 0x00000020; - return this; - } - public Builder setSupervisorUuid( - akka.remote.RemoteProtocol.UuidProtocol.Builder builderForValue) { - if (supervisorUuidBuilder_ == null) { - supervisorUuid_ = builderForValue.build(); - onChanged(); - } else { - supervisorUuidBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000020; - return this; - } - public Builder mergeSupervisorUuid(akka.remote.RemoteProtocol.UuidProtocol value) { - if (supervisorUuidBuilder_ == null) { - if (((bitField0_ & 0x00000020) == 0x00000020) && - supervisorUuid_ != akka.remote.RemoteProtocol.UuidProtocol.getDefaultInstance()) { - supervisorUuid_ = - akka.remote.RemoteProtocol.UuidProtocol.newBuilder(supervisorUuid_).mergeFrom(value).buildPartial(); - } else { - supervisorUuid_ = value; - } - onChanged(); - } else { - supervisorUuidBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00000020; - return this; - } - public Builder clearSupervisorUuid() { - if (supervisorUuidBuilder_ == null) { - supervisorUuid_ = akka.remote.RemoteProtocol.UuidProtocol.getDefaultInstance(); - onChanged(); - } else { - supervisorUuidBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000020); - return this; - } - public akka.remote.RemoteProtocol.UuidProtocol.Builder getSupervisorUuidBuilder() { - bitField0_ |= 0x00000020; - onChanged(); - return getSupervisorUuidFieldBuilder().getBuilder(); - } - public akka.remote.RemoteProtocol.UuidProtocolOrBuilder getSupervisorUuidOrBuilder() { - if (supervisorUuidBuilder_ != null) { - return supervisorUuidBuilder_.getMessageOrBuilder(); - } else { - return supervisorUuid_; - } - } - private com.google.protobuf.SingleFieldBuilder< - akka.remote.RemoteProtocol.UuidProtocol, akka.remote.RemoteProtocol.UuidProtocol.Builder, akka.remote.RemoteProtocol.UuidProtocolOrBuilder> - getSupervisorUuidFieldBuilder() { - if (supervisorUuidBuilder_ == null) { - supervisorUuidBuilder_ = new com.google.protobuf.SingleFieldBuilder< - akka.remote.RemoteProtocol.UuidProtocol, akka.remote.RemoteProtocol.UuidProtocol.Builder, akka.remote.RemoteProtocol.UuidProtocolOrBuilder>( - supervisorUuid_, - getParentForChildren(), - isClean()); - supervisorUuid_ = null; - } - return supervisorUuidBuilder_; - } - - // optional .RemoteActorRefProtocol sender = 7; - private akka.remote.RemoteProtocol.RemoteActorRefProtocol sender_ = akka.remote.RemoteProtocol.RemoteActorRefProtocol.getDefaultInstance(); - private com.google.protobuf.SingleFieldBuilder< - akka.remote.RemoteProtocol.RemoteActorRefProtocol, akka.remote.RemoteProtocol.RemoteActorRefProtocol.Builder, akka.remote.RemoteProtocol.RemoteActorRefProtocolOrBuilder> senderBuilder_; + akka.remote.RemoteProtocol.ActorRefProtocol, akka.remote.RemoteProtocol.ActorRefProtocol.Builder, akka.remote.RemoteProtocol.ActorRefProtocolOrBuilder> senderBuilder_; public boolean hasSender() { - return ((bitField0_ & 0x00000040) == 0x00000040); + return ((bitField0_ & 0x00000008) == 0x00000008); } - public akka.remote.RemoteProtocol.RemoteActorRefProtocol getSender() { + public akka.remote.RemoteProtocol.ActorRefProtocol getSender() { if (senderBuilder_ == null) { return sender_; } else { return senderBuilder_.getMessage(); } } - public Builder setSender(akka.remote.RemoteProtocol.RemoteActorRefProtocol value) { + public Builder setSender(akka.remote.RemoteProtocol.ActorRefProtocol value) { if (senderBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -2370,26 +1841,26 @@ public final class RemoteProtocol { } else { senderBuilder_.setMessage(value); } - bitField0_ |= 0x00000040; + bitField0_ |= 0x00000008; return this; } public Builder setSender( - akka.remote.RemoteProtocol.RemoteActorRefProtocol.Builder builderForValue) { + akka.remote.RemoteProtocol.ActorRefProtocol.Builder builderForValue) { if (senderBuilder_ == null) { sender_ = builderForValue.build(); onChanged(); } else { senderBuilder_.setMessage(builderForValue.build()); } - bitField0_ |= 0x00000040; + bitField0_ |= 0x00000008; return this; } - public Builder mergeSender(akka.remote.RemoteProtocol.RemoteActorRefProtocol value) { + public Builder mergeSender(akka.remote.RemoteProtocol.ActorRefProtocol value) { if (senderBuilder_ == null) { - if (((bitField0_ & 0x00000040) == 0x00000040) && - sender_ != akka.remote.RemoteProtocol.RemoteActorRefProtocol.getDefaultInstance()) { + if (((bitField0_ & 0x00000008) == 0x00000008) && + sender_ != akka.remote.RemoteProtocol.ActorRefProtocol.getDefaultInstance()) { sender_ = - akka.remote.RemoteProtocol.RemoteActorRefProtocol.newBuilder(sender_).mergeFrom(value).buildPartial(); + akka.remote.RemoteProtocol.ActorRefProtocol.newBuilder(sender_).mergeFrom(value).buildPartial(); } else { sender_ = value; } @@ -2397,25 +1868,25 @@ public final class RemoteProtocol { } else { senderBuilder_.mergeFrom(value); } - bitField0_ |= 0x00000040; + bitField0_ |= 0x00000008; return this; } public Builder clearSender() { if (senderBuilder_ == null) { - sender_ = akka.remote.RemoteProtocol.RemoteActorRefProtocol.getDefaultInstance(); + sender_ = akka.remote.RemoteProtocol.ActorRefProtocol.getDefaultInstance(); onChanged(); } else { senderBuilder_.clear(); } - bitField0_ = (bitField0_ & ~0x00000040); + bitField0_ = (bitField0_ & ~0x00000008); return this; } - public akka.remote.RemoteProtocol.RemoteActorRefProtocol.Builder getSenderBuilder() { - bitField0_ |= 0x00000040; + public akka.remote.RemoteProtocol.ActorRefProtocol.Builder getSenderBuilder() { + bitField0_ |= 0x00000008; onChanged(); return getSenderFieldBuilder().getBuilder(); } - public akka.remote.RemoteProtocol.RemoteActorRefProtocolOrBuilder getSenderOrBuilder() { + public akka.remote.RemoteProtocol.ActorRefProtocolOrBuilder getSenderOrBuilder() { if (senderBuilder_ != null) { return senderBuilder_.getMessageOrBuilder(); } else { @@ -2423,11 +1894,11 @@ public final class RemoteProtocol { } } private com.google.protobuf.SingleFieldBuilder< - akka.remote.RemoteProtocol.RemoteActorRefProtocol, akka.remote.RemoteProtocol.RemoteActorRefProtocol.Builder, akka.remote.RemoteProtocol.RemoteActorRefProtocolOrBuilder> + akka.remote.RemoteProtocol.ActorRefProtocol, akka.remote.RemoteProtocol.ActorRefProtocol.Builder, akka.remote.RemoteProtocol.ActorRefProtocolOrBuilder> getSenderFieldBuilder() { if (senderBuilder_ == null) { senderBuilder_ = new com.google.protobuf.SingleFieldBuilder< - akka.remote.RemoteProtocol.RemoteActorRefProtocol, akka.remote.RemoteProtocol.RemoteActorRefProtocol.Builder, akka.remote.RemoteProtocol.RemoteActorRefProtocolOrBuilder>( + akka.remote.RemoteProtocol.ActorRefProtocol, akka.remote.RemoteProtocol.ActorRefProtocol.Builder, akka.remote.RemoteProtocol.ActorRefProtocolOrBuilder>( sender_, getParentForChildren(), isClean()); @@ -2435,20 +1906,20 @@ public final class RemoteProtocol { } return senderBuilder_; } - - // repeated .MetadataEntryProtocol metadata = 8; + + // repeated .MetadataEntryProtocol metadata = 5; private java.util.List metadata_ = java.util.Collections.emptyList(); private void ensureMetadataIsMutable() { - if (!((bitField0_ & 0x00000080) == 0x00000080)) { + if (!((bitField0_ & 0x00000010) == 0x00000010)) { metadata_ = new java.util.ArrayList(metadata_); - bitField0_ |= 0x00000080; + bitField0_ |= 0x00000010; } } - + private com.google.protobuf.RepeatedFieldBuilder< akka.remote.RemoteProtocol.MetadataEntryProtocol, akka.remote.RemoteProtocol.MetadataEntryProtocol.Builder, akka.remote.RemoteProtocol.MetadataEntryProtocolOrBuilder> metadataBuilder_; - + public java.util.List getMetadataList() { if (metadataBuilder_ == null) { return java.util.Collections.unmodifiableList(metadata_); @@ -2558,7 +2029,7 @@ public final class RemoteProtocol { public Builder clearMetadata() { if (metadataBuilder_ == null) { metadata_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000080); + bitField0_ = (bitField0_ & ~0x00000010); onChanged(); } else { metadataBuilder_.clear(); @@ -2586,7 +2057,7 @@ public final class RemoteProtocol { return metadataBuilder_.getMessageOrBuilder(index); } } - public java.util.List + public java.util.List getMetadataOrBuilderList() { if (metadataBuilder_ != null) { return metadataBuilder_.getMessageOrBuilderList(); @@ -2603,43 +2074,43 @@ public final class RemoteProtocol { return getMetadataFieldBuilder().addBuilder( index, akka.remote.RemoteProtocol.MetadataEntryProtocol.getDefaultInstance()); } - public java.util.List + public java.util.List getMetadataBuilderList() { return getMetadataFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilder< - akka.remote.RemoteProtocol.MetadataEntryProtocol, akka.remote.RemoteProtocol.MetadataEntryProtocol.Builder, akka.remote.RemoteProtocol.MetadataEntryProtocolOrBuilder> + akka.remote.RemoteProtocol.MetadataEntryProtocol, akka.remote.RemoteProtocol.MetadataEntryProtocol.Builder, akka.remote.RemoteProtocol.MetadataEntryProtocolOrBuilder> getMetadataFieldBuilder() { if (metadataBuilder_ == null) { metadataBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< akka.remote.RemoteProtocol.MetadataEntryProtocol, akka.remote.RemoteProtocol.MetadataEntryProtocol.Builder, akka.remote.RemoteProtocol.MetadataEntryProtocolOrBuilder>( metadata_, - ((bitField0_ & 0x00000080) == 0x00000080), + ((bitField0_ & 0x00000010) == 0x00000010), getParentForChildren(), isClean()); metadata_ = null; } return metadataBuilder_; } - + // @@protoc_insertion_point(builder_scope:RemoteMessageProtocol) } - + static { defaultInstance = new RemoteMessageProtocol(true); defaultInstance.initFields(); } - + // @@protoc_insertion_point(class_scope:RemoteMessageProtocol) } - + public interface RemoteControlProtocolOrBuilder extends com.google.protobuf.MessageOrBuilder { - + // optional string cookie = 1; boolean hasCookie(); String getCookie(); - + // required .CommandType commandType = 2; boolean hasCommandType(); akka.remote.RemoteProtocol.CommandType getCommandType(); @@ -2652,26 +2123,26 @@ public final class RemoteProtocol { super(builder); } private RemoteControlProtocol(boolean noInit) {} - + private static final RemoteControlProtocol defaultInstance; public static RemoteControlProtocol getDefaultInstance() { return defaultInstance; } - + public RemoteControlProtocol getDefaultInstanceForType() { return defaultInstance; } - + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return akka.remote.RemoteProtocol.internal_static_RemoteControlProtocol_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return akka.remote.RemoteProtocol.internal_static_RemoteControlProtocol_fieldAccessorTable; } - + private int bitField0_; // optional string cookie = 1; public static final int COOKIE_FIELD_NUMBER = 1; @@ -2684,7 +2155,7 @@ public final class RemoteProtocol { if (ref instanceof String) { return (String) ref; } else { - com.google.protobuf.ByteString bs = + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; String s = bs.toStringUtf8(); if (com.google.protobuf.Internal.isValidUtf8(bs)) { @@ -2696,7 +2167,7 @@ public final class RemoteProtocol { private com.google.protobuf.ByteString getCookieBytes() { java.lang.Object ref = cookie_; if (ref instanceof String) { - com.google.protobuf.ByteString b = + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((String) ref); cookie_ = b; return b; @@ -2704,7 +2175,7 @@ public final class RemoteProtocol { return (com.google.protobuf.ByteString) ref; } } - + // required .CommandType commandType = 2; public static final int COMMANDTYPE_FIELD_NUMBER = 2; private akka.remote.RemoteProtocol.CommandType commandType_; @@ -2714,7 +2185,7 @@ public final class RemoteProtocol { public akka.remote.RemoteProtocol.CommandType getCommandType() { return commandType_; } - + private void initFields() { cookie_ = ""; commandType_ = akka.remote.RemoteProtocol.CommandType.CONNECT; @@ -2723,7 +2194,7 @@ public final class RemoteProtocol { public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized != -1) return isInitialized == 1; - + if (!hasCommandType()) { memoizedIsInitialized = 0; return false; @@ -2731,7 +2202,7 @@ public final class RemoteProtocol { memoizedIsInitialized = 1; return true; } - + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); @@ -2743,12 +2214,12 @@ public final class RemoteProtocol { } getUnknownFields().writeTo(output); } - + private int memoizedSerializedSize = -1; public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; - + size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream @@ -2762,14 +2233,14 @@ public final class RemoteProtocol { memoizedSerializedSize = size; return size; } - + private static final long serialVersionUID = 0L; @java.lang.Override protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { return super.writeReplace(); } - + public static akka.remote.RemoteProtocol.RemoteControlProtocol parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { @@ -2836,14 +2307,14 @@ public final class RemoteProtocol { return newBuilder().mergeFrom(input, extensionRegistry) .buildParsed(); } - + public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(akka.remote.RemoteProtocol.RemoteControlProtocol prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } - + @java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessage.BuilderParent parent) { @@ -2857,18 +2328,18 @@ public final class RemoteProtocol { getDescriptor() { return akka.remote.RemoteProtocol.internal_static_RemoteControlProtocol_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return akka.remote.RemoteProtocol.internal_static_RemoteControlProtocol_fieldAccessorTable; } - + // Construct using akka.remote.RemoteProtocol.RemoteControlProtocol.newBuilder() private Builder() { maybeForceBuilderInitialization(); } - - private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + + private Builder(BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } @@ -2879,7 +2350,7 @@ public final class RemoteProtocol { private static Builder create() { return new Builder(); } - + public Builder clear() { super.clear(); cookie_ = ""; @@ -2888,20 +2359,20 @@ public final class RemoteProtocol { bitField0_ = (bitField0_ & ~0x00000002); return this; } - + public Builder clone() { return create().mergeFrom(buildPartial()); } - + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return akka.remote.RemoteProtocol.RemoteControlProtocol.getDescriptor(); } - + public akka.remote.RemoteProtocol.RemoteControlProtocol getDefaultInstanceForType() { return akka.remote.RemoteProtocol.RemoteControlProtocol.getDefaultInstance(); } - + public akka.remote.RemoteProtocol.RemoteControlProtocol build() { akka.remote.RemoteProtocol.RemoteControlProtocol result = buildPartial(); if (!result.isInitialized()) { @@ -2909,7 +2380,7 @@ public final class RemoteProtocol { } return result; } - + private akka.remote.RemoteProtocol.RemoteControlProtocol buildParsed() throws com.google.protobuf.InvalidProtocolBufferException { akka.remote.RemoteProtocol.RemoteControlProtocol result = buildPartial(); @@ -2919,7 +2390,7 @@ public final class RemoteProtocol { } return result; } - + public akka.remote.RemoteProtocol.RemoteControlProtocol buildPartial() { akka.remote.RemoteProtocol.RemoteControlProtocol result = new akka.remote.RemoteProtocol.RemoteControlProtocol(this); int from_bitField0_ = bitField0_; @@ -2936,7 +2407,7 @@ public final class RemoteProtocol { onBuilt(); return result; } - + public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof akka.remote.RemoteProtocol.RemoteControlProtocol) { return mergeFrom((akka.remote.RemoteProtocol.RemoteControlProtocol)other); @@ -2945,7 +2416,7 @@ public final class RemoteProtocol { return this; } } - + public Builder mergeFrom(akka.remote.RemoteProtocol.RemoteControlProtocol other) { if (other == akka.remote.RemoteProtocol.RemoteControlProtocol.getDefaultInstance()) return this; if (other.hasCookie()) { @@ -2957,15 +2428,15 @@ public final class RemoteProtocol { this.mergeUnknownFields(other.getUnknownFields()); return this; } - + public final boolean isInitialized() { if (!hasCommandType()) { - + return false; } return true; } - + public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) @@ -3008,9 +2479,9 @@ public final class RemoteProtocol { } } } - + private int bitField0_; - + // optional string cookie = 1; private java.lang.Object cookie_ = ""; public boolean hasCookie() { @@ -3046,7 +2517,7 @@ public final class RemoteProtocol { cookie_ = value; onChanged(); } - + // required .CommandType commandType = 2; private akka.remote.RemoteProtocol.CommandType commandType_ = akka.remote.RemoteProtocol.CommandType.CONNECT; public boolean hasCommandType() { @@ -3070,61 +2541,61 @@ public final class RemoteProtocol { onChanged(); return this; } - + // @@protoc_insertion_point(builder_scope:RemoteControlProtocol) } - + static { defaultInstance = new RemoteControlProtocol(true); defaultInstance.initFields(); } - + // @@protoc_insertion_point(class_scope:RemoteControlProtocol) } - - public interface RemoteActorRefProtocolOrBuilder + + public interface ActorRefProtocolOrBuilder extends com.google.protobuf.MessageOrBuilder { - + // required string address = 1; boolean hasAddress(); String getAddress(); - - // required bytes inetSocketAddress = 2; - boolean hasInetSocketAddress(); - com.google.protobuf.ByteString getInetSocketAddress(); - - // optional uint64 timeout = 3; - boolean hasTimeout(); - long getTimeout(); + + // required string host = 2; + boolean hasHost(); + String getHost(); + + // required uint32 port = 3; + boolean hasPort(); + int getPort(); } - public static final class RemoteActorRefProtocol extends + public static final class ActorRefProtocol extends com.google.protobuf.GeneratedMessage - implements RemoteActorRefProtocolOrBuilder { - // Use RemoteActorRefProtocol.newBuilder() to construct. - private RemoteActorRefProtocol(Builder builder) { + implements ActorRefProtocolOrBuilder { + // Use ActorRefProtocol.newBuilder() to construct. + private ActorRefProtocol(Builder builder) { super(builder); } - private RemoteActorRefProtocol(boolean noInit) {} - - private static final RemoteActorRefProtocol defaultInstance; - public static RemoteActorRefProtocol getDefaultInstance() { + private ActorRefProtocol(boolean noInit) {} + + private static final ActorRefProtocol defaultInstance; + public static ActorRefProtocol getDefaultInstance() { return defaultInstance; } - - public RemoteActorRefProtocol getDefaultInstanceForType() { + + public ActorRefProtocol getDefaultInstanceForType() { return defaultInstance; } - + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return akka.remote.RemoteProtocol.internal_static_RemoteActorRefProtocol_descriptor; + return akka.remote.RemoteProtocol.internal_static_ActorRefProtocol_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return akka.remote.RemoteProtocol.internal_static_RemoteActorRefProtocol_fieldAccessorTable; + return akka.remote.RemoteProtocol.internal_static_ActorRefProtocol_fieldAccessorTable; } - + private int bitField0_; // required string address = 1; public static final int ADDRESS_FIELD_NUMBER = 1; @@ -3137,7 +2608,7 @@ public final class RemoteProtocol { if (ref instanceof String) { return (String) ref; } else { - com.google.protobuf.ByteString bs = + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; String s = bs.toStringUtf8(); if (com.google.protobuf.Internal.isValidUtf8(bs)) { @@ -3149,7 +2620,7 @@ public final class RemoteProtocol { private com.google.protobuf.ByteString getAddressBytes() { java.lang.Object ref = address_; if (ref instanceof String) { - com.google.protobuf.ByteString b = + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((String) ref); address_ = b; return b; @@ -3157,49 +2628,75 @@ public final class RemoteProtocol { return (com.google.protobuf.ByteString) ref; } } - - // required bytes inetSocketAddress = 2; - public static final int INETSOCKETADDRESS_FIELD_NUMBER = 2; - private com.google.protobuf.ByteString inetSocketAddress_; - public boolean hasInetSocketAddress() { + + // required string host = 2; + public static final int HOST_FIELD_NUMBER = 2; + private java.lang.Object host_; + public boolean hasHost() { return ((bitField0_ & 0x00000002) == 0x00000002); } - public com.google.protobuf.ByteString getInetSocketAddress() { - return inetSocketAddress_; + public String getHost() { + java.lang.Object ref = host_; + if (ref instanceof String) { + return (String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + String s = bs.toStringUtf8(); + if (com.google.protobuf.Internal.isValidUtf8(bs)) { + host_ = s; + } + return s; + } } - - // optional uint64 timeout = 3; - public static final int TIMEOUT_FIELD_NUMBER = 3; - private long timeout_; - public boolean hasTimeout() { + private com.google.protobuf.ByteString getHostBytes() { + java.lang.Object ref = host_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((String) ref); + host_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + // required uint32 port = 3; + public static final int PORT_FIELD_NUMBER = 3; + private int port_; + public boolean hasPort() { return ((bitField0_ & 0x00000004) == 0x00000004); } - public long getTimeout() { - return timeout_; + public int getPort() { + return port_; } - + private void initFields() { address_ = ""; - inetSocketAddress_ = com.google.protobuf.ByteString.EMPTY; - timeout_ = 0L; + host_ = ""; + port_ = 0; } private byte memoizedIsInitialized = -1; public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized != -1) return isInitialized == 1; - + if (!hasAddress()) { memoizedIsInitialized = 0; return false; } - if (!hasInetSocketAddress()) { + if (!hasHost()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasPort()) { memoizedIsInitialized = 0; return false; } memoizedIsInitialized = 1; return true; } - + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); @@ -3207,19 +2704,19 @@ public final class RemoteProtocol { output.writeBytes(1, getAddressBytes()); } if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeBytes(2, inetSocketAddress_); + output.writeBytes(2, getHostBytes()); } if (((bitField0_ & 0x00000004) == 0x00000004)) { - output.writeUInt64(3, timeout_); + output.writeUInt32(3, port_); } getUnknownFields().writeTo(output); } - + private int memoizedSerializedSize = -1; public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; - + size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream @@ -3227,59 +2724,59 @@ public final class RemoteProtocol { } if (((bitField0_ & 0x00000002) == 0x00000002)) { size += com.google.protobuf.CodedOutputStream - .computeBytesSize(2, inetSocketAddress_); + .computeBytesSize(2, getHostBytes()); } if (((bitField0_ & 0x00000004) == 0x00000004)) { size += com.google.protobuf.CodedOutputStream - .computeUInt64Size(3, timeout_); + .computeUInt32Size(3, port_); } size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; return size; } - + private static final long serialVersionUID = 0L; @java.lang.Override protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { return super.writeReplace(); } - - public static akka.remote.RemoteProtocol.RemoteActorRefProtocol parseFrom( + + public static akka.remote.RemoteProtocol.ActorRefProtocol parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return newBuilder().mergeFrom(data).buildParsed(); } - public static akka.remote.RemoteProtocol.RemoteActorRefProtocol parseFrom( + public static akka.remote.RemoteProtocol.ActorRefProtocol parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return newBuilder().mergeFrom(data, extensionRegistry) .buildParsed(); } - public static akka.remote.RemoteProtocol.RemoteActorRefProtocol parseFrom(byte[] data) + public static akka.remote.RemoteProtocol.ActorRefProtocol parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return newBuilder().mergeFrom(data).buildParsed(); } - public static akka.remote.RemoteProtocol.RemoteActorRefProtocol parseFrom( + public static akka.remote.RemoteProtocol.ActorRefProtocol parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return newBuilder().mergeFrom(data, extensionRegistry) .buildParsed(); } - public static akka.remote.RemoteProtocol.RemoteActorRefProtocol parseFrom(java.io.InputStream input) + public static akka.remote.RemoteProtocol.ActorRefProtocol parseFrom(java.io.InputStream input) throws java.io.IOException { return newBuilder().mergeFrom(input).buildParsed(); } - public static akka.remote.RemoteProtocol.RemoteActorRefProtocol parseFrom( + public static akka.remote.RemoteProtocol.ActorRefProtocol parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return newBuilder().mergeFrom(input, extensionRegistry) .buildParsed(); } - public static akka.remote.RemoteProtocol.RemoteActorRefProtocol parseDelimitedFrom(java.io.InputStream input) + public static akka.remote.RemoteProtocol.ActorRefProtocol parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { Builder builder = newBuilder(); if (builder.mergeDelimitedFrom(input)) { @@ -3288,7 +2785,7 @@ public final class RemoteProtocol { return null; } } - public static akka.remote.RemoteProtocol.RemoteActorRefProtocol parseDelimitedFrom( + public static akka.remote.RemoteProtocol.ActorRefProtocol parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { @@ -3299,26 +2796,26 @@ public final class RemoteProtocol { return null; } } - public static akka.remote.RemoteProtocol.RemoteActorRefProtocol parseFrom( + public static akka.remote.RemoteProtocol.ActorRefProtocol parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return newBuilder().mergeFrom(input).buildParsed(); } - public static akka.remote.RemoteProtocol.RemoteActorRefProtocol parseFrom( + public static akka.remote.RemoteProtocol.ActorRefProtocol parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return newBuilder().mergeFrom(input, extensionRegistry) .buildParsed(); } - + public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(akka.remote.RemoteProtocol.RemoteActorRefProtocol prototype) { + public static Builder newBuilder(akka.remote.RemoteProtocol.ActorRefProtocol prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } - + @java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessage.BuilderParent parent) { @@ -3327,23 +2824,23 @@ public final class RemoteProtocol { } public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder - implements akka.remote.RemoteProtocol.RemoteActorRefProtocolOrBuilder { + implements akka.remote.RemoteProtocol.ActorRefProtocolOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return akka.remote.RemoteProtocol.internal_static_RemoteActorRefProtocol_descriptor; + return akka.remote.RemoteProtocol.internal_static_ActorRefProtocol_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - return akka.remote.RemoteProtocol.internal_static_RemoteActorRefProtocol_fieldAccessorTable; + return akka.remote.RemoteProtocol.internal_static_ActorRefProtocol_fieldAccessorTable; } - - // Construct using akka.remote.RemoteProtocol.RemoteActorRefProtocol.newBuilder() + + // Construct using akka.remote.RemoteProtocol.ActorRefProtocol.newBuilder() private Builder() { maybeForceBuilderInitialization(); } - - private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + + private Builder(BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } @@ -3354,51 +2851,51 @@ public final class RemoteProtocol { private static Builder create() { return new Builder(); } - + public Builder clear() { super.clear(); address_ = ""; bitField0_ = (bitField0_ & ~0x00000001); - inetSocketAddress_ = com.google.protobuf.ByteString.EMPTY; + host_ = ""; bitField0_ = (bitField0_ & ~0x00000002); - timeout_ = 0L; + port_ = 0; bitField0_ = (bitField0_ & ~0x00000004); return this; } - + public Builder clone() { return create().mergeFrom(buildPartial()); } - + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return akka.remote.RemoteProtocol.RemoteActorRefProtocol.getDescriptor(); + return akka.remote.RemoteProtocol.ActorRefProtocol.getDescriptor(); } - - public akka.remote.RemoteProtocol.RemoteActorRefProtocol getDefaultInstanceForType() { - return akka.remote.RemoteProtocol.RemoteActorRefProtocol.getDefaultInstance(); + + public akka.remote.RemoteProtocol.ActorRefProtocol getDefaultInstanceForType() { + return akka.remote.RemoteProtocol.ActorRefProtocol.getDefaultInstance(); } - - public akka.remote.RemoteProtocol.RemoteActorRefProtocol build() { - akka.remote.RemoteProtocol.RemoteActorRefProtocol result = buildPartial(); + + public akka.remote.RemoteProtocol.ActorRefProtocol build() { + akka.remote.RemoteProtocol.ActorRefProtocol result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } - - private akka.remote.RemoteProtocol.RemoteActorRefProtocol buildParsed() + + private akka.remote.RemoteProtocol.ActorRefProtocol buildParsed() throws com.google.protobuf.InvalidProtocolBufferException { - akka.remote.RemoteProtocol.RemoteActorRefProtocol result = buildPartial(); + akka.remote.RemoteProtocol.ActorRefProtocol result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException( result).asInvalidProtocolBufferException(); } return result; } - - public akka.remote.RemoteProtocol.RemoteActorRefProtocol buildPartial() { - akka.remote.RemoteProtocol.RemoteActorRefProtocol result = new akka.remote.RemoteProtocol.RemoteActorRefProtocol(this); + + public akka.remote.RemoteProtocol.ActorRefProtocol buildPartial() { + akka.remote.RemoteProtocol.ActorRefProtocol result = new akka.remote.RemoteProtocol.ActorRefProtocol(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { @@ -3408,52 +2905,56 @@ public final class RemoteProtocol { if (((from_bitField0_ & 0x00000002) == 0x00000002)) { to_bitField0_ |= 0x00000002; } - result.inetSocketAddress_ = inetSocketAddress_; + result.host_ = host_; if (((from_bitField0_ & 0x00000004) == 0x00000004)) { to_bitField0_ |= 0x00000004; } - result.timeout_ = timeout_; + result.port_ = port_; result.bitField0_ = to_bitField0_; onBuilt(); return result; } - + public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof akka.remote.RemoteProtocol.RemoteActorRefProtocol) { - return mergeFrom((akka.remote.RemoteProtocol.RemoteActorRefProtocol)other); + if (other instanceof akka.remote.RemoteProtocol.ActorRefProtocol) { + return mergeFrom((akka.remote.RemoteProtocol.ActorRefProtocol)other); } else { super.mergeFrom(other); return this; } } - - public Builder mergeFrom(akka.remote.RemoteProtocol.RemoteActorRefProtocol other) { - if (other == akka.remote.RemoteProtocol.RemoteActorRefProtocol.getDefaultInstance()) return this; + + public Builder mergeFrom(akka.remote.RemoteProtocol.ActorRefProtocol other) { + if (other == akka.remote.RemoteProtocol.ActorRefProtocol.getDefaultInstance()) return this; if (other.hasAddress()) { setAddress(other.getAddress()); } - if (other.hasInetSocketAddress()) { - setInetSocketAddress(other.getInetSocketAddress()); + if (other.hasHost()) { + setHost(other.getHost()); } - if (other.hasTimeout()) { - setTimeout(other.getTimeout()); + if (other.hasPort()) { + setPort(other.getPort()); } this.mergeUnknownFields(other.getUnknownFields()); return this; } - + public final boolean isInitialized() { if (!hasAddress()) { - + return false; } - if (!hasInetSocketAddress()) { - + if (!hasHost()) { + + return false; + } + if (!hasPort()) { + return false; } return true; } - + public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) @@ -3484,20 +2985,20 @@ public final class RemoteProtocol { } case 18: { bitField0_ |= 0x00000002; - inetSocketAddress_ = input.readBytes(); + host_ = input.readBytes(); break; } case 24: { bitField0_ |= 0x00000004; - timeout_ = input.readUInt64(); + port_ = input.readUInt32(); break; } } } } - + private int bitField0_; - + // required string address = 1; private java.lang.Object address_ = ""; public boolean hasAddress() { @@ -3533,2311 +3034,82 @@ public final class RemoteProtocol { address_ = value; onChanged(); } - - // required bytes inetSocketAddress = 2; - private com.google.protobuf.ByteString inetSocketAddress_ = com.google.protobuf.ByteString.EMPTY; - public boolean hasInetSocketAddress() { + + // required string host = 2; + private java.lang.Object host_ = ""; + public boolean hasHost() { return ((bitField0_ & 0x00000002) == 0x00000002); } - public com.google.protobuf.ByteString getInetSocketAddress() { - return inetSocketAddress_; + public String getHost() { + java.lang.Object ref = host_; + if (!(ref instanceof String)) { + String s = ((com.google.protobuf.ByteString) ref).toStringUtf8(); + host_ = s; + return s; + } else { + return (String) ref; + } } - public Builder setInetSocketAddress(com.google.protobuf.ByteString value) { + public Builder setHost(String value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000002; - inetSocketAddress_ = value; + host_ = value; onChanged(); return this; } - public Builder clearInetSocketAddress() { + public Builder clearHost() { bitField0_ = (bitField0_ & ~0x00000002); - inetSocketAddress_ = getDefaultInstance().getInetSocketAddress(); + host_ = getDefaultInstance().getHost(); onChanged(); return this; } - - // optional uint64 timeout = 3; - private long timeout_ ; - public boolean hasTimeout() { + void setHost(com.google.protobuf.ByteString value) { + bitField0_ |= 0x00000002; + host_ = value; + onChanged(); + } + + // required uint32 port = 3; + private int port_ ; + public boolean hasPort() { return ((bitField0_ & 0x00000004) == 0x00000004); } - public long getTimeout() { - return timeout_; + public int getPort() { + return port_; } - public Builder setTimeout(long value) { + public Builder setPort(int value) { bitField0_ |= 0x00000004; - timeout_ = value; + port_ = value; onChanged(); return this; } - public Builder clearTimeout() { + public Builder clearPort() { bitField0_ = (bitField0_ & ~0x00000004); - timeout_ = 0L; + port_ = 0; onChanged(); return this; } - - // @@protoc_insertion_point(builder_scope:RemoteActorRefProtocol) + + // @@protoc_insertion_point(builder_scope:ActorRefProtocol) } - + static { - defaultInstance = new RemoteActorRefProtocol(true); + defaultInstance = new ActorRefProtocol(true); defaultInstance.initFields(); } - - // @@protoc_insertion_point(class_scope:RemoteActorRefProtocol) + + // @@protoc_insertion_point(class_scope:ActorRefProtocol) } - - public interface SerializedActorRefProtocolOrBuilder - extends com.google.protobuf.MessageOrBuilder { - - // required .UuidProtocol uuid = 1; - boolean hasUuid(); - akka.remote.RemoteProtocol.UuidProtocol getUuid(); - akka.remote.RemoteProtocol.UuidProtocolOrBuilder getUuidOrBuilder(); - - // required string address = 2; - boolean hasAddress(); - String getAddress(); - - // required string actorClassname = 3; - boolean hasActorClassname(); - String getActorClassname(); - - // optional bytes actorInstance = 4; - boolean hasActorInstance(); - com.google.protobuf.ByteString getActorInstance(); - - // optional string serializerClassname = 5; - boolean hasSerializerClassname(); - String getSerializerClassname(); - - // optional uint64 timeout = 6; - boolean hasTimeout(); - long getTimeout(); - - // optional uint64 receiveTimeout = 7; - boolean hasReceiveTimeout(); - long getReceiveTimeout(); - - // optional .LifeCycleProtocol lifeCycle = 8; - boolean hasLifeCycle(); - akka.remote.RemoteProtocol.LifeCycleProtocol getLifeCycle(); - akka.remote.RemoteProtocol.LifeCycleProtocolOrBuilder getLifeCycleOrBuilder(); - - // optional .RemoteActorRefProtocol supervisor = 9; - boolean hasSupervisor(); - akka.remote.RemoteProtocol.RemoteActorRefProtocol getSupervisor(); - akka.remote.RemoteProtocol.RemoteActorRefProtocolOrBuilder getSupervisorOrBuilder(); - - // optional bytes hotswapStack = 10; - boolean hasHotswapStack(); - com.google.protobuf.ByteString getHotswapStack(); - - // optional .ReplicationStorageType replicationStorage = 11; - boolean hasReplicationStorage(); - akka.remote.RemoteProtocol.ReplicationStorageType getReplicationStorage(); - - // optional .ReplicationStrategyType replicationStrategy = 12; - boolean hasReplicationStrategy(); - akka.remote.RemoteProtocol.ReplicationStrategyType getReplicationStrategy(); - - // repeated .RemoteMessageProtocol messages = 13; - java.util.List - getMessagesList(); - akka.remote.RemoteProtocol.RemoteMessageProtocol getMessages(int index); - int getMessagesCount(); - java.util.List - getMessagesOrBuilderList(); - akka.remote.RemoteProtocol.RemoteMessageProtocolOrBuilder getMessagesOrBuilder( - int index); - } - public static final class SerializedActorRefProtocol extends - com.google.protobuf.GeneratedMessage - implements SerializedActorRefProtocolOrBuilder { - // Use SerializedActorRefProtocol.newBuilder() to construct. - private SerializedActorRefProtocol(Builder builder) { - super(builder); - } - private SerializedActorRefProtocol(boolean noInit) {} - - private static final SerializedActorRefProtocol defaultInstance; - public static SerializedActorRefProtocol getDefaultInstance() { - return defaultInstance; - } - - public SerializedActorRefProtocol getDefaultInstanceForType() { - return defaultInstance; - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return akka.remote.RemoteProtocol.internal_static_SerializedActorRefProtocol_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return akka.remote.RemoteProtocol.internal_static_SerializedActorRefProtocol_fieldAccessorTable; - } - - private int bitField0_; - // required .UuidProtocol uuid = 1; - public static final int UUID_FIELD_NUMBER = 1; - private akka.remote.RemoteProtocol.UuidProtocol uuid_; - public boolean hasUuid() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - public akka.remote.RemoteProtocol.UuidProtocol getUuid() { - return uuid_; - } - public akka.remote.RemoteProtocol.UuidProtocolOrBuilder getUuidOrBuilder() { - return uuid_; - } - - // required string address = 2; - public static final int ADDRESS_FIELD_NUMBER = 2; - private java.lang.Object address_; - public boolean hasAddress() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - public String getAddress() { - java.lang.Object ref = address_; - if (ref instanceof String) { - return (String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - if (com.google.protobuf.Internal.isValidUtf8(bs)) { - address_ = s; - } - return s; - } - } - private com.google.protobuf.ByteString getAddressBytes() { - java.lang.Object ref = address_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((String) ref); - address_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - // required string actorClassname = 3; - public static final int ACTORCLASSNAME_FIELD_NUMBER = 3; - private java.lang.Object actorClassname_; - public boolean hasActorClassname() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - public String getActorClassname() { - java.lang.Object ref = actorClassname_; - if (ref instanceof String) { - return (String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - if (com.google.protobuf.Internal.isValidUtf8(bs)) { - actorClassname_ = s; - } - return s; - } - } - private com.google.protobuf.ByteString getActorClassnameBytes() { - java.lang.Object ref = actorClassname_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((String) ref); - actorClassname_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - // optional bytes actorInstance = 4; - public static final int ACTORINSTANCE_FIELD_NUMBER = 4; - private com.google.protobuf.ByteString actorInstance_; - public boolean hasActorInstance() { - return ((bitField0_ & 0x00000008) == 0x00000008); - } - public com.google.protobuf.ByteString getActorInstance() { - return actorInstance_; - } - - // optional string serializerClassname = 5; - public static final int SERIALIZERCLASSNAME_FIELD_NUMBER = 5; - private java.lang.Object serializerClassname_; - public boolean hasSerializerClassname() { - return ((bitField0_ & 0x00000010) == 0x00000010); - } - public String getSerializerClassname() { - java.lang.Object ref = serializerClassname_; - if (ref instanceof String) { - return (String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - if (com.google.protobuf.Internal.isValidUtf8(bs)) { - serializerClassname_ = s; - } - return s; - } - } - private com.google.protobuf.ByteString getSerializerClassnameBytes() { - java.lang.Object ref = serializerClassname_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((String) ref); - serializerClassname_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - // optional uint64 timeout = 6; - public static final int TIMEOUT_FIELD_NUMBER = 6; - private long timeout_; - public boolean hasTimeout() { - return ((bitField0_ & 0x00000020) == 0x00000020); - } - public long getTimeout() { - return timeout_; - } - - // optional uint64 receiveTimeout = 7; - public static final int RECEIVETIMEOUT_FIELD_NUMBER = 7; - private long receiveTimeout_; - public boolean hasReceiveTimeout() { - return ((bitField0_ & 0x00000040) == 0x00000040); - } - public long getReceiveTimeout() { - return receiveTimeout_; - } - - // optional .LifeCycleProtocol lifeCycle = 8; - public static final int LIFECYCLE_FIELD_NUMBER = 8; - private akka.remote.RemoteProtocol.LifeCycleProtocol lifeCycle_; - public boolean hasLifeCycle() { - return ((bitField0_ & 0x00000080) == 0x00000080); - } - public akka.remote.RemoteProtocol.LifeCycleProtocol getLifeCycle() { - return lifeCycle_; - } - public akka.remote.RemoteProtocol.LifeCycleProtocolOrBuilder getLifeCycleOrBuilder() { - return lifeCycle_; - } - - // optional .RemoteActorRefProtocol supervisor = 9; - public static final int SUPERVISOR_FIELD_NUMBER = 9; - private akka.remote.RemoteProtocol.RemoteActorRefProtocol supervisor_; - public boolean hasSupervisor() { - return ((bitField0_ & 0x00000100) == 0x00000100); - } - public akka.remote.RemoteProtocol.RemoteActorRefProtocol getSupervisor() { - return supervisor_; - } - public akka.remote.RemoteProtocol.RemoteActorRefProtocolOrBuilder getSupervisorOrBuilder() { - return supervisor_; - } - - // optional bytes hotswapStack = 10; - public static final int HOTSWAPSTACK_FIELD_NUMBER = 10; - private com.google.protobuf.ByteString hotswapStack_; - public boolean hasHotswapStack() { - return ((bitField0_ & 0x00000200) == 0x00000200); - } - public com.google.protobuf.ByteString getHotswapStack() { - return hotswapStack_; - } - - // optional .ReplicationStorageType replicationStorage = 11; - public static final int REPLICATIONSTORAGE_FIELD_NUMBER = 11; - private akka.remote.RemoteProtocol.ReplicationStorageType replicationStorage_; - public boolean hasReplicationStorage() { - return ((bitField0_ & 0x00000400) == 0x00000400); - } - public akka.remote.RemoteProtocol.ReplicationStorageType getReplicationStorage() { - return replicationStorage_; - } - - // optional .ReplicationStrategyType replicationStrategy = 12; - public static final int REPLICATIONSTRATEGY_FIELD_NUMBER = 12; - private akka.remote.RemoteProtocol.ReplicationStrategyType replicationStrategy_; - public boolean hasReplicationStrategy() { - return ((bitField0_ & 0x00000800) == 0x00000800); - } - public akka.remote.RemoteProtocol.ReplicationStrategyType getReplicationStrategy() { - return replicationStrategy_; - } - - // repeated .RemoteMessageProtocol messages = 13; - public static final int MESSAGES_FIELD_NUMBER = 13; - private java.util.List messages_; - public java.util.List getMessagesList() { - return messages_; - } - public java.util.List - getMessagesOrBuilderList() { - return messages_; - } - public int getMessagesCount() { - return messages_.size(); - } - public akka.remote.RemoteProtocol.RemoteMessageProtocol getMessages(int index) { - return messages_.get(index); - } - public akka.remote.RemoteProtocol.RemoteMessageProtocolOrBuilder getMessagesOrBuilder( - int index) { - return messages_.get(index); - } - - private void initFields() { - uuid_ = akka.remote.RemoteProtocol.UuidProtocol.getDefaultInstance(); - address_ = ""; - actorClassname_ = ""; - actorInstance_ = com.google.protobuf.ByteString.EMPTY; - serializerClassname_ = ""; - timeout_ = 0L; - receiveTimeout_ = 0L; - lifeCycle_ = akka.remote.RemoteProtocol.LifeCycleProtocol.getDefaultInstance(); - supervisor_ = akka.remote.RemoteProtocol.RemoteActorRefProtocol.getDefaultInstance(); - hotswapStack_ = com.google.protobuf.ByteString.EMPTY; - replicationStorage_ = akka.remote.RemoteProtocol.ReplicationStorageType.TRANSIENT; - replicationStrategy_ = akka.remote.RemoteProtocol.ReplicationStrategyType.WRITE_THROUGH; - messages_ = java.util.Collections.emptyList(); - } - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized != -1) return isInitialized == 1; - - if (!hasUuid()) { - memoizedIsInitialized = 0; - return false; - } - if (!hasAddress()) { - memoizedIsInitialized = 0; - return false; - } - if (!hasActorClassname()) { - memoizedIsInitialized = 0; - return false; - } - if (!getUuid().isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - if (hasLifeCycle()) { - if (!getLifeCycle().isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - if (hasSupervisor()) { - if (!getSupervisor().isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - for (int i = 0; i < getMessagesCount(); i++) { - if (!getMessages(i).isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeMessage(1, uuid_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeBytes(2, getAddressBytes()); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - output.writeBytes(3, getActorClassnameBytes()); - } - if (((bitField0_ & 0x00000008) == 0x00000008)) { - output.writeBytes(4, actorInstance_); - } - if (((bitField0_ & 0x00000010) == 0x00000010)) { - output.writeBytes(5, getSerializerClassnameBytes()); - } - if (((bitField0_ & 0x00000020) == 0x00000020)) { - output.writeUInt64(6, timeout_); - } - if (((bitField0_ & 0x00000040) == 0x00000040)) { - output.writeUInt64(7, receiveTimeout_); - } - if (((bitField0_ & 0x00000080) == 0x00000080)) { - output.writeMessage(8, lifeCycle_); - } - if (((bitField0_ & 0x00000100) == 0x00000100)) { - output.writeMessage(9, supervisor_); - } - if (((bitField0_ & 0x00000200) == 0x00000200)) { - output.writeBytes(10, hotswapStack_); - } - if (((bitField0_ & 0x00000400) == 0x00000400)) { - output.writeEnum(11, replicationStorage_.getNumber()); - } - if (((bitField0_ & 0x00000800) == 0x00000800)) { - output.writeEnum(12, replicationStrategy_.getNumber()); - } - for (int i = 0; i < messages_.size(); i++) { - output.writeMessage(13, messages_.get(i)); - } - getUnknownFields().writeTo(output); - } - - private int memoizedSerializedSize = -1; - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, uuid_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(2, getAddressBytes()); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(3, getActorClassnameBytes()); - } - if (((bitField0_ & 0x00000008) == 0x00000008)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(4, actorInstance_); - } - if (((bitField0_ & 0x00000010) == 0x00000010)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(5, getSerializerClassnameBytes()); - } - if (((bitField0_ & 0x00000020) == 0x00000020)) { - size += com.google.protobuf.CodedOutputStream - .computeUInt64Size(6, timeout_); - } - if (((bitField0_ & 0x00000040) == 0x00000040)) { - size += com.google.protobuf.CodedOutputStream - .computeUInt64Size(7, receiveTimeout_); - } - if (((bitField0_ & 0x00000080) == 0x00000080)) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(8, lifeCycle_); - } - if (((bitField0_ & 0x00000100) == 0x00000100)) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(9, supervisor_); - } - if (((bitField0_ & 0x00000200) == 0x00000200)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(10, hotswapStack_); - } - if (((bitField0_ & 0x00000400) == 0x00000400)) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(11, replicationStorage_.getNumber()); - } - if (((bitField0_ & 0x00000800) == 0x00000800)) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(12, replicationStrategy_.getNumber()); - } - for (int i = 0; i < messages_.size(); i++) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(13, messages_.get(i)); - } - size += getUnknownFields().getSerializedSize(); - memoizedSerializedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - @java.lang.Override - protected java.lang.Object writeReplace() - throws java.io.ObjectStreamException { - return super.writeReplace(); - } - - public static akka.remote.RemoteProtocol.SerializedActorRefProtocol parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); - } - public static akka.remote.RemoteProtocol.SerializedActorRefProtocol parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); - } - public static akka.remote.RemoteProtocol.SerializedActorRefProtocol parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); - } - public static akka.remote.RemoteProtocol.SerializedActorRefProtocol parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); - } - public static akka.remote.RemoteProtocol.SerializedActorRefProtocol parseFrom(java.io.InputStream input) - throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); - } - public static akka.remote.RemoteProtocol.SerializedActorRefProtocol parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); - } - public static akka.remote.RemoteProtocol.SerializedActorRefProtocol parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - Builder builder = newBuilder(); - if (builder.mergeDelimitedFrom(input)) { - return builder.buildParsed(); - } else { - return null; - } - } - public static akka.remote.RemoteProtocol.SerializedActorRefProtocol parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - Builder builder = newBuilder(); - if (builder.mergeDelimitedFrom(input, extensionRegistry)) { - return builder.buildParsed(); - } else { - return null; - } - } - public static akka.remote.RemoteProtocol.SerializedActorRefProtocol parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); - } - public static akka.remote.RemoteProtocol.SerializedActorRefProtocol parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); - } - - public static Builder newBuilder() { return Builder.create(); } - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(akka.remote.RemoteProtocol.SerializedActorRefProtocol prototype) { - return newBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { return newBuilder(this); } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder - implements akka.remote.RemoteProtocol.SerializedActorRefProtocolOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return akka.remote.RemoteProtocol.internal_static_SerializedActorRefProtocol_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return akka.remote.RemoteProtocol.internal_static_SerializedActorRefProtocol_fieldAccessorTable; - } - - // Construct using akka.remote.RemoteProtocol.SerializedActorRefProtocol.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - getUuidFieldBuilder(); - getLifeCycleFieldBuilder(); - getSupervisorFieldBuilder(); - getMessagesFieldBuilder(); - } - } - private static Builder create() { - return new Builder(); - } - - public Builder clear() { - super.clear(); - if (uuidBuilder_ == null) { - uuid_ = akka.remote.RemoteProtocol.UuidProtocol.getDefaultInstance(); - } else { - uuidBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000001); - address_ = ""; - bitField0_ = (bitField0_ & ~0x00000002); - actorClassname_ = ""; - bitField0_ = (bitField0_ & ~0x00000004); - actorInstance_ = com.google.protobuf.ByteString.EMPTY; - bitField0_ = (bitField0_ & ~0x00000008); - serializerClassname_ = ""; - bitField0_ = (bitField0_ & ~0x00000010); - timeout_ = 0L; - bitField0_ = (bitField0_ & ~0x00000020); - receiveTimeout_ = 0L; - bitField0_ = (bitField0_ & ~0x00000040); - if (lifeCycleBuilder_ == null) { - lifeCycle_ = akka.remote.RemoteProtocol.LifeCycleProtocol.getDefaultInstance(); - } else { - lifeCycleBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000080); - if (supervisorBuilder_ == null) { - supervisor_ = akka.remote.RemoteProtocol.RemoteActorRefProtocol.getDefaultInstance(); - } else { - supervisorBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000100); - hotswapStack_ = com.google.protobuf.ByteString.EMPTY; - bitField0_ = (bitField0_ & ~0x00000200); - replicationStorage_ = akka.remote.RemoteProtocol.ReplicationStorageType.TRANSIENT; - bitField0_ = (bitField0_ & ~0x00000400); - replicationStrategy_ = akka.remote.RemoteProtocol.ReplicationStrategyType.WRITE_THROUGH; - bitField0_ = (bitField0_ & ~0x00000800); - if (messagesBuilder_ == null) { - messages_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00001000); - } else { - messagesBuilder_.clear(); - } - return this; - } - - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return akka.remote.RemoteProtocol.SerializedActorRefProtocol.getDescriptor(); - } - - public akka.remote.RemoteProtocol.SerializedActorRefProtocol getDefaultInstanceForType() { - return akka.remote.RemoteProtocol.SerializedActorRefProtocol.getDefaultInstance(); - } - - public akka.remote.RemoteProtocol.SerializedActorRefProtocol build() { - akka.remote.RemoteProtocol.SerializedActorRefProtocol result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - private akka.remote.RemoteProtocol.SerializedActorRefProtocol buildParsed() - throws com.google.protobuf.InvalidProtocolBufferException { - akka.remote.RemoteProtocol.SerializedActorRefProtocol result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException( - result).asInvalidProtocolBufferException(); - } - return result; - } - - public akka.remote.RemoteProtocol.SerializedActorRefProtocol buildPartial() { - akka.remote.RemoteProtocol.SerializedActorRefProtocol result = new akka.remote.RemoteProtocol.SerializedActorRefProtocol(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - if (uuidBuilder_ == null) { - result.uuid_ = uuid_; - } else { - result.uuid_ = uuidBuilder_.build(); - } - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } - result.address_ = address_; - if (((from_bitField0_ & 0x00000004) == 0x00000004)) { - to_bitField0_ |= 0x00000004; - } - result.actorClassname_ = actorClassname_; - if (((from_bitField0_ & 0x00000008) == 0x00000008)) { - to_bitField0_ |= 0x00000008; - } - result.actorInstance_ = actorInstance_; - if (((from_bitField0_ & 0x00000010) == 0x00000010)) { - to_bitField0_ |= 0x00000010; - } - result.serializerClassname_ = serializerClassname_; - if (((from_bitField0_ & 0x00000020) == 0x00000020)) { - to_bitField0_ |= 0x00000020; - } - result.timeout_ = timeout_; - if (((from_bitField0_ & 0x00000040) == 0x00000040)) { - to_bitField0_ |= 0x00000040; - } - result.receiveTimeout_ = receiveTimeout_; - if (((from_bitField0_ & 0x00000080) == 0x00000080)) { - to_bitField0_ |= 0x00000080; - } - if (lifeCycleBuilder_ == null) { - result.lifeCycle_ = lifeCycle_; - } else { - result.lifeCycle_ = lifeCycleBuilder_.build(); - } - if (((from_bitField0_ & 0x00000100) == 0x00000100)) { - to_bitField0_ |= 0x00000100; - } - if (supervisorBuilder_ == null) { - result.supervisor_ = supervisor_; - } else { - result.supervisor_ = supervisorBuilder_.build(); - } - if (((from_bitField0_ & 0x00000200) == 0x00000200)) { - to_bitField0_ |= 0x00000200; - } - result.hotswapStack_ = hotswapStack_; - if (((from_bitField0_ & 0x00000400) == 0x00000400)) { - to_bitField0_ |= 0x00000400; - } - result.replicationStorage_ = replicationStorage_; - if (((from_bitField0_ & 0x00000800) == 0x00000800)) { - to_bitField0_ |= 0x00000800; - } - result.replicationStrategy_ = replicationStrategy_; - if (messagesBuilder_ == null) { - if (((bitField0_ & 0x00001000) == 0x00001000)) { - messages_ = java.util.Collections.unmodifiableList(messages_); - bitField0_ = (bitField0_ & ~0x00001000); - } - result.messages_ = messages_; - } else { - result.messages_ = messagesBuilder_.build(); - } - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof akka.remote.RemoteProtocol.SerializedActorRefProtocol) { - return mergeFrom((akka.remote.RemoteProtocol.SerializedActorRefProtocol)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(akka.remote.RemoteProtocol.SerializedActorRefProtocol other) { - if (other == akka.remote.RemoteProtocol.SerializedActorRefProtocol.getDefaultInstance()) return this; - if (other.hasUuid()) { - mergeUuid(other.getUuid()); - } - if (other.hasAddress()) { - setAddress(other.getAddress()); - } - if (other.hasActorClassname()) { - setActorClassname(other.getActorClassname()); - } - if (other.hasActorInstance()) { - setActorInstance(other.getActorInstance()); - } - if (other.hasSerializerClassname()) { - setSerializerClassname(other.getSerializerClassname()); - } - if (other.hasTimeout()) { - setTimeout(other.getTimeout()); - } - if (other.hasReceiveTimeout()) { - setReceiveTimeout(other.getReceiveTimeout()); - } - if (other.hasLifeCycle()) { - mergeLifeCycle(other.getLifeCycle()); - } - if (other.hasSupervisor()) { - mergeSupervisor(other.getSupervisor()); - } - if (other.hasHotswapStack()) { - setHotswapStack(other.getHotswapStack()); - } - if (other.hasReplicationStorage()) { - setReplicationStorage(other.getReplicationStorage()); - } - if (other.hasReplicationStrategy()) { - setReplicationStrategy(other.getReplicationStrategy()); - } - if (messagesBuilder_ == null) { - if (!other.messages_.isEmpty()) { - if (messages_.isEmpty()) { - messages_ = other.messages_; - bitField0_ = (bitField0_ & ~0x00001000); - } else { - ensureMessagesIsMutable(); - messages_.addAll(other.messages_); - } - onChanged(); - } - } else { - if (!other.messages_.isEmpty()) { - if (messagesBuilder_.isEmpty()) { - messagesBuilder_.dispose(); - messagesBuilder_ = null; - messages_ = other.messages_; - bitField0_ = (bitField0_ & ~0x00001000); - messagesBuilder_ = - com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? - getMessagesFieldBuilder() : null; - } else { - messagesBuilder_.addAllMessages(other.messages_); - } - } - } - this.mergeUnknownFields(other.getUnknownFields()); - return this; - } - - public final boolean isInitialized() { - if (!hasUuid()) { - - return false; - } - if (!hasAddress()) { - - return false; - } - if (!hasActorClassname()) { - - return false; - } - if (!getUuid().isInitialized()) { - - return false; - } - if (hasLifeCycle()) { - if (!getLifeCycle().isInitialized()) { - - return false; - } - } - if (hasSupervisor()) { - if (!getSupervisor().isInitialized()) { - - return false; - } - } - for (int i = 0; i < getMessagesCount(); i++) { - if (!getMessages(i).isInitialized()) { - - return false; - } - } - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder( - this.getUnknownFields()); - while (true) { - int tag = input.readTag(); - switch (tag) { - case 0: - this.setUnknownFields(unknownFields.build()); - onChanged(); - return this; - default: { - if (!parseUnknownField(input, unknownFields, - extensionRegistry, tag)) { - this.setUnknownFields(unknownFields.build()); - onChanged(); - return this; - } - break; - } - case 10: { - akka.remote.RemoteProtocol.UuidProtocol.Builder subBuilder = akka.remote.RemoteProtocol.UuidProtocol.newBuilder(); - if (hasUuid()) { - subBuilder.mergeFrom(getUuid()); - } - input.readMessage(subBuilder, extensionRegistry); - setUuid(subBuilder.buildPartial()); - break; - } - case 18: { - bitField0_ |= 0x00000002; - address_ = input.readBytes(); - break; - } - case 26: { - bitField0_ |= 0x00000004; - actorClassname_ = input.readBytes(); - break; - } - case 34: { - bitField0_ |= 0x00000008; - actorInstance_ = input.readBytes(); - break; - } - case 42: { - bitField0_ |= 0x00000010; - serializerClassname_ = input.readBytes(); - break; - } - case 48: { - bitField0_ |= 0x00000020; - timeout_ = input.readUInt64(); - break; - } - case 56: { - bitField0_ |= 0x00000040; - receiveTimeout_ = input.readUInt64(); - break; - } - case 66: { - akka.remote.RemoteProtocol.LifeCycleProtocol.Builder subBuilder = akka.remote.RemoteProtocol.LifeCycleProtocol.newBuilder(); - if (hasLifeCycle()) { - subBuilder.mergeFrom(getLifeCycle()); - } - input.readMessage(subBuilder, extensionRegistry); - setLifeCycle(subBuilder.buildPartial()); - break; - } - case 74: { - akka.remote.RemoteProtocol.RemoteActorRefProtocol.Builder subBuilder = akka.remote.RemoteProtocol.RemoteActorRefProtocol.newBuilder(); - if (hasSupervisor()) { - subBuilder.mergeFrom(getSupervisor()); - } - input.readMessage(subBuilder, extensionRegistry); - setSupervisor(subBuilder.buildPartial()); - break; - } - case 82: { - bitField0_ |= 0x00000200; - hotswapStack_ = input.readBytes(); - break; - } - case 88: { - int rawValue = input.readEnum(); - akka.remote.RemoteProtocol.ReplicationStorageType value = akka.remote.RemoteProtocol.ReplicationStorageType.valueOf(rawValue); - if (value == null) { - unknownFields.mergeVarintField(11, rawValue); - } else { - bitField0_ |= 0x00000400; - replicationStorage_ = value; - } - break; - } - case 96: { - int rawValue = input.readEnum(); - akka.remote.RemoteProtocol.ReplicationStrategyType value = akka.remote.RemoteProtocol.ReplicationStrategyType.valueOf(rawValue); - if (value == null) { - unknownFields.mergeVarintField(12, rawValue); - } else { - bitField0_ |= 0x00000800; - replicationStrategy_ = value; - } - break; - } - case 106: { - akka.remote.RemoteProtocol.RemoteMessageProtocol.Builder subBuilder = akka.remote.RemoteProtocol.RemoteMessageProtocol.newBuilder(); - input.readMessage(subBuilder, extensionRegistry); - addMessages(subBuilder.buildPartial()); - break; - } - } - } - } - - private int bitField0_; - - // required .UuidProtocol uuid = 1; - private akka.remote.RemoteProtocol.UuidProtocol uuid_ = akka.remote.RemoteProtocol.UuidProtocol.getDefaultInstance(); - private com.google.protobuf.SingleFieldBuilder< - akka.remote.RemoteProtocol.UuidProtocol, akka.remote.RemoteProtocol.UuidProtocol.Builder, akka.remote.RemoteProtocol.UuidProtocolOrBuilder> uuidBuilder_; - public boolean hasUuid() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - public akka.remote.RemoteProtocol.UuidProtocol getUuid() { - if (uuidBuilder_ == null) { - return uuid_; - } else { - return uuidBuilder_.getMessage(); - } - } - public Builder setUuid(akka.remote.RemoteProtocol.UuidProtocol value) { - if (uuidBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - uuid_ = value; - onChanged(); - } else { - uuidBuilder_.setMessage(value); - } - bitField0_ |= 0x00000001; - return this; - } - public Builder setUuid( - akka.remote.RemoteProtocol.UuidProtocol.Builder builderForValue) { - if (uuidBuilder_ == null) { - uuid_ = builderForValue.build(); - onChanged(); - } else { - uuidBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000001; - return this; - } - public Builder mergeUuid(akka.remote.RemoteProtocol.UuidProtocol value) { - if (uuidBuilder_ == null) { - if (((bitField0_ & 0x00000001) == 0x00000001) && - uuid_ != akka.remote.RemoteProtocol.UuidProtocol.getDefaultInstance()) { - uuid_ = - akka.remote.RemoteProtocol.UuidProtocol.newBuilder(uuid_).mergeFrom(value).buildPartial(); - } else { - uuid_ = value; - } - onChanged(); - } else { - uuidBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00000001; - return this; - } - public Builder clearUuid() { - if (uuidBuilder_ == null) { - uuid_ = akka.remote.RemoteProtocol.UuidProtocol.getDefaultInstance(); - onChanged(); - } else { - uuidBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000001); - return this; - } - public akka.remote.RemoteProtocol.UuidProtocol.Builder getUuidBuilder() { - bitField0_ |= 0x00000001; - onChanged(); - return getUuidFieldBuilder().getBuilder(); - } - public akka.remote.RemoteProtocol.UuidProtocolOrBuilder getUuidOrBuilder() { - if (uuidBuilder_ != null) { - return uuidBuilder_.getMessageOrBuilder(); - } else { - return uuid_; - } - } - private com.google.protobuf.SingleFieldBuilder< - akka.remote.RemoteProtocol.UuidProtocol, akka.remote.RemoteProtocol.UuidProtocol.Builder, akka.remote.RemoteProtocol.UuidProtocolOrBuilder> - getUuidFieldBuilder() { - if (uuidBuilder_ == null) { - uuidBuilder_ = new com.google.protobuf.SingleFieldBuilder< - akka.remote.RemoteProtocol.UuidProtocol, akka.remote.RemoteProtocol.UuidProtocol.Builder, akka.remote.RemoteProtocol.UuidProtocolOrBuilder>( - uuid_, - getParentForChildren(), - isClean()); - uuid_ = null; - } - return uuidBuilder_; - } - - // required string address = 2; - private java.lang.Object address_ = ""; - public boolean hasAddress() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - public String getAddress() { - java.lang.Object ref = address_; - if (!(ref instanceof String)) { - String s = ((com.google.protobuf.ByteString) ref).toStringUtf8(); - address_ = s; - return s; - } else { - return (String) ref; - } - } - public Builder setAddress(String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000002; - address_ = value; - onChanged(); - return this; - } - public Builder clearAddress() { - bitField0_ = (bitField0_ & ~0x00000002); - address_ = getDefaultInstance().getAddress(); - onChanged(); - return this; - } - void setAddress(com.google.protobuf.ByteString value) { - bitField0_ |= 0x00000002; - address_ = value; - onChanged(); - } - - // required string actorClassname = 3; - private java.lang.Object actorClassname_ = ""; - public boolean hasActorClassname() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - public String getActorClassname() { - java.lang.Object ref = actorClassname_; - if (!(ref instanceof String)) { - String s = ((com.google.protobuf.ByteString) ref).toStringUtf8(); - actorClassname_ = s; - return s; - } else { - return (String) ref; - } - } - public Builder setActorClassname(String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000004; - actorClassname_ = value; - onChanged(); - return this; - } - public Builder clearActorClassname() { - bitField0_ = (bitField0_ & ~0x00000004); - actorClassname_ = getDefaultInstance().getActorClassname(); - onChanged(); - return this; - } - void setActorClassname(com.google.protobuf.ByteString value) { - bitField0_ |= 0x00000004; - actorClassname_ = value; - onChanged(); - } - - // optional bytes actorInstance = 4; - private com.google.protobuf.ByteString actorInstance_ = com.google.protobuf.ByteString.EMPTY; - public boolean hasActorInstance() { - return ((bitField0_ & 0x00000008) == 0x00000008); - } - public com.google.protobuf.ByteString getActorInstance() { - return actorInstance_; - } - public Builder setActorInstance(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000008; - actorInstance_ = value; - onChanged(); - return this; - } - public Builder clearActorInstance() { - bitField0_ = (bitField0_ & ~0x00000008); - actorInstance_ = getDefaultInstance().getActorInstance(); - onChanged(); - return this; - } - - // optional string serializerClassname = 5; - private java.lang.Object serializerClassname_ = ""; - public boolean hasSerializerClassname() { - return ((bitField0_ & 0x00000010) == 0x00000010); - } - public String getSerializerClassname() { - java.lang.Object ref = serializerClassname_; - if (!(ref instanceof String)) { - String s = ((com.google.protobuf.ByteString) ref).toStringUtf8(); - serializerClassname_ = s; - return s; - } else { - return (String) ref; - } - } - public Builder setSerializerClassname(String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000010; - serializerClassname_ = value; - onChanged(); - return this; - } - public Builder clearSerializerClassname() { - bitField0_ = (bitField0_ & ~0x00000010); - serializerClassname_ = getDefaultInstance().getSerializerClassname(); - onChanged(); - return this; - } - void setSerializerClassname(com.google.protobuf.ByteString value) { - bitField0_ |= 0x00000010; - serializerClassname_ = value; - onChanged(); - } - - // optional uint64 timeout = 6; - private long timeout_ ; - public boolean hasTimeout() { - return ((bitField0_ & 0x00000020) == 0x00000020); - } - public long getTimeout() { - return timeout_; - } - public Builder setTimeout(long value) { - bitField0_ |= 0x00000020; - timeout_ = value; - onChanged(); - return this; - } - public Builder clearTimeout() { - bitField0_ = (bitField0_ & ~0x00000020); - timeout_ = 0L; - onChanged(); - return this; - } - - // optional uint64 receiveTimeout = 7; - private long receiveTimeout_ ; - public boolean hasReceiveTimeout() { - return ((bitField0_ & 0x00000040) == 0x00000040); - } - public long getReceiveTimeout() { - return receiveTimeout_; - } - public Builder setReceiveTimeout(long value) { - bitField0_ |= 0x00000040; - receiveTimeout_ = value; - onChanged(); - return this; - } - public Builder clearReceiveTimeout() { - bitField0_ = (bitField0_ & ~0x00000040); - receiveTimeout_ = 0L; - onChanged(); - return this; - } - - // optional .LifeCycleProtocol lifeCycle = 8; - private akka.remote.RemoteProtocol.LifeCycleProtocol lifeCycle_ = akka.remote.RemoteProtocol.LifeCycleProtocol.getDefaultInstance(); - private com.google.protobuf.SingleFieldBuilder< - akka.remote.RemoteProtocol.LifeCycleProtocol, akka.remote.RemoteProtocol.LifeCycleProtocol.Builder, akka.remote.RemoteProtocol.LifeCycleProtocolOrBuilder> lifeCycleBuilder_; - public boolean hasLifeCycle() { - return ((bitField0_ & 0x00000080) == 0x00000080); - } - public akka.remote.RemoteProtocol.LifeCycleProtocol getLifeCycle() { - if (lifeCycleBuilder_ == null) { - return lifeCycle_; - } else { - return lifeCycleBuilder_.getMessage(); - } - } - public Builder setLifeCycle(akka.remote.RemoteProtocol.LifeCycleProtocol value) { - if (lifeCycleBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - lifeCycle_ = value; - onChanged(); - } else { - lifeCycleBuilder_.setMessage(value); - } - bitField0_ |= 0x00000080; - return this; - } - public Builder setLifeCycle( - akka.remote.RemoteProtocol.LifeCycleProtocol.Builder builderForValue) { - if (lifeCycleBuilder_ == null) { - lifeCycle_ = builderForValue.build(); - onChanged(); - } else { - lifeCycleBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000080; - return this; - } - public Builder mergeLifeCycle(akka.remote.RemoteProtocol.LifeCycleProtocol value) { - if (lifeCycleBuilder_ == null) { - if (((bitField0_ & 0x00000080) == 0x00000080) && - lifeCycle_ != akka.remote.RemoteProtocol.LifeCycleProtocol.getDefaultInstance()) { - lifeCycle_ = - akka.remote.RemoteProtocol.LifeCycleProtocol.newBuilder(lifeCycle_).mergeFrom(value).buildPartial(); - } else { - lifeCycle_ = value; - } - onChanged(); - } else { - lifeCycleBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00000080; - return this; - } - public Builder clearLifeCycle() { - if (lifeCycleBuilder_ == null) { - lifeCycle_ = akka.remote.RemoteProtocol.LifeCycleProtocol.getDefaultInstance(); - onChanged(); - } else { - lifeCycleBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000080); - return this; - } - public akka.remote.RemoteProtocol.LifeCycleProtocol.Builder getLifeCycleBuilder() { - bitField0_ |= 0x00000080; - onChanged(); - return getLifeCycleFieldBuilder().getBuilder(); - } - public akka.remote.RemoteProtocol.LifeCycleProtocolOrBuilder getLifeCycleOrBuilder() { - if (lifeCycleBuilder_ != null) { - return lifeCycleBuilder_.getMessageOrBuilder(); - } else { - return lifeCycle_; - } - } - private com.google.protobuf.SingleFieldBuilder< - akka.remote.RemoteProtocol.LifeCycleProtocol, akka.remote.RemoteProtocol.LifeCycleProtocol.Builder, akka.remote.RemoteProtocol.LifeCycleProtocolOrBuilder> - getLifeCycleFieldBuilder() { - if (lifeCycleBuilder_ == null) { - lifeCycleBuilder_ = new com.google.protobuf.SingleFieldBuilder< - akka.remote.RemoteProtocol.LifeCycleProtocol, akka.remote.RemoteProtocol.LifeCycleProtocol.Builder, akka.remote.RemoteProtocol.LifeCycleProtocolOrBuilder>( - lifeCycle_, - getParentForChildren(), - isClean()); - lifeCycle_ = null; - } - return lifeCycleBuilder_; - } - - // optional .RemoteActorRefProtocol supervisor = 9; - private akka.remote.RemoteProtocol.RemoteActorRefProtocol supervisor_ = akka.remote.RemoteProtocol.RemoteActorRefProtocol.getDefaultInstance(); - private com.google.protobuf.SingleFieldBuilder< - akka.remote.RemoteProtocol.RemoteActorRefProtocol, akka.remote.RemoteProtocol.RemoteActorRefProtocol.Builder, akka.remote.RemoteProtocol.RemoteActorRefProtocolOrBuilder> supervisorBuilder_; - public boolean hasSupervisor() { - return ((bitField0_ & 0x00000100) == 0x00000100); - } - public akka.remote.RemoteProtocol.RemoteActorRefProtocol getSupervisor() { - if (supervisorBuilder_ == null) { - return supervisor_; - } else { - return supervisorBuilder_.getMessage(); - } - } - public Builder setSupervisor(akka.remote.RemoteProtocol.RemoteActorRefProtocol value) { - if (supervisorBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - supervisor_ = value; - onChanged(); - } else { - supervisorBuilder_.setMessage(value); - } - bitField0_ |= 0x00000100; - return this; - } - public Builder setSupervisor( - akka.remote.RemoteProtocol.RemoteActorRefProtocol.Builder builderForValue) { - if (supervisorBuilder_ == null) { - supervisor_ = builderForValue.build(); - onChanged(); - } else { - supervisorBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000100; - return this; - } - public Builder mergeSupervisor(akka.remote.RemoteProtocol.RemoteActorRefProtocol value) { - if (supervisorBuilder_ == null) { - if (((bitField0_ & 0x00000100) == 0x00000100) && - supervisor_ != akka.remote.RemoteProtocol.RemoteActorRefProtocol.getDefaultInstance()) { - supervisor_ = - akka.remote.RemoteProtocol.RemoteActorRefProtocol.newBuilder(supervisor_).mergeFrom(value).buildPartial(); - } else { - supervisor_ = value; - } - onChanged(); - } else { - supervisorBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00000100; - return this; - } - public Builder clearSupervisor() { - if (supervisorBuilder_ == null) { - supervisor_ = akka.remote.RemoteProtocol.RemoteActorRefProtocol.getDefaultInstance(); - onChanged(); - } else { - supervisorBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000100); - return this; - } - public akka.remote.RemoteProtocol.RemoteActorRefProtocol.Builder getSupervisorBuilder() { - bitField0_ |= 0x00000100; - onChanged(); - return getSupervisorFieldBuilder().getBuilder(); - } - public akka.remote.RemoteProtocol.RemoteActorRefProtocolOrBuilder getSupervisorOrBuilder() { - if (supervisorBuilder_ != null) { - return supervisorBuilder_.getMessageOrBuilder(); - } else { - return supervisor_; - } - } - private com.google.protobuf.SingleFieldBuilder< - akka.remote.RemoteProtocol.RemoteActorRefProtocol, akka.remote.RemoteProtocol.RemoteActorRefProtocol.Builder, akka.remote.RemoteProtocol.RemoteActorRefProtocolOrBuilder> - getSupervisorFieldBuilder() { - if (supervisorBuilder_ == null) { - supervisorBuilder_ = new com.google.protobuf.SingleFieldBuilder< - akka.remote.RemoteProtocol.RemoteActorRefProtocol, akka.remote.RemoteProtocol.RemoteActorRefProtocol.Builder, akka.remote.RemoteProtocol.RemoteActorRefProtocolOrBuilder>( - supervisor_, - getParentForChildren(), - isClean()); - supervisor_ = null; - } - return supervisorBuilder_; - } - - // optional bytes hotswapStack = 10; - private com.google.protobuf.ByteString hotswapStack_ = com.google.protobuf.ByteString.EMPTY; - public boolean hasHotswapStack() { - return ((bitField0_ & 0x00000200) == 0x00000200); - } - public com.google.protobuf.ByteString getHotswapStack() { - return hotswapStack_; - } - public Builder setHotswapStack(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000200; - hotswapStack_ = value; - onChanged(); - return this; - } - public Builder clearHotswapStack() { - bitField0_ = (bitField0_ & ~0x00000200); - hotswapStack_ = getDefaultInstance().getHotswapStack(); - onChanged(); - return this; - } - - // optional .ReplicationStorageType replicationStorage = 11; - private akka.remote.RemoteProtocol.ReplicationStorageType replicationStorage_ = akka.remote.RemoteProtocol.ReplicationStorageType.TRANSIENT; - public boolean hasReplicationStorage() { - return ((bitField0_ & 0x00000400) == 0x00000400); - } - public akka.remote.RemoteProtocol.ReplicationStorageType getReplicationStorage() { - return replicationStorage_; - } - public Builder setReplicationStorage(akka.remote.RemoteProtocol.ReplicationStorageType value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000400; - replicationStorage_ = value; - onChanged(); - return this; - } - public Builder clearReplicationStorage() { - bitField0_ = (bitField0_ & ~0x00000400); - replicationStorage_ = akka.remote.RemoteProtocol.ReplicationStorageType.TRANSIENT; - onChanged(); - return this; - } - - // optional .ReplicationStrategyType replicationStrategy = 12; - private akka.remote.RemoteProtocol.ReplicationStrategyType replicationStrategy_ = akka.remote.RemoteProtocol.ReplicationStrategyType.WRITE_THROUGH; - public boolean hasReplicationStrategy() { - return ((bitField0_ & 0x00000800) == 0x00000800); - } - public akka.remote.RemoteProtocol.ReplicationStrategyType getReplicationStrategy() { - return replicationStrategy_; - } - public Builder setReplicationStrategy(akka.remote.RemoteProtocol.ReplicationStrategyType value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000800; - replicationStrategy_ = value; - onChanged(); - return this; - } - public Builder clearReplicationStrategy() { - bitField0_ = (bitField0_ & ~0x00000800); - replicationStrategy_ = akka.remote.RemoteProtocol.ReplicationStrategyType.WRITE_THROUGH; - onChanged(); - return this; - } - - // repeated .RemoteMessageProtocol messages = 13; - private java.util.List messages_ = - java.util.Collections.emptyList(); - private void ensureMessagesIsMutable() { - if (!((bitField0_ & 0x00001000) == 0x00001000)) { - messages_ = new java.util.ArrayList(messages_); - bitField0_ |= 0x00001000; - } - } - - private com.google.protobuf.RepeatedFieldBuilder< - akka.remote.RemoteProtocol.RemoteMessageProtocol, akka.remote.RemoteProtocol.RemoteMessageProtocol.Builder, akka.remote.RemoteProtocol.RemoteMessageProtocolOrBuilder> messagesBuilder_; - - public java.util.List getMessagesList() { - if (messagesBuilder_ == null) { - return java.util.Collections.unmodifiableList(messages_); - } else { - return messagesBuilder_.getMessageList(); - } - } - public int getMessagesCount() { - if (messagesBuilder_ == null) { - return messages_.size(); - } else { - return messagesBuilder_.getCount(); - } - } - public akka.remote.RemoteProtocol.RemoteMessageProtocol getMessages(int index) { - if (messagesBuilder_ == null) { - return messages_.get(index); - } else { - return messagesBuilder_.getMessage(index); - } - } - public Builder setMessages( - int index, akka.remote.RemoteProtocol.RemoteMessageProtocol value) { - if (messagesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureMessagesIsMutable(); - messages_.set(index, value); - onChanged(); - } else { - messagesBuilder_.setMessage(index, value); - } - return this; - } - public Builder setMessages( - int index, akka.remote.RemoteProtocol.RemoteMessageProtocol.Builder builderForValue) { - if (messagesBuilder_ == null) { - ensureMessagesIsMutable(); - messages_.set(index, builderForValue.build()); - onChanged(); - } else { - messagesBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - public Builder addMessages(akka.remote.RemoteProtocol.RemoteMessageProtocol value) { - if (messagesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureMessagesIsMutable(); - messages_.add(value); - onChanged(); - } else { - messagesBuilder_.addMessage(value); - } - return this; - } - public Builder addMessages( - int index, akka.remote.RemoteProtocol.RemoteMessageProtocol value) { - if (messagesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureMessagesIsMutable(); - messages_.add(index, value); - onChanged(); - } else { - messagesBuilder_.addMessage(index, value); - } - return this; - } - public Builder addMessages( - akka.remote.RemoteProtocol.RemoteMessageProtocol.Builder builderForValue) { - if (messagesBuilder_ == null) { - ensureMessagesIsMutable(); - messages_.add(builderForValue.build()); - onChanged(); - } else { - messagesBuilder_.addMessage(builderForValue.build()); - } - return this; - } - public Builder addMessages( - int index, akka.remote.RemoteProtocol.RemoteMessageProtocol.Builder builderForValue) { - if (messagesBuilder_ == null) { - ensureMessagesIsMutable(); - messages_.add(index, builderForValue.build()); - onChanged(); - } else { - messagesBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - public Builder addAllMessages( - java.lang.Iterable values) { - if (messagesBuilder_ == null) { - ensureMessagesIsMutable(); - super.addAll(values, messages_); - onChanged(); - } else { - messagesBuilder_.addAllMessages(values); - } - return this; - } - public Builder clearMessages() { - if (messagesBuilder_ == null) { - messages_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00001000); - onChanged(); - } else { - messagesBuilder_.clear(); - } - return this; - } - public Builder removeMessages(int index) { - if (messagesBuilder_ == null) { - ensureMessagesIsMutable(); - messages_.remove(index); - onChanged(); - } else { - messagesBuilder_.remove(index); - } - return this; - } - public akka.remote.RemoteProtocol.RemoteMessageProtocol.Builder getMessagesBuilder( - int index) { - return getMessagesFieldBuilder().getBuilder(index); - } - public akka.remote.RemoteProtocol.RemoteMessageProtocolOrBuilder getMessagesOrBuilder( - int index) { - if (messagesBuilder_ == null) { - return messages_.get(index); } else { - return messagesBuilder_.getMessageOrBuilder(index); - } - } - public java.util.List - getMessagesOrBuilderList() { - if (messagesBuilder_ != null) { - return messagesBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(messages_); - } - } - public akka.remote.RemoteProtocol.RemoteMessageProtocol.Builder addMessagesBuilder() { - return getMessagesFieldBuilder().addBuilder( - akka.remote.RemoteProtocol.RemoteMessageProtocol.getDefaultInstance()); - } - public akka.remote.RemoteProtocol.RemoteMessageProtocol.Builder addMessagesBuilder( - int index) { - return getMessagesFieldBuilder().addBuilder( - index, akka.remote.RemoteProtocol.RemoteMessageProtocol.getDefaultInstance()); - } - public java.util.List - getMessagesBuilderList() { - return getMessagesFieldBuilder().getBuilderList(); - } - private com.google.protobuf.RepeatedFieldBuilder< - akka.remote.RemoteProtocol.RemoteMessageProtocol, akka.remote.RemoteProtocol.RemoteMessageProtocol.Builder, akka.remote.RemoteProtocol.RemoteMessageProtocolOrBuilder> - getMessagesFieldBuilder() { - if (messagesBuilder_ == null) { - messagesBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< - akka.remote.RemoteProtocol.RemoteMessageProtocol, akka.remote.RemoteProtocol.RemoteMessageProtocol.Builder, akka.remote.RemoteProtocol.RemoteMessageProtocolOrBuilder>( - messages_, - ((bitField0_ & 0x00001000) == 0x00001000), - getParentForChildren(), - isClean()); - messages_ = null; - } - return messagesBuilder_; - } - - // @@protoc_insertion_point(builder_scope:SerializedActorRefProtocol) - } - - static { - defaultInstance = new SerializedActorRefProtocol(true); - defaultInstance.initFields(); - } - - // @@protoc_insertion_point(class_scope:SerializedActorRefProtocol) - } - - public interface SerializedTypedActorRefProtocolOrBuilder - extends com.google.protobuf.MessageOrBuilder { - - // required .SerializedActorRefProtocol actorRef = 1; - boolean hasActorRef(); - akka.remote.RemoteProtocol.SerializedActorRefProtocol getActorRef(); - akka.remote.RemoteProtocol.SerializedActorRefProtocolOrBuilder getActorRefOrBuilder(); - - // required string interfaceName = 2; - boolean hasInterfaceName(); - String getInterfaceName(); - } - public static final class SerializedTypedActorRefProtocol extends - com.google.protobuf.GeneratedMessage - implements SerializedTypedActorRefProtocolOrBuilder { - // Use SerializedTypedActorRefProtocol.newBuilder() to construct. - private SerializedTypedActorRefProtocol(Builder builder) { - super(builder); - } - private SerializedTypedActorRefProtocol(boolean noInit) {} - - private static final SerializedTypedActorRefProtocol defaultInstance; - public static SerializedTypedActorRefProtocol getDefaultInstance() { - return defaultInstance; - } - - public SerializedTypedActorRefProtocol getDefaultInstanceForType() { - return defaultInstance; - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return akka.remote.RemoteProtocol.internal_static_SerializedTypedActorRefProtocol_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return akka.remote.RemoteProtocol.internal_static_SerializedTypedActorRefProtocol_fieldAccessorTable; - } - - private int bitField0_; - // required .SerializedActorRefProtocol actorRef = 1; - public static final int ACTORREF_FIELD_NUMBER = 1; - private akka.remote.RemoteProtocol.SerializedActorRefProtocol actorRef_; - public boolean hasActorRef() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - public akka.remote.RemoteProtocol.SerializedActorRefProtocol getActorRef() { - return actorRef_; - } - public akka.remote.RemoteProtocol.SerializedActorRefProtocolOrBuilder getActorRefOrBuilder() { - return actorRef_; - } - - // required string interfaceName = 2; - public static final int INTERFACENAME_FIELD_NUMBER = 2; - private java.lang.Object interfaceName_; - public boolean hasInterfaceName() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - public String getInterfaceName() { - java.lang.Object ref = interfaceName_; - if (ref instanceof String) { - return (String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - if (com.google.protobuf.Internal.isValidUtf8(bs)) { - interfaceName_ = s; - } - return s; - } - } - private com.google.protobuf.ByteString getInterfaceNameBytes() { - java.lang.Object ref = interfaceName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((String) ref); - interfaceName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private void initFields() { - actorRef_ = akka.remote.RemoteProtocol.SerializedActorRefProtocol.getDefaultInstance(); - interfaceName_ = ""; - } - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized != -1) return isInitialized == 1; - - if (!hasActorRef()) { - memoizedIsInitialized = 0; - return false; - } - if (!hasInterfaceName()) { - memoizedIsInitialized = 0; - return false; - } - if (!getActorRef().isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeMessage(1, actorRef_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeBytes(2, getInterfaceNameBytes()); - } - getUnknownFields().writeTo(output); - } - - private int memoizedSerializedSize = -1; - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, actorRef_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(2, getInterfaceNameBytes()); - } - size += getUnknownFields().getSerializedSize(); - memoizedSerializedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - @java.lang.Override - protected java.lang.Object writeReplace() - throws java.io.ObjectStreamException { - return super.writeReplace(); - } - - public static akka.remote.RemoteProtocol.SerializedTypedActorRefProtocol parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); - } - public static akka.remote.RemoteProtocol.SerializedTypedActorRefProtocol parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); - } - public static akka.remote.RemoteProtocol.SerializedTypedActorRefProtocol parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); - } - public static akka.remote.RemoteProtocol.SerializedTypedActorRefProtocol parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); - } - public static akka.remote.RemoteProtocol.SerializedTypedActorRefProtocol parseFrom(java.io.InputStream input) - throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); - } - public static akka.remote.RemoteProtocol.SerializedTypedActorRefProtocol parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); - } - public static akka.remote.RemoteProtocol.SerializedTypedActorRefProtocol parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - Builder builder = newBuilder(); - if (builder.mergeDelimitedFrom(input)) { - return builder.buildParsed(); - } else { - return null; - } - } - public static akka.remote.RemoteProtocol.SerializedTypedActorRefProtocol parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - Builder builder = newBuilder(); - if (builder.mergeDelimitedFrom(input, extensionRegistry)) { - return builder.buildParsed(); - } else { - return null; - } - } - public static akka.remote.RemoteProtocol.SerializedTypedActorRefProtocol parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); - } - public static akka.remote.RemoteProtocol.SerializedTypedActorRefProtocol parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); - } - - public static Builder newBuilder() { return Builder.create(); } - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(akka.remote.RemoteProtocol.SerializedTypedActorRefProtocol prototype) { - return newBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { return newBuilder(this); } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder - implements akka.remote.RemoteProtocol.SerializedTypedActorRefProtocolOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return akka.remote.RemoteProtocol.internal_static_SerializedTypedActorRefProtocol_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return akka.remote.RemoteProtocol.internal_static_SerializedTypedActorRefProtocol_fieldAccessorTable; - } - - // Construct using akka.remote.RemoteProtocol.SerializedTypedActorRefProtocol.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - getActorRefFieldBuilder(); - } - } - private static Builder create() { - return new Builder(); - } - - public Builder clear() { - super.clear(); - if (actorRefBuilder_ == null) { - actorRef_ = akka.remote.RemoteProtocol.SerializedActorRefProtocol.getDefaultInstance(); - } else { - actorRefBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000001); - interfaceName_ = ""; - bitField0_ = (bitField0_ & ~0x00000002); - return this; - } - - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return akka.remote.RemoteProtocol.SerializedTypedActorRefProtocol.getDescriptor(); - } - - public akka.remote.RemoteProtocol.SerializedTypedActorRefProtocol getDefaultInstanceForType() { - return akka.remote.RemoteProtocol.SerializedTypedActorRefProtocol.getDefaultInstance(); - } - - public akka.remote.RemoteProtocol.SerializedTypedActorRefProtocol build() { - akka.remote.RemoteProtocol.SerializedTypedActorRefProtocol result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - private akka.remote.RemoteProtocol.SerializedTypedActorRefProtocol buildParsed() - throws com.google.protobuf.InvalidProtocolBufferException { - akka.remote.RemoteProtocol.SerializedTypedActorRefProtocol result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException( - result).asInvalidProtocolBufferException(); - } - return result; - } - - public akka.remote.RemoteProtocol.SerializedTypedActorRefProtocol buildPartial() { - akka.remote.RemoteProtocol.SerializedTypedActorRefProtocol result = new akka.remote.RemoteProtocol.SerializedTypedActorRefProtocol(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - if (actorRefBuilder_ == null) { - result.actorRef_ = actorRef_; - } else { - result.actorRef_ = actorRefBuilder_.build(); - } - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } - result.interfaceName_ = interfaceName_; - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof akka.remote.RemoteProtocol.SerializedTypedActorRefProtocol) { - return mergeFrom((akka.remote.RemoteProtocol.SerializedTypedActorRefProtocol)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(akka.remote.RemoteProtocol.SerializedTypedActorRefProtocol other) { - if (other == akka.remote.RemoteProtocol.SerializedTypedActorRefProtocol.getDefaultInstance()) return this; - if (other.hasActorRef()) { - mergeActorRef(other.getActorRef()); - } - if (other.hasInterfaceName()) { - setInterfaceName(other.getInterfaceName()); - } - this.mergeUnknownFields(other.getUnknownFields()); - return this; - } - - public final boolean isInitialized() { - if (!hasActorRef()) { - - return false; - } - if (!hasInterfaceName()) { - - return false; - } - if (!getActorRef().isInitialized()) { - - return false; - } - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder( - this.getUnknownFields()); - while (true) { - int tag = input.readTag(); - switch (tag) { - case 0: - this.setUnknownFields(unknownFields.build()); - onChanged(); - return this; - default: { - if (!parseUnknownField(input, unknownFields, - extensionRegistry, tag)) { - this.setUnknownFields(unknownFields.build()); - onChanged(); - return this; - } - break; - } - case 10: { - akka.remote.RemoteProtocol.SerializedActorRefProtocol.Builder subBuilder = akka.remote.RemoteProtocol.SerializedActorRefProtocol.newBuilder(); - if (hasActorRef()) { - subBuilder.mergeFrom(getActorRef()); - } - input.readMessage(subBuilder, extensionRegistry); - setActorRef(subBuilder.buildPartial()); - break; - } - case 18: { - bitField0_ |= 0x00000002; - interfaceName_ = input.readBytes(); - break; - } - } - } - } - - private int bitField0_; - - // required .SerializedActorRefProtocol actorRef = 1; - private akka.remote.RemoteProtocol.SerializedActorRefProtocol actorRef_ = akka.remote.RemoteProtocol.SerializedActorRefProtocol.getDefaultInstance(); - private com.google.protobuf.SingleFieldBuilder< - akka.remote.RemoteProtocol.SerializedActorRefProtocol, akka.remote.RemoteProtocol.SerializedActorRefProtocol.Builder, akka.remote.RemoteProtocol.SerializedActorRefProtocolOrBuilder> actorRefBuilder_; - public boolean hasActorRef() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - public akka.remote.RemoteProtocol.SerializedActorRefProtocol getActorRef() { - if (actorRefBuilder_ == null) { - return actorRef_; - } else { - return actorRefBuilder_.getMessage(); - } - } - public Builder setActorRef(akka.remote.RemoteProtocol.SerializedActorRefProtocol value) { - if (actorRefBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - actorRef_ = value; - onChanged(); - } else { - actorRefBuilder_.setMessage(value); - } - bitField0_ |= 0x00000001; - return this; - } - public Builder setActorRef( - akka.remote.RemoteProtocol.SerializedActorRefProtocol.Builder builderForValue) { - if (actorRefBuilder_ == null) { - actorRef_ = builderForValue.build(); - onChanged(); - } else { - actorRefBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000001; - return this; - } - public Builder mergeActorRef(akka.remote.RemoteProtocol.SerializedActorRefProtocol value) { - if (actorRefBuilder_ == null) { - if (((bitField0_ & 0x00000001) == 0x00000001) && - actorRef_ != akka.remote.RemoteProtocol.SerializedActorRefProtocol.getDefaultInstance()) { - actorRef_ = - akka.remote.RemoteProtocol.SerializedActorRefProtocol.newBuilder(actorRef_).mergeFrom(value).buildPartial(); - } else { - actorRef_ = value; - } - onChanged(); - } else { - actorRefBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00000001; - return this; - } - public Builder clearActorRef() { - if (actorRefBuilder_ == null) { - actorRef_ = akka.remote.RemoteProtocol.SerializedActorRefProtocol.getDefaultInstance(); - onChanged(); - } else { - actorRefBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000001); - return this; - } - public akka.remote.RemoteProtocol.SerializedActorRefProtocol.Builder getActorRefBuilder() { - bitField0_ |= 0x00000001; - onChanged(); - return getActorRefFieldBuilder().getBuilder(); - } - public akka.remote.RemoteProtocol.SerializedActorRefProtocolOrBuilder getActorRefOrBuilder() { - if (actorRefBuilder_ != null) { - return actorRefBuilder_.getMessageOrBuilder(); - } else { - return actorRef_; - } - } - private com.google.protobuf.SingleFieldBuilder< - akka.remote.RemoteProtocol.SerializedActorRefProtocol, akka.remote.RemoteProtocol.SerializedActorRefProtocol.Builder, akka.remote.RemoteProtocol.SerializedActorRefProtocolOrBuilder> - getActorRefFieldBuilder() { - if (actorRefBuilder_ == null) { - actorRefBuilder_ = new com.google.protobuf.SingleFieldBuilder< - akka.remote.RemoteProtocol.SerializedActorRefProtocol, akka.remote.RemoteProtocol.SerializedActorRefProtocol.Builder, akka.remote.RemoteProtocol.SerializedActorRefProtocolOrBuilder>( - actorRef_, - getParentForChildren(), - isClean()); - actorRef_ = null; - } - return actorRefBuilder_; - } - - // required string interfaceName = 2; - private java.lang.Object interfaceName_ = ""; - public boolean hasInterfaceName() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - public String getInterfaceName() { - java.lang.Object ref = interfaceName_; - if (!(ref instanceof String)) { - String s = ((com.google.protobuf.ByteString) ref).toStringUtf8(); - interfaceName_ = s; - return s; - } else { - return (String) ref; - } - } - public Builder setInterfaceName(String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000002; - interfaceName_ = value; - onChanged(); - return this; - } - public Builder clearInterfaceName() { - bitField0_ = (bitField0_ & ~0x00000002); - interfaceName_ = getDefaultInstance().getInterfaceName(); - onChanged(); - return this; - } - void setInterfaceName(com.google.protobuf.ByteString value) { - bitField0_ |= 0x00000002; - interfaceName_ = value; - onChanged(); - } - - // @@protoc_insertion_point(builder_scope:SerializedTypedActorRefProtocol) - } - - static { - defaultInstance = new SerializedTypedActorRefProtocol(true); - defaultInstance.initFields(); - } - - // @@protoc_insertion_point(class_scope:SerializedTypedActorRefProtocol) - } - + public interface MessageProtocolOrBuilder extends com.google.protobuf.MessageOrBuilder { - + // required bytes message = 1; boolean hasMessage(); com.google.protobuf.ByteString getMessage(); - + // optional bytes messageManifest = 2; boolean hasMessageManifest(); com.google.protobuf.ByteString getMessageManifest(); @@ -5850,26 +3122,26 @@ public final class RemoteProtocol { super(builder); } private MessageProtocol(boolean noInit) {} - + private static final MessageProtocol defaultInstance; public static MessageProtocol getDefaultInstance() { return defaultInstance; } - + public MessageProtocol getDefaultInstanceForType() { return defaultInstance; } - + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return akka.remote.RemoteProtocol.internal_static_MessageProtocol_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return akka.remote.RemoteProtocol.internal_static_MessageProtocol_fieldAccessorTable; } - + private int bitField0_; // required bytes message = 1; public static final int MESSAGE_FIELD_NUMBER = 1; @@ -5880,7 +3152,7 @@ public final class RemoteProtocol { public com.google.protobuf.ByteString getMessage() { return message_; } - + // optional bytes messageManifest = 2; public static final int MESSAGEMANIFEST_FIELD_NUMBER = 2; private com.google.protobuf.ByteString messageManifest_; @@ -5890,7 +3162,7 @@ public final class RemoteProtocol { public com.google.protobuf.ByteString getMessageManifest() { return messageManifest_; } - + private void initFields() { message_ = com.google.protobuf.ByteString.EMPTY; messageManifest_ = com.google.protobuf.ByteString.EMPTY; @@ -5899,7 +3171,7 @@ public final class RemoteProtocol { public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized != -1) return isInitialized == 1; - + if (!hasMessage()) { memoizedIsInitialized = 0; return false; @@ -5907,7 +3179,7 @@ public final class RemoteProtocol { memoizedIsInitialized = 1; return true; } - + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); @@ -5919,12 +3191,12 @@ public final class RemoteProtocol { } getUnknownFields().writeTo(output); } - + private int memoizedSerializedSize = -1; public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; - + size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream @@ -5938,14 +3210,14 @@ public final class RemoteProtocol { memoizedSerializedSize = size; return size; } - + private static final long serialVersionUID = 0L; @java.lang.Override protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { return super.writeReplace(); } - + public static akka.remote.RemoteProtocol.MessageProtocol parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { @@ -6012,14 +3284,14 @@ public final class RemoteProtocol { return newBuilder().mergeFrom(input, extensionRegistry) .buildParsed(); } - + public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(akka.remote.RemoteProtocol.MessageProtocol prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } - + @java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessage.BuilderParent parent) { @@ -6033,18 +3305,18 @@ public final class RemoteProtocol { getDescriptor() { return akka.remote.RemoteProtocol.internal_static_MessageProtocol_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return akka.remote.RemoteProtocol.internal_static_MessageProtocol_fieldAccessorTable; } - + // Construct using akka.remote.RemoteProtocol.MessageProtocol.newBuilder() private Builder() { maybeForceBuilderInitialization(); } - - private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + + private Builder(BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } @@ -6055,7 +3327,7 @@ public final class RemoteProtocol { private static Builder create() { return new Builder(); } - + public Builder clear() { super.clear(); message_ = com.google.protobuf.ByteString.EMPTY; @@ -6064,20 +3336,20 @@ public final class RemoteProtocol { bitField0_ = (bitField0_ & ~0x00000002); return this; } - + public Builder clone() { return create().mergeFrom(buildPartial()); } - + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return akka.remote.RemoteProtocol.MessageProtocol.getDescriptor(); } - + public akka.remote.RemoteProtocol.MessageProtocol getDefaultInstanceForType() { return akka.remote.RemoteProtocol.MessageProtocol.getDefaultInstance(); } - + public akka.remote.RemoteProtocol.MessageProtocol build() { akka.remote.RemoteProtocol.MessageProtocol result = buildPartial(); if (!result.isInitialized()) { @@ -6085,7 +3357,7 @@ public final class RemoteProtocol { } return result; } - + private akka.remote.RemoteProtocol.MessageProtocol buildParsed() throws com.google.protobuf.InvalidProtocolBufferException { akka.remote.RemoteProtocol.MessageProtocol result = buildPartial(); @@ -6095,7 +3367,7 @@ public final class RemoteProtocol { } return result; } - + public akka.remote.RemoteProtocol.MessageProtocol buildPartial() { akka.remote.RemoteProtocol.MessageProtocol result = new akka.remote.RemoteProtocol.MessageProtocol(this); int from_bitField0_ = bitField0_; @@ -6112,7 +3384,7 @@ public final class RemoteProtocol { onBuilt(); return result; } - + public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof akka.remote.RemoteProtocol.MessageProtocol) { return mergeFrom((akka.remote.RemoteProtocol.MessageProtocol)other); @@ -6121,7 +3393,7 @@ public final class RemoteProtocol { return this; } } - + public Builder mergeFrom(akka.remote.RemoteProtocol.MessageProtocol other) { if (other == akka.remote.RemoteProtocol.MessageProtocol.getDefaultInstance()) return this; if (other.hasMessage()) { @@ -6133,15 +3405,15 @@ public final class RemoteProtocol { this.mergeUnknownFields(other.getUnknownFields()); return this; } - + public final boolean isInitialized() { if (!hasMessage()) { - + return false; } return true; } - + public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) @@ -6178,9 +3450,9 @@ public final class RemoteProtocol { } } } - + private int bitField0_; - + // required bytes message = 1; private com.google.protobuf.ByteString message_ = com.google.protobuf.ByteString.EMPTY; public boolean hasMessage() { @@ -6204,7 +3476,7 @@ public final class RemoteProtocol { onChanged(); return this; } - + // optional bytes messageManifest = 2; private com.google.protobuf.ByteString messageManifest_ = com.google.protobuf.ByteString.EMPTY; public boolean hasMessageManifest() { @@ -6228,624 +3500,25 @@ public final class RemoteProtocol { onChanged(); return this; } - + // @@protoc_insertion_point(builder_scope:MessageProtocol) } - + static { defaultInstance = new MessageProtocol(true); defaultInstance.initFields(); } - + // @@protoc_insertion_point(class_scope:MessageProtocol) } - - public interface ActorInfoProtocolOrBuilder - extends com.google.protobuf.MessageOrBuilder { - - // required .UuidProtocol uuid = 1; - boolean hasUuid(); - akka.remote.RemoteProtocol.UuidProtocol getUuid(); - akka.remote.RemoteProtocol.UuidProtocolOrBuilder getUuidOrBuilder(); - - // required uint64 timeout = 2; - boolean hasTimeout(); - long getTimeout(); - - // optional string address = 3; - boolean hasAddress(); - String getAddress(); - } - public static final class ActorInfoProtocol extends - com.google.protobuf.GeneratedMessage - implements ActorInfoProtocolOrBuilder { - // Use ActorInfoProtocol.newBuilder() to construct. - private ActorInfoProtocol(Builder builder) { - super(builder); - } - private ActorInfoProtocol(boolean noInit) {} - - private static final ActorInfoProtocol defaultInstance; - public static ActorInfoProtocol getDefaultInstance() { - return defaultInstance; - } - - public ActorInfoProtocol getDefaultInstanceForType() { - return defaultInstance; - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return akka.remote.RemoteProtocol.internal_static_ActorInfoProtocol_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return akka.remote.RemoteProtocol.internal_static_ActorInfoProtocol_fieldAccessorTable; - } - - private int bitField0_; - // required .UuidProtocol uuid = 1; - public static final int UUID_FIELD_NUMBER = 1; - private akka.remote.RemoteProtocol.UuidProtocol uuid_; - public boolean hasUuid() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - public akka.remote.RemoteProtocol.UuidProtocol getUuid() { - return uuid_; - } - public akka.remote.RemoteProtocol.UuidProtocolOrBuilder getUuidOrBuilder() { - return uuid_; - } - - // required uint64 timeout = 2; - public static final int TIMEOUT_FIELD_NUMBER = 2; - private long timeout_; - public boolean hasTimeout() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - public long getTimeout() { - return timeout_; - } - - // optional string address = 3; - public static final int ADDRESS_FIELD_NUMBER = 3; - private java.lang.Object address_; - public boolean hasAddress() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - public String getAddress() { - java.lang.Object ref = address_; - if (ref instanceof String) { - return (String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - if (com.google.protobuf.Internal.isValidUtf8(bs)) { - address_ = s; - } - return s; - } - } - private com.google.protobuf.ByteString getAddressBytes() { - java.lang.Object ref = address_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((String) ref); - address_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - private void initFields() { - uuid_ = akka.remote.RemoteProtocol.UuidProtocol.getDefaultInstance(); - timeout_ = 0L; - address_ = ""; - } - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized != -1) return isInitialized == 1; - - if (!hasUuid()) { - memoizedIsInitialized = 0; - return false; - } - if (!hasTimeout()) { - memoizedIsInitialized = 0; - return false; - } - if (!getUuid().isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeMessage(1, uuid_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeUInt64(2, timeout_); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - output.writeBytes(3, getAddressBytes()); - } - getUnknownFields().writeTo(output); - } - - private int memoizedSerializedSize = -1; - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, uuid_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream - .computeUInt64Size(2, timeout_); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(3, getAddressBytes()); - } - size += getUnknownFields().getSerializedSize(); - memoizedSerializedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - @java.lang.Override - protected java.lang.Object writeReplace() - throws java.io.ObjectStreamException { - return super.writeReplace(); - } - - public static akka.remote.RemoteProtocol.ActorInfoProtocol parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); - } - public static akka.remote.RemoteProtocol.ActorInfoProtocol parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); - } - public static akka.remote.RemoteProtocol.ActorInfoProtocol parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); - } - public static akka.remote.RemoteProtocol.ActorInfoProtocol parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); - } - public static akka.remote.RemoteProtocol.ActorInfoProtocol parseFrom(java.io.InputStream input) - throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); - } - public static akka.remote.RemoteProtocol.ActorInfoProtocol parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); - } - public static akka.remote.RemoteProtocol.ActorInfoProtocol parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - Builder builder = newBuilder(); - if (builder.mergeDelimitedFrom(input)) { - return builder.buildParsed(); - } else { - return null; - } - } - public static akka.remote.RemoteProtocol.ActorInfoProtocol parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - Builder builder = newBuilder(); - if (builder.mergeDelimitedFrom(input, extensionRegistry)) { - return builder.buildParsed(); - } else { - return null; - } - } - public static akka.remote.RemoteProtocol.ActorInfoProtocol parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); - } - public static akka.remote.RemoteProtocol.ActorInfoProtocol parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); - } - - public static Builder newBuilder() { return Builder.create(); } - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(akka.remote.RemoteProtocol.ActorInfoProtocol prototype) { - return newBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { return newBuilder(this); } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder - implements akka.remote.RemoteProtocol.ActorInfoProtocolOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return akka.remote.RemoteProtocol.internal_static_ActorInfoProtocol_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return akka.remote.RemoteProtocol.internal_static_ActorInfoProtocol_fieldAccessorTable; - } - - // Construct using akka.remote.RemoteProtocol.ActorInfoProtocol.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - getUuidFieldBuilder(); - } - } - private static Builder create() { - return new Builder(); - } - - public Builder clear() { - super.clear(); - if (uuidBuilder_ == null) { - uuid_ = akka.remote.RemoteProtocol.UuidProtocol.getDefaultInstance(); - } else { - uuidBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000001); - timeout_ = 0L; - bitField0_ = (bitField0_ & ~0x00000002); - address_ = ""; - bitField0_ = (bitField0_ & ~0x00000004); - return this; - } - - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return akka.remote.RemoteProtocol.ActorInfoProtocol.getDescriptor(); - } - - public akka.remote.RemoteProtocol.ActorInfoProtocol getDefaultInstanceForType() { - return akka.remote.RemoteProtocol.ActorInfoProtocol.getDefaultInstance(); - } - - public akka.remote.RemoteProtocol.ActorInfoProtocol build() { - akka.remote.RemoteProtocol.ActorInfoProtocol result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - private akka.remote.RemoteProtocol.ActorInfoProtocol buildParsed() - throws com.google.protobuf.InvalidProtocolBufferException { - akka.remote.RemoteProtocol.ActorInfoProtocol result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException( - result).asInvalidProtocolBufferException(); - } - return result; - } - - public akka.remote.RemoteProtocol.ActorInfoProtocol buildPartial() { - akka.remote.RemoteProtocol.ActorInfoProtocol result = new akka.remote.RemoteProtocol.ActorInfoProtocol(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - if (uuidBuilder_ == null) { - result.uuid_ = uuid_; - } else { - result.uuid_ = uuidBuilder_.build(); - } - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } - result.timeout_ = timeout_; - if (((from_bitField0_ & 0x00000004) == 0x00000004)) { - to_bitField0_ |= 0x00000004; - } - result.address_ = address_; - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof akka.remote.RemoteProtocol.ActorInfoProtocol) { - return mergeFrom((akka.remote.RemoteProtocol.ActorInfoProtocol)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(akka.remote.RemoteProtocol.ActorInfoProtocol other) { - if (other == akka.remote.RemoteProtocol.ActorInfoProtocol.getDefaultInstance()) return this; - if (other.hasUuid()) { - mergeUuid(other.getUuid()); - } - if (other.hasTimeout()) { - setTimeout(other.getTimeout()); - } - if (other.hasAddress()) { - setAddress(other.getAddress()); - } - this.mergeUnknownFields(other.getUnknownFields()); - return this; - } - - public final boolean isInitialized() { - if (!hasUuid()) { - - return false; - } - if (!hasTimeout()) { - - return false; - } - if (!getUuid().isInitialized()) { - - return false; - } - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder( - this.getUnknownFields()); - while (true) { - int tag = input.readTag(); - switch (tag) { - case 0: - this.setUnknownFields(unknownFields.build()); - onChanged(); - return this; - default: { - if (!parseUnknownField(input, unknownFields, - extensionRegistry, tag)) { - this.setUnknownFields(unknownFields.build()); - onChanged(); - return this; - } - break; - } - case 10: { - akka.remote.RemoteProtocol.UuidProtocol.Builder subBuilder = akka.remote.RemoteProtocol.UuidProtocol.newBuilder(); - if (hasUuid()) { - subBuilder.mergeFrom(getUuid()); - } - input.readMessage(subBuilder, extensionRegistry); - setUuid(subBuilder.buildPartial()); - break; - } - case 16: { - bitField0_ |= 0x00000002; - timeout_ = input.readUInt64(); - break; - } - case 26: { - bitField0_ |= 0x00000004; - address_ = input.readBytes(); - break; - } - } - } - } - - private int bitField0_; - - // required .UuidProtocol uuid = 1; - private akka.remote.RemoteProtocol.UuidProtocol uuid_ = akka.remote.RemoteProtocol.UuidProtocol.getDefaultInstance(); - private com.google.protobuf.SingleFieldBuilder< - akka.remote.RemoteProtocol.UuidProtocol, akka.remote.RemoteProtocol.UuidProtocol.Builder, akka.remote.RemoteProtocol.UuidProtocolOrBuilder> uuidBuilder_; - public boolean hasUuid() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - public akka.remote.RemoteProtocol.UuidProtocol getUuid() { - if (uuidBuilder_ == null) { - return uuid_; - } else { - return uuidBuilder_.getMessage(); - } - } - public Builder setUuid(akka.remote.RemoteProtocol.UuidProtocol value) { - if (uuidBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - uuid_ = value; - onChanged(); - } else { - uuidBuilder_.setMessage(value); - } - bitField0_ |= 0x00000001; - return this; - } - public Builder setUuid( - akka.remote.RemoteProtocol.UuidProtocol.Builder builderForValue) { - if (uuidBuilder_ == null) { - uuid_ = builderForValue.build(); - onChanged(); - } else { - uuidBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000001; - return this; - } - public Builder mergeUuid(akka.remote.RemoteProtocol.UuidProtocol value) { - if (uuidBuilder_ == null) { - if (((bitField0_ & 0x00000001) == 0x00000001) && - uuid_ != akka.remote.RemoteProtocol.UuidProtocol.getDefaultInstance()) { - uuid_ = - akka.remote.RemoteProtocol.UuidProtocol.newBuilder(uuid_).mergeFrom(value).buildPartial(); - } else { - uuid_ = value; - } - onChanged(); - } else { - uuidBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00000001; - return this; - } - public Builder clearUuid() { - if (uuidBuilder_ == null) { - uuid_ = akka.remote.RemoteProtocol.UuidProtocol.getDefaultInstance(); - onChanged(); - } else { - uuidBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000001); - return this; - } - public akka.remote.RemoteProtocol.UuidProtocol.Builder getUuidBuilder() { - bitField0_ |= 0x00000001; - onChanged(); - return getUuidFieldBuilder().getBuilder(); - } - public akka.remote.RemoteProtocol.UuidProtocolOrBuilder getUuidOrBuilder() { - if (uuidBuilder_ != null) { - return uuidBuilder_.getMessageOrBuilder(); - } else { - return uuid_; - } - } - private com.google.protobuf.SingleFieldBuilder< - akka.remote.RemoteProtocol.UuidProtocol, akka.remote.RemoteProtocol.UuidProtocol.Builder, akka.remote.RemoteProtocol.UuidProtocolOrBuilder> - getUuidFieldBuilder() { - if (uuidBuilder_ == null) { - uuidBuilder_ = new com.google.protobuf.SingleFieldBuilder< - akka.remote.RemoteProtocol.UuidProtocol, akka.remote.RemoteProtocol.UuidProtocol.Builder, akka.remote.RemoteProtocol.UuidProtocolOrBuilder>( - uuid_, - getParentForChildren(), - isClean()); - uuid_ = null; - } - return uuidBuilder_; - } - - // required uint64 timeout = 2; - private long timeout_ ; - public boolean hasTimeout() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - public long getTimeout() { - return timeout_; - } - public Builder setTimeout(long value) { - bitField0_ |= 0x00000002; - timeout_ = value; - onChanged(); - return this; - } - public Builder clearTimeout() { - bitField0_ = (bitField0_ & ~0x00000002); - timeout_ = 0L; - onChanged(); - return this; - } - - // optional string address = 3; - private java.lang.Object address_ = ""; - public boolean hasAddress() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - public String getAddress() { - java.lang.Object ref = address_; - if (!(ref instanceof String)) { - String s = ((com.google.protobuf.ByteString) ref).toStringUtf8(); - address_ = s; - return s; - } else { - return (String) ref; - } - } - public Builder setAddress(String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000004; - address_ = value; - onChanged(); - return this; - } - public Builder clearAddress() { - bitField0_ = (bitField0_ & ~0x00000004); - address_ = getDefaultInstance().getAddress(); - onChanged(); - return this; - } - void setAddress(com.google.protobuf.ByteString value) { - bitField0_ |= 0x00000004; - address_ = value; - onChanged(); - } - - // @@protoc_insertion_point(builder_scope:ActorInfoProtocol) - } - - static { - defaultInstance = new ActorInfoProtocol(true); - defaultInstance.initFields(); - } - - // @@protoc_insertion_point(class_scope:ActorInfoProtocol) - } - + public interface UuidProtocolOrBuilder extends com.google.protobuf.MessageOrBuilder { - + // required uint64 high = 1; boolean hasHigh(); long getHigh(); - + // required uint64 low = 2; boolean hasLow(); long getLow(); @@ -6858,26 +3531,26 @@ public final class RemoteProtocol { super(builder); } private UuidProtocol(boolean noInit) {} - + private static final UuidProtocol defaultInstance; public static UuidProtocol getDefaultInstance() { return defaultInstance; } - + public UuidProtocol getDefaultInstanceForType() { return defaultInstance; } - + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return akka.remote.RemoteProtocol.internal_static_UuidProtocol_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return akka.remote.RemoteProtocol.internal_static_UuidProtocol_fieldAccessorTable; } - + private int bitField0_; // required uint64 high = 1; public static final int HIGH_FIELD_NUMBER = 1; @@ -6888,7 +3561,7 @@ public final class RemoteProtocol { public long getHigh() { return high_; } - + // required uint64 low = 2; public static final int LOW_FIELD_NUMBER = 2; private long low_; @@ -6898,7 +3571,7 @@ public final class RemoteProtocol { public long getLow() { return low_; } - + private void initFields() { high_ = 0L; low_ = 0L; @@ -6907,7 +3580,7 @@ public final class RemoteProtocol { public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized != -1) return isInitialized == 1; - + if (!hasHigh()) { memoizedIsInitialized = 0; return false; @@ -6919,7 +3592,7 @@ public final class RemoteProtocol { memoizedIsInitialized = 1; return true; } - + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); @@ -6931,12 +3604,12 @@ public final class RemoteProtocol { } getUnknownFields().writeTo(output); } - + private int memoizedSerializedSize = -1; public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; - + size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream @@ -6950,14 +3623,14 @@ public final class RemoteProtocol { memoizedSerializedSize = size; return size; } - + private static final long serialVersionUID = 0L; @java.lang.Override protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { return super.writeReplace(); } - + public static akka.remote.RemoteProtocol.UuidProtocol parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { @@ -7024,14 +3697,14 @@ public final class RemoteProtocol { return newBuilder().mergeFrom(input, extensionRegistry) .buildParsed(); } - + public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(akka.remote.RemoteProtocol.UuidProtocol prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } - + @java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessage.BuilderParent parent) { @@ -7045,18 +3718,18 @@ public final class RemoteProtocol { getDescriptor() { return akka.remote.RemoteProtocol.internal_static_UuidProtocol_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return akka.remote.RemoteProtocol.internal_static_UuidProtocol_fieldAccessorTable; } - + // Construct using akka.remote.RemoteProtocol.UuidProtocol.newBuilder() private Builder() { maybeForceBuilderInitialization(); } - - private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + + private Builder(BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } @@ -7067,7 +3740,7 @@ public final class RemoteProtocol { private static Builder create() { return new Builder(); } - + public Builder clear() { super.clear(); high_ = 0L; @@ -7076,20 +3749,20 @@ public final class RemoteProtocol { bitField0_ = (bitField0_ & ~0x00000002); return this; } - + public Builder clone() { return create().mergeFrom(buildPartial()); } - + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return akka.remote.RemoteProtocol.UuidProtocol.getDescriptor(); } - + public akka.remote.RemoteProtocol.UuidProtocol getDefaultInstanceForType() { return akka.remote.RemoteProtocol.UuidProtocol.getDefaultInstance(); } - + public akka.remote.RemoteProtocol.UuidProtocol build() { akka.remote.RemoteProtocol.UuidProtocol result = buildPartial(); if (!result.isInitialized()) { @@ -7097,7 +3770,7 @@ public final class RemoteProtocol { } return result; } - + private akka.remote.RemoteProtocol.UuidProtocol buildParsed() throws com.google.protobuf.InvalidProtocolBufferException { akka.remote.RemoteProtocol.UuidProtocol result = buildPartial(); @@ -7107,7 +3780,7 @@ public final class RemoteProtocol { } return result; } - + public akka.remote.RemoteProtocol.UuidProtocol buildPartial() { akka.remote.RemoteProtocol.UuidProtocol result = new akka.remote.RemoteProtocol.UuidProtocol(this); int from_bitField0_ = bitField0_; @@ -7124,7 +3797,7 @@ public final class RemoteProtocol { onBuilt(); return result; } - + public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof akka.remote.RemoteProtocol.UuidProtocol) { return mergeFrom((akka.remote.RemoteProtocol.UuidProtocol)other); @@ -7133,7 +3806,7 @@ public final class RemoteProtocol { return this; } } - + public Builder mergeFrom(akka.remote.RemoteProtocol.UuidProtocol other) { if (other == akka.remote.RemoteProtocol.UuidProtocol.getDefaultInstance()) return this; if (other.hasHigh()) { @@ -7145,19 +3818,19 @@ public final class RemoteProtocol { this.mergeUnknownFields(other.getUnknownFields()); return this; } - + public final boolean isInitialized() { if (!hasHigh()) { - + return false; } if (!hasLow()) { - + return false; } return true; } - + public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) @@ -7194,9 +3867,9 @@ public final class RemoteProtocol { } } } - + private int bitField0_; - + // required uint64 high = 1; private long high_ ; public boolean hasHigh() { @@ -7217,7 +3890,7 @@ public final class RemoteProtocol { onChanged(); return this; } - + // required uint64 low = 2; private long low_ ; public boolean hasLow() { @@ -7238,25 +3911,25 @@ public final class RemoteProtocol { onChanged(); return this; } - + // @@protoc_insertion_point(builder_scope:UuidProtocol) } - + static { defaultInstance = new UuidProtocol(true); defaultInstance.initFields(); } - + // @@protoc_insertion_point(class_scope:UuidProtocol) } - + public interface MetadataEntryProtocolOrBuilder extends com.google.protobuf.MessageOrBuilder { - + // required string key = 1; boolean hasKey(); String getKey(); - + // required bytes value = 2; boolean hasValue(); com.google.protobuf.ByteString getValue(); @@ -7269,26 +3942,26 @@ public final class RemoteProtocol { super(builder); } private MetadataEntryProtocol(boolean noInit) {} - + private static final MetadataEntryProtocol defaultInstance; public static MetadataEntryProtocol getDefaultInstance() { return defaultInstance; } - + public MetadataEntryProtocol getDefaultInstanceForType() { return defaultInstance; } - + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return akka.remote.RemoteProtocol.internal_static_MetadataEntryProtocol_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return akka.remote.RemoteProtocol.internal_static_MetadataEntryProtocol_fieldAccessorTable; } - + private int bitField0_; // required string key = 1; public static final int KEY_FIELD_NUMBER = 1; @@ -7301,7 +3974,7 @@ public final class RemoteProtocol { if (ref instanceof String) { return (String) ref; } else { - com.google.protobuf.ByteString bs = + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; String s = bs.toStringUtf8(); if (com.google.protobuf.Internal.isValidUtf8(bs)) { @@ -7313,7 +3986,7 @@ public final class RemoteProtocol { private com.google.protobuf.ByteString getKeyBytes() { java.lang.Object ref = key_; if (ref instanceof String) { - com.google.protobuf.ByteString b = + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((String) ref); key_ = b; return b; @@ -7321,7 +3994,7 @@ public final class RemoteProtocol { return (com.google.protobuf.ByteString) ref; } } - + // required bytes value = 2; public static final int VALUE_FIELD_NUMBER = 2; private com.google.protobuf.ByteString value_; @@ -7331,7 +4004,7 @@ public final class RemoteProtocol { public com.google.protobuf.ByteString getValue() { return value_; } - + private void initFields() { key_ = ""; value_ = com.google.protobuf.ByteString.EMPTY; @@ -7340,7 +4013,7 @@ public final class RemoteProtocol { public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized != -1) return isInitialized == 1; - + if (!hasKey()) { memoizedIsInitialized = 0; return false; @@ -7352,7 +4025,7 @@ public final class RemoteProtocol { memoizedIsInitialized = 1; return true; } - + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); @@ -7364,12 +4037,12 @@ public final class RemoteProtocol { } getUnknownFields().writeTo(output); } - + private int memoizedSerializedSize = -1; public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; - + size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream @@ -7383,14 +4056,14 @@ public final class RemoteProtocol { memoizedSerializedSize = size; return size; } - + private static final long serialVersionUID = 0L; @java.lang.Override protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { return super.writeReplace(); } - + public static akka.remote.RemoteProtocol.MetadataEntryProtocol parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { @@ -7457,14 +4130,14 @@ public final class RemoteProtocol { return newBuilder().mergeFrom(input, extensionRegistry) .buildParsed(); } - + public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(akka.remote.RemoteProtocol.MetadataEntryProtocol prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } - + @java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessage.BuilderParent parent) { @@ -7478,18 +4151,18 @@ public final class RemoteProtocol { getDescriptor() { return akka.remote.RemoteProtocol.internal_static_MetadataEntryProtocol_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return akka.remote.RemoteProtocol.internal_static_MetadataEntryProtocol_fieldAccessorTable; } - + // Construct using akka.remote.RemoteProtocol.MetadataEntryProtocol.newBuilder() private Builder() { maybeForceBuilderInitialization(); } - - private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + + private Builder(BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } @@ -7500,7 +4173,7 @@ public final class RemoteProtocol { private static Builder create() { return new Builder(); } - + public Builder clear() { super.clear(); key_ = ""; @@ -7509,20 +4182,20 @@ public final class RemoteProtocol { bitField0_ = (bitField0_ & ~0x00000002); return this; } - + public Builder clone() { return create().mergeFrom(buildPartial()); } - + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return akka.remote.RemoteProtocol.MetadataEntryProtocol.getDescriptor(); } - + public akka.remote.RemoteProtocol.MetadataEntryProtocol getDefaultInstanceForType() { return akka.remote.RemoteProtocol.MetadataEntryProtocol.getDefaultInstance(); } - + public akka.remote.RemoteProtocol.MetadataEntryProtocol build() { akka.remote.RemoteProtocol.MetadataEntryProtocol result = buildPartial(); if (!result.isInitialized()) { @@ -7530,7 +4203,7 @@ public final class RemoteProtocol { } return result; } - + private akka.remote.RemoteProtocol.MetadataEntryProtocol buildParsed() throws com.google.protobuf.InvalidProtocolBufferException { akka.remote.RemoteProtocol.MetadataEntryProtocol result = buildPartial(); @@ -7540,7 +4213,7 @@ public final class RemoteProtocol { } return result; } - + public akka.remote.RemoteProtocol.MetadataEntryProtocol buildPartial() { akka.remote.RemoteProtocol.MetadataEntryProtocol result = new akka.remote.RemoteProtocol.MetadataEntryProtocol(this); int from_bitField0_ = bitField0_; @@ -7557,7 +4230,7 @@ public final class RemoteProtocol { onBuilt(); return result; } - + public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof akka.remote.RemoteProtocol.MetadataEntryProtocol) { return mergeFrom((akka.remote.RemoteProtocol.MetadataEntryProtocol)other); @@ -7566,7 +4239,7 @@ public final class RemoteProtocol { return this; } } - + public Builder mergeFrom(akka.remote.RemoteProtocol.MetadataEntryProtocol other) { if (other == akka.remote.RemoteProtocol.MetadataEntryProtocol.getDefaultInstance()) return this; if (other.hasKey()) { @@ -7578,19 +4251,19 @@ public final class RemoteProtocol { this.mergeUnknownFields(other.getUnknownFields()); return this; } - + public final boolean isInitialized() { if (!hasKey()) { - + return false; } if (!hasValue()) { - + return false; } return true; } - + public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) @@ -7627,9 +4300,9 @@ public final class RemoteProtocol { } } } - + private int bitField0_; - + // required string key = 1; private java.lang.Object key_ = ""; public boolean hasKey() { @@ -7665,7 +4338,7 @@ public final class RemoteProtocol { key_ = value; onChanged(); } - + // required bytes value = 2; private com.google.protobuf.ByteString value_ = com.google.protobuf.ByteString.EMPTY; public boolean hasValue() { @@ -7689,380 +4362,25 @@ public final class RemoteProtocol { onChanged(); return this; } - + // @@protoc_insertion_point(builder_scope:MetadataEntryProtocol) } - + static { defaultInstance = new MetadataEntryProtocol(true); defaultInstance.initFields(); } - + // @@protoc_insertion_point(class_scope:MetadataEntryProtocol) } - - public interface LifeCycleProtocolOrBuilder - extends com.google.protobuf.MessageOrBuilder { - - // required .LifeCycleType lifeCycle = 1; - boolean hasLifeCycle(); - akka.remote.RemoteProtocol.LifeCycleType getLifeCycle(); - } - public static final class LifeCycleProtocol extends - com.google.protobuf.GeneratedMessage - implements LifeCycleProtocolOrBuilder { - // Use LifeCycleProtocol.newBuilder() to construct. - private LifeCycleProtocol(Builder builder) { - super(builder); - } - private LifeCycleProtocol(boolean noInit) {} - - private static final LifeCycleProtocol defaultInstance; - public static LifeCycleProtocol getDefaultInstance() { - return defaultInstance; - } - - public LifeCycleProtocol getDefaultInstanceForType() { - return defaultInstance; - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return akka.remote.RemoteProtocol.internal_static_LifeCycleProtocol_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return akka.remote.RemoteProtocol.internal_static_LifeCycleProtocol_fieldAccessorTable; - } - - private int bitField0_; - // required .LifeCycleType lifeCycle = 1; - public static final int LIFECYCLE_FIELD_NUMBER = 1; - private akka.remote.RemoteProtocol.LifeCycleType lifeCycle_; - public boolean hasLifeCycle() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - public akka.remote.RemoteProtocol.LifeCycleType getLifeCycle() { - return lifeCycle_; - } - - private void initFields() { - lifeCycle_ = akka.remote.RemoteProtocol.LifeCycleType.PERMANENT; - } - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized != -1) return isInitialized == 1; - - if (!hasLifeCycle()) { - memoizedIsInitialized = 0; - return false; - } - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeEnum(1, lifeCycle_.getNumber()); - } - getUnknownFields().writeTo(output); - } - - private int memoizedSerializedSize = -1; - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream - .computeEnumSize(1, lifeCycle_.getNumber()); - } - size += getUnknownFields().getSerializedSize(); - memoizedSerializedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - @java.lang.Override - protected java.lang.Object writeReplace() - throws java.io.ObjectStreamException { - return super.writeReplace(); - } - - public static akka.remote.RemoteProtocol.LifeCycleProtocol parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); - } - public static akka.remote.RemoteProtocol.LifeCycleProtocol parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); - } - public static akka.remote.RemoteProtocol.LifeCycleProtocol parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); - } - public static akka.remote.RemoteProtocol.LifeCycleProtocol parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); - } - public static akka.remote.RemoteProtocol.LifeCycleProtocol parseFrom(java.io.InputStream input) - throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); - } - public static akka.remote.RemoteProtocol.LifeCycleProtocol parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); - } - public static akka.remote.RemoteProtocol.LifeCycleProtocol parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - Builder builder = newBuilder(); - if (builder.mergeDelimitedFrom(input)) { - return builder.buildParsed(); - } else { - return null; - } - } - public static akka.remote.RemoteProtocol.LifeCycleProtocol parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - Builder builder = newBuilder(); - if (builder.mergeDelimitedFrom(input, extensionRegistry)) { - return builder.buildParsed(); - } else { - return null; - } - } - public static akka.remote.RemoteProtocol.LifeCycleProtocol parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); - } - public static akka.remote.RemoteProtocol.LifeCycleProtocol parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); - } - - public static Builder newBuilder() { return Builder.create(); } - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(akka.remote.RemoteProtocol.LifeCycleProtocol prototype) { - return newBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { return newBuilder(this); } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder - implements akka.remote.RemoteProtocol.LifeCycleProtocolOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return akka.remote.RemoteProtocol.internal_static_LifeCycleProtocol_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return akka.remote.RemoteProtocol.internal_static_LifeCycleProtocol_fieldAccessorTable; - } - - // Construct using akka.remote.RemoteProtocol.LifeCycleProtocol.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - } - } - private static Builder create() { - return new Builder(); - } - - public Builder clear() { - super.clear(); - lifeCycle_ = akka.remote.RemoteProtocol.LifeCycleType.PERMANENT; - bitField0_ = (bitField0_ & ~0x00000001); - return this; - } - - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return akka.remote.RemoteProtocol.LifeCycleProtocol.getDescriptor(); - } - - public akka.remote.RemoteProtocol.LifeCycleProtocol getDefaultInstanceForType() { - return akka.remote.RemoteProtocol.LifeCycleProtocol.getDefaultInstance(); - } - - public akka.remote.RemoteProtocol.LifeCycleProtocol build() { - akka.remote.RemoteProtocol.LifeCycleProtocol result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - private akka.remote.RemoteProtocol.LifeCycleProtocol buildParsed() - throws com.google.protobuf.InvalidProtocolBufferException { - akka.remote.RemoteProtocol.LifeCycleProtocol result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException( - result).asInvalidProtocolBufferException(); - } - return result; - } - - public akka.remote.RemoteProtocol.LifeCycleProtocol buildPartial() { - akka.remote.RemoteProtocol.LifeCycleProtocol result = new akka.remote.RemoteProtocol.LifeCycleProtocol(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - result.lifeCycle_ = lifeCycle_; - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof akka.remote.RemoteProtocol.LifeCycleProtocol) { - return mergeFrom((akka.remote.RemoteProtocol.LifeCycleProtocol)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(akka.remote.RemoteProtocol.LifeCycleProtocol other) { - if (other == akka.remote.RemoteProtocol.LifeCycleProtocol.getDefaultInstance()) return this; - if (other.hasLifeCycle()) { - setLifeCycle(other.getLifeCycle()); - } - this.mergeUnknownFields(other.getUnknownFields()); - return this; - } - - public final boolean isInitialized() { - if (!hasLifeCycle()) { - - return false; - } - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder( - this.getUnknownFields()); - while (true) { - int tag = input.readTag(); - switch (tag) { - case 0: - this.setUnknownFields(unknownFields.build()); - onChanged(); - return this; - default: { - if (!parseUnknownField(input, unknownFields, - extensionRegistry, tag)) { - this.setUnknownFields(unknownFields.build()); - onChanged(); - return this; - } - break; - } - case 8: { - int rawValue = input.readEnum(); - akka.remote.RemoteProtocol.LifeCycleType value = akka.remote.RemoteProtocol.LifeCycleType.valueOf(rawValue); - if (value == null) { - unknownFields.mergeVarintField(1, rawValue); - } else { - bitField0_ |= 0x00000001; - lifeCycle_ = value; - } - break; - } - } - } - } - - private int bitField0_; - - // required .LifeCycleType lifeCycle = 1; - private akka.remote.RemoteProtocol.LifeCycleType lifeCycle_ = akka.remote.RemoteProtocol.LifeCycleType.PERMANENT; - public boolean hasLifeCycle() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - public akka.remote.RemoteProtocol.LifeCycleType getLifeCycle() { - return lifeCycle_; - } - public Builder setLifeCycle(akka.remote.RemoteProtocol.LifeCycleType value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000001; - lifeCycle_ = value; - onChanged(); - return this; - } - public Builder clearLifeCycle() { - bitField0_ = (bitField0_ & ~0x00000001); - lifeCycle_ = akka.remote.RemoteProtocol.LifeCycleType.PERMANENT; - onChanged(); - return this; - } - - // @@protoc_insertion_point(builder_scope:LifeCycleProtocol) - } - - static { - defaultInstance = new LifeCycleProtocol(true); - defaultInstance.initFields(); - } - - // @@protoc_insertion_point(class_scope:LifeCycleProtocol) - } - + public interface AddressProtocolOrBuilder extends com.google.protobuf.MessageOrBuilder { - + // required string hostname = 1; boolean hasHostname(); String getHostname(); - + // required uint32 port = 2; boolean hasPort(); int getPort(); @@ -8075,26 +4393,26 @@ public final class RemoteProtocol { super(builder); } private AddressProtocol(boolean noInit) {} - + private static final AddressProtocol defaultInstance; public static AddressProtocol getDefaultInstance() { return defaultInstance; } - + public AddressProtocol getDefaultInstanceForType() { return defaultInstance; } - + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return akka.remote.RemoteProtocol.internal_static_AddressProtocol_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return akka.remote.RemoteProtocol.internal_static_AddressProtocol_fieldAccessorTable; } - + private int bitField0_; // required string hostname = 1; public static final int HOSTNAME_FIELD_NUMBER = 1; @@ -8107,7 +4425,7 @@ public final class RemoteProtocol { if (ref instanceof String) { return (String) ref; } else { - com.google.protobuf.ByteString bs = + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; String s = bs.toStringUtf8(); if (com.google.protobuf.Internal.isValidUtf8(bs)) { @@ -8119,7 +4437,7 @@ public final class RemoteProtocol { private com.google.protobuf.ByteString getHostnameBytes() { java.lang.Object ref = hostname_; if (ref instanceof String) { - com.google.protobuf.ByteString b = + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((String) ref); hostname_ = b; return b; @@ -8127,7 +4445,7 @@ public final class RemoteProtocol { return (com.google.protobuf.ByteString) ref; } } - + // required uint32 port = 2; public static final int PORT_FIELD_NUMBER = 2; private int port_; @@ -8137,7 +4455,7 @@ public final class RemoteProtocol { public int getPort() { return port_; } - + private void initFields() { hostname_ = ""; port_ = 0; @@ -8146,7 +4464,7 @@ public final class RemoteProtocol { public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized != -1) return isInitialized == 1; - + if (!hasHostname()) { memoizedIsInitialized = 0; return false; @@ -8158,7 +4476,7 @@ public final class RemoteProtocol { memoizedIsInitialized = 1; return true; } - + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); @@ -8170,12 +4488,12 @@ public final class RemoteProtocol { } getUnknownFields().writeTo(output); } - + private int memoizedSerializedSize = -1; public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; - + size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream @@ -8189,14 +4507,14 @@ public final class RemoteProtocol { memoizedSerializedSize = size; return size; } - + private static final long serialVersionUID = 0L; @java.lang.Override protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { return super.writeReplace(); } - + public static akka.remote.RemoteProtocol.AddressProtocol parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { @@ -8263,14 +4581,14 @@ public final class RemoteProtocol { return newBuilder().mergeFrom(input, extensionRegistry) .buildParsed(); } - + public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(akka.remote.RemoteProtocol.AddressProtocol prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } - + @java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessage.BuilderParent parent) { @@ -8284,18 +4602,18 @@ public final class RemoteProtocol { getDescriptor() { return akka.remote.RemoteProtocol.internal_static_AddressProtocol_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return akka.remote.RemoteProtocol.internal_static_AddressProtocol_fieldAccessorTable; } - + // Construct using akka.remote.RemoteProtocol.AddressProtocol.newBuilder() private Builder() { maybeForceBuilderInitialization(); } - - private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + + private Builder(BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } @@ -8306,7 +4624,7 @@ public final class RemoteProtocol { private static Builder create() { return new Builder(); } - + public Builder clear() { super.clear(); hostname_ = ""; @@ -8315,20 +4633,20 @@ public final class RemoteProtocol { bitField0_ = (bitField0_ & ~0x00000002); return this; } - + public Builder clone() { return create().mergeFrom(buildPartial()); } - + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return akka.remote.RemoteProtocol.AddressProtocol.getDescriptor(); } - + public akka.remote.RemoteProtocol.AddressProtocol getDefaultInstanceForType() { return akka.remote.RemoteProtocol.AddressProtocol.getDefaultInstance(); } - + public akka.remote.RemoteProtocol.AddressProtocol build() { akka.remote.RemoteProtocol.AddressProtocol result = buildPartial(); if (!result.isInitialized()) { @@ -8336,7 +4654,7 @@ public final class RemoteProtocol { } return result; } - + private akka.remote.RemoteProtocol.AddressProtocol buildParsed() throws com.google.protobuf.InvalidProtocolBufferException { akka.remote.RemoteProtocol.AddressProtocol result = buildPartial(); @@ -8346,7 +4664,7 @@ public final class RemoteProtocol { } return result; } - + public akka.remote.RemoteProtocol.AddressProtocol buildPartial() { akka.remote.RemoteProtocol.AddressProtocol result = new akka.remote.RemoteProtocol.AddressProtocol(this); int from_bitField0_ = bitField0_; @@ -8363,7 +4681,7 @@ public final class RemoteProtocol { onBuilt(); return result; } - + public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof akka.remote.RemoteProtocol.AddressProtocol) { return mergeFrom((akka.remote.RemoteProtocol.AddressProtocol)other); @@ -8372,7 +4690,7 @@ public final class RemoteProtocol { return this; } } - + public Builder mergeFrom(akka.remote.RemoteProtocol.AddressProtocol other) { if (other == akka.remote.RemoteProtocol.AddressProtocol.getDefaultInstance()) return this; if (other.hasHostname()) { @@ -8384,19 +4702,19 @@ public final class RemoteProtocol { this.mergeUnknownFields(other.getUnknownFields()); return this; } - + public final boolean isInitialized() { if (!hasHostname()) { - + return false; } if (!hasPort()) { - + return false; } return true; } - + public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) @@ -8433,9 +4751,9 @@ public final class RemoteProtocol { } } } - + private int bitField0_; - + // required string hostname = 1; private java.lang.Object hostname_ = ""; public boolean hasHostname() { @@ -8471,7 +4789,7 @@ public final class RemoteProtocol { hostname_ = value; onChanged(); } - + // required uint32 port = 2; private int port_ ; public boolean hasPort() { @@ -8492,25 +4810,25 @@ public final class RemoteProtocol { onChanged(); return this; } - + // @@protoc_insertion_point(builder_scope:AddressProtocol) } - + static { defaultInstance = new AddressProtocol(true); defaultInstance.initFields(); } - + // @@protoc_insertion_point(class_scope:AddressProtocol) } - + public interface ExceptionProtocolOrBuilder extends com.google.protobuf.MessageOrBuilder { - + // required string classname = 1; boolean hasClassname(); String getClassname(); - + // required string message = 2; boolean hasMessage(); String getMessage(); @@ -8523,26 +4841,26 @@ public final class RemoteProtocol { super(builder); } private ExceptionProtocol(boolean noInit) {} - + private static final ExceptionProtocol defaultInstance; public static ExceptionProtocol getDefaultInstance() { return defaultInstance; } - + public ExceptionProtocol getDefaultInstanceForType() { return defaultInstance; } - + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return akka.remote.RemoteProtocol.internal_static_ExceptionProtocol_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return akka.remote.RemoteProtocol.internal_static_ExceptionProtocol_fieldAccessorTable; } - + private int bitField0_; // required string classname = 1; public static final int CLASSNAME_FIELD_NUMBER = 1; @@ -8555,7 +4873,7 @@ public final class RemoteProtocol { if (ref instanceof String) { return (String) ref; } else { - com.google.protobuf.ByteString bs = + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; String s = bs.toStringUtf8(); if (com.google.protobuf.Internal.isValidUtf8(bs)) { @@ -8567,7 +4885,7 @@ public final class RemoteProtocol { private com.google.protobuf.ByteString getClassnameBytes() { java.lang.Object ref = classname_; if (ref instanceof String) { - com.google.protobuf.ByteString b = + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((String) ref); classname_ = b; return b; @@ -8575,7 +4893,7 @@ public final class RemoteProtocol { return (com.google.protobuf.ByteString) ref; } } - + // required string message = 2; public static final int MESSAGE_FIELD_NUMBER = 2; private java.lang.Object message_; @@ -8587,7 +4905,7 @@ public final class RemoteProtocol { if (ref instanceof String) { return (String) ref; } else { - com.google.protobuf.ByteString bs = + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; String s = bs.toStringUtf8(); if (com.google.protobuf.Internal.isValidUtf8(bs)) { @@ -8599,7 +4917,7 @@ public final class RemoteProtocol { private com.google.protobuf.ByteString getMessageBytes() { java.lang.Object ref = message_; if (ref instanceof String) { - com.google.protobuf.ByteString b = + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((String) ref); message_ = b; return b; @@ -8607,7 +4925,7 @@ public final class RemoteProtocol { return (com.google.protobuf.ByteString) ref; } } - + private void initFields() { classname_ = ""; message_ = ""; @@ -8616,7 +4934,7 @@ public final class RemoteProtocol { public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized != -1) return isInitialized == 1; - + if (!hasClassname()) { memoizedIsInitialized = 0; return false; @@ -8628,7 +4946,7 @@ public final class RemoteProtocol { memoizedIsInitialized = 1; return true; } - + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); @@ -8640,12 +4958,12 @@ public final class RemoteProtocol { } getUnknownFields().writeTo(output); } - + private int memoizedSerializedSize = -1; public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; - + size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream @@ -8659,14 +4977,14 @@ public final class RemoteProtocol { memoizedSerializedSize = size; return size; } - + private static final long serialVersionUID = 0L; @java.lang.Override protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { return super.writeReplace(); } - + public static akka.remote.RemoteProtocol.ExceptionProtocol parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { @@ -8733,14 +5051,14 @@ public final class RemoteProtocol { return newBuilder().mergeFrom(input, extensionRegistry) .buildParsed(); } - + public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(akka.remote.RemoteProtocol.ExceptionProtocol prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } - + @java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessage.BuilderParent parent) { @@ -8754,18 +5072,18 @@ public final class RemoteProtocol { getDescriptor() { return akka.remote.RemoteProtocol.internal_static_ExceptionProtocol_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return akka.remote.RemoteProtocol.internal_static_ExceptionProtocol_fieldAccessorTable; } - + // Construct using akka.remote.RemoteProtocol.ExceptionProtocol.newBuilder() private Builder() { maybeForceBuilderInitialization(); } - - private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + + private Builder(BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } @@ -8776,7 +5094,7 @@ public final class RemoteProtocol { private static Builder create() { return new Builder(); } - + public Builder clear() { super.clear(); classname_ = ""; @@ -8785,20 +5103,20 @@ public final class RemoteProtocol { bitField0_ = (bitField0_ & ~0x00000002); return this; } - + public Builder clone() { return create().mergeFrom(buildPartial()); } - + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return akka.remote.RemoteProtocol.ExceptionProtocol.getDescriptor(); } - + public akka.remote.RemoteProtocol.ExceptionProtocol getDefaultInstanceForType() { return akka.remote.RemoteProtocol.ExceptionProtocol.getDefaultInstance(); } - + public akka.remote.RemoteProtocol.ExceptionProtocol build() { akka.remote.RemoteProtocol.ExceptionProtocol result = buildPartial(); if (!result.isInitialized()) { @@ -8806,7 +5124,7 @@ public final class RemoteProtocol { } return result; } - + private akka.remote.RemoteProtocol.ExceptionProtocol buildParsed() throws com.google.protobuf.InvalidProtocolBufferException { akka.remote.RemoteProtocol.ExceptionProtocol result = buildPartial(); @@ -8816,7 +5134,7 @@ public final class RemoteProtocol { } return result; } - + public akka.remote.RemoteProtocol.ExceptionProtocol buildPartial() { akka.remote.RemoteProtocol.ExceptionProtocol result = new akka.remote.RemoteProtocol.ExceptionProtocol(this); int from_bitField0_ = bitField0_; @@ -8833,7 +5151,7 @@ public final class RemoteProtocol { onBuilt(); return result; } - + public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof akka.remote.RemoteProtocol.ExceptionProtocol) { return mergeFrom((akka.remote.RemoteProtocol.ExceptionProtocol)other); @@ -8842,7 +5160,7 @@ public final class RemoteProtocol { return this; } } - + public Builder mergeFrom(akka.remote.RemoteProtocol.ExceptionProtocol other) { if (other == akka.remote.RemoteProtocol.ExceptionProtocol.getDefaultInstance()) return this; if (other.hasClassname()) { @@ -8854,19 +5172,19 @@ public final class RemoteProtocol { this.mergeUnknownFields(other.getUnknownFields()); return this; } - + public final boolean isInitialized() { if (!hasClassname()) { - + return false; } if (!hasMessage()) { - + return false; } return true; } - + public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) @@ -8903,9 +5221,9 @@ public final class RemoteProtocol { } } } - + private int bitField0_; - + // required string classname = 1; private java.lang.Object classname_ = ""; public boolean hasClassname() { @@ -8941,7 +5259,7 @@ public final class RemoteProtocol { classname_ = value; onChanged(); } - + // required string message = 2; private java.lang.Object message_ = ""; public boolean hasMessage() { @@ -8977,39 +5295,34 @@ public final class RemoteProtocol { message_ = value; onChanged(); } - + // @@protoc_insertion_point(builder_scope:ExceptionProtocol) } - + static { defaultInstance = new ExceptionProtocol(true); defaultInstance.initFields(); } - + // @@protoc_insertion_point(class_scope:ExceptionProtocol) } - + public interface RemoteSystemDaemonMessageProtocolOrBuilder extends com.google.protobuf.MessageOrBuilder { - + // required .RemoteSystemDaemonMessageType messageType = 1; boolean hasMessageType(); akka.remote.RemoteProtocol.RemoteSystemDaemonMessageType getMessageType(); - - // optional .UuidProtocol actorUuid = 2; - boolean hasActorUuid(); - akka.remote.RemoteProtocol.UuidProtocol getActorUuid(); - akka.remote.RemoteProtocol.UuidProtocolOrBuilder getActorUuidOrBuilder(); - - // optional string actorAddress = 3; + + // optional string actorAddress = 2; boolean hasActorAddress(); String getActorAddress(); - - // optional bytes payload = 5; + + // optional bytes payload = 3; boolean hasPayload(); com.google.protobuf.ByteString getPayload(); - - // optional .UuidProtocol replicateActorFromUuid = 6; + + // optional .UuidProtocol replicateActorFromUuid = 4; boolean hasReplicateActorFromUuid(); akka.remote.RemoteProtocol.UuidProtocol getReplicateActorFromUuid(); akka.remote.RemoteProtocol.UuidProtocolOrBuilder getReplicateActorFromUuidOrBuilder(); @@ -9022,26 +5335,26 @@ public final class RemoteProtocol { super(builder); } private RemoteSystemDaemonMessageProtocol(boolean noInit) {} - + private static final RemoteSystemDaemonMessageProtocol defaultInstance; public static RemoteSystemDaemonMessageProtocol getDefaultInstance() { return defaultInstance; } - + public RemoteSystemDaemonMessageProtocol getDefaultInstanceForType() { return defaultInstance; } - + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return akka.remote.RemoteProtocol.internal_static_RemoteSystemDaemonMessageProtocol_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return akka.remote.RemoteProtocol.internal_static_RemoteSystemDaemonMessageProtocol_fieldAccessorTable; } - + private int bitField0_; // required .RemoteSystemDaemonMessageType messageType = 1; public static final int MESSAGETYPE_FIELD_NUMBER = 1; @@ -9052,32 +5365,19 @@ public final class RemoteProtocol { public akka.remote.RemoteProtocol.RemoteSystemDaemonMessageType getMessageType() { return messageType_; } - - // optional .UuidProtocol actorUuid = 2; - public static final int ACTORUUID_FIELD_NUMBER = 2; - private akka.remote.RemoteProtocol.UuidProtocol actorUuid_; - public boolean hasActorUuid() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - public akka.remote.RemoteProtocol.UuidProtocol getActorUuid() { - return actorUuid_; - } - public akka.remote.RemoteProtocol.UuidProtocolOrBuilder getActorUuidOrBuilder() { - return actorUuid_; - } - - // optional string actorAddress = 3; - public static final int ACTORADDRESS_FIELD_NUMBER = 3; + + // optional string actorAddress = 2; + public static final int ACTORADDRESS_FIELD_NUMBER = 2; private java.lang.Object actorAddress_; public boolean hasActorAddress() { - return ((bitField0_ & 0x00000004) == 0x00000004); + return ((bitField0_ & 0x00000002) == 0x00000002); } public String getActorAddress() { java.lang.Object ref = actorAddress_; if (ref instanceof String) { return (String) ref; } else { - com.google.protobuf.ByteString bs = + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; String s = bs.toStringUtf8(); if (com.google.protobuf.Internal.isValidUtf8(bs)) { @@ -9089,7 +5389,7 @@ public final class RemoteProtocol { private com.google.protobuf.ByteString getActorAddressBytes() { java.lang.Object ref = actorAddress_; if (ref instanceof String) { - com.google.protobuf.ByteString b = + com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((String) ref); actorAddress_ = b; return b; @@ -9097,22 +5397,22 @@ public final class RemoteProtocol { return (com.google.protobuf.ByteString) ref; } } - - // optional bytes payload = 5; - public static final int PAYLOAD_FIELD_NUMBER = 5; + + // optional bytes payload = 3; + public static final int PAYLOAD_FIELD_NUMBER = 3; private com.google.protobuf.ByteString payload_; public boolean hasPayload() { - return ((bitField0_ & 0x00000008) == 0x00000008); + return ((bitField0_ & 0x00000004) == 0x00000004); } public com.google.protobuf.ByteString getPayload() { return payload_; } - - // optional .UuidProtocol replicateActorFromUuid = 6; - public static final int REPLICATEACTORFROMUUID_FIELD_NUMBER = 6; + + // optional .UuidProtocol replicateActorFromUuid = 4; + public static final int REPLICATEACTORFROMUUID_FIELD_NUMBER = 4; private akka.remote.RemoteProtocol.UuidProtocol replicateActorFromUuid_; public boolean hasReplicateActorFromUuid() { - return ((bitField0_ & 0x00000010) == 0x00000010); + return ((bitField0_ & 0x00000008) == 0x00000008); } public akka.remote.RemoteProtocol.UuidProtocol getReplicateActorFromUuid() { return replicateActorFromUuid_; @@ -9120,10 +5420,9 @@ public final class RemoteProtocol { public akka.remote.RemoteProtocol.UuidProtocolOrBuilder getReplicateActorFromUuidOrBuilder() { return replicateActorFromUuid_; } - + private void initFields() { messageType_ = akka.remote.RemoteProtocol.RemoteSystemDaemonMessageType.STOP; - actorUuid_ = akka.remote.RemoteProtocol.UuidProtocol.getDefaultInstance(); actorAddress_ = ""; payload_ = com.google.protobuf.ByteString.EMPTY; replicateActorFromUuid_ = akka.remote.RemoteProtocol.UuidProtocol.getDefaultInstance(); @@ -9132,17 +5431,11 @@ public final class RemoteProtocol { public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized != -1) return isInitialized == 1; - + if (!hasMessageType()) { memoizedIsInitialized = 0; return false; } - if (hasActorUuid()) { - if (!getActorUuid().isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } if (hasReplicateActorFromUuid()) { if (!getReplicateActorFromUuid().isInitialized()) { memoizedIsInitialized = 0; @@ -9152,7 +5445,7 @@ public final class RemoteProtocol { memoizedIsInitialized = 1; return true; } - + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); @@ -9160,25 +5453,22 @@ public final class RemoteProtocol { output.writeEnum(1, messageType_.getNumber()); } if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeMessage(2, actorUuid_); + output.writeBytes(2, getActorAddressBytes()); } if (((bitField0_ & 0x00000004) == 0x00000004)) { - output.writeBytes(3, getActorAddressBytes()); + output.writeBytes(3, payload_); } if (((bitField0_ & 0x00000008) == 0x00000008)) { - output.writeBytes(5, payload_); - } - if (((bitField0_ & 0x00000010) == 0x00000010)) { - output.writeMessage(6, replicateActorFromUuid_); + output.writeMessage(4, replicateActorFromUuid_); } getUnknownFields().writeTo(output); } - + private int memoizedSerializedSize = -1; public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; - + size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream @@ -9186,32 +5476,28 @@ public final class RemoteProtocol { } if (((bitField0_ & 0x00000002) == 0x00000002)) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, actorUuid_); + .computeBytesSize(2, getActorAddressBytes()); } if (((bitField0_ & 0x00000004) == 0x00000004)) { size += com.google.protobuf.CodedOutputStream - .computeBytesSize(3, getActorAddressBytes()); + .computeBytesSize(3, payload_); } if (((bitField0_ & 0x00000008) == 0x00000008)) { size += com.google.protobuf.CodedOutputStream - .computeBytesSize(5, payload_); - } - if (((bitField0_ & 0x00000010) == 0x00000010)) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(6, replicateActorFromUuid_); + .computeMessageSize(4, replicateActorFromUuid_); } size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; return size; } - + private static final long serialVersionUID = 0L; @java.lang.Override protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { return super.writeReplace(); } - + public static akka.remote.RemoteProtocol.RemoteSystemDaemonMessageProtocol parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { @@ -9278,14 +5564,14 @@ public final class RemoteProtocol { return newBuilder().mergeFrom(input, extensionRegistry) .buildParsed(); } - + public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(akka.remote.RemoteProtocol.RemoteSystemDaemonMessageProtocol prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } - + @java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessage.BuilderParent parent) { @@ -9299,67 +5585,60 @@ public final class RemoteProtocol { getDescriptor() { return akka.remote.RemoteProtocol.internal_static_RemoteSystemDaemonMessageProtocol_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return akka.remote.RemoteProtocol.internal_static_RemoteSystemDaemonMessageProtocol_fieldAccessorTable; } - + // Construct using akka.remote.RemoteProtocol.RemoteSystemDaemonMessageProtocol.newBuilder() private Builder() { maybeForceBuilderInitialization(); } - - private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + + private Builder(BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - getActorUuidFieldBuilder(); getReplicateActorFromUuidFieldBuilder(); } } private static Builder create() { return new Builder(); } - + public Builder clear() { super.clear(); messageType_ = akka.remote.RemoteProtocol.RemoteSystemDaemonMessageType.STOP; bitField0_ = (bitField0_ & ~0x00000001); - if (actorUuidBuilder_ == null) { - actorUuid_ = akka.remote.RemoteProtocol.UuidProtocol.getDefaultInstance(); - } else { - actorUuidBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000002); actorAddress_ = ""; - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000002); payload_ = com.google.protobuf.ByteString.EMPTY; - bitField0_ = (bitField0_ & ~0x00000008); + bitField0_ = (bitField0_ & ~0x00000004); if (replicateActorFromUuidBuilder_ == null) { replicateActorFromUuid_ = akka.remote.RemoteProtocol.UuidProtocol.getDefaultInstance(); } else { replicateActorFromUuidBuilder_.clear(); } - bitField0_ = (bitField0_ & ~0x00000010); + bitField0_ = (bitField0_ & ~0x00000008); return this; } - + public Builder clone() { return create().mergeFrom(buildPartial()); } - + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return akka.remote.RemoteProtocol.RemoteSystemDaemonMessageProtocol.getDescriptor(); } - + public akka.remote.RemoteProtocol.RemoteSystemDaemonMessageProtocol getDefaultInstanceForType() { return akka.remote.RemoteProtocol.RemoteSystemDaemonMessageProtocol.getDefaultInstance(); } - + public akka.remote.RemoteProtocol.RemoteSystemDaemonMessageProtocol build() { akka.remote.RemoteProtocol.RemoteSystemDaemonMessageProtocol result = buildPartial(); if (!result.isInitialized()) { @@ -9367,7 +5646,7 @@ public final class RemoteProtocol { } return result; } - + private akka.remote.RemoteProtocol.RemoteSystemDaemonMessageProtocol buildParsed() throws com.google.protobuf.InvalidProtocolBufferException { akka.remote.RemoteProtocol.RemoteSystemDaemonMessageProtocol result = buildPartial(); @@ -9377,7 +5656,7 @@ public final class RemoteProtocol { } return result; } - + public akka.remote.RemoteProtocol.RemoteSystemDaemonMessageProtocol buildPartial() { akka.remote.RemoteProtocol.RemoteSystemDaemonMessageProtocol result = new akka.remote.RemoteProtocol.RemoteSystemDaemonMessageProtocol(this); int from_bitField0_ = bitField0_; @@ -9389,22 +5668,14 @@ public final class RemoteProtocol { if (((from_bitField0_ & 0x00000002) == 0x00000002)) { to_bitField0_ |= 0x00000002; } - if (actorUuidBuilder_ == null) { - result.actorUuid_ = actorUuid_; - } else { - result.actorUuid_ = actorUuidBuilder_.build(); - } + result.actorAddress_ = actorAddress_; if (((from_bitField0_ & 0x00000004) == 0x00000004)) { to_bitField0_ |= 0x00000004; } - result.actorAddress_ = actorAddress_; + result.payload_ = payload_; if (((from_bitField0_ & 0x00000008) == 0x00000008)) { to_bitField0_ |= 0x00000008; } - result.payload_ = payload_; - if (((from_bitField0_ & 0x00000010) == 0x00000010)) { - to_bitField0_ |= 0x00000010; - } if (replicateActorFromUuidBuilder_ == null) { result.replicateActorFromUuid_ = replicateActorFromUuid_; } else { @@ -9414,7 +5685,7 @@ public final class RemoteProtocol { onBuilt(); return result; } - + public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof akka.remote.RemoteProtocol.RemoteSystemDaemonMessageProtocol) { return mergeFrom((akka.remote.RemoteProtocol.RemoteSystemDaemonMessageProtocol)other); @@ -9423,15 +5694,12 @@ public final class RemoteProtocol { return this; } } - + public Builder mergeFrom(akka.remote.RemoteProtocol.RemoteSystemDaemonMessageProtocol other) { if (other == akka.remote.RemoteProtocol.RemoteSystemDaemonMessageProtocol.getDefaultInstance()) return this; if (other.hasMessageType()) { setMessageType(other.getMessageType()); } - if (other.hasActorUuid()) { - mergeActorUuid(other.getActorUuid()); - } if (other.hasActorAddress()) { setActorAddress(other.getActorAddress()); } @@ -9444,27 +5712,21 @@ public final class RemoteProtocol { this.mergeUnknownFields(other.getUnknownFields()); return this; } - + public final boolean isInitialized() { if (!hasMessageType()) { - + return false; } - if (hasActorUuid()) { - if (!getActorUuid().isInitialized()) { - - return false; - } - } if (hasReplicateActorFromUuid()) { if (!getReplicateActorFromUuid().isInitialized()) { - + return false; } } return true; } - + public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) @@ -9500,25 +5762,16 @@ public final class RemoteProtocol { break; } case 18: { - akka.remote.RemoteProtocol.UuidProtocol.Builder subBuilder = akka.remote.RemoteProtocol.UuidProtocol.newBuilder(); - if (hasActorUuid()) { - subBuilder.mergeFrom(getActorUuid()); - } - input.readMessage(subBuilder, extensionRegistry); - setActorUuid(subBuilder.buildPartial()); + bitField0_ |= 0x00000002; + actorAddress_ = input.readBytes(); break; } case 26: { bitField0_ |= 0x00000004; - actorAddress_ = input.readBytes(); - break; - } - case 42: { - bitField0_ |= 0x00000008; payload_ = input.readBytes(); break; } - case 50: { + case 34: { akka.remote.RemoteProtocol.UuidProtocol.Builder subBuilder = akka.remote.RemoteProtocol.UuidProtocol.newBuilder(); if (hasReplicateActorFromUuid()) { subBuilder.mergeFrom(getReplicateActorFromUuid()); @@ -9530,9 +5783,9 @@ public final class RemoteProtocol { } } } - + private int bitField0_; - + // required .RemoteSystemDaemonMessageType messageType = 1; private akka.remote.RemoteProtocol.RemoteSystemDaemonMessageType messageType_ = akka.remote.RemoteProtocol.RemoteSystemDaemonMessageType.STOP; public boolean hasMessageType() { @@ -9556,101 +5809,11 @@ public final class RemoteProtocol { onChanged(); return this; } - - // optional .UuidProtocol actorUuid = 2; - private akka.remote.RemoteProtocol.UuidProtocol actorUuid_ = akka.remote.RemoteProtocol.UuidProtocol.getDefaultInstance(); - private com.google.protobuf.SingleFieldBuilder< - akka.remote.RemoteProtocol.UuidProtocol, akka.remote.RemoteProtocol.UuidProtocol.Builder, akka.remote.RemoteProtocol.UuidProtocolOrBuilder> actorUuidBuilder_; - public boolean hasActorUuid() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - public akka.remote.RemoteProtocol.UuidProtocol getActorUuid() { - if (actorUuidBuilder_ == null) { - return actorUuid_; - } else { - return actorUuidBuilder_.getMessage(); - } - } - public Builder setActorUuid(akka.remote.RemoteProtocol.UuidProtocol value) { - if (actorUuidBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - actorUuid_ = value; - onChanged(); - } else { - actorUuidBuilder_.setMessage(value); - } - bitField0_ |= 0x00000002; - return this; - } - public Builder setActorUuid( - akka.remote.RemoteProtocol.UuidProtocol.Builder builderForValue) { - if (actorUuidBuilder_ == null) { - actorUuid_ = builderForValue.build(); - onChanged(); - } else { - actorUuidBuilder_.setMessage(builderForValue.build()); - } - bitField0_ |= 0x00000002; - return this; - } - public Builder mergeActorUuid(akka.remote.RemoteProtocol.UuidProtocol value) { - if (actorUuidBuilder_ == null) { - if (((bitField0_ & 0x00000002) == 0x00000002) && - actorUuid_ != akka.remote.RemoteProtocol.UuidProtocol.getDefaultInstance()) { - actorUuid_ = - akka.remote.RemoteProtocol.UuidProtocol.newBuilder(actorUuid_).mergeFrom(value).buildPartial(); - } else { - actorUuid_ = value; - } - onChanged(); - } else { - actorUuidBuilder_.mergeFrom(value); - } - bitField0_ |= 0x00000002; - return this; - } - public Builder clearActorUuid() { - if (actorUuidBuilder_ == null) { - actorUuid_ = akka.remote.RemoteProtocol.UuidProtocol.getDefaultInstance(); - onChanged(); - } else { - actorUuidBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000002); - return this; - } - public akka.remote.RemoteProtocol.UuidProtocol.Builder getActorUuidBuilder() { - bitField0_ |= 0x00000002; - onChanged(); - return getActorUuidFieldBuilder().getBuilder(); - } - public akka.remote.RemoteProtocol.UuidProtocolOrBuilder getActorUuidOrBuilder() { - if (actorUuidBuilder_ != null) { - return actorUuidBuilder_.getMessageOrBuilder(); - } else { - return actorUuid_; - } - } - private com.google.protobuf.SingleFieldBuilder< - akka.remote.RemoteProtocol.UuidProtocol, akka.remote.RemoteProtocol.UuidProtocol.Builder, akka.remote.RemoteProtocol.UuidProtocolOrBuilder> - getActorUuidFieldBuilder() { - if (actorUuidBuilder_ == null) { - actorUuidBuilder_ = new com.google.protobuf.SingleFieldBuilder< - akka.remote.RemoteProtocol.UuidProtocol, akka.remote.RemoteProtocol.UuidProtocol.Builder, akka.remote.RemoteProtocol.UuidProtocolOrBuilder>( - actorUuid_, - getParentForChildren(), - isClean()); - actorUuid_ = null; - } - return actorUuidBuilder_; - } - - // optional string actorAddress = 3; + + // optional string actorAddress = 2; private java.lang.Object actorAddress_ = ""; public boolean hasActorAddress() { - return ((bitField0_ & 0x00000004) == 0x00000004); + return ((bitField0_ & 0x00000002) == 0x00000002); } public String getActorAddress() { java.lang.Object ref = actorAddress_; @@ -9666,27 +5829,27 @@ public final class RemoteProtocol { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000004; + bitField0_ |= 0x00000002; actorAddress_ = value; onChanged(); return this; } public Builder clearActorAddress() { - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000002); actorAddress_ = getDefaultInstance().getActorAddress(); onChanged(); return this; } void setActorAddress(com.google.protobuf.ByteString value) { - bitField0_ |= 0x00000004; + bitField0_ |= 0x00000002; actorAddress_ = value; onChanged(); } - - // optional bytes payload = 5; + + // optional bytes payload = 3; private com.google.protobuf.ByteString payload_ = com.google.protobuf.ByteString.EMPTY; public boolean hasPayload() { - return ((bitField0_ & 0x00000008) == 0x00000008); + return ((bitField0_ & 0x00000004) == 0x00000004); } public com.google.protobuf.ByteString getPayload() { return payload_; @@ -9695,24 +5858,24 @@ public final class RemoteProtocol { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000008; + bitField0_ |= 0x00000004; payload_ = value; onChanged(); return this; } public Builder clearPayload() { - bitField0_ = (bitField0_ & ~0x00000008); + bitField0_ = (bitField0_ & ~0x00000004); payload_ = getDefaultInstance().getPayload(); onChanged(); return this; } - - // optional .UuidProtocol replicateActorFromUuid = 6; + + // optional .UuidProtocol replicateActorFromUuid = 4; private akka.remote.RemoteProtocol.UuidProtocol replicateActorFromUuid_ = akka.remote.RemoteProtocol.UuidProtocol.getDefaultInstance(); private com.google.protobuf.SingleFieldBuilder< akka.remote.RemoteProtocol.UuidProtocol, akka.remote.RemoteProtocol.UuidProtocol.Builder, akka.remote.RemoteProtocol.UuidProtocolOrBuilder> replicateActorFromUuidBuilder_; public boolean hasReplicateActorFromUuid() { - return ((bitField0_ & 0x00000010) == 0x00000010); + return ((bitField0_ & 0x00000008) == 0x00000008); } public akka.remote.RemoteProtocol.UuidProtocol getReplicateActorFromUuid() { if (replicateActorFromUuidBuilder_ == null) { @@ -9731,7 +5894,7 @@ public final class RemoteProtocol { } else { replicateActorFromUuidBuilder_.setMessage(value); } - bitField0_ |= 0x00000010; + bitField0_ |= 0x00000008; return this; } public Builder setReplicateActorFromUuid( @@ -9742,12 +5905,12 @@ public final class RemoteProtocol { } else { replicateActorFromUuidBuilder_.setMessage(builderForValue.build()); } - bitField0_ |= 0x00000010; + bitField0_ |= 0x00000008; return this; } public Builder mergeReplicateActorFromUuid(akka.remote.RemoteProtocol.UuidProtocol value) { if (replicateActorFromUuidBuilder_ == null) { - if (((bitField0_ & 0x00000010) == 0x00000010) && + if (((bitField0_ & 0x00000008) == 0x00000008) && replicateActorFromUuid_ != akka.remote.RemoteProtocol.UuidProtocol.getDefaultInstance()) { replicateActorFromUuid_ = akka.remote.RemoteProtocol.UuidProtocol.newBuilder(replicateActorFromUuid_).mergeFrom(value).buildPartial(); @@ -9758,7 +5921,7 @@ public final class RemoteProtocol { } else { replicateActorFromUuidBuilder_.mergeFrom(value); } - bitField0_ |= 0x00000010; + bitField0_ |= 0x00000008; return this; } public Builder clearReplicateActorFromUuid() { @@ -9768,11 +5931,11 @@ public final class RemoteProtocol { } else { replicateActorFromUuidBuilder_.clear(); } - bitField0_ = (bitField0_ & ~0x00000010); + bitField0_ = (bitField0_ & ~0x00000008); return this; } public akka.remote.RemoteProtocol.UuidProtocol.Builder getReplicateActorFromUuidBuilder() { - bitField0_ |= 0x00000010; + bitField0_ |= 0x00000008; onChanged(); return getReplicateActorFromUuidFieldBuilder().getBuilder(); } @@ -9784,7 +5947,7 @@ public final class RemoteProtocol { } } private com.google.protobuf.SingleFieldBuilder< - akka.remote.RemoteProtocol.UuidProtocol, akka.remote.RemoteProtocol.UuidProtocol.Builder, akka.remote.RemoteProtocol.UuidProtocolOrBuilder> + akka.remote.RemoteProtocol.UuidProtocol, akka.remote.RemoteProtocol.UuidProtocol.Builder, akka.remote.RemoteProtocol.UuidProtocolOrBuilder> getReplicateActorFromUuidFieldBuilder() { if (replicateActorFromUuidBuilder_ == null) { replicateActorFromUuidBuilder_ = new com.google.protobuf.SingleFieldBuilder< @@ -9796,35 +5959,32 @@ public final class RemoteProtocol { } return replicateActorFromUuidBuilder_; } - + // @@protoc_insertion_point(builder_scope:RemoteSystemDaemonMessageProtocol) } - + static { defaultInstance = new RemoteSystemDaemonMessageProtocol(true); defaultInstance.initFields(); } - + // @@protoc_insertion_point(class_scope:RemoteSystemDaemonMessageProtocol) } - + public interface DurableMailboxMessageProtocolOrBuilder extends com.google.protobuf.MessageOrBuilder { - - // required string ownerActorAddress = 1; - boolean hasOwnerActorAddress(); - String getOwnerActorAddress(); - - // optional string senderActorAddress = 2; - boolean hasSenderActorAddress(); - String getSenderActorAddress(); - - // optional .UuidProtocol futureUuid = 3; - boolean hasFutureUuid(); - akka.remote.RemoteProtocol.UuidProtocol getFutureUuid(); - akka.remote.RemoteProtocol.UuidProtocolOrBuilder getFutureUuidOrBuilder(); - - // required bytes message = 4; + + // required .ActorRefProtocol recipient = 1; + boolean hasRecipient(); + akka.remote.RemoteProtocol.ActorRefProtocol getRecipient(); + akka.remote.RemoteProtocol.ActorRefProtocolOrBuilder getRecipientOrBuilder(); + + // optional .ActorRefProtocol sender = 2; + boolean hasSender(); + akka.remote.RemoteProtocol.ActorRefProtocol getSender(); + akka.remote.RemoteProtocol.ActorRefProtocolOrBuilder getSenderOrBuilder(); + + // required bytes message = 3; boolean hasMessage(); com.google.protobuf.ByteString getMessage(); } @@ -9836,126 +5996,74 @@ public final class RemoteProtocol { super(builder); } private DurableMailboxMessageProtocol(boolean noInit) {} - + private static final DurableMailboxMessageProtocol defaultInstance; public static DurableMailboxMessageProtocol getDefaultInstance() { return defaultInstance; } - + public DurableMailboxMessageProtocol getDefaultInstanceForType() { return defaultInstance; } - + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return akka.remote.RemoteProtocol.internal_static_DurableMailboxMessageProtocol_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return akka.remote.RemoteProtocol.internal_static_DurableMailboxMessageProtocol_fieldAccessorTable; } - + private int bitField0_; - // required string ownerActorAddress = 1; - public static final int OWNERACTORADDRESS_FIELD_NUMBER = 1; - private java.lang.Object ownerActorAddress_; - public boolean hasOwnerActorAddress() { + // required .ActorRefProtocol recipient = 1; + public static final int RECIPIENT_FIELD_NUMBER = 1; + private akka.remote.RemoteProtocol.ActorRefProtocol recipient_; + public boolean hasRecipient() { return ((bitField0_ & 0x00000001) == 0x00000001); } - public String getOwnerActorAddress() { - java.lang.Object ref = ownerActorAddress_; - if (ref instanceof String) { - return (String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - if (com.google.protobuf.Internal.isValidUtf8(bs)) { - ownerActorAddress_ = s; - } - return s; - } + public akka.remote.RemoteProtocol.ActorRefProtocol getRecipient() { + return recipient_; } - private com.google.protobuf.ByteString getOwnerActorAddressBytes() { - java.lang.Object ref = ownerActorAddress_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((String) ref); - ownerActorAddress_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } + public akka.remote.RemoteProtocol.ActorRefProtocolOrBuilder getRecipientOrBuilder() { + return recipient_; } - - // optional string senderActorAddress = 2; - public static final int SENDERACTORADDRESS_FIELD_NUMBER = 2; - private java.lang.Object senderActorAddress_; - public boolean hasSenderActorAddress() { + + // optional .ActorRefProtocol sender = 2; + public static final int SENDER_FIELD_NUMBER = 2; + private akka.remote.RemoteProtocol.ActorRefProtocol sender_; + public boolean hasSender() { return ((bitField0_ & 0x00000002) == 0x00000002); } - public String getSenderActorAddress() { - java.lang.Object ref = senderActorAddress_; - if (ref instanceof String) { - return (String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - if (com.google.protobuf.Internal.isValidUtf8(bs)) { - senderActorAddress_ = s; - } - return s; - } + public akka.remote.RemoteProtocol.ActorRefProtocol getSender() { + return sender_; } - private com.google.protobuf.ByteString getSenderActorAddressBytes() { - java.lang.Object ref = senderActorAddress_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((String) ref); - senderActorAddress_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } + public akka.remote.RemoteProtocol.ActorRefProtocolOrBuilder getSenderOrBuilder() { + return sender_; } - - // optional .UuidProtocol futureUuid = 3; - public static final int FUTUREUUID_FIELD_NUMBER = 3; - private akka.remote.RemoteProtocol.UuidProtocol futureUuid_; - public boolean hasFutureUuid() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - public akka.remote.RemoteProtocol.UuidProtocol getFutureUuid() { - return futureUuid_; - } - public akka.remote.RemoteProtocol.UuidProtocolOrBuilder getFutureUuidOrBuilder() { - return futureUuid_; - } - - // required bytes message = 4; - public static final int MESSAGE_FIELD_NUMBER = 4; + + // required bytes message = 3; + public static final int MESSAGE_FIELD_NUMBER = 3; private com.google.protobuf.ByteString message_; public boolean hasMessage() { - return ((bitField0_ & 0x00000008) == 0x00000008); + return ((bitField0_ & 0x00000004) == 0x00000004); } public com.google.protobuf.ByteString getMessage() { return message_; } - + private void initFields() { - ownerActorAddress_ = ""; - senderActorAddress_ = ""; - futureUuid_ = akka.remote.RemoteProtocol.UuidProtocol.getDefaultInstance(); + recipient_ = akka.remote.RemoteProtocol.ActorRefProtocol.getDefaultInstance(); + sender_ = akka.remote.RemoteProtocol.ActorRefProtocol.getDefaultInstance(); message_ = com.google.protobuf.ByteString.EMPTY; } private byte memoizedIsInitialized = -1; public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized != -1) return isInitialized == 1; - - if (!hasOwnerActorAddress()) { + + if (!hasRecipient()) { memoizedIsInitialized = 0; return false; } @@ -9963,8 +6071,12 @@ public final class RemoteProtocol { memoizedIsInitialized = 0; return false; } - if (hasFutureUuid()) { - if (!getFutureUuid().isInitialized()) { + if (!getRecipient().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + if (hasSender()) { + if (!getSender().isInitialized()) { memoizedIsInitialized = 0; return false; } @@ -9972,59 +6084,52 @@ public final class RemoteProtocol { memoizedIsInitialized = 1; return true; } - + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeBytes(1, getOwnerActorAddressBytes()); + output.writeMessage(1, recipient_); } if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeBytes(2, getSenderActorAddressBytes()); + output.writeMessage(2, sender_); } if (((bitField0_ & 0x00000004) == 0x00000004)) { - output.writeMessage(3, futureUuid_); - } - if (((bitField0_ & 0x00000008) == 0x00000008)) { - output.writeBytes(4, message_); + output.writeBytes(3, message_); } getUnknownFields().writeTo(output); } - + private int memoizedSerializedSize = -1; public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; - + size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream - .computeBytesSize(1, getOwnerActorAddressBytes()); + .computeMessageSize(1, recipient_); } if (((bitField0_ & 0x00000002) == 0x00000002)) { size += com.google.protobuf.CodedOutputStream - .computeBytesSize(2, getSenderActorAddressBytes()); + .computeMessageSize(2, sender_); } if (((bitField0_ & 0x00000004) == 0x00000004)) { size += com.google.protobuf.CodedOutputStream - .computeMessageSize(3, futureUuid_); - } - if (((bitField0_ & 0x00000008) == 0x00000008)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(4, message_); + .computeBytesSize(3, message_); } size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; return size; } - + private static final long serialVersionUID = 0L; @java.lang.Override protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { return super.writeReplace(); } - + public static akka.remote.RemoteProtocol.DurableMailboxMessageProtocol parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { @@ -10091,14 +6196,14 @@ public final class RemoteProtocol { return newBuilder().mergeFrom(input, extensionRegistry) .buildParsed(); } - + public static Builder newBuilder() { return Builder.create(); } public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder(akka.remote.RemoteProtocol.DurableMailboxMessageProtocol prototype) { return newBuilder().mergeFrom(prototype); } public Builder toBuilder() { return newBuilder(this); } - + @java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessage.BuilderParent parent) { @@ -10112,60 +6217,63 @@ public final class RemoteProtocol { getDescriptor() { return akka.remote.RemoteProtocol.internal_static_DurableMailboxMessageProtocol_descriptor; } - + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return akka.remote.RemoteProtocol.internal_static_DurableMailboxMessageProtocol_fieldAccessorTable; } - + // Construct using akka.remote.RemoteProtocol.DurableMailboxMessageProtocol.newBuilder() private Builder() { maybeForceBuilderInitialization(); } - - private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { + + private Builder(BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - getFutureUuidFieldBuilder(); + getRecipientFieldBuilder(); + getSenderFieldBuilder(); } } private static Builder create() { return new Builder(); } - + public Builder clear() { super.clear(); - ownerActorAddress_ = ""; - bitField0_ = (bitField0_ & ~0x00000001); - senderActorAddress_ = ""; - bitField0_ = (bitField0_ & ~0x00000002); - if (futureUuidBuilder_ == null) { - futureUuid_ = akka.remote.RemoteProtocol.UuidProtocol.getDefaultInstance(); + if (recipientBuilder_ == null) { + recipient_ = akka.remote.RemoteProtocol.ActorRefProtocol.getDefaultInstance(); } else { - futureUuidBuilder_.clear(); + recipientBuilder_.clear(); } - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000001); + if (senderBuilder_ == null) { + sender_ = akka.remote.RemoteProtocol.ActorRefProtocol.getDefaultInstance(); + } else { + senderBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); message_ = com.google.protobuf.ByteString.EMPTY; - bitField0_ = (bitField0_ & ~0x00000008); + bitField0_ = (bitField0_ & ~0x00000004); return this; } - + public Builder clone() { return create().mergeFrom(buildPartial()); } - + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return akka.remote.RemoteProtocol.DurableMailboxMessageProtocol.getDescriptor(); } - + public akka.remote.RemoteProtocol.DurableMailboxMessageProtocol getDefaultInstanceForType() { return akka.remote.RemoteProtocol.DurableMailboxMessageProtocol.getDefaultInstance(); } - + public akka.remote.RemoteProtocol.DurableMailboxMessageProtocol build() { akka.remote.RemoteProtocol.DurableMailboxMessageProtocol result = buildPartial(); if (!result.isInitialized()) { @@ -10173,7 +6281,7 @@ public final class RemoteProtocol { } return result; } - + private akka.remote.RemoteProtocol.DurableMailboxMessageProtocol buildParsed() throws com.google.protobuf.InvalidProtocolBufferException { akka.remote.RemoteProtocol.DurableMailboxMessageProtocol result = buildPartial(); @@ -10183,7 +6291,7 @@ public final class RemoteProtocol { } return result; } - + public akka.remote.RemoteProtocol.DurableMailboxMessageProtocol buildPartial() { akka.remote.RemoteProtocol.DurableMailboxMessageProtocol result = new akka.remote.RemoteProtocol.DurableMailboxMessageProtocol(this); int from_bitField0_ = bitField0_; @@ -10191,28 +6299,28 @@ public final class RemoteProtocol { if (((from_bitField0_ & 0x00000001) == 0x00000001)) { to_bitField0_ |= 0x00000001; } - result.ownerActorAddress_ = ownerActorAddress_; + if (recipientBuilder_ == null) { + result.recipient_ = recipient_; + } else { + result.recipient_ = recipientBuilder_.build(); + } if (((from_bitField0_ & 0x00000002) == 0x00000002)) { to_bitField0_ |= 0x00000002; } - result.senderActorAddress_ = senderActorAddress_; + if (senderBuilder_ == null) { + result.sender_ = sender_; + } else { + result.sender_ = senderBuilder_.build(); + } if (((from_bitField0_ & 0x00000004) == 0x00000004)) { to_bitField0_ |= 0x00000004; } - if (futureUuidBuilder_ == null) { - result.futureUuid_ = futureUuid_; - } else { - result.futureUuid_ = futureUuidBuilder_.build(); - } - if (((from_bitField0_ & 0x00000008) == 0x00000008)) { - to_bitField0_ |= 0x00000008; - } result.message_ = message_; result.bitField0_ = to_bitField0_; onBuilt(); return result; } - + public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof akka.remote.RemoteProtocol.DurableMailboxMessageProtocol) { return mergeFrom((akka.remote.RemoteProtocol.DurableMailboxMessageProtocol)other); @@ -10221,17 +6329,14 @@ public final class RemoteProtocol { return this; } } - + public Builder mergeFrom(akka.remote.RemoteProtocol.DurableMailboxMessageProtocol other) { if (other == akka.remote.RemoteProtocol.DurableMailboxMessageProtocol.getDefaultInstance()) return this; - if (other.hasOwnerActorAddress()) { - setOwnerActorAddress(other.getOwnerActorAddress()); + if (other.hasRecipient()) { + mergeRecipient(other.getRecipient()); } - if (other.hasSenderActorAddress()) { - setSenderActorAddress(other.getSenderActorAddress()); - } - if (other.hasFutureUuid()) { - mergeFutureUuid(other.getFutureUuid()); + if (other.hasSender()) { + mergeSender(other.getSender()); } if (other.hasMessage()) { setMessage(other.getMessage()); @@ -10239,25 +6344,29 @@ public final class RemoteProtocol { this.mergeUnknownFields(other.getUnknownFields()); return this; } - + public final boolean isInitialized() { - if (!hasOwnerActorAddress()) { - + if (!hasRecipient()) { + return false; } if (!hasMessage()) { - + return false; } - if (hasFutureUuid()) { - if (!getFutureUuid().isInitialized()) { - + if (!getRecipient().isInitialized()) { + + return false; + } + if (hasSender()) { + if (!getSender().isInitialized()) { + return false; } } return true; } - + public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) @@ -10282,201 +6391,218 @@ public final class RemoteProtocol { break; } case 10: { - bitField0_ |= 0x00000001; - ownerActorAddress_ = input.readBytes(); + akka.remote.RemoteProtocol.ActorRefProtocol.Builder subBuilder = akka.remote.RemoteProtocol.ActorRefProtocol.newBuilder(); + if (hasRecipient()) { + subBuilder.mergeFrom(getRecipient()); + } + input.readMessage(subBuilder, extensionRegistry); + setRecipient(subBuilder.buildPartial()); break; } case 18: { - bitField0_ |= 0x00000002; - senderActorAddress_ = input.readBytes(); + akka.remote.RemoteProtocol.ActorRefProtocol.Builder subBuilder = akka.remote.RemoteProtocol.ActorRefProtocol.newBuilder(); + if (hasSender()) { + subBuilder.mergeFrom(getSender()); + } + input.readMessage(subBuilder, extensionRegistry); + setSender(subBuilder.buildPartial()); break; } case 26: { - akka.remote.RemoteProtocol.UuidProtocol.Builder subBuilder = akka.remote.RemoteProtocol.UuidProtocol.newBuilder(); - if (hasFutureUuid()) { - subBuilder.mergeFrom(getFutureUuid()); - } - input.readMessage(subBuilder, extensionRegistry); - setFutureUuid(subBuilder.buildPartial()); - break; - } - case 34: { - bitField0_ |= 0x00000008; + bitField0_ |= 0x00000004; message_ = input.readBytes(); break; } } } } - + private int bitField0_; - - // required string ownerActorAddress = 1; - private java.lang.Object ownerActorAddress_ = ""; - public boolean hasOwnerActorAddress() { + + // required .ActorRefProtocol recipient = 1; + private akka.remote.RemoteProtocol.ActorRefProtocol recipient_ = akka.remote.RemoteProtocol.ActorRefProtocol.getDefaultInstance(); + private com.google.protobuf.SingleFieldBuilder< + akka.remote.RemoteProtocol.ActorRefProtocol, akka.remote.RemoteProtocol.ActorRefProtocol.Builder, akka.remote.RemoteProtocol.ActorRefProtocolOrBuilder> recipientBuilder_; + public boolean hasRecipient() { return ((bitField0_ & 0x00000001) == 0x00000001); } - public String getOwnerActorAddress() { - java.lang.Object ref = ownerActorAddress_; - if (!(ref instanceof String)) { - String s = ((com.google.protobuf.ByteString) ref).toStringUtf8(); - ownerActorAddress_ = s; - return s; + public akka.remote.RemoteProtocol.ActorRefProtocol getRecipient() { + if (recipientBuilder_ == null) { + return recipient_; } else { - return (String) ref; + return recipientBuilder_.getMessage(); } } - public Builder setOwnerActorAddress(String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000001; - ownerActorAddress_ = value; - onChanged(); - return this; - } - public Builder clearOwnerActorAddress() { - bitField0_ = (bitField0_ & ~0x00000001); - ownerActorAddress_ = getDefaultInstance().getOwnerActorAddress(); - onChanged(); - return this; - } - void setOwnerActorAddress(com.google.protobuf.ByteString value) { - bitField0_ |= 0x00000001; - ownerActorAddress_ = value; - onChanged(); - } - - // optional string senderActorAddress = 2; - private java.lang.Object senderActorAddress_ = ""; - public boolean hasSenderActorAddress() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - public String getSenderActorAddress() { - java.lang.Object ref = senderActorAddress_; - if (!(ref instanceof String)) { - String s = ((com.google.protobuf.ByteString) ref).toStringUtf8(); - senderActorAddress_ = s; - return s; - } else { - return (String) ref; - } - } - public Builder setSenderActorAddress(String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000002; - senderActorAddress_ = value; - onChanged(); - return this; - } - public Builder clearSenderActorAddress() { - bitField0_ = (bitField0_ & ~0x00000002); - senderActorAddress_ = getDefaultInstance().getSenderActorAddress(); - onChanged(); - return this; - } - void setSenderActorAddress(com.google.protobuf.ByteString value) { - bitField0_ |= 0x00000002; - senderActorAddress_ = value; - onChanged(); - } - - // optional .UuidProtocol futureUuid = 3; - private akka.remote.RemoteProtocol.UuidProtocol futureUuid_ = akka.remote.RemoteProtocol.UuidProtocol.getDefaultInstance(); - private com.google.protobuf.SingleFieldBuilder< - akka.remote.RemoteProtocol.UuidProtocol, akka.remote.RemoteProtocol.UuidProtocol.Builder, akka.remote.RemoteProtocol.UuidProtocolOrBuilder> futureUuidBuilder_; - public boolean hasFutureUuid() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - public akka.remote.RemoteProtocol.UuidProtocol getFutureUuid() { - if (futureUuidBuilder_ == null) { - return futureUuid_; - } else { - return futureUuidBuilder_.getMessage(); - } - } - public Builder setFutureUuid(akka.remote.RemoteProtocol.UuidProtocol value) { - if (futureUuidBuilder_ == null) { + public Builder setRecipient(akka.remote.RemoteProtocol.ActorRefProtocol value) { + if (recipientBuilder_ == null) { if (value == null) { throw new NullPointerException(); } - futureUuid_ = value; + recipient_ = value; onChanged(); } else { - futureUuidBuilder_.setMessage(value); + recipientBuilder_.setMessage(value); } - bitField0_ |= 0x00000004; + bitField0_ |= 0x00000001; return this; } - public Builder setFutureUuid( - akka.remote.RemoteProtocol.UuidProtocol.Builder builderForValue) { - if (futureUuidBuilder_ == null) { - futureUuid_ = builderForValue.build(); + public Builder setRecipient( + akka.remote.RemoteProtocol.ActorRefProtocol.Builder builderForValue) { + if (recipientBuilder_ == null) { + recipient_ = builderForValue.build(); onChanged(); } else { - futureUuidBuilder_.setMessage(builderForValue.build()); + recipientBuilder_.setMessage(builderForValue.build()); } - bitField0_ |= 0x00000004; + bitField0_ |= 0x00000001; return this; } - public Builder mergeFutureUuid(akka.remote.RemoteProtocol.UuidProtocol value) { - if (futureUuidBuilder_ == null) { - if (((bitField0_ & 0x00000004) == 0x00000004) && - futureUuid_ != akka.remote.RemoteProtocol.UuidProtocol.getDefaultInstance()) { - futureUuid_ = - akka.remote.RemoteProtocol.UuidProtocol.newBuilder(futureUuid_).mergeFrom(value).buildPartial(); + public Builder mergeRecipient(akka.remote.RemoteProtocol.ActorRefProtocol value) { + if (recipientBuilder_ == null) { + if (((bitField0_ & 0x00000001) == 0x00000001) && + recipient_ != akka.remote.RemoteProtocol.ActorRefProtocol.getDefaultInstance()) { + recipient_ = + akka.remote.RemoteProtocol.ActorRefProtocol.newBuilder(recipient_).mergeFrom(value).buildPartial(); } else { - futureUuid_ = value; + recipient_ = value; } onChanged(); } else { - futureUuidBuilder_.mergeFrom(value); + recipientBuilder_.mergeFrom(value); } - bitField0_ |= 0x00000004; + bitField0_ |= 0x00000001; return this; } - public Builder clearFutureUuid() { - if (futureUuidBuilder_ == null) { - futureUuid_ = akka.remote.RemoteProtocol.UuidProtocol.getDefaultInstance(); + public Builder clearRecipient() { + if (recipientBuilder_ == null) { + recipient_ = akka.remote.RemoteProtocol.ActorRefProtocol.getDefaultInstance(); onChanged(); } else { - futureUuidBuilder_.clear(); + recipientBuilder_.clear(); } - bitField0_ = (bitField0_ & ~0x00000004); + bitField0_ = (bitField0_ & ~0x00000001); return this; } - public akka.remote.RemoteProtocol.UuidProtocol.Builder getFutureUuidBuilder() { - bitField0_ |= 0x00000004; + public akka.remote.RemoteProtocol.ActorRefProtocol.Builder getRecipientBuilder() { + bitField0_ |= 0x00000001; onChanged(); - return getFutureUuidFieldBuilder().getBuilder(); + return getRecipientFieldBuilder().getBuilder(); } - public akka.remote.RemoteProtocol.UuidProtocolOrBuilder getFutureUuidOrBuilder() { - if (futureUuidBuilder_ != null) { - return futureUuidBuilder_.getMessageOrBuilder(); + public akka.remote.RemoteProtocol.ActorRefProtocolOrBuilder getRecipientOrBuilder() { + if (recipientBuilder_ != null) { + return recipientBuilder_.getMessageOrBuilder(); } else { - return futureUuid_; + return recipient_; } } private com.google.protobuf.SingleFieldBuilder< - akka.remote.RemoteProtocol.UuidProtocol, akka.remote.RemoteProtocol.UuidProtocol.Builder, akka.remote.RemoteProtocol.UuidProtocolOrBuilder> - getFutureUuidFieldBuilder() { - if (futureUuidBuilder_ == null) { - futureUuidBuilder_ = new com.google.protobuf.SingleFieldBuilder< - akka.remote.RemoteProtocol.UuidProtocol, akka.remote.RemoteProtocol.UuidProtocol.Builder, akka.remote.RemoteProtocol.UuidProtocolOrBuilder>( - futureUuid_, + akka.remote.RemoteProtocol.ActorRefProtocol, akka.remote.RemoteProtocol.ActorRefProtocol.Builder, akka.remote.RemoteProtocol.ActorRefProtocolOrBuilder> + getRecipientFieldBuilder() { + if (recipientBuilder_ == null) { + recipientBuilder_ = new com.google.protobuf.SingleFieldBuilder< + akka.remote.RemoteProtocol.ActorRefProtocol, akka.remote.RemoteProtocol.ActorRefProtocol.Builder, akka.remote.RemoteProtocol.ActorRefProtocolOrBuilder>( + recipient_, getParentForChildren(), isClean()); - futureUuid_ = null; + recipient_ = null; } - return futureUuidBuilder_; + return recipientBuilder_; } - - // required bytes message = 4; + + // optional .ActorRefProtocol sender = 2; + private akka.remote.RemoteProtocol.ActorRefProtocol sender_ = akka.remote.RemoteProtocol.ActorRefProtocol.getDefaultInstance(); + private com.google.protobuf.SingleFieldBuilder< + akka.remote.RemoteProtocol.ActorRefProtocol, akka.remote.RemoteProtocol.ActorRefProtocol.Builder, akka.remote.RemoteProtocol.ActorRefProtocolOrBuilder> senderBuilder_; + public boolean hasSender() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + public akka.remote.RemoteProtocol.ActorRefProtocol getSender() { + if (senderBuilder_ == null) { + return sender_; + } else { + return senderBuilder_.getMessage(); + } + } + public Builder setSender(akka.remote.RemoteProtocol.ActorRefProtocol value) { + if (senderBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sender_ = value; + onChanged(); + } else { + senderBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + return this; + } + public Builder setSender( + akka.remote.RemoteProtocol.ActorRefProtocol.Builder builderForValue) { + if (senderBuilder_ == null) { + sender_ = builderForValue.build(); + onChanged(); + } else { + senderBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + return this; + } + public Builder mergeSender(akka.remote.RemoteProtocol.ActorRefProtocol value) { + if (senderBuilder_ == null) { + if (((bitField0_ & 0x00000002) == 0x00000002) && + sender_ != akka.remote.RemoteProtocol.ActorRefProtocol.getDefaultInstance()) { + sender_ = + akka.remote.RemoteProtocol.ActorRefProtocol.newBuilder(sender_).mergeFrom(value).buildPartial(); + } else { + sender_ = value; + } + onChanged(); + } else { + senderBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + return this; + } + public Builder clearSender() { + if (senderBuilder_ == null) { + sender_ = akka.remote.RemoteProtocol.ActorRefProtocol.getDefaultInstance(); + onChanged(); + } else { + senderBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + public akka.remote.RemoteProtocol.ActorRefProtocol.Builder getSenderBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getSenderFieldBuilder().getBuilder(); + } + public akka.remote.RemoteProtocol.ActorRefProtocolOrBuilder getSenderOrBuilder() { + if (senderBuilder_ != null) { + return senderBuilder_.getMessageOrBuilder(); + } else { + return sender_; + } + } + private com.google.protobuf.SingleFieldBuilder< + akka.remote.RemoteProtocol.ActorRefProtocol, akka.remote.RemoteProtocol.ActorRefProtocol.Builder, akka.remote.RemoteProtocol.ActorRefProtocolOrBuilder> + getSenderFieldBuilder() { + if (senderBuilder_ == null) { + senderBuilder_ = new com.google.protobuf.SingleFieldBuilder< + akka.remote.RemoteProtocol.ActorRefProtocol, akka.remote.RemoteProtocol.ActorRefProtocol.Builder, akka.remote.RemoteProtocol.ActorRefProtocolOrBuilder>( + sender_, + getParentForChildren(), + isClean()); + sender_ = null; + } + return senderBuilder_; + } + + // required bytes message = 3; private com.google.protobuf.ByteString message_ = com.google.protobuf.ByteString.EMPTY; public boolean hasMessage() { - return ((bitField0_ & 0x00000008) == 0x00000008); + return ((bitField0_ & 0x00000004) == 0x00000004); } public com.google.protobuf.ByteString getMessage() { return message_; @@ -10485,29 +6611,29 @@ public final class RemoteProtocol { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00000008; + bitField0_ |= 0x00000004; message_ = value; onChanged(); return this; } public Builder clearMessage() { - bitField0_ = (bitField0_ & ~0x00000008); + bitField0_ = (bitField0_ & ~0x00000004); message_ = getDefaultInstance().getMessage(); onChanged(); return this; } - + // @@protoc_insertion_point(builder_scope:DurableMailboxMessageProtocol) } - + static { defaultInstance = new DurableMailboxMessageProtocol(true); defaultInstance.initFields(); } - + // @@protoc_insertion_point(class_scope:DurableMailboxMessageProtocol) } - + private static com.google.protobuf.Descriptors.Descriptor internal_static_AkkaRemoteProtocol_descriptor; private static @@ -10524,30 +6650,15 @@ public final class RemoteProtocol { com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_RemoteControlProtocol_fieldAccessorTable; private static com.google.protobuf.Descriptors.Descriptor - internal_static_RemoteActorRefProtocol_descriptor; + internal_static_ActorRefProtocol_descriptor; private static com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_RemoteActorRefProtocol_fieldAccessorTable; - private static com.google.protobuf.Descriptors.Descriptor - internal_static_SerializedActorRefProtocol_descriptor; - private static - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_SerializedActorRefProtocol_fieldAccessorTable; - private static com.google.protobuf.Descriptors.Descriptor - internal_static_SerializedTypedActorRefProtocol_descriptor; - private static - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_SerializedTypedActorRefProtocol_fieldAccessorTable; + internal_static_ActorRefProtocol_fieldAccessorTable; private static com.google.protobuf.Descriptors.Descriptor internal_static_MessageProtocol_descriptor; private static com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_MessageProtocol_fieldAccessorTable; - private static com.google.protobuf.Descriptors.Descriptor - internal_static_ActorInfoProtocol_descriptor; - private static - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_ActorInfoProtocol_fieldAccessorTable; private static com.google.protobuf.Descriptors.Descriptor internal_static_UuidProtocol_descriptor; private static @@ -10558,11 +6669,6 @@ public final class RemoteProtocol { private static com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_MetadataEntryProtocol_fieldAccessorTable; - private static com.google.protobuf.Descriptors.Descriptor - internal_static_LifeCycleProtocol_descriptor; - private static - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_LifeCycleProtocol_fieldAccessorTable; private static com.google.protobuf.Descriptors.Descriptor internal_static_AddressProtocol_descriptor; private static @@ -10583,7 +6689,7 @@ public final class RemoteProtocol { private static com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_DurableMailboxMessageProtocol_fieldAccessorTable; - + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { return descriptor; @@ -10595,68 +6701,42 @@ public final class RemoteProtocol { "\n\024RemoteProtocol.proto\"j\n\022AkkaRemoteProt" + "ocol\022\'\n\007message\030\001 \001(\0132\026.RemoteMessagePro" + "tocol\022+\n\013instruction\030\002 \001(\0132\026.RemoteContr" + - "olProtocol\"\257\002\n\025RemoteMessageProtocol\022\033\n\004" + - "uuid\030\001 \002(\0132\r.UuidProtocol\022%\n\tactorInfo\030\002" + - " \002(\0132\022.ActorInfoProtocol\022\016\n\006oneWay\030\003 \002(\010" + - "\022!\n\007message\030\004 \001(\0132\020.MessageProtocol\022%\n\te" + - "xception\030\005 \001(\0132\022.ExceptionProtocol\022%\n\016su" + - "pervisorUuid\030\006 \001(\0132\r.UuidProtocol\022\'\n\006sen" + - "der\030\007 \001(\0132\027.RemoteActorRefProtocol\022(\n\010me", - "tadata\030\010 \003(\0132\026.MetadataEntryProtocol\"J\n\025" + - "RemoteControlProtocol\022\016\n\006cookie\030\001 \001(\t\022!\n" + - "\013commandType\030\002 \002(\0162\014.CommandType\"U\n\026Remo" + - "teActorRefProtocol\022\017\n\007address\030\001 \002(\t\022\031\n\021i" + - "netSocketAddress\030\002 \002(\014\022\017\n\007timeout\030\003 \001(\004\"" + - "\277\003\n\032SerializedActorRefProtocol\022\033\n\004uuid\030\001" + - " \002(\0132\r.UuidProtocol\022\017\n\007address\030\002 \002(\t\022\026\n\016" + - "actorClassname\030\003 \002(\t\022\025\n\ractorInstance\030\004 " + - "\001(\014\022\033\n\023serializerClassname\030\005 \001(\t\022\017\n\007time" + - "out\030\006 \001(\004\022\026\n\016receiveTimeout\030\007 \001(\004\022%\n\tlif", - "eCycle\030\010 \001(\0132\022.LifeCycleProtocol\022+\n\nsupe" + - "rvisor\030\t \001(\0132\027.RemoteActorRefProtocol\022\024\n" + - "\014hotswapStack\030\n \001(\014\0223\n\022replicationStorag" + - "e\030\013 \001(\0162\027.ReplicationStorageType\0225\n\023repl" + - "icationStrategy\030\014 \001(\0162\030.ReplicationStrat" + - "egyType\022(\n\010messages\030\r \003(\0132\026.RemoteMessag" + - "eProtocol\"g\n\037SerializedTypedActorRefProt" + - "ocol\022-\n\010actorRef\030\001 \002(\0132\033.SerializedActor" + - "RefProtocol\022\025\n\rinterfaceName\030\002 \002(\t\";\n\017Me" + - "ssageProtocol\022\017\n\007message\030\001 \002(\014\022\027\n\017messag", - "eManifest\030\002 \001(\014\"R\n\021ActorInfoProtocol\022\033\n\004" + - "uuid\030\001 \002(\0132\r.UuidProtocol\022\017\n\007timeout\030\002 \002" + - "(\004\022\017\n\007address\030\003 \001(\t\")\n\014UuidProtocol\022\014\n\004h" + - "igh\030\001 \002(\004\022\013\n\003low\030\002 \002(\004\"3\n\025MetadataEntryP" + - "rotocol\022\013\n\003key\030\001 \002(\t\022\r\n\005value\030\002 \002(\014\"6\n\021L" + - "ifeCycleProtocol\022!\n\tlifeCycle\030\001 \002(\0162\016.Li" + - "feCycleType\"1\n\017AddressProtocol\022\020\n\010hostna" + - "me\030\001 \002(\t\022\014\n\004port\030\002 \002(\r\"7\n\021ExceptionProto" + - "col\022\021\n\tclassname\030\001 \002(\t\022\017\n\007message\030\002 \002(\t\"" + - "\320\001\n!RemoteSystemDaemonMessageProtocol\0223\n", - "\013messageType\030\001 \002(\0162\036.RemoteSystemDaemonM" + - "essageType\022 \n\tactorUuid\030\002 \001(\0132\r.UuidProt" + - "ocol\022\024\n\014actorAddress\030\003 \001(\t\022\017\n\007payload\030\005 " + - "\001(\014\022-\n\026replicateActorFromUuid\030\006 \001(\0132\r.Uu" + - "idProtocol\"\212\001\n\035DurableMailboxMessageProt" + - "ocol\022\031\n\021ownerActorAddress\030\001 \002(\t\022\032\n\022sende" + - "rActorAddress\030\002 \001(\t\022!\n\nfutureUuid\030\003 \001(\0132" + - "\r.UuidProtocol\022\017\n\007message\030\004 \002(\014*(\n\013Comma" + - "ndType\022\013\n\007CONNECT\020\001\022\014\n\010SHUTDOWN\020\002*K\n\026Rep" + - "licationStorageType\022\r\n\tTRANSIENT\020\001\022\023\n\017TR", - "ANSACTION_LOG\020\002\022\r\n\tDATA_GRID\020\003*>\n\027Replic" + - "ationStrategyType\022\021\n\rWRITE_THROUGH\020\001\022\020\n\014" + - "WRITE_BEHIND\020\002*]\n\027SerializationSchemeTyp" + - "e\022\010\n\004JAVA\020\001\022\013\n\007SBINARY\020\002\022\016\n\nSCALA_JSON\020\003" + - "\022\r\n\tJAVA_JSON\020\004\022\014\n\010PROTOBUF\020\005*-\n\rLifeCyc" + - "leType\022\r\n\tPERMANENT\020\001\022\r\n\tTEMPORARY\020\002*\261\002\n" + - "\035RemoteSystemDaemonMessageType\022\010\n\004STOP\020\001" + - "\022\007\n\003USE\020\002\022\013\n\007RELEASE\020\003\022\022\n\016MAKE_AVAILABLE" + - "\020\004\022\024\n\020MAKE_UNAVAILABLE\020\005\022\016\n\nDISCONNECT\020\006" + - "\022\r\n\tRECONNECT\020\007\022\n\n\006RESIGN\020\010\022\n\n\006GOSSIP\020\t\022", - "\016\n\nGOSSIP_ACK\020\n\022\031\n\025FAIL_OVER_CONNECTIONS" + - "\020\024\022\026\n\022FUNCTION_FUN0_UNIT\020\025\022\025\n\021FUNCTION_F" + - "UN0_ANY\020\026\022\032\n\026FUNCTION_FUN1_ARG_UNIT\020\027\022\031\n" + - "\025FUNCTION_FUN1_ARG_ANY\020\030B\017\n\013akka.remoteH" + - "\001" + "olProtocol\"\324\001\n\025RemoteMessageProtocol\022$\n\t" + + "recipient\030\001 \002(\0132\021.ActorRefProtocol\022!\n\007me" + + "ssage\030\002 \001(\0132\020.MessageProtocol\022%\n\texcepti" + + "on\030\003 \001(\0132\022.ExceptionProtocol\022!\n\006sender\030\004" + + " \001(\0132\021.ActorRefProtocol\022(\n\010metadata\030\005 \003(" + + "\0132\026.MetadataEntryProtocol\"J\n\025RemoteContr" + + "olProtocol\022\016\n\006cookie\030\001 \001(\t\022!\n\013commandTyp", + "e\030\002 \002(\0162\014.CommandType\"?\n\020ActorRefProtoco" + + "l\022\017\n\007address\030\001 \002(\t\022\014\n\004host\030\002 \002(\t\022\014\n\004port" + + "\030\003 \002(\r\";\n\017MessageProtocol\022\017\n\007message\030\001 \002" + + "(\014\022\027\n\017messageManifest\030\002 \001(\014\")\n\014UuidProto" + + "col\022\014\n\004high\030\001 \002(\004\022\013\n\003low\030\002 \002(\004\"3\n\025Metada" + + "taEntryProtocol\022\013\n\003key\030\001 \002(\t\022\r\n\005value\030\002 " + + "\002(\014\"1\n\017AddressProtocol\022\020\n\010hostname\030\001 \002(\t" + + "\022\014\n\004port\030\002 \002(\r\"7\n\021ExceptionProtocol\022\021\n\tc" + + "lassname\030\001 \002(\t\022\017\n\007message\030\002 \002(\t\"\256\001\n!Remo" + + "teSystemDaemonMessageProtocol\0223\n\013message", + "Type\030\001 \002(\0162\036.RemoteSystemDaemonMessageTy" + + "pe\022\024\n\014actorAddress\030\002 \001(\t\022\017\n\007payload\030\003 \001(" + + "\014\022-\n\026replicateActorFromUuid\030\004 \001(\0132\r.Uuid" + + "Protocol\"y\n\035DurableMailboxMessageProtoco" + + "l\022$\n\trecipient\030\001 \002(\0132\021.ActorRefProtocol\022" + + "!\n\006sender\030\002 \001(\0132\021.ActorRefProtocol\022\017\n\007me" + + "ssage\030\003 \002(\014*(\n\013CommandType\022\013\n\007CONNECT\020\001\022" + + "\014\n\010SHUTDOWN\020\002*K\n\026ReplicationStorageType\022" + + "\r\n\tTRANSIENT\020\001\022\023\n\017TRANSACTION_LOG\020\002\022\r\n\tD" + + "ATA_GRID\020\003*>\n\027ReplicationStrategyType\022\021\n", + "\rWRITE_THROUGH\020\001\022\020\n\014WRITE_BEHIND\020\002*\241\002\n\035R" + + "emoteSystemDaemonMessageType\022\010\n\004STOP\020\001\022\007" + + "\n\003USE\020\002\022\013\n\007RELEASE\020\003\022\022\n\016MAKE_AVAILABLE\020\004" + + "\022\024\n\020MAKE_UNAVAILABLE\020\005\022\016\n\nDISCONNECT\020\006\022\r" + + "\n\tRECONNECT\020\007\022\n\n\006RESIGN\020\010\022\n\n\006GOSSIP\020\t\022\031\n" + + "\025FAIL_OVER_CONNECTIONS\020\024\022\026\n\022FUNCTION_FUN" + + "0_UNIT\020\025\022\025\n\021FUNCTION_FUN0_ANY\020\026\022\032\n\026FUNCT" + + "ION_FUN1_ARG_UNIT\020\027\022\031\n\025FUNCTION_FUN1_ARG" + + "_ANY\020\030B\017\n\013akka.remoteH\001" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { @@ -10676,7 +6756,7 @@ public final class RemoteProtocol { internal_static_RemoteMessageProtocol_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_RemoteMessageProtocol_descriptor, - new java.lang.String[] { "Uuid", "ActorInfo", "OneWay", "Message", "Exception", "SupervisorUuid", "Sender", "Metadata", }, + new java.lang.String[] { "Recipient", "Message", "Exception", "Sender", "Metadata", }, akka.remote.RemoteProtocol.RemoteMessageProtocol.class, akka.remote.RemoteProtocol.RemoteMessageProtocol.Builder.class); internal_static_RemoteControlProtocol_descriptor = @@ -10687,48 +6767,24 @@ public final class RemoteProtocol { new java.lang.String[] { "Cookie", "CommandType", }, akka.remote.RemoteProtocol.RemoteControlProtocol.class, akka.remote.RemoteProtocol.RemoteControlProtocol.Builder.class); - internal_static_RemoteActorRefProtocol_descriptor = + internal_static_ActorRefProtocol_descriptor = getDescriptor().getMessageTypes().get(3); - internal_static_RemoteActorRefProtocol_fieldAccessorTable = new + internal_static_ActorRefProtocol_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_RemoteActorRefProtocol_descriptor, - new java.lang.String[] { "Address", "InetSocketAddress", "Timeout", }, - akka.remote.RemoteProtocol.RemoteActorRefProtocol.class, - akka.remote.RemoteProtocol.RemoteActorRefProtocol.Builder.class); - internal_static_SerializedActorRefProtocol_descriptor = - getDescriptor().getMessageTypes().get(4); - internal_static_SerializedActorRefProtocol_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_SerializedActorRefProtocol_descriptor, - new java.lang.String[] { "Uuid", "Address", "ActorClassname", "ActorInstance", "SerializerClassname", "Timeout", "ReceiveTimeout", "LifeCycle", "Supervisor", "HotswapStack", "ReplicationStorage", "ReplicationStrategy", "Messages", }, - akka.remote.RemoteProtocol.SerializedActorRefProtocol.class, - akka.remote.RemoteProtocol.SerializedActorRefProtocol.Builder.class); - internal_static_SerializedTypedActorRefProtocol_descriptor = - getDescriptor().getMessageTypes().get(5); - internal_static_SerializedTypedActorRefProtocol_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_SerializedTypedActorRefProtocol_descriptor, - new java.lang.String[] { "ActorRef", "InterfaceName", }, - akka.remote.RemoteProtocol.SerializedTypedActorRefProtocol.class, - akka.remote.RemoteProtocol.SerializedTypedActorRefProtocol.Builder.class); + internal_static_ActorRefProtocol_descriptor, + new java.lang.String[] { "Address", "Host", "Port", }, + akka.remote.RemoteProtocol.ActorRefProtocol.class, + akka.remote.RemoteProtocol.ActorRefProtocol.Builder.class); internal_static_MessageProtocol_descriptor = - getDescriptor().getMessageTypes().get(6); + getDescriptor().getMessageTypes().get(4); internal_static_MessageProtocol_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_MessageProtocol_descriptor, new java.lang.String[] { "Message", "MessageManifest", }, akka.remote.RemoteProtocol.MessageProtocol.class, akka.remote.RemoteProtocol.MessageProtocol.Builder.class); - internal_static_ActorInfoProtocol_descriptor = - getDescriptor().getMessageTypes().get(7); - internal_static_ActorInfoProtocol_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_ActorInfoProtocol_descriptor, - new java.lang.String[] { "Uuid", "Timeout", "Address", }, - akka.remote.RemoteProtocol.ActorInfoProtocol.class, - akka.remote.RemoteProtocol.ActorInfoProtocol.Builder.class); internal_static_UuidProtocol_descriptor = - getDescriptor().getMessageTypes().get(8); + getDescriptor().getMessageTypes().get(5); internal_static_UuidProtocol_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_UuidProtocol_descriptor, @@ -10736,23 +6792,15 @@ public final class RemoteProtocol { akka.remote.RemoteProtocol.UuidProtocol.class, akka.remote.RemoteProtocol.UuidProtocol.Builder.class); internal_static_MetadataEntryProtocol_descriptor = - getDescriptor().getMessageTypes().get(9); + getDescriptor().getMessageTypes().get(6); internal_static_MetadataEntryProtocol_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_MetadataEntryProtocol_descriptor, new java.lang.String[] { "Key", "Value", }, akka.remote.RemoteProtocol.MetadataEntryProtocol.class, akka.remote.RemoteProtocol.MetadataEntryProtocol.Builder.class); - internal_static_LifeCycleProtocol_descriptor = - getDescriptor().getMessageTypes().get(10); - internal_static_LifeCycleProtocol_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_LifeCycleProtocol_descriptor, - new java.lang.String[] { "LifeCycle", }, - akka.remote.RemoteProtocol.LifeCycleProtocol.class, - akka.remote.RemoteProtocol.LifeCycleProtocol.Builder.class); internal_static_AddressProtocol_descriptor = - getDescriptor().getMessageTypes().get(11); + getDescriptor().getMessageTypes().get(7); internal_static_AddressProtocol_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_AddressProtocol_descriptor, @@ -10760,7 +6808,7 @@ public final class RemoteProtocol { akka.remote.RemoteProtocol.AddressProtocol.class, akka.remote.RemoteProtocol.AddressProtocol.Builder.class); internal_static_ExceptionProtocol_descriptor = - getDescriptor().getMessageTypes().get(12); + getDescriptor().getMessageTypes().get(8); internal_static_ExceptionProtocol_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_ExceptionProtocol_descriptor, @@ -10768,19 +6816,19 @@ public final class RemoteProtocol { akka.remote.RemoteProtocol.ExceptionProtocol.class, akka.remote.RemoteProtocol.ExceptionProtocol.Builder.class); internal_static_RemoteSystemDaemonMessageProtocol_descriptor = - getDescriptor().getMessageTypes().get(13); + getDescriptor().getMessageTypes().get(9); internal_static_RemoteSystemDaemonMessageProtocol_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_RemoteSystemDaemonMessageProtocol_descriptor, - new java.lang.String[] { "MessageType", "ActorUuid", "ActorAddress", "Payload", "ReplicateActorFromUuid", }, + new java.lang.String[] { "MessageType", "ActorAddress", "Payload", "ReplicateActorFromUuid", }, akka.remote.RemoteProtocol.RemoteSystemDaemonMessageProtocol.class, akka.remote.RemoteProtocol.RemoteSystemDaemonMessageProtocol.Builder.class); internal_static_DurableMailboxMessageProtocol_descriptor = - getDescriptor().getMessageTypes().get(14); + getDescriptor().getMessageTypes().get(10); internal_static_DurableMailboxMessageProtocol_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_DurableMailboxMessageProtocol_descriptor, - new java.lang.String[] { "OwnerActorAddress", "SenderActorAddress", "FutureUuid", "Message", }, + new java.lang.String[] { "Recipient", "Sender", "Message", }, akka.remote.RemoteProtocol.DurableMailboxMessageProtocol.class, akka.remote.RemoteProtocol.DurableMailboxMessageProtocol.Builder.class); return null; @@ -10791,6 +6839,6 @@ public final class RemoteProtocol { new com.google.protobuf.Descriptors.FileDescriptor[] { }, assigner); } - + // @@protoc_insertion_point(outer_class_scope) } diff --git a/akka-remote/src/main/protocol/RemoteProtocol.proto b/akka-remote/src/main/protocol/RemoteProtocol.proto index 7f2b9ce4b4..8dda9e4a11 100644 --- a/akka-remote/src/main/protocol/RemoteProtocol.proto +++ b/akka-remote/src/main/protocol/RemoteProtocol.proto @@ -20,14 +20,11 @@ message AkkaRemoteProtocol { * Defines a remote message. */ message RemoteMessageProtocol { - required UuidProtocol uuid = 1; - required ActorInfoProtocol actorInfo = 2; - required bool oneWay = 3; - optional MessageProtocol message = 4; - optional ExceptionProtocol exception = 5; - optional UuidProtocol supervisorUuid = 6; - optional RemoteActorRefProtocol sender = 7; - repeated MetadataEntryProtocol metadata = 8; + required ActorRefProtocol recipient = 1; + optional MessageProtocol message = 2; + optional ExceptionProtocol exception = 3; + optional ActorRefProtocol sender = 4; + repeated MetadataEntryProtocol metadata = 5; } /** @@ -67,41 +64,10 @@ enum ReplicationStrategyType { * Defines a remote ActorRef that "remembers" and uses its original Actor instance * on the original node. */ -message RemoteActorRefProtocol { +message ActorRefProtocol { required string address = 1; - required bytes inetSocketAddress = 2; - optional uint64 timeout = 3; -} - -/** - * Defines a fully serialized remote ActorRef (with serialized Actor instance) - * that is about to be instantiated on the remote node. It is fully disconnected - * from its original host. - */ -message SerializedActorRefProtocol { - required UuidProtocol uuid = 1; - required string address = 2; - required string actorClassname = 3; - optional bytes actorInstance = 4; - optional string serializerClassname = 5; - optional uint64 timeout = 6; - optional uint64 receiveTimeout = 7; - optional LifeCycleProtocol lifeCycle = 8; - optional RemoteActorRefProtocol supervisor = 9; - optional bytes hotswapStack = 10; - optional ReplicationStorageType replicationStorage = 11; - optional ReplicationStrategyType replicationStrategy = 12; - repeated RemoteMessageProtocol messages = 13; -} - -/** - * Defines a fully serialized remote ActorRef (with serialized typed actor instance) - * that is about to be instantiated on the remote node. It is fully disconnected - * from its original host. - */ -message SerializedTypedActorRefProtocol { - required SerializedActorRefProtocol actorRef = 1; - required string interfaceName = 2; + required string host = 2; + required uint32 port = 3; } /** @@ -112,15 +78,6 @@ message MessageProtocol { optional bytes messageManifest = 2; } -/** - * Defines the actor info. - */ -message ActorInfoProtocol { - required UuidProtocol uuid = 1; - required uint64 timeout = 2; - optional string address = 3; -} - /** * Defines a UUID. */ @@ -137,32 +94,6 @@ message MetadataEntryProtocol { required bytes value = 2; } -/** - * Defines the serialization scheme used to serialize the message and/or Actor instance. - */ -enum SerializationSchemeType { - JAVA = 1; - SBINARY = 2; - SCALA_JSON = 3; - JAVA_JSON = 4; - PROTOBUF = 5; -} - -/** - * Defines the type of the life-cycle of a supervised Actor. - */ -enum LifeCycleType { - PERMANENT = 1; - TEMPORARY = 2; -} - -/** - * Defines the life-cycle of a supervised Actor. - */ -message LifeCycleProtocol { - required LifeCycleType lifeCycle = 1; -} - /** * Defines a remote address. */ @@ -184,10 +115,9 @@ message ExceptionProtocol { */ message RemoteSystemDaemonMessageProtocol { required RemoteSystemDaemonMessageType messageType = 1; - optional UuidProtocol actorUuid = 2; - optional string actorAddress = 3; - optional bytes payload = 5; - optional UuidProtocol replicateActorFromUuid = 6; + optional string actorAddress = 2; + optional bytes payload = 3; + optional UuidProtocol replicateActorFromUuid = 4; } /** @@ -214,8 +144,7 @@ enum RemoteSystemDaemonMessageType { * Defines the durable mailbox message. */ message DurableMailboxMessageProtocol { - required string ownerActorAddress= 1; - optional string senderActorAddress = 2; - optional UuidProtocol futureUuid = 3; - required bytes message = 4; + required ActorRefProtocol recipient= 1; + optional ActorRefProtocol sender = 2; + required bytes message = 3; } diff --git a/akka-remote/src/main/scala/akka/remote/Gossiper.scala b/akka-remote/src/main/scala/akka/remote/Gossiper.scala index 95adec1edf..f834137b88 100644 --- a/akka-remote/src/main/scala/akka/remote/Gossiper.scala +++ b/akka-remote/src/main/scala/akka/remote/Gossiper.scala @@ -109,7 +109,7 @@ class Gossiper(remote: Remote) { private val seeds = Set(address) // FIXME read in list of seeds from config private val scheduler = new DefaultScheduler - private val address = new InetSocketAddress(app.hostname, app.port) + private val address = app.defaultAddress private val nodeFingerprint = address.## private val random = SecureRandom.getInstance("SHA1PRNG") diff --git a/akka-remote/src/main/scala/akka/remote/MessageSerializer.scala b/akka-remote/src/main/scala/akka/remote/MessageSerializer.scala index 333cb6f3dc..eaeeb410ae 100644 --- a/akka-remote/src/main/scala/akka/remote/MessageSerializer.scala +++ b/akka-remote/src/main/scala/akka/remote/MessageSerializer.scala @@ -14,12 +14,12 @@ object MessageSerializer { def deserialize(app: AkkaApplication, messageProtocol: MessageProtocol, classLoader: Option[ClassLoader] = None): AnyRef = { val clazz = loadManifest(classLoader, messageProtocol) app.serialization.deserialize(messageProtocol.getMessage.toByteArray, - clazz, classLoader).fold(x ⇒ throw x, o ⇒ o) + clazz, classLoader).fold(x ⇒ throw x, identity) } def serialize(app: AkkaApplication, message: AnyRef): MessageProtocol = { val builder = MessageProtocol.newBuilder - val bytes = app.serialization.serialize(message).fold(x ⇒ throw x, b ⇒ b) + val bytes = app.serialization.serialize(message).fold(x ⇒ throw x, identity) builder.setMessage(ByteString.copyFrom(bytes)) builder.setMessageManifest(ByteString.copyFromUtf8(message.getClass.getName)) builder.build diff --git a/akka-remote/src/main/scala/akka/remote/Remote.scala b/akka-remote/src/main/scala/akka/remote/Remote.scala index 7e3bb86a78..8ba981798f 100644 --- a/akka-remote/src/main/scala/akka/remote/Remote.scala +++ b/akka-remote/src/main/scala/akka/remote/Remote.scala @@ -13,7 +13,6 @@ import akka.util._ import akka.util.duration._ import akka.util.Helpers._ import akka.actor.DeploymentConfig._ -import akka.serialization.{ Serialization, Serializer, Compression } import akka.serialization.Compression.LZF import akka.remote.RemoteProtocol._ import akka.remote.RemoteProtocol.RemoteSystemDaemonMessageType._ @@ -21,6 +20,7 @@ import akka.remote.RemoteProtocol.RemoteSystemDaemonMessageType._ import java.net.InetSocketAddress import com.eaio.uuid.UUID +import akka.serialization.{ JavaSerializer, Serialization, Serializer, Compression } /** * Remote module - contains remote client and server config, remote server instance, remote daemon, remote dispatchers etc. @@ -37,9 +37,6 @@ class Remote(val app: AkkaApplication) extends RemoteService { val shouldCompressData = config.getBool("akka.remote.use-compression", false) val remoteSystemDaemonAckTimeout = Duration(config.getInt("akka.remote.remote-daemon-ack-timeout", 30), DefaultTimeUnit).toMillis.toInt - val hostname = app.hostname - val port = app.port - val failureDetector = new AccrualFailureDetector(FailureDetectorThreshold, FailureDetectorMaxSampleSize) // val gossiper = new Gossiper(this) @@ -53,8 +50,7 @@ class Remote(val app: AkkaApplication) extends RemoteService { OneForOneStrategy(List(classOf[Exception]), None, None))) // is infinite restart what we want? private[remote] lazy val remoteDaemon = - new LocalActorRef( - app, + app.provider.actorOf( Props(new RemoteSystemDaemon(this)).withDispatcher(dispatcherFactory.newPinnedDispatcher(remoteDaemonServiceName)), remoteDaemonSupervisor, remoteDaemonServiceName, @@ -73,7 +69,6 @@ class Remote(val app: AkkaApplication) extends RemoteService { lazy val server: RemoteSupport = { val remote = new akka.remote.netty.NettyRemoteSupport(app) remote.start(hostname, port) - remote.register(remoteDaemonServiceName, remoteDaemon) app.eventHandler.addListener(eventStream.sender) app.eventHandler.addListener(remoteClientLifeCycleHandler) @@ -83,20 +78,11 @@ class Remote(val app: AkkaApplication) extends RemoteService { remote } - lazy val address = server.address - - def start() { - val triggerLazyServerVal = address.toString - eventHandler.info(this, "Starting remote server on [%s]".format(triggerLazyServerVal)) + def start(): Unit = { + val serverAddress = server.app.defaultAddress //Force init of server + val daemonAddress = remoteDaemon.address //Force init of daemon + eventHandler.info(this, "Starting remote server on [%s] and starting remoteDaemon with address [%s]".format(serverAddress, daemonAddress)) } - - def uuidProtocolToUuid(uuid: UuidProtocol): UUID = new UUID(uuid.getHigh, uuid.getLow) - - def uuidToUuidProtocol(uuid: UUID): UuidProtocol = - UuidProtocol.newBuilder - .setHigh(uuid.getTime) - .setLow(uuid.getClockSeqAndNode) - .build } /** @@ -117,7 +103,7 @@ class RemoteSystemDaemon(remote: Remote) extends Actor { def receive: Actor.Receive = { case message: RemoteSystemDaemonMessageProtocol ⇒ - eventHandler.debug(this, "Received command [\n%s] to RemoteSystemDaemon on [%s]".format(message, nodename)) + eventHandler.debug(this, "Received command [\n%s] to RemoteSystemDaemon on [%s]".format(message.getMessageType, nodename)) message.getMessageType match { case USE ⇒ handleUse(message) @@ -151,16 +137,12 @@ class RemoteSystemDaemon(remote: Remote) extends Actor { case Right(instance) ⇒ instance.asInstanceOf[() ⇒ Actor] } - val actorAddress = message.getActorAddress - val newActorRef = app.actorOf(Props(creator = actorFactory), actorAddress) - - server.register(actorAddress, newActorRef) - + app.actorOf(Props(creator = actorFactory), message.getActorAddress) } else { eventHandler.error(this, "Actor 'address' for actor to instantiate is not defined, ignoring remote system daemon command [%s]".format(message)) } - sender ! Success(address.toString) + sender ! Success(app.defaultAddress) } catch { case error: Throwable ⇒ //FIXME doesn't seem sensible sender ! Failure(error) @@ -237,3 +219,38 @@ class RemoteSystemDaemon(remote: Remote) extends Actor { } } } + +class RemoteMessage(input: RemoteMessageProtocol, remote: RemoteSupport, classLoader: Option[ClassLoader] = None) { + lazy val sender: ActorRef = + if (input.hasSender) + remote.app.provider.deserialize( + SerializedActorRef(input.getSender.getAddress, input.getSender.getHost, input.getSender.getPort)).getOrElse(throw new IllegalStateException("OHNOES")) + else + remote.app.deadLetters + lazy val recipient: ActorRef = remote.app.findActor(input.getRecipient.getAddress) match { + case None ⇒ remote.app.deadLetters + case Some(target) ⇒ target + } + + lazy val payload: Either[Throwable, AnyRef] = + if (input.hasException) Left(parseException()) + else Right(MessageSerializer.deserialize(remote.app, input.getMessage, classLoader)) + + protected def parseException(): Throwable = { + val exception = input.getException + val classname = exception.getClassname + try { + val exceptionClass = + if (classLoader.isDefined) classLoader.get.loadClass(classname) else Class.forName(classname) + exceptionClass + .getConstructor(Array[Class[_]](classOf[String]): _*) + .newInstance(exception.getMessage).asInstanceOf[Throwable] + } catch { + case problem: Exception ⇒ + remote.app.eventHandler.error(problem, remote, problem.getMessage) + CannotInstantiateRemoteExceptionDueToRemoteProtocolParsingErrorException(problem, classname, exception.getMessage) + } + } + + override def toString = "RemoteMessage: " + recipient + "(" + input.getRecipient.getAddress + ") from " + sender +} diff --git a/akka-remote/src/main/scala/akka/remote/RemoteActorRefProvider.scala b/akka-remote/src/main/scala/akka/remote/RemoteActorRefProvider.scala index 8a34e8b118..84b2e5a71c 100644 --- a/akka-remote/src/main/scala/akka/remote/RemoteActorRefProvider.scala +++ b/akka-remote/src/main/scala/akka/remote/RemoteActorRefProvider.scala @@ -22,6 +22,7 @@ import java.net.InetSocketAddress import java.util.concurrent.ConcurrentHashMap import com.google.protobuf.ByteString +import java.util.concurrent.atomic.AtomicBoolean /** * Remote ActorRefProvider. Starts up actor on remote node and creates a RemoteActorRef representing it. @@ -65,14 +66,13 @@ class RemoteActorRefProvider(val app: AkkaApplication) extends ActorRefProvider // case FailureDetectorType.Custom(implClass) ⇒ FailureDetector.createCustomFailureDetector(implClass) // } - val thisHostname = remote.address.getHostName - val thisPort = remote.address.getPort + def isReplicaNode: Boolean = remoteAddresses exists { some ⇒ some.port == app.port && some.hostname == app.hostname } - def isReplicaNode: Boolean = remoteAddresses exists { some ⇒ some.hostname == thisHostname && some.port == thisPort } + //app.eventHandler.debug(this, "%s: Deploy Remote Actor with address [%s] connected to [%s]: isReplica(%s)".format(app.defaultAddress, address, remoteAddresses.mkString, isReplicaNode)) if (isReplicaNode) { // we are on one of the replica node for this remote actor - new LocalActorRef(app, props, supervisor, address, false) + local.actorOf(props, supervisor, address, true) //FIXME systemService = true here to bypass Deploy, should be fixed when create-or-get is replaced by get-or-create } else { // we are on the single "reference" node uses the remote actors on the replica nodes @@ -147,28 +147,38 @@ class RemoteActorRefProvider(val app: AkkaApplication) extends ActorRefProvider } def actorFor(address: String): Option[ActorRef] = actors.get(address) match { - case null ⇒ None + case null ⇒ local.actorFor(address) case actor: ActorRef ⇒ Some(actor) case future: Future[_] ⇒ Some(future.get.asInstanceOf[ActorRef]) } + val optimizeLocal = new AtomicBoolean(true) + def optimizeLocalScoped_?() = optimizeLocal.get + /** * Returns true if the actor was in the provider's cache and evicted successfully, else false. */ private[akka] def evict(address: String): Boolean = actors.remove(address) ne null - private[akka] def serialize(actor: ActorRef): AnyRef = actor match { - case r: RemoteActorRef ⇒ SerializedActorRef(actor.uuid, actor.address, r.remoteAddress.getAddress.getHostAddress, r.remoteAddress.getPort) + private[akka] def serialize(actor: ActorRef): SerializedActorRef = actor match { + case r: RemoteActorRef ⇒ new SerializedActorRef(actor.address, r.remoteAddress) case other ⇒ local.serialize(actor) } - private[akka] def deserialize(actor: SerializedActorRef): Option[ActorRef] = - local.actorFor(actor.address) orElse Some(RemoteActorRef(remote.server, new InetSocketAddress(actor.hostname, actor.port), actor.address, None)) + private[akka] def deserialize(actor: SerializedActorRef): Option[ActorRef] = { + if (optimizeLocalScoped_? && (actor.hostname == app.hostname || actor.hostname == app.defaultAddress.getHostName) && actor.port == app.port) { + local.actorFor(actor.address) + } else { + val remoteInetSocketAddress = new InetSocketAddress(actor.hostname, actor.port) //FIXME Drop the InetSocketAddresses and use RemoteAddress + app.eventHandler.debug(this, "%s: Creating RemoteActorRef with address [%s] connected to [%s]".format(app.defaultAddress, actor.address, remoteInetSocketAddress)) + Some(RemoteActorRef(remote.server, remoteInetSocketAddress, actor.address, None)) //Should it be None here + } + } /** * Using (checking out) actor on a specific node. */ def useActorOnNode(remoteAddress: InetSocketAddress, actorAddress: String, actorFactory: () ⇒ Actor) { - app.eventHandler.debug(this, "Instantiating Actor [%s] on node [%s]".format(actorAddress, remoteAddress)) + app.eventHandler.debug(this, "[%s] Instantiating Actor [%s] on node [%s]".format(app.defaultAddress, actorAddress, remoteAddress)) val actorFactoryBytes = app.serialization.serialize(actorFactory) match { @@ -182,7 +192,7 @@ class RemoteActorRefProvider(val app: AkkaApplication) extends ActorRefProvider .setPayload(ByteString.copyFrom(actorFactoryBytes)) .build() - val connectionFactory = () ⇒ remote.server.actorFor(remote.remoteDaemonServiceName, remoteAddress.getAddress.getHostAddress, remoteAddress.getPort) + val connectionFactory = () ⇒ deserialize(new SerializedActorRef(remote.remoteDaemonServiceName, remoteAddress)).get // try to get the connection for the remote address, if not already there then create it val connection = remoteDaemonConnectionManager.putIfAbsent(remoteAddress, connectionFactory) @@ -234,9 +244,6 @@ private[akka] case class RemoteActorRef private[akka] ( address: String, loader: Option[ClassLoader]) extends ActorRef with ScalaActorRef { - - private[akka] val uuid: Uuid = newUuid - @volatile private var running: Boolean = true @@ -250,9 +257,9 @@ private[akka] case class RemoteActorRef private[akka] ( def ?(message: Any)(implicit timeout: Timeout): Future[Any] = remote.app.provider.ask(message, this, timeout) - def suspend(): Unit = unsupported + def suspend(): Unit = () - def resume(): Unit = unsupported + def resume(): Unit = () def stop() { //FIXME send the cause as well! synchronized { @@ -266,11 +273,11 @@ private[akka] case class RemoteActorRef private[akka] ( @throws(classOf[java.io.ObjectStreamException]) private def writeReplace(): AnyRef = remote.app.provider.serialize(this) - def startsMonitoring(actorRef: ActorRef): ActorRef = unsupported + def startsMonitoring(actorRef: ActorRef): ActorRef = unsupported //FIXME Implement - def stopsMonitoring(actorRef: ActorRef): ActorRef = unsupported + def stopsMonitoring(actorRef: ActorRef): ActorRef = unsupported //FIXME Implement - protected[akka] def restart(cause: Throwable): Unit = unsupported + protected[akka] def restart(cause: Throwable): Unit = () private def unsupported = throw new UnsupportedOperationException("Not supported for RemoteActorRef") } diff --git a/akka-remote/src/main/scala/akka/remote/netty/NettyRemoteSupport.scala b/akka-remote/src/main/scala/akka/remote/netty/NettyRemoteSupport.scala index 66ce5a5334..10b5246596 100644 --- a/akka-remote/src/main/scala/akka/remote/netty/NettyRemoteSupport.scala +++ b/akka-remote/src/main/scala/akka/remote/netty/NettyRemoteSupport.scala @@ -57,14 +57,13 @@ trait NettyRemoteClientModule extends RemoteClientModule { protected[akka] def send[T](message: Any, senderOption: Option[ActorRef], - remoteAddress: InetSocketAddress, - actorRef: ActorRef, + recipientAddress: InetSocketAddress, + recipient: ActorRef, loader: Option[ClassLoader]): Unit = - withClientFor(remoteAddress, loader) { _.send[T](message, senderOption, remoteAddress, actorRef) } + withClientFor(recipientAddress, loader) { _.send[T](message, senderOption, recipient) } private[akka] def withClientFor[T]( address: InetSocketAddress, loader: Option[ClassLoader])(body: RemoteClient ⇒ T): T = { - // loader.foreach(MessageSerializer.setClassLoader(_)) val key = RemoteAddress(address) lock.readLock.lock try { @@ -158,9 +157,8 @@ abstract class RemoteClient private[akka] ( /** * Converts the message to the wireprotocol and sends the message across the wire */ - def send[T](message: Any, senderOption: Option[ActorRef], remoteAddress: InetSocketAddress, actorRef: ActorRef) { - val messageProtocol = serialization.createRemoteMessageProtocolBuilder(Option(actorRef), Left(actorRef.uuid), actorRef.address, app.AkkaConfig.ActorTimeoutMillis, Right(message), senderOption).build - send(messageProtocol) + def send[T](message: Any, senderOption: Option[ActorRef], recipient: ActorRef) { + send(serialization.createRemoteMessageProtocolBuilder(Left(recipient), Right(message), senderOption).build) } /** @@ -168,7 +166,7 @@ abstract class RemoteClient private[akka] ( */ def send[T](request: RemoteMessageProtocol) { if (isRunning) { //TODO FIXME RACY - app.eventHandler.debug(this, "Sending to connection [%s] message [\n%s]".format(remoteAddress, request)) + app.eventHandler.debug(this, "Sending to connection [%s] message [%s]".format(remoteAddress, new RemoteMessage(request, remoteSupport))) // tell try { @@ -378,10 +376,6 @@ class ActiveRemoteClientHandler( } case arp: AkkaRemoteProtocol if arp.hasMessage ⇒ - val reply = arp.getMessage - val replyUuid = uuidFrom(reply.getActorInfo.getUuid.getHigh, reply.getActorInfo.getUuid.getLow) - app.eventHandler.debug(this, "Remote client received RemoteMessageProtocol[\n%s]\nTrying to map back to future [%s]".format(reply, replyUuid)) - //TODO FIXME DOESN'T DO ANYTHING ANYMORE case other ⇒ @@ -443,54 +437,13 @@ class ActiveRemoteClientHandler( } else app.eventHandler.error(this, "Unexpected exception from downstream in remote client [%s]".format(event)) } - - private def parseException(reply: RemoteMessageProtocol, loader: Option[ClassLoader]): Throwable = { - val exception = reply.getException - val classname = exception.getClassname - try { - val exceptionClass = - if (loader.isDefined) loader.get.loadClass(classname) - else Class.forName(classname) - exceptionClass - .getConstructor(Array[Class[_]](classOf[String]): _*) - .newInstance(exception.getMessage).asInstanceOf[Throwable] - } catch { - case problem: Exception ⇒ - app.eventHandler.error(problem, this, problem.getMessage) - CannotInstantiateRemoteExceptionDueToRemoteProtocolParsingErrorException(problem, classname, exception.getMessage) - } - } } /** * Provides the implementation of the Netty remote support */ class NettyRemoteSupport(_app: AkkaApplication) extends RemoteSupport(_app) with NettyRemoteServerModule with NettyRemoteClientModule { - - // Needed for remote testing and switching on/off under run - val optimizeLocal = new AtomicBoolean(true) - - def optimizeLocalScoped_?() = optimizeLocal.get - - protected[akka] def actorFor(actorAddress: String, host: String, port: Int, loader: Option[ClassLoader]): ActorRef = { - - val homeInetSocketAddress = this.address - if (optimizeLocalScoped_?) { - if ((host == homeInetSocketAddress.getAddress.getHostAddress || - host == homeInetSocketAddress.getHostName) && - port == homeInetSocketAddress.getPort) { - //TODO: switch to InetSocketAddress.equals? - val localRef = findActorByAddressOrUuid(actorAddress, actorAddress) - if (localRef ne null) return localRef //Code significantly simpler with the return statement - } - } - - val remoteInetSocketAddress = new InetSocketAddress(host, port) - app.eventHandler.debug(this, - "Creating RemoteActorRef with address [%s] connected to [%s]" - .format(actorAddress, remoteInetSocketAddress)) - RemoteActorRef(this, remoteInetSocketAddress, actorAddress, loader) - } + override def toString = name } class NettyRemoteServer(app: AkkaApplication, serverModule: NettyRemoteServerModule, val host: String, val port: Int, val loader: Option[ClassLoader]) { @@ -577,7 +530,7 @@ trait NettyRemoteServerModule extends RemoteServerModule { def start(_hostname: String, _port: Int, loader: Option[ClassLoader] = None): RemoteServerModule = guard withGuard { try { _isRunning switchOn { - app.eventHandler.debug(this, "Starting up remote server on %s:s".format(_hostname, _port)) + app.eventHandler.debug(this, "Starting up remote server on [%s:%s]".format(_hostname, _port)) currentServer.set(Some(new NettyRemoteServer(app, this, _hostname, _port, loader))) } @@ -597,85 +550,6 @@ trait NettyRemoteServerModule extends RemoteServerModule { } } } - - /** - * Register RemoteModule Actor by a specific 'id' passed as argument. - *

- * NOTE: If you use this method to register your remote actor then you must unregister the actor by this ID yourself. - */ - def register(id: String, actorRef: ActorRef): Unit = guard withGuard { - if (id.startsWith(UUID_PREFIX)) register(id.substring(UUID_PREFIX.length), actorRef, actorsByUuid) - else register(id, actorRef, actors) - } - - def registerByUuid(actorRef: ActorRef): Unit = guard withGuard { - register(actorRef.uuid.toString, actorRef, actorsByUuid) - } - - private def register[Key](id: Key, actorRef: ActorRef, registry: ConcurrentHashMap[Key, ActorRef]) { - if (_isRunning.isOn) - registry.put(id, actorRef) //TODO change to putIfAbsent - } - - /** - * Register RemoteModule Session Actor by a specific 'id' passed as argument. - *

- * NOTE: If you use this method to register your remote actor then you must unregister the actor by this ID yourself. - */ - def registerPerSession(id: String, factory: ⇒ ActorRef): Unit = synchronized { - registerPerSession(id, () ⇒ factory, actorsFactories) - } - - private def registerPerSession[Key](id: Key, factory: () ⇒ ActorRef, registry: ConcurrentHashMap[Key, () ⇒ ActorRef]) { - if (_isRunning.isOn) - registry.put(id, factory) //TODO change to putIfAbsent - } - - /** - * Unregister RemoteModule Actor that is registered using its 'id' field (not custom ID). - */ - def unregister(actorRef: ActorRef): Unit = guard withGuard { - - if (_isRunning.isOn) { - app.eventHandler.debug(this, "Unregister server side remote actor with id [%s]".format(actorRef.uuid)) - - actors.remove(actorRef.address, actorRef) - actorsByUuid.remove(actorRef.uuid.toString, actorRef) - } - } - - /** - * Unregister RemoteModule Actor by specific 'id'. - *

- * NOTE: You need to call this method if you have registered an actor by a custom ID. - */ - def unregister(id: String): Unit = guard withGuard { - - if (_isRunning.isOn) { - app.eventHandler.debug(this, "Unregister server side remote actor with id [%s]".format(id)) - - if (id.startsWith(UUID_PREFIX)) actorsByUuid.remove(id.substring(UUID_PREFIX.length)) - else { - val actorRef = actors get id - actorsByUuid.remove(actorRef.uuid.toString, actorRef) - actors.remove(id, actorRef) - } - } - } - - /** - * Unregister RemoteModule Actor by specific 'id'. - *

- * NOTE: You need to call this method if you have registered an actor by a custom ID. - */ - def unregisterPerSession(id: String) { - - if (_isRunning.isOn) { - app.eventHandler.info(this, "Unregistering server side remote actor with id [%s]".format(id)) - - actorsFactories.remove(id) - } - } } /** @@ -747,10 +621,6 @@ class RemoteServerHandler( implicit def app = server.app - // applicationLoader.foreach(MessageSerializer.setClassLoader(_)) //TODO: REVISIT: THIS FEELS A BIT DODGY - - val sessionActors = new ChannelLocal[ConcurrentHashMap[String, ActorRef]]() - //Writes the specified message to the specified channel and propagates write errors to listeners private def write(channel: Channel, payload: AkkaRemoteProtocol) { channel.write(payload).addListener( @@ -778,48 +648,26 @@ class RemoteServerHandler( override def channelConnected(ctx: ChannelHandlerContext, event: ChannelStateEvent) = { val clientAddress = getClientAddress(ctx) app.eventHandler.debug(this, "Remote client [%s] connected to [%s]".format(clientAddress, server.name)) - - sessionActors.set(event.getChannel(), new ConcurrentHashMap[String, ActorRef]()) server.notifyListeners(RemoteServerClientConnected(server, clientAddress)) } override def channelDisconnected(ctx: ChannelHandlerContext, event: ChannelStateEvent) = { val clientAddress = getClientAddress(ctx) - app.eventHandler.debug(this, "Remote client [%s] disconnected from [%s]".format(clientAddress, server.name)) - - // stop all session actors - for ( - map ← Option(sessionActors.remove(event.getChannel)); - actor ← collectionAsScalaIterable(map.values) - ) { - try { - actor ! PoisonPill - } catch { - case e: Exception ⇒ app.eventHandler.error(e, this, "Couldn't stop %s".format(actor)) - } - } - server.notifyListeners(RemoteServerClientDisconnected(server, clientAddress)) } override def channelClosed(ctx: ChannelHandlerContext, event: ChannelStateEvent) = { val clientAddress = getClientAddress(ctx) app.eventHandler.debug("Remote client [%s] channel closed from [%s]".format(clientAddress, server.name), this) - server.notifyListeners(RemoteServerClientClosed(server, clientAddress)) } override def messageReceived(ctx: ChannelHandlerContext, event: MessageEvent) = { event.getMessage match { - case null ⇒ - throw new IllegalActorStateException("Message in remote MessageEvent is null [" + event + "]") - - case remote: AkkaRemoteProtocol if remote.hasMessage ⇒ - handleRemoteMessageProtocol(remote.getMessage, event.getChannel) - + case null ⇒ throw new IllegalActorStateException("Message in remote MessageEvent is null [" + event + "]") + case remote: AkkaRemoteProtocol if remote.hasMessage ⇒ handleRemoteMessageProtocol(remote.getMessage, event.getChannel) //case remote: AkkaRemoteProtocol if remote.hasInstruction => RemoteServer cannot receive control messages (yet) - case _ ⇒ //ignore } } @@ -838,101 +686,32 @@ class RemoteServerHandler( } private def handleRemoteMessageProtocol(request: RemoteMessageProtocol, channel: Channel) = try { - app.eventHandler.debug(this, "Received remote message [%s]".format(request)) - dispatchToActor(request, channel) + try { + val remoteMessage = new RemoteMessage(request, server.remoteSupport, applicationLoader) + val recipient = remoteMessage.recipient + + remoteMessage.payload match { + case Left(t) ⇒ throw t + case Right(r) ⇒ r match { + case _: Terminate ⇒ if (UNTRUSTED_MODE) throw new SecurityException("RemoteModule server is operating is untrusted mode, can not stop the actor") else recipient.stop() + case _: AutoReceivedMessage if (UNTRUSTED_MODE) ⇒ throw new SecurityException("RemoteModule server is operating is untrusted mode, can not pass on a AutoReceivedMessage to the remote actor") + case m ⇒ recipient.!(m)(remoteMessage.sender) + } + } + } catch { + case e: SecurityException ⇒ + app.eventHandler.error(e, this, e.getMessage) + write(channel, createErrorReplyMessage(e, request)) + server.notifyListeners(RemoteServerError(e, server)) + } } catch { case e: Exception ⇒ server.notifyListeners(RemoteServerError(e, server)) app.eventHandler.error(e, this, e.getMessage) } - private def dispatchToActor(request: RemoteMessageProtocol, channel: Channel) { - val actorInfo = request.getActorInfo - - app.eventHandler.debug(this, "Dispatching to remote actor [%s]".format(actorInfo.getUuid)) - - val actorRef = - try { - actorOf(actorInfo, channel) - } catch { - case e: SecurityException ⇒ - app.eventHandler.error(e, this, e.getMessage) - write(channel, createErrorReplyMessage(e, request)) - server.notifyListeners(RemoteServerError(e, server)) - return - } - - val sender = if (request.hasSender) serialization.fromProtobufToRemoteActorRef(request.getSender, applicationLoader) else app.deadLetters - - MessageSerializer.deserialize(app, request.getMessage) match { - case _: Terminate ⇒ if (UNTRUSTED_MODE) throw new SecurityException("RemoteModule server is operating is untrusted mode, can not stop the actor") else actorRef.stop() - case _: AutoReceivedMessage if (UNTRUSTED_MODE) ⇒ throw new SecurityException("RemoteModule server is operating is untrusted mode, can not pass on a AutoReceivedMessage to the remote actor") - case m ⇒ actorRef.!(m)(sender) - } - } - - /** - * Creates a new instance of the actor with name, uuid and timeout specified as arguments. - * - * If actor already created then just return it from the registry. - * - * Does not start the actor. - */ - private def actorOf(actorInfo: ActorInfoProtocol, channel: Channel): ActorRef = { - val uuid = actorInfo.getUuid - val address = actorInfo.getAddress - - app.eventHandler.debug(this, - "Looking up a remotely available actor for address [%s] on node [%s]" - .format(address, app.nodename)) - - val byAddress = server.actors.get(address) // try actor-by-address - if (byAddress eq null) { - val byUuid = server.actorsByUuid.get(uuid) // try actor-by-uuid - if (byUuid eq null) { - val bySession = createSessionActor(actorInfo, channel) // try actor-by-session - if (bySession eq null) { - throw new IllegalActorStateException( - "Could not find a remote actor with address [" + address + "] or uuid [" + uuid + "]") - } else bySession - } else byUuid - } else byAddress - } - - /** - * gets the actor from the session, or creates one if there is a factory for it - */ - private def createSessionActor(actorInfo: ActorInfoProtocol, channel: Channel): ActorRef = { - val uuid = actorInfo.getUuid - val address = actorInfo.getAddress - - findSessionActor(address, channel) match { - case null ⇒ // we dont have it in the session either, see if we have a factory for it - server.findActorFactory(address) match { - case null ⇒ null - case factory ⇒ - val actorRef = factory() - sessionActors.get(channel).put(address, actorRef) - actorRef //Start it where's it's created - } - case sessionActor ⇒ sessionActor - } - } - - private def findSessionActor(id: String, channel: Channel): ActorRef = - sessionActors.get(channel) match { - case null ⇒ null - case map ⇒ map get id - } - - private def createErrorReplyMessage(exception: Throwable, request: RemoteMessageProtocol): AkkaRemoteProtocol = { - val actorInfo = request.getActorInfo - val messageBuilder = serialization.createRemoteMessageProtocolBuilder(None, Right(request.getUuid), actorInfo.getAddress, actorInfo.getTimeout, Left(exception), None) - if (request.hasSupervisorUuid) messageBuilder.setSupervisorUuid(request.getSupervisorUuid) - RemoteEncoder.encode(messageBuilder.build) - } - - protected def parseUuid(protocol: UuidProtocol): Uuid = uuidFrom(protocol.getHigh, protocol.getLow) + private def createErrorReplyMessage(exception: Throwable, request: RemoteMessageProtocol): AkkaRemoteProtocol = + RemoteEncoder.encode(serialization.createRemoteMessageProtocolBuilder(Right(request.getSender), Left(exception), None).build) } class DefaultDisposableChannelGroup(name: String) extends DefaultChannelGroup(name) { diff --git a/akka-remote/src/main/scala/akka/serialization/SerializationProtocol.scala b/akka-remote/src/main/scala/akka/serialization/SerializationProtocol.scala index bea53aee16..aedcd5f3ee 100644 --- a/akka-remote/src/main/scala/akka/serialization/SerializationProtocol.scala +++ b/akka-remote/src/main/scala/akka/serialization/SerializationProtocol.scala @@ -6,17 +6,10 @@ package akka.serialization import akka.actor._ import akka.actor.DeploymentConfig._ -import akka.dispatch.Envelope -import akka.util.{ ReflectiveAccess, Duration } -import akka.event.EventHandler import akka.remote._ import RemoteProtocol._ -import akka.AkkaApplication - -import scala.collection.immutable.Stack import java.net.InetSocketAddress -import java.util.{ LinkedList, Collections } import com.google.protobuf.ByteString @@ -24,79 +17,20 @@ import com.eaio.uuid.UUID class RemoteActorSerialization(remote: RemoteSupport) { - /** - * Deserializes a byte array (Array[Byte]) into an RemoteActorRef instance. - */ - def fromBinaryToRemoteActorRef(bytes: Array[Byte]): ActorRef = - fromProtobufToRemoteActorRef(RemoteActorRefProtocol.newBuilder.mergeFrom(bytes).build, None) - - /** - * Deserializes a byte array (Array[Byte]) into an RemoteActorRef instance. - */ - def fromBinaryToRemoteActorRef(bytes: Array[Byte], loader: ClassLoader): ActorRef = - fromProtobufToRemoteActorRef(RemoteActorRefProtocol.newBuilder.mergeFrom(bytes).build, Some(loader)) - - /** - * Deserializes a RemoteActorRefProtocol Protocol Buffers (protobuf) Message into an RemoteActorRef instance. - */ - private[akka] def fromProtobufToRemoteActorRef(protocol: RemoteActorRefProtocol, loader: Option[ClassLoader]): ActorRef = { - remote.app.eventHandler.debug(this, "Deserializing RemoteActorRefProtocol to RemoteActorRef:\n %s".format(protocol)) - - val ref = RemoteActorRef( - remote, - JavaSerializer.fromBinary(protocol.getInetSocketAddress.toByteArray, Some(classOf[InetSocketAddress]), loader).asInstanceOf[InetSocketAddress], - protocol.getAddress, - loader) - - remote.app.eventHandler.debug(this, "Newly deserialized RemoteActorRef has uuid: %s".format(ref.uuid)) - - ref - } - /** * Serializes the ActorRef instance into a Protocol Buffers (protobuf) Message. */ - def toRemoteActorRefProtocol(actor: ActorRef): RemoteActorRefProtocol = { - val remoteAddress = actor match { - case ar: RemoteActorRef ⇒ - ar.remoteAddress - case ar: ActorRef ⇒ - remote.register(ar) //FIXME stop doing this and delegate to provider.actorFor in the NettyRemoting - remote.app.defaultAddress //FIXME Shouldn't this be the _current_ address of the remoting? - } - - remote.app.eventHandler.debug(this, "Register serialized Actor [%s] as remote @ [%s]".format(actor.uuid, remoteAddress)) - - RemoteActorRefProtocol.newBuilder - .setInetSocketAddress(ByteString.copyFrom(JavaSerializer.toBinary(remoteAddress))) - .setAddress(actor.address) - .setTimeout(remote.app.AkkaConfig.ActorTimeoutMillis) - .build + def toRemoteActorRefProtocol(actor: ActorRef): ActorRefProtocol = { + val rep = remote.app.provider.serialize(actor) + ActorRefProtocol.newBuilder.setAddress(rep.address).setHost(rep.hostname).setPort(rep.port).build } def createRemoteMessageProtocolBuilder( - actorRef: Option[ActorRef], - replyUuid: Either[Uuid, UuidProtocol], - actorAddress: String, - timeout: Long, + recipient: Either[ActorRef, ActorRefProtocol], message: Either[Throwable, Any], senderOption: Option[ActorRef]): RemoteMessageProtocol.Builder = { - val uuidProtocol = replyUuid match { - case Left(uid) ⇒ UuidProtocol.newBuilder.setHigh(uid.getTime).setLow(uid.getClockSeqAndNode).build - case Right(protocol) ⇒ protocol - } - - val actorInfoBuilder = ActorInfoProtocol.newBuilder.setUuid(uuidProtocol).setAddress(actorAddress).setTimeout(timeout) - - val actorInfo = actorInfoBuilder.build - val messageBuilder = RemoteMessageProtocol.newBuilder - .setUuid({ - val messageUuid = newUuid - UuidProtocol.newBuilder.setHigh(messageUuid.getTime).setLow(messageUuid.getClockSeqAndNode).build - }) - .setActorInfo(actorInfo) - .setOneWay(true) + val messageBuilder = RemoteMessageProtocol.newBuilder.setRecipient(recipient.fold(toRemoteActorRefProtocol _, identity)) message match { case Right(message) ⇒ @@ -108,8 +42,7 @@ class RemoteActorSerialization(remote: RemoteSupport) { .build) } - if (senderOption.isDefined) - messageBuilder.setSender(toRemoteActorRefProtocol(senderOption.get)) + if (senderOption.isDefined) messageBuilder.setSender(toRemoteActorRefProtocol(senderOption.get)) messageBuilder } From 601df0421c235f27b972120b1281273ae8d41c4b Mon Sep 17 00:00:00 2001 From: Viktor Klang Date: Thu, 3 Nov 2011 15:42:46 +0100 Subject: [PATCH 40/57] Folding RemoteEncoder into the RemoteMarshallingOps --- .../src/main/scala/akka/remote/Remote.scala | 50 +++++++++++++++++++ .../remote/netty/NettyRemoteSupport.scala | 46 ++++------------- .../serialization/SerializationProtocol.scala | 49 ------------------ 3 files changed, 61 insertions(+), 84 deletions(-) delete mode 100644 akka-remote/src/main/scala/akka/serialization/SerializationProtocol.scala diff --git a/akka-remote/src/main/scala/akka/remote/Remote.scala b/akka-remote/src/main/scala/akka/remote/Remote.scala index 8ba981798f..0d67a15985 100644 --- a/akka-remote/src/main/scala/akka/remote/Remote.scala +++ b/akka-remote/src/main/scala/akka/remote/Remote.scala @@ -254,3 +254,53 @@ class RemoteMessage(input: RemoteMessageProtocol, remote: RemoteSupport, classLo override def toString = "RemoteMessage: " + recipient + "(" + input.getRecipient.getAddress + ") from " + sender } + +trait RemoteMarshallingOps { + + def app: AkkaApplication + + def createMessageSendEnvelope(rmp: RemoteMessageProtocol): AkkaRemoteProtocol = { + val arp = AkkaRemoteProtocol.newBuilder + arp.setMessage(rmp) + arp.build + } + + def createControlEnvelope(rcp: RemoteControlProtocol): AkkaRemoteProtocol = { + val arp = AkkaRemoteProtocol.newBuilder + arp.setInstruction(rcp) + arp.build + } + + /** + * Serializes the ActorRef instance into a Protocol Buffers (protobuf) Message. + */ + def toRemoteActorRefProtocol(actor: ActorRef): ActorRefProtocol = { + val rep = app.provider.serialize(actor) + ActorRefProtocol.newBuilder.setAddress(rep.address).setHost(rep.hostname).setPort(rep.port).build + } + + def createRemoteMessageProtocolBuilder( + recipient: Either[ActorRef, ActorRefProtocol], + message: Either[Throwable, Any], + senderOption: Option[ActorRef]): RemoteMessageProtocol.Builder = { + + val messageBuilder = RemoteMessageProtocol.newBuilder.setRecipient(recipient.fold(toRemoteActorRefProtocol _, identity)) + + message match { + case Right(message) ⇒ + messageBuilder.setMessage(MessageSerializer.serialize(app, message.asInstanceOf[AnyRef])) + case Left(exception) ⇒ + messageBuilder.setException(ExceptionProtocol.newBuilder + .setClassname(exception.getClass.getName) + .setMessage(Option(exception.getMessage).getOrElse("")) + .build) + } + + if (senderOption.isDefined) messageBuilder.setSender(toRemoteActorRefProtocol(senderOption.get)) + + messageBuilder + } + + def createErrorReplyMessage(exception: Throwable, request: RemoteMessageProtocol): AkkaRemoteProtocol = + createMessageSendEnvelope(createRemoteMessageProtocolBuilder(Right(request.getSender), Left(exception), None).build) +} diff --git a/akka-remote/src/main/scala/akka/remote/netty/NettyRemoteSupport.scala b/akka-remote/src/main/scala/akka/remote/netty/NettyRemoteSupport.scala index 10b5246596..d0e4c59efd 100644 --- a/akka-remote/src/main/scala/akka/remote/netty/NettyRemoteSupport.scala +++ b/akka-remote/src/main/scala/akka/remote/netty/NettyRemoteSupport.scala @@ -4,7 +4,7 @@ package akka.remote.netty -import akka.actor.{ ActorRef, Uuid, newUuid, uuidFrom, IllegalActorStateException, PoisonPill, AutoReceivedMessage, simpleName } +import akka.actor.{ ActorRef, IllegalActorStateException, AutoReceivedMessage, simpleName } import akka.remote._ import RemoteProtocol._ import akka.util._ @@ -26,27 +26,12 @@ import java.util.concurrent._ import java.util.concurrent.atomic._ import akka.AkkaException import akka.AkkaApplication -import akka.serialization.RemoteActorSerialization -import akka.dispatch.{ Terminate, DefaultPromise, Promise } +import akka.dispatch.{ Terminate } class RemoteClientMessageBufferException(message: String, cause: Throwable = null) extends AkkaException(message, cause) { def this(msg: String) = this(msg, null); } -object RemoteEncoder { - def encode(rmp: RemoteMessageProtocol): AkkaRemoteProtocol = { - val arp = AkkaRemoteProtocol.newBuilder - arp.setMessage(rmp) - arp.build - } - - def encode(rcp: RemoteControlProtocol): AkkaRemoteProtocol = { - val arp = AkkaRemoteProtocol.newBuilder - arp.setInstruction(rcp) - arp.build - } -} - trait NettyRemoteClientModule extends RemoteClientModule { self: RemoteSupport ⇒ @@ -134,14 +119,12 @@ abstract class RemoteClient private[akka] ( val app: AkkaApplication, val remoteSupport: RemoteSupport, val module: NettyRemoteClientModule, - val remoteAddress: InetSocketAddress) { + val remoteAddress: InetSocketAddress) extends RemoteMarshallingOps { val name = simpleName(this) + "@" + remoteAddress.getAddress.getHostAddress + "::" + remoteAddress.getPort - val serialization = new RemoteActorSerialization(remoteSupport) - private[remote] val runSwitch = new Switch() private[remote] def isRunning = runSwitch.isOn @@ -158,7 +141,7 @@ abstract class RemoteClient private[akka] ( * Converts the message to the wireprotocol and sends the message across the wire */ def send[T](message: Any, senderOption: Option[ActorRef], recipient: ActorRef) { - send(serialization.createRemoteMessageProtocolBuilder(Left(recipient), Right(message), senderOption).build) + send(createRemoteMessageProtocolBuilder(Left(recipient), Right(message), senderOption).build) } /** @@ -170,7 +153,7 @@ abstract class RemoteClient private[akka] ( // tell try { - val future = currentChannel.write(RemoteEncoder.encode(request)) + val future = currentChannel.write(createMessageSendEnvelope(request)) future.awaitUninterruptibly() //TODO FIXME SWITCH TO NONBLOCKING WRITE if (!future.isCancelled && !future.isSuccess) { notifyListeners(RemoteClientWriteFailed(request, future.getCause, module, remoteAddress)) @@ -227,7 +210,7 @@ class ActiveRemoteClient private[akka] ( def sendSecureCookie(connection: ChannelFuture) { val handshake = RemoteControlProtocol.newBuilder.setCommandType(CommandType.CONNECT) if (SECURE_COOKIE.nonEmpty) handshake.setCookie(SECURE_COOKIE.get) - connection.getChannel.write(RemoteEncoder.encode(handshake.build)) + connection.getChannel.write(createControlEnvelope(handshake.build)) } def closeChannel(connection: ChannelFuture) = { @@ -446,13 +429,11 @@ class NettyRemoteSupport(_app: AkkaApplication) extends RemoteSupport(_app) with override def toString = name } -class NettyRemoteServer(app: AkkaApplication, serverModule: NettyRemoteServerModule, val host: String, val port: Int, val loader: Option[ClassLoader]) { +class NettyRemoteServer(val app: AkkaApplication, serverModule: NettyRemoteServerModule, val host: String, val port: Int, val loader: Option[ClassLoader]) extends RemoteMarshallingOps { val settings = new RemoteServerSettings(app) import settings._ - val serialization = new RemoteActorSerialization(serverModule.remoteSupport) - val name = "NettyRemoteServer@" + host + ":" + port val address = new InetSocketAddress(host, port) @@ -470,7 +451,7 @@ class NettyRemoteServer(app: AkkaApplication, serverModule: NettyRemoteServerMod // group of open channels, used for clean-up private val openChannels: ChannelGroup = new DefaultDisposableChannelGroup("akka-remote-server") - val pipelineFactory = new RemoteServerPipelineFactory(settings, serialization, name, openChannels, executor, loader, serverModule) + val pipelineFactory = new RemoteServerPipelineFactory(settings, name, openChannels, executor, loader, serverModule) bootstrap.setPipelineFactory(pipelineFactory) bootstrap.setOption("backlog", BACKLOG) bootstrap.setOption("child.tcpNoDelay", true) @@ -490,7 +471,7 @@ class NettyRemoteServer(app: AkkaApplication, serverModule: NettyRemoteServerMod b.setCookie(SECURE_COOKIE.get) b.build } - openChannels.write(RemoteEncoder.encode(shutdownSignal)).awaitUninterruptibly + openChannels.write(createControlEnvelope(shutdownSignal)).awaitUninterruptibly openChannels.disconnect openChannels.close.awaitUninterruptibly bootstrap.releaseExternalResources() @@ -557,7 +538,6 @@ trait NettyRemoteServerModule extends RemoteServerModule { */ class RemoteServerPipelineFactory( val settings: RemoteServerSettings, - val serialization: RemoteActorSerialization, val name: String, val openChannels: ChannelGroup, val executor: ExecutionHandler, @@ -573,7 +553,7 @@ class RemoteServerPipelineFactory( val protobufEnc = new ProtobufEncoder val authenticator = if (REQUIRE_COOKIE) new RemoteServerAuthenticationHandler(SECURE_COOKIE) :: Nil else Nil - val remoteServer = new RemoteServerHandler(settings, serialization, name, openChannels, loader, server) + val remoteServer = new RemoteServerHandler(settings, name, openChannels, loader, server) val stages: List[ChannelHandler] = lenDec :: protobufDec :: lenPrep :: protobufEnc :: executor :: authenticator ::: remoteServer :: Nil new StaticChannelPipeline(stages: _*) } @@ -611,11 +591,10 @@ class RemoteServerAuthenticationHandler(secureCookie: Option[String]) extends Si @ChannelHandler.Sharable class RemoteServerHandler( val settings: RemoteServerSettings, - val serialization: RemoteActorSerialization, val name: String, val openChannels: ChannelGroup, val applicationLoader: Option[ClassLoader], - val server: NettyRemoteServerModule) extends SimpleChannelUpstreamHandler { + val server: NettyRemoteServerModule) extends SimpleChannelUpstreamHandler with RemoteMarshallingOps { import settings._ @@ -709,9 +688,6 @@ class RemoteServerHandler( server.notifyListeners(RemoteServerError(e, server)) app.eventHandler.error(e, this, e.getMessage) } - - private def createErrorReplyMessage(exception: Throwable, request: RemoteMessageProtocol): AkkaRemoteProtocol = - RemoteEncoder.encode(serialization.createRemoteMessageProtocolBuilder(Right(request.getSender), Left(exception), None).build) } class DefaultDisposableChannelGroup(name: String) extends DefaultChannelGroup(name) { diff --git a/akka-remote/src/main/scala/akka/serialization/SerializationProtocol.scala b/akka-remote/src/main/scala/akka/serialization/SerializationProtocol.scala deleted file mode 100644 index aedcd5f3ee..0000000000 --- a/akka-remote/src/main/scala/akka/serialization/SerializationProtocol.scala +++ /dev/null @@ -1,49 +0,0 @@ -/** - * Copyright (C) 2009-2011 Typesafe Inc. - */ - -package akka.serialization - -import akka.actor._ -import akka.actor.DeploymentConfig._ -import akka.remote._ -import RemoteProtocol._ - -import java.net.InetSocketAddress - -import com.google.protobuf.ByteString - -import com.eaio.uuid.UUID - -class RemoteActorSerialization(remote: RemoteSupport) { - - /** - * Serializes the ActorRef instance into a Protocol Buffers (protobuf) Message. - */ - def toRemoteActorRefProtocol(actor: ActorRef): ActorRefProtocol = { - val rep = remote.app.provider.serialize(actor) - ActorRefProtocol.newBuilder.setAddress(rep.address).setHost(rep.hostname).setPort(rep.port).build - } - - def createRemoteMessageProtocolBuilder( - recipient: Either[ActorRef, ActorRefProtocol], - message: Either[Throwable, Any], - senderOption: Option[ActorRef]): RemoteMessageProtocol.Builder = { - - val messageBuilder = RemoteMessageProtocol.newBuilder.setRecipient(recipient.fold(toRemoteActorRefProtocol _, identity)) - - message match { - case Right(message) ⇒ - messageBuilder.setMessage(MessageSerializer.serialize(remote.app, message.asInstanceOf[AnyRef])) - case Left(exception) ⇒ - messageBuilder.setException(ExceptionProtocol.newBuilder - .setClassname(exception.getClass.getName) - .setMessage(Option(exception.getMessage).getOrElse("")) - .build) - } - - if (senderOption.isDefined) messageBuilder.setSender(toRemoteActorRefProtocol(senderOption.get)) - - messageBuilder - } -} From 37ba03eadbe63096f3ab2b6105ca2b227d63647b Mon Sep 17 00:00:00 2001 From: Viktor Klang Date: Thu, 3 Nov 2011 18:33:57 +0100 Subject: [PATCH 41/57] Adding initial support in the protocol to get the public host/port of the connecting remote server --- .../scala/akka/remote/RemoteInterface.scala | 16 +- .../scala/akka/util/ReflectiveAccess.scala | 4 - .../main/java/akka/remote/RemoteProtocol.java | 820 +++++++++++++++--- .../src/main/protocol/RemoteProtocol.proto | 10 +- .../src/main/scala/akka/remote/Remote.scala | 2 +- .../akka/remote/RemoteActorRefProvider.scala | 6 +- .../remote/netty/NettyRemoteSupport.scala | 24 +- 7 files changed, 748 insertions(+), 134 deletions(-) diff --git a/akka-actor/src/main/scala/akka/remote/RemoteInterface.scala b/akka-actor/src/main/scala/akka/remote/RemoteInterface.scala index e32421e989..797ea7c1aa 100644 --- a/akka-actor/src/main/scala/akka/remote/RemoteInterface.scala +++ b/akka-actor/src/main/scala/akka/remote/RemoteInterface.scala @@ -21,10 +21,6 @@ import java.lang.reflect.InvocationTargetException class RemoteException(message: String) extends AkkaException(message) -trait RemoteService { - def server: RemoteSupport -} - trait RemoteModule { protected[akka] def notifyListeners(message: ⇒ Any): Unit } @@ -174,9 +170,9 @@ trait RemoteClientModule extends RemoteModule { self: RemoteSupport ⇒ /** Methods that needs to be implemented by a transport **/ - protected[akka] def send[T](message: Any, - senderOption: Option[ActorRef], - remoteAddress: InetSocketAddress, - recipient: ActorRef, - loader: Option[ClassLoader]): Unit -} + protected[akka] def send(message: Any, + senderOption: Option[ActorRef], + remoteAddress: InetSocketAddress, + recipient: ActorRef, + loader: Option[ClassLoader]): Unit +} \ No newline at end of file diff --git a/akka-actor/src/main/scala/akka/util/ReflectiveAccess.scala b/akka-actor/src/main/scala/akka/util/ReflectiveAccess.scala index a1e05cc819..f507b08ba6 100644 --- a/akka-actor/src/main/scala/akka/util/ReflectiveAccess.scala +++ b/akka-actor/src/main/scala/akka/util/ReflectiveAccess.scala @@ -4,15 +4,11 @@ package akka.util import akka.dispatch.Envelope -import akka.config.ModuleNotAvailableException import akka.actor._ import DeploymentConfig.ReplicationScheme import akka.config.ModuleNotAvailableException -import akka.event.EventHandler import akka.cluster.ClusterNode -import akka.remote.{ RemoteSupport, RemoteService } import akka.routing.{ RoutedProps, Router } -import java.net.InetSocketAddress import akka.AkkaApplication object ReflectiveAccess { diff --git a/akka-remote/src/main/java/akka/remote/RemoteProtocol.java b/akka-remote/src/main/java/akka/remote/RemoteProtocol.java index dec400def6..1efeb0e27f 100644 --- a/akka-remote/src/main/java/akka/remote/RemoteProtocol.java +++ b/akka-remote/src/main/java/akka/remote/RemoteProtocol.java @@ -2107,13 +2107,18 @@ public final class RemoteProtocol { public interface RemoteControlProtocolOrBuilder extends com.google.protobuf.MessageOrBuilder { - // optional string cookie = 1; + // required .CommandType commandType = 1; + boolean hasCommandType(); + akka.remote.RemoteProtocol.CommandType getCommandType(); + + // optional string cookie = 2; boolean hasCookie(); String getCookie(); - // required .CommandType commandType = 2; - boolean hasCommandType(); - akka.remote.RemoteProtocol.CommandType getCommandType(); + // optional .Endpoint origin = 3; + boolean hasOrigin(); + akka.remote.RemoteProtocol.Endpoint getOrigin(); + akka.remote.RemoteProtocol.EndpointOrBuilder getOriginOrBuilder(); } public static final class RemoteControlProtocol extends com.google.protobuf.GeneratedMessage @@ -2144,11 +2149,21 @@ public final class RemoteProtocol { } private int bitField0_; - // optional string cookie = 1; - public static final int COOKIE_FIELD_NUMBER = 1; + // required .CommandType commandType = 1; + public static final int COMMANDTYPE_FIELD_NUMBER = 1; + private akka.remote.RemoteProtocol.CommandType commandType_; + public boolean hasCommandType() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + public akka.remote.RemoteProtocol.CommandType getCommandType() { + return commandType_; + } + + // optional string cookie = 2; + public static final int COOKIE_FIELD_NUMBER = 2; private java.lang.Object cookie_; public boolean hasCookie() { - return ((bitField0_ & 0x00000001) == 0x00000001); + return ((bitField0_ & 0x00000002) == 0x00000002); } public String getCookie() { java.lang.Object ref = cookie_; @@ -2176,19 +2191,23 @@ public final class RemoteProtocol { } } - // required .CommandType commandType = 2; - public static final int COMMANDTYPE_FIELD_NUMBER = 2; - private akka.remote.RemoteProtocol.CommandType commandType_; - public boolean hasCommandType() { - return ((bitField0_ & 0x00000002) == 0x00000002); + // optional .Endpoint origin = 3; + public static final int ORIGIN_FIELD_NUMBER = 3; + private akka.remote.RemoteProtocol.Endpoint origin_; + public boolean hasOrigin() { + return ((bitField0_ & 0x00000004) == 0x00000004); } - public akka.remote.RemoteProtocol.CommandType getCommandType() { - return commandType_; + public akka.remote.RemoteProtocol.Endpoint getOrigin() { + return origin_; + } + public akka.remote.RemoteProtocol.EndpointOrBuilder getOriginOrBuilder() { + return origin_; } private void initFields() { - cookie_ = ""; commandType_ = akka.remote.RemoteProtocol.CommandType.CONNECT; + cookie_ = ""; + origin_ = akka.remote.RemoteProtocol.Endpoint.getDefaultInstance(); } private byte memoizedIsInitialized = -1; public final boolean isInitialized() { @@ -2199,6 +2218,12 @@ public final class RemoteProtocol { memoizedIsInitialized = 0; return false; } + if (hasOrigin()) { + if (!getOrigin().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } memoizedIsInitialized = 1; return true; } @@ -2207,10 +2232,13 @@ public final class RemoteProtocol { throws java.io.IOException { getSerializedSize(); if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeBytes(1, getCookieBytes()); + output.writeEnum(1, commandType_.getNumber()); } if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeEnum(2, commandType_.getNumber()); + output.writeBytes(2, getCookieBytes()); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeMessage(3, origin_); } getUnknownFields().writeTo(output); } @@ -2223,11 +2251,15 @@ public final class RemoteProtocol { size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += com.google.protobuf.CodedOutputStream - .computeBytesSize(1, getCookieBytes()); + .computeEnumSize(1, commandType_.getNumber()); } if (((bitField0_ & 0x00000002) == 0x00000002)) { size += com.google.protobuf.CodedOutputStream - .computeEnumSize(2, commandType_.getNumber()); + .computeBytesSize(2, getCookieBytes()); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, origin_); } size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; @@ -2345,6 +2377,7 @@ public final class RemoteProtocol { } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + getOriginFieldBuilder(); } } private static Builder create() { @@ -2353,10 +2386,16 @@ public final class RemoteProtocol { public Builder clear() { super.clear(); - cookie_ = ""; - bitField0_ = (bitField0_ & ~0x00000001); commandType_ = akka.remote.RemoteProtocol.CommandType.CONNECT; + bitField0_ = (bitField0_ & ~0x00000001); + cookie_ = ""; bitField0_ = (bitField0_ & ~0x00000002); + if (originBuilder_ == null) { + origin_ = akka.remote.RemoteProtocol.Endpoint.getDefaultInstance(); + } else { + originBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000004); return this; } @@ -2398,11 +2437,19 @@ public final class RemoteProtocol { if (((from_bitField0_ & 0x00000001) == 0x00000001)) { to_bitField0_ |= 0x00000001; } - result.cookie_ = cookie_; + result.commandType_ = commandType_; if (((from_bitField0_ & 0x00000002) == 0x00000002)) { to_bitField0_ |= 0x00000002; } - result.commandType_ = commandType_; + result.cookie_ = cookie_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + if (originBuilder_ == null) { + result.origin_ = origin_; + } else { + result.origin_ = originBuilder_.build(); + } result.bitField0_ = to_bitField0_; onBuilt(); return result; @@ -2419,11 +2466,14 @@ public final class RemoteProtocol { public Builder mergeFrom(akka.remote.RemoteProtocol.RemoteControlProtocol other) { if (other == akka.remote.RemoteProtocol.RemoteControlProtocol.getDefaultInstance()) return this; + if (other.hasCommandType()) { + setCommandType(other.getCommandType()); + } if (other.hasCookie()) { setCookie(other.getCookie()); } - if (other.hasCommandType()) { - setCommandType(other.getCommandType()); + if (other.hasOrigin()) { + mergeOrigin(other.getOrigin()); } this.mergeUnknownFields(other.getUnknownFields()); return this; @@ -2434,6 +2484,568 @@ public final class RemoteProtocol { return false; } + if (hasOrigin()) { + if (!getOrigin().isInitialized()) { + + return false; + } + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder( + this.getUnknownFields()); + while (true) { + int tag = input.readTag(); + switch (tag) { + case 0: + this.setUnknownFields(unknownFields.build()); + onChanged(); + return this; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + this.setUnknownFields(unknownFields.build()); + onChanged(); + return this; + } + break; + } + case 8: { + int rawValue = input.readEnum(); + akka.remote.RemoteProtocol.CommandType value = akka.remote.RemoteProtocol.CommandType.valueOf(rawValue); + if (value == null) { + unknownFields.mergeVarintField(1, rawValue); + } else { + bitField0_ |= 0x00000001; + commandType_ = value; + } + break; + } + case 18: { + bitField0_ |= 0x00000002; + cookie_ = input.readBytes(); + break; + } + case 26: { + akka.remote.RemoteProtocol.Endpoint.Builder subBuilder = akka.remote.RemoteProtocol.Endpoint.newBuilder(); + if (hasOrigin()) { + subBuilder.mergeFrom(getOrigin()); + } + input.readMessage(subBuilder, extensionRegistry); + setOrigin(subBuilder.buildPartial()); + break; + } + } + } + } + + private int bitField0_; + + // required .CommandType commandType = 1; + private akka.remote.RemoteProtocol.CommandType commandType_ = akka.remote.RemoteProtocol.CommandType.CONNECT; + public boolean hasCommandType() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + public akka.remote.RemoteProtocol.CommandType getCommandType() { + return commandType_; + } + public Builder setCommandType(akka.remote.RemoteProtocol.CommandType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + commandType_ = value; + onChanged(); + return this; + } + public Builder clearCommandType() { + bitField0_ = (bitField0_ & ~0x00000001); + commandType_ = akka.remote.RemoteProtocol.CommandType.CONNECT; + onChanged(); + return this; + } + + // optional string cookie = 2; + private java.lang.Object cookie_ = ""; + public boolean hasCookie() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + public String getCookie() { + java.lang.Object ref = cookie_; + if (!(ref instanceof String)) { + String s = ((com.google.protobuf.ByteString) ref).toStringUtf8(); + cookie_ = s; + return s; + } else { + return (String) ref; + } + } + public Builder setCookie(String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + cookie_ = value; + onChanged(); + return this; + } + public Builder clearCookie() { + bitField0_ = (bitField0_ & ~0x00000002); + cookie_ = getDefaultInstance().getCookie(); + onChanged(); + return this; + } + void setCookie(com.google.protobuf.ByteString value) { + bitField0_ |= 0x00000002; + cookie_ = value; + onChanged(); + } + + // optional .Endpoint origin = 3; + private akka.remote.RemoteProtocol.Endpoint origin_ = akka.remote.RemoteProtocol.Endpoint.getDefaultInstance(); + private com.google.protobuf.SingleFieldBuilder< + akka.remote.RemoteProtocol.Endpoint, akka.remote.RemoteProtocol.Endpoint.Builder, akka.remote.RemoteProtocol.EndpointOrBuilder> originBuilder_; + public boolean hasOrigin() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + public akka.remote.RemoteProtocol.Endpoint getOrigin() { + if (originBuilder_ == null) { + return origin_; + } else { + return originBuilder_.getMessage(); + } + } + public Builder setOrigin(akka.remote.RemoteProtocol.Endpoint value) { + if (originBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + origin_ = value; + onChanged(); + } else { + originBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + return this; + } + public Builder setOrigin( + akka.remote.RemoteProtocol.Endpoint.Builder builderForValue) { + if (originBuilder_ == null) { + origin_ = builderForValue.build(); + onChanged(); + } else { + originBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + return this; + } + public Builder mergeOrigin(akka.remote.RemoteProtocol.Endpoint value) { + if (originBuilder_ == null) { + if (((bitField0_ & 0x00000004) == 0x00000004) && + origin_ != akka.remote.RemoteProtocol.Endpoint.getDefaultInstance()) { + origin_ = + akka.remote.RemoteProtocol.Endpoint.newBuilder(origin_).mergeFrom(value).buildPartial(); + } else { + origin_ = value; + } + onChanged(); + } else { + originBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + return this; + } + public Builder clearOrigin() { + if (originBuilder_ == null) { + origin_ = akka.remote.RemoteProtocol.Endpoint.getDefaultInstance(); + onChanged(); + } else { + originBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + public akka.remote.RemoteProtocol.Endpoint.Builder getOriginBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getOriginFieldBuilder().getBuilder(); + } + public akka.remote.RemoteProtocol.EndpointOrBuilder getOriginOrBuilder() { + if (originBuilder_ != null) { + return originBuilder_.getMessageOrBuilder(); + } else { + return origin_; + } + } + private com.google.protobuf.SingleFieldBuilder< + akka.remote.RemoteProtocol.Endpoint, akka.remote.RemoteProtocol.Endpoint.Builder, akka.remote.RemoteProtocol.EndpointOrBuilder> + getOriginFieldBuilder() { + if (originBuilder_ == null) { + originBuilder_ = new com.google.protobuf.SingleFieldBuilder< + akka.remote.RemoteProtocol.Endpoint, akka.remote.RemoteProtocol.Endpoint.Builder, akka.remote.RemoteProtocol.EndpointOrBuilder>( + origin_, + getParentForChildren(), + isClean()); + origin_ = null; + } + return originBuilder_; + } + + // @@protoc_insertion_point(builder_scope:RemoteControlProtocol) + } + + static { + defaultInstance = new RemoteControlProtocol(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:RemoteControlProtocol) + } + + public interface EndpointOrBuilder + extends com.google.protobuf.MessageOrBuilder { + + // required string host = 1; + boolean hasHost(); + String getHost(); + + // required uint32 port = 2; + boolean hasPort(); + int getPort(); + } + public static final class Endpoint extends + com.google.protobuf.GeneratedMessage + implements EndpointOrBuilder { + // Use Endpoint.newBuilder() to construct. + private Endpoint(Builder builder) { + super(builder); + } + private Endpoint(boolean noInit) {} + + private static final Endpoint defaultInstance; + public static Endpoint getDefaultInstance() { + return defaultInstance; + } + + public Endpoint getDefaultInstanceForType() { + return defaultInstance; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return akka.remote.RemoteProtocol.internal_static_Endpoint_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return akka.remote.RemoteProtocol.internal_static_Endpoint_fieldAccessorTable; + } + + private int bitField0_; + // required string host = 1; + public static final int HOST_FIELD_NUMBER = 1; + private java.lang.Object host_; + public boolean hasHost() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + public String getHost() { + java.lang.Object ref = host_; + if (ref instanceof String) { + return (String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + String s = bs.toStringUtf8(); + if (com.google.protobuf.Internal.isValidUtf8(bs)) { + host_ = s; + } + return s; + } + } + private com.google.protobuf.ByteString getHostBytes() { + java.lang.Object ref = host_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((String) ref); + host_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + // required uint32 port = 2; + public static final int PORT_FIELD_NUMBER = 2; + private int port_; + public boolean hasPort() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + public int getPort() { + return port_; + } + + private void initFields() { + host_ = ""; + port_ = 0; + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized != -1) return isInitialized == 1; + + if (!hasHost()) { + memoizedIsInitialized = 0; + return false; + } + if (!hasPort()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeBytes(1, getHostBytes()); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeUInt32(2, port_); + } + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(1, getHostBytes()); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(2, port_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static akka.remote.RemoteProtocol.Endpoint parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return newBuilder().mergeFrom(data).buildParsed(); + } + public static akka.remote.RemoteProtocol.Endpoint parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return newBuilder().mergeFrom(data, extensionRegistry) + .buildParsed(); + } + public static akka.remote.RemoteProtocol.Endpoint parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return newBuilder().mergeFrom(data).buildParsed(); + } + public static akka.remote.RemoteProtocol.Endpoint parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return newBuilder().mergeFrom(data, extensionRegistry) + .buildParsed(); + } + public static akka.remote.RemoteProtocol.Endpoint parseFrom(java.io.InputStream input) + throws java.io.IOException { + return newBuilder().mergeFrom(input).buildParsed(); + } + public static akka.remote.RemoteProtocol.Endpoint parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return newBuilder().mergeFrom(input, extensionRegistry) + .buildParsed(); + } + public static akka.remote.RemoteProtocol.Endpoint parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + Builder builder = newBuilder(); + if (builder.mergeDelimitedFrom(input)) { + return builder.buildParsed(); + } else { + return null; + } + } + public static akka.remote.RemoteProtocol.Endpoint parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + Builder builder = newBuilder(); + if (builder.mergeDelimitedFrom(input, extensionRegistry)) { + return builder.buildParsed(); + } else { + return null; + } + } + public static akka.remote.RemoteProtocol.Endpoint parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return newBuilder().mergeFrom(input).buildParsed(); + } + public static akka.remote.RemoteProtocol.Endpoint parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return newBuilder().mergeFrom(input, extensionRegistry) + .buildParsed(); + } + + public static Builder newBuilder() { return Builder.create(); } + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(akka.remote.RemoteProtocol.Endpoint prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder + implements akka.remote.RemoteProtocol.EndpointOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return akka.remote.RemoteProtocol.internal_static_Endpoint_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return akka.remote.RemoteProtocol.internal_static_Endpoint_fieldAccessorTable; + } + + // Construct using akka.remote.RemoteProtocol.Endpoint.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { + } + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + host_ = ""; + bitField0_ = (bitField0_ & ~0x00000001); + port_ = 0; + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return akka.remote.RemoteProtocol.Endpoint.getDescriptor(); + } + + public akka.remote.RemoteProtocol.Endpoint getDefaultInstanceForType() { + return akka.remote.RemoteProtocol.Endpoint.getDefaultInstance(); + } + + public akka.remote.RemoteProtocol.Endpoint build() { + akka.remote.RemoteProtocol.Endpoint result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + private akka.remote.RemoteProtocol.Endpoint buildParsed() + throws com.google.protobuf.InvalidProtocolBufferException { + akka.remote.RemoteProtocol.Endpoint result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException( + result).asInvalidProtocolBufferException(); + } + return result; + } + + public akka.remote.RemoteProtocol.Endpoint buildPartial() { + akka.remote.RemoteProtocol.Endpoint result = new akka.remote.RemoteProtocol.Endpoint(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.host_ = host_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.port_ = port_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof akka.remote.RemoteProtocol.Endpoint) { + return mergeFrom((akka.remote.RemoteProtocol.Endpoint)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(akka.remote.RemoteProtocol.Endpoint other) { + if (other == akka.remote.RemoteProtocol.Endpoint.getDefaultInstance()) return this; + if (other.hasHost()) { + setHost(other.getHost()); + } + if (other.hasPort()) { + setPort(other.getPort()); + } + this.mergeUnknownFields(other.getUnknownFields()); + return this; + } + + public final boolean isInitialized() { + if (!hasHost()) { + + return false; + } + if (!hasPort()) { + + return false; + } return true; } @@ -2462,18 +3074,12 @@ public final class RemoteProtocol { } case 10: { bitField0_ |= 0x00000001; - cookie_ = input.readBytes(); + host_ = input.readBytes(); break; } case 16: { - int rawValue = input.readEnum(); - akka.remote.RemoteProtocol.CommandType value = akka.remote.RemoteProtocol.CommandType.valueOf(rawValue); - if (value == null) { - unknownFields.mergeVarintField(2, rawValue); - } else { - bitField0_ |= 0x00000002; - commandType_ = value; - } + bitField0_ |= 0x00000002; + port_ = input.readUInt32(); break; } } @@ -2482,75 +3088,72 @@ public final class RemoteProtocol { private int bitField0_; - // optional string cookie = 1; - private java.lang.Object cookie_ = ""; - public boolean hasCookie() { + // required string host = 1; + private java.lang.Object host_ = ""; + public boolean hasHost() { return ((bitField0_ & 0x00000001) == 0x00000001); } - public String getCookie() { - java.lang.Object ref = cookie_; + public String getHost() { + java.lang.Object ref = host_; if (!(ref instanceof String)) { String s = ((com.google.protobuf.ByteString) ref).toStringUtf8(); - cookie_ = s; + host_ = s; return s; } else { return (String) ref; } } - public Builder setCookie(String value) { + public Builder setHost(String value) { if (value == null) { throw new NullPointerException(); } bitField0_ |= 0x00000001; - cookie_ = value; + host_ = value; onChanged(); return this; } - public Builder clearCookie() { + public Builder clearHost() { bitField0_ = (bitField0_ & ~0x00000001); - cookie_ = getDefaultInstance().getCookie(); + host_ = getDefaultInstance().getHost(); onChanged(); return this; } - void setCookie(com.google.protobuf.ByteString value) { + void setHost(com.google.protobuf.ByteString value) { bitField0_ |= 0x00000001; - cookie_ = value; + host_ = value; onChanged(); } - // required .CommandType commandType = 2; - private akka.remote.RemoteProtocol.CommandType commandType_ = akka.remote.RemoteProtocol.CommandType.CONNECT; - public boolean hasCommandType() { + // required uint32 port = 2; + private int port_ ; + public boolean hasPort() { return ((bitField0_ & 0x00000002) == 0x00000002); } - public akka.remote.RemoteProtocol.CommandType getCommandType() { - return commandType_; + public int getPort() { + return port_; } - public Builder setCommandType(akka.remote.RemoteProtocol.CommandType value) { - if (value == null) { - throw new NullPointerException(); - } + public Builder setPort(int value) { bitField0_ |= 0x00000002; - commandType_ = value; + port_ = value; onChanged(); return this; } - public Builder clearCommandType() { + public Builder clearPort() { bitField0_ = (bitField0_ & ~0x00000002); - commandType_ = akka.remote.RemoteProtocol.CommandType.CONNECT; + port_ = 0; onChanged(); return this; } - // @@protoc_insertion_point(builder_scope:RemoteControlProtocol) + // @@protoc_insertion_point(builder_scope:Endpoint) } static { - defaultInstance = new RemoteControlProtocol(true); + defaultInstance = new Endpoint(true); defaultInstance.initFields(); } - // @@protoc_insertion_point(class_scope:RemoteControlProtocol) + // @@protoc_insertion_point(class_scope:Endpoint) } public interface ActorRefProtocolOrBuilder @@ -6649,6 +7252,11 @@ public final class RemoteProtocol { private static com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_RemoteControlProtocol_fieldAccessorTable; + private static com.google.protobuf.Descriptors.Descriptor + internal_static_Endpoint_descriptor; + private static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_Endpoint_fieldAccessorTable; private static com.google.protobuf.Descriptors.Descriptor internal_static_ActorRefProtocol_descriptor; private static @@ -6706,37 +7314,39 @@ public final class RemoteProtocol { "ssage\030\002 \001(\0132\020.MessageProtocol\022%\n\texcepti" + "on\030\003 \001(\0132\022.ExceptionProtocol\022!\n\006sender\030\004" + " \001(\0132\021.ActorRefProtocol\022(\n\010metadata\030\005 \003(" + - "\0132\026.MetadataEntryProtocol\"J\n\025RemoteContr" + - "olProtocol\022\016\n\006cookie\030\001 \001(\t\022!\n\013commandTyp", - "e\030\002 \002(\0162\014.CommandType\"?\n\020ActorRefProtoco" + - "l\022\017\n\007address\030\001 \002(\t\022\014\n\004host\030\002 \002(\t\022\014\n\004port" + - "\030\003 \002(\r\";\n\017MessageProtocol\022\017\n\007message\030\001 \002" + - "(\014\022\027\n\017messageManifest\030\002 \001(\014\")\n\014UuidProto" + - "col\022\014\n\004high\030\001 \002(\004\022\013\n\003low\030\002 \002(\004\"3\n\025Metada" + - "taEntryProtocol\022\013\n\003key\030\001 \002(\t\022\r\n\005value\030\002 " + - "\002(\014\"1\n\017AddressProtocol\022\020\n\010hostname\030\001 \002(\t" + - "\022\014\n\004port\030\002 \002(\r\"7\n\021ExceptionProtocol\022\021\n\tc" + - "lassname\030\001 \002(\t\022\017\n\007message\030\002 \002(\t\"\256\001\n!Remo" + - "teSystemDaemonMessageProtocol\0223\n\013message", - "Type\030\001 \002(\0162\036.RemoteSystemDaemonMessageTy" + - "pe\022\024\n\014actorAddress\030\002 \001(\t\022\017\n\007payload\030\003 \001(" + - "\014\022-\n\026replicateActorFromUuid\030\004 \001(\0132\r.Uuid" + - "Protocol\"y\n\035DurableMailboxMessageProtoco" + - "l\022$\n\trecipient\030\001 \002(\0132\021.ActorRefProtocol\022" + - "!\n\006sender\030\002 \001(\0132\021.ActorRefProtocol\022\017\n\007me" + - "ssage\030\003 \002(\014*(\n\013CommandType\022\013\n\007CONNECT\020\001\022" + - "\014\n\010SHUTDOWN\020\002*K\n\026ReplicationStorageType\022" + - "\r\n\tTRANSIENT\020\001\022\023\n\017TRANSACTION_LOG\020\002\022\r\n\tD" + - "ATA_GRID\020\003*>\n\027ReplicationStrategyType\022\021\n", - "\rWRITE_THROUGH\020\001\022\020\n\014WRITE_BEHIND\020\002*\241\002\n\035R" + - "emoteSystemDaemonMessageType\022\010\n\004STOP\020\001\022\007" + - "\n\003USE\020\002\022\013\n\007RELEASE\020\003\022\022\n\016MAKE_AVAILABLE\020\004" + - "\022\024\n\020MAKE_UNAVAILABLE\020\005\022\016\n\nDISCONNECT\020\006\022\r" + - "\n\tRECONNECT\020\007\022\n\n\006RESIGN\020\010\022\n\n\006GOSSIP\020\t\022\031\n" + - "\025FAIL_OVER_CONNECTIONS\020\024\022\026\n\022FUNCTION_FUN" + - "0_UNIT\020\025\022\025\n\021FUNCTION_FUN0_ANY\020\026\022\032\n\026FUNCT" + - "ION_FUN1_ARG_UNIT\020\027\022\031\n\025FUNCTION_FUN1_ARG" + - "_ANY\020\030B\017\n\013akka.remoteH\001" + "\0132\026.MetadataEntryProtocol\"e\n\025RemoteContr" + + "olProtocol\022!\n\013commandType\030\001 \002(\0162\014.Comman", + "dType\022\016\n\006cookie\030\002 \001(\t\022\031\n\006origin\030\003 \001(\0132\t." + + "Endpoint\"&\n\010Endpoint\022\014\n\004host\030\001 \002(\t\022\014\n\004po" + + "rt\030\002 \002(\r\"?\n\020ActorRefProtocol\022\017\n\007address\030" + + "\001 \002(\t\022\014\n\004host\030\002 \002(\t\022\014\n\004port\030\003 \002(\r\";\n\017Mes" + + "sageProtocol\022\017\n\007message\030\001 \002(\014\022\027\n\017message" + + "Manifest\030\002 \001(\014\")\n\014UuidProtocol\022\014\n\004high\030\001" + + " \002(\004\022\013\n\003low\030\002 \002(\004\"3\n\025MetadataEntryProtoc" + + "ol\022\013\n\003key\030\001 \002(\t\022\r\n\005value\030\002 \002(\014\"1\n\017Addres" + + "sProtocol\022\020\n\010hostname\030\001 \002(\t\022\014\n\004port\030\002 \002(" + + "\r\"7\n\021ExceptionProtocol\022\021\n\tclassname\030\001 \002(", + "\t\022\017\n\007message\030\002 \002(\t\"\256\001\n!RemoteSystemDaemo" + + "nMessageProtocol\0223\n\013messageType\030\001 \002(\0162\036." + + "RemoteSystemDaemonMessageType\022\024\n\014actorAd" + + "dress\030\002 \001(\t\022\017\n\007payload\030\003 \001(\014\022-\n\026replicat" + + "eActorFromUuid\030\004 \001(\0132\r.UuidProtocol\"y\n\035D" + + "urableMailboxMessageProtocol\022$\n\trecipien" + + "t\030\001 \002(\0132\021.ActorRefProtocol\022!\n\006sender\030\002 \001" + + "(\0132\021.ActorRefProtocol\022\017\n\007message\030\003 \002(\014*(" + + "\n\013CommandType\022\013\n\007CONNECT\020\001\022\014\n\010SHUTDOWN\020\002" + + "*K\n\026ReplicationStorageType\022\r\n\tTRANSIENT\020", + "\001\022\023\n\017TRANSACTION_LOG\020\002\022\r\n\tDATA_GRID\020\003*>\n" + + "\027ReplicationStrategyType\022\021\n\rWRITE_THROUG" + + "H\020\001\022\020\n\014WRITE_BEHIND\020\002*\241\002\n\035RemoteSystemDa" + + "emonMessageType\022\010\n\004STOP\020\001\022\007\n\003USE\020\002\022\013\n\007RE" + + "LEASE\020\003\022\022\n\016MAKE_AVAILABLE\020\004\022\024\n\020MAKE_UNAV" + + "AILABLE\020\005\022\016\n\nDISCONNECT\020\006\022\r\n\tRECONNECT\020\007" + + "\022\n\n\006RESIGN\020\010\022\n\n\006GOSSIP\020\t\022\031\n\025FAIL_OVER_CO" + + "NNECTIONS\020\024\022\026\n\022FUNCTION_FUN0_UNIT\020\025\022\025\n\021F" + + "UNCTION_FUN0_ANY\020\026\022\032\n\026FUNCTION_FUN1_ARG_" + + "UNIT\020\027\022\031\n\025FUNCTION_FUN1_ARG_ANY\020\030B\017\n\013akk", + "a.remoteH\001" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { @@ -6764,11 +7374,19 @@ public final class RemoteProtocol { internal_static_RemoteControlProtocol_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_RemoteControlProtocol_descriptor, - new java.lang.String[] { "Cookie", "CommandType", }, + new java.lang.String[] { "CommandType", "Cookie", "Origin", }, akka.remote.RemoteProtocol.RemoteControlProtocol.class, akka.remote.RemoteProtocol.RemoteControlProtocol.Builder.class); - internal_static_ActorRefProtocol_descriptor = + internal_static_Endpoint_descriptor = getDescriptor().getMessageTypes().get(3); + internal_static_Endpoint_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_Endpoint_descriptor, + new java.lang.String[] { "Host", "Port", }, + akka.remote.RemoteProtocol.Endpoint.class, + akka.remote.RemoteProtocol.Endpoint.Builder.class); + internal_static_ActorRefProtocol_descriptor = + getDescriptor().getMessageTypes().get(4); internal_static_ActorRefProtocol_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_ActorRefProtocol_descriptor, @@ -6776,7 +7394,7 @@ public final class RemoteProtocol { akka.remote.RemoteProtocol.ActorRefProtocol.class, akka.remote.RemoteProtocol.ActorRefProtocol.Builder.class); internal_static_MessageProtocol_descriptor = - getDescriptor().getMessageTypes().get(4); + getDescriptor().getMessageTypes().get(5); internal_static_MessageProtocol_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_MessageProtocol_descriptor, @@ -6784,7 +7402,7 @@ public final class RemoteProtocol { akka.remote.RemoteProtocol.MessageProtocol.class, akka.remote.RemoteProtocol.MessageProtocol.Builder.class); internal_static_UuidProtocol_descriptor = - getDescriptor().getMessageTypes().get(5); + getDescriptor().getMessageTypes().get(6); internal_static_UuidProtocol_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_UuidProtocol_descriptor, @@ -6792,7 +7410,7 @@ public final class RemoteProtocol { akka.remote.RemoteProtocol.UuidProtocol.class, akka.remote.RemoteProtocol.UuidProtocol.Builder.class); internal_static_MetadataEntryProtocol_descriptor = - getDescriptor().getMessageTypes().get(6); + getDescriptor().getMessageTypes().get(7); internal_static_MetadataEntryProtocol_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_MetadataEntryProtocol_descriptor, @@ -6800,7 +7418,7 @@ public final class RemoteProtocol { akka.remote.RemoteProtocol.MetadataEntryProtocol.class, akka.remote.RemoteProtocol.MetadataEntryProtocol.Builder.class); internal_static_AddressProtocol_descriptor = - getDescriptor().getMessageTypes().get(7); + getDescriptor().getMessageTypes().get(8); internal_static_AddressProtocol_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_AddressProtocol_descriptor, @@ -6808,7 +7426,7 @@ public final class RemoteProtocol { akka.remote.RemoteProtocol.AddressProtocol.class, akka.remote.RemoteProtocol.AddressProtocol.Builder.class); internal_static_ExceptionProtocol_descriptor = - getDescriptor().getMessageTypes().get(8); + getDescriptor().getMessageTypes().get(9); internal_static_ExceptionProtocol_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_ExceptionProtocol_descriptor, @@ -6816,7 +7434,7 @@ public final class RemoteProtocol { akka.remote.RemoteProtocol.ExceptionProtocol.class, akka.remote.RemoteProtocol.ExceptionProtocol.Builder.class); internal_static_RemoteSystemDaemonMessageProtocol_descriptor = - getDescriptor().getMessageTypes().get(9); + getDescriptor().getMessageTypes().get(10); internal_static_RemoteSystemDaemonMessageProtocol_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_RemoteSystemDaemonMessageProtocol_descriptor, @@ -6824,7 +7442,7 @@ public final class RemoteProtocol { akka.remote.RemoteProtocol.RemoteSystemDaemonMessageProtocol.class, akka.remote.RemoteProtocol.RemoteSystemDaemonMessageProtocol.Builder.class); internal_static_DurableMailboxMessageProtocol_descriptor = - getDescriptor().getMessageTypes().get(10); + getDescriptor().getMessageTypes().get(11); internal_static_DurableMailboxMessageProtocol_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_DurableMailboxMessageProtocol_descriptor, diff --git a/akka-remote/src/main/protocol/RemoteProtocol.proto b/akka-remote/src/main/protocol/RemoteProtocol.proto index 8dda9e4a11..9d6ad23bd7 100644 --- a/akka-remote/src/main/protocol/RemoteProtocol.proto +++ b/akka-remote/src/main/protocol/RemoteProtocol.proto @@ -31,8 +31,14 @@ message RemoteMessageProtocol { * Defines some control messages for the remoting */ message RemoteControlProtocol { - optional string cookie = 1; - required CommandType commandType = 2; + required CommandType commandType = 1; + optional string cookie = 2; + optional Endpoint origin = 3; +} + +message Endpoint { + required string host = 1; + required uint32 port = 2; } /** diff --git a/akka-remote/src/main/scala/akka/remote/Remote.scala b/akka-remote/src/main/scala/akka/remote/Remote.scala index 0d67a15985..50d1ebb87f 100644 --- a/akka-remote/src/main/scala/akka/remote/Remote.scala +++ b/akka-remote/src/main/scala/akka/remote/Remote.scala @@ -27,7 +27,7 @@ import akka.serialization.{ JavaSerializer, Serialization, Serializer, Compressi * * @author Jonas Bonér */ -class Remote(val app: AkkaApplication) extends RemoteService { +class Remote(val app: AkkaApplication) { import app._ import app.config diff --git a/akka-remote/src/main/scala/akka/remote/RemoteActorRefProvider.scala b/akka-remote/src/main/scala/akka/remote/RemoteActorRefProvider.scala index 84b2e5a71c..99c47e5285 100644 --- a/akka-remote/src/main/scala/akka/remote/RemoteActorRefProvider.scala +++ b/akka-remote/src/main/scala/akka/remote/RemoteActorRefProvider.scala @@ -251,9 +251,7 @@ private[akka] case class RemoteActorRef private[akka] ( protected[akka] def sendSystemMessage(message: SystemMessage): Unit = unsupported - def postMessageToMailbox(message: Any, sender: ActorRef) { - remote.send[Any](message, Option(sender), remoteAddress, this, loader) - } + def postMessageToMailbox(message: Any, sender: ActorRef): Unit = remote.send(message, Option(sender), remoteAddress, this, loader) def ?(message: Any)(implicit timeout: Timeout): Future[Any] = remote.app.provider.ask(message, this, timeout) @@ -265,7 +263,7 @@ private[akka] case class RemoteActorRef private[akka] ( synchronized { if (running) { running = false - remote.send[Any](new Terminate(), None, remoteAddress, this, loader) + remote.send(new Terminate(), None, remoteAddress, this, loader) } } } diff --git a/akka-remote/src/main/scala/akka/remote/netty/NettyRemoteSupport.scala b/akka-remote/src/main/scala/akka/remote/netty/NettyRemoteSupport.scala index d0e4c59efd..f70e479a11 100644 --- a/akka-remote/src/main/scala/akka/remote/netty/NettyRemoteSupport.scala +++ b/akka-remote/src/main/scala/akka/remote/netty/NettyRemoteSupport.scala @@ -40,12 +40,12 @@ trait NettyRemoteClientModule extends RemoteClientModule { def app: AkkaApplication - protected[akka] def send[T](message: Any, - senderOption: Option[ActorRef], - recipientAddress: InetSocketAddress, - recipient: ActorRef, - loader: Option[ClassLoader]): Unit = - withClientFor(recipientAddress, loader) { _.send[T](message, senderOption, recipient) } + protected[akka] def send(message: Any, + senderOption: Option[ActorRef], + recipientAddress: InetSocketAddress, + recipient: ActorRef, + loader: Option[ClassLoader]): Unit = + withClientFor(recipientAddress, loader) { _.send(message, senderOption, recipient) } private[akka] def withClientFor[T]( address: InetSocketAddress, loader: Option[ClassLoader])(body: RemoteClient ⇒ T): T = { @@ -140,14 +140,14 @@ abstract class RemoteClient private[akka] ( /** * Converts the message to the wireprotocol and sends the message across the wire */ - def send[T](message: Any, senderOption: Option[ActorRef], recipient: ActorRef) { + def send(message: Any, senderOption: Option[ActorRef], recipient: ActorRef) { send(createRemoteMessageProtocolBuilder(Left(recipient), Right(message), senderOption).build) } /** * Sends the message across the wire */ - def send[T](request: RemoteMessageProtocol) { + def send(request: RemoteMessageProtocol) { if (isRunning) { //TODO FIXME RACY app.eventHandler.debug(this, "Sending to connection [%s] message [%s]".format(remoteAddress, new RemoteMessage(request, remoteSupport))) @@ -210,6 +210,7 @@ class ActiveRemoteClient private[akka] ( def sendSecureCookie(connection: ChannelFuture) { val handshake = RemoteControlProtocol.newBuilder.setCommandType(CommandType.CONNECT) if (SECURE_COOKIE.nonEmpty) handshake.setCookie(SECURE_COOKIE.get) + handshake.setOrigin(RemoteProtocol.Endpoint.newBuilder().setHost(app.hostname).setPort(app.port).build) connection.getChannel.write(createControlEnvelope(handshake.build)) } @@ -353,9 +354,7 @@ class ActiveRemoteClientHandler( case arp: AkkaRemoteProtocol if arp.hasInstruction ⇒ val rcp = arp.getInstruction rcp.getCommandType match { - case CommandType.SHUTDOWN ⇒ akka.dispatch.Future { - client.module.shutdownClientConnection(remoteAddress) - } + case CommandType.SHUTDOWN ⇒ akka.dispatch.Future { client.module.shutdownClientConnection(remoteAddress) } } case arp: AkkaRemoteProtocol if arp.hasMessage ⇒ @@ -570,7 +569,8 @@ class RemoteServerAuthenticationHandler(secureCookie: Option[String]) extends Si case `authenticated` ⇒ ctx.sendUpstream(event) case null ⇒ event.getMessage match { case remoteProtocol: AkkaRemoteProtocol if remoteProtocol.hasInstruction ⇒ - remoteProtocol.getInstruction.getCookie match { + val instruction = remoteProtocol.getInstruction + instruction.getCookie match { case `cookie` ⇒ ctx.setAttachment(authenticated) ctx.sendUpstream(event) From e958987e5bb4ca66bb36fb3ae55866970204bf17 Mon Sep 17 00:00:00 2001 From: Viktor Klang Date: Thu, 3 Nov 2011 19:32:53 +0100 Subject: [PATCH 42/57] Switching to AddressProtocol for the remote origin address --- .../actor/LocalActorRefProviderSpec.scala | 14 +- .../scala/akka/actor/ActorRefProvider.scala | 1 + .../src/main/scala/akka/actor/Deployer.scala | 25 +- .../main/java/akka/remote/RemoteProtocol.java | 588 ++---------------- .../src/main/protocol/RemoteProtocol.proto | 7 +- .../remote/netty/NettyRemoteSupport.scala | 5 +- 6 files changed, 79 insertions(+), 561 deletions(-) diff --git a/akka-actor-tests/src/test/scala/akka/actor/LocalActorRefProviderSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/LocalActorRefProviderSpec.scala index cb3758081a..b6f7196f81 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/LocalActorRefProviderSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/LocalActorRefProviderSpec.scala @@ -17,15 +17,11 @@ class LocalActorRefProviderSpec extends AkkaSpec { provider.isInstanceOf[LocalActorRefProvider] must be(true) - implicit val timeout = Timeout(30 seconds) - - val actors: Seq[Future[ActorRef]] = - (0 until 100) flatMap { i ⇒ // 100 concurrent runs - val address = "new-actor" + i - (1 to 4) map { _ ⇒ Future { provider.actorOf(Props(c ⇒ { case _ ⇒ }), app.guardian, address) } } - } - - actors.map(_.get).distinct.size must be(100) + (0 until 100) foreach { i ⇒ // 100 concurrent runs + val address = "new-actor" + i + implicit val timeout = Timeout(30 seconds) + ((1 to 4) map { _ ⇒ Future { provider.actorOf(Props(c ⇒ { case _ ⇒ }), app.guardian, address, true) } }).map(_.get).distinct.size must be(1) + } } } } diff --git a/akka-actor/src/main/scala/akka/actor/ActorRefProvider.scala b/akka-actor/src/main/scala/akka/actor/ActorRefProvider.scala index 5c05fd867b..973ed36ef6 100644 --- a/akka-actor/src/main/scala/akka/actor/ActorRefProvider.scala +++ b/akka-actor/src/main/scala/akka/actor/ActorRefProvider.scala @@ -160,6 +160,7 @@ class LocalActorRefProvider(val app: AkkaApplication) extends ActorRefProvider { // create a routed actor ref case deploy @ Some(DeploymentConfig.Deploy(_, _, routerType, nrOfInstances, _, DeploymentConfig.LocalScope)) ⇒ + val routerFactory: () ⇒ Router = DeploymentConfig.routerTypeFor(routerType) match { case RouterType.Direct ⇒ () ⇒ new DirectRouter case RouterType.Random ⇒ () ⇒ new RandomRouter diff --git a/akka-actor/src/main/scala/akka/actor/Deployer.scala b/akka-actor/src/main/scala/akka/actor/Deployer.scala index bee5027839..e900893604 100644 --- a/akka-actor/src/main/scala/akka/actor/Deployer.scala +++ b/akka-actor/src/main/scala/akka/actor/Deployer.scala @@ -36,8 +36,6 @@ class Deployer(val app: AkkaApplication) extends ActorDeployer { val deploymentConfig = new DeploymentConfig(app) - // val defaultAddress = Node(Config.nodename) - lazy val instance: ActorDeployer = { val deployer = if (app.reflective.ClusterModule.isEnabled) app.reflective.ClusterModule.clusterDeployer else LocalDeployer deployer.init(deploymentsInConfig) @@ -74,22 +72,13 @@ class Deployer(val app: AkkaApplication) extends ActorDeployer { } private[akka] def lookupDeploymentFor(address: String): Option[Deploy] = { - val deployment_? = instance.lookupDeploymentFor(address) - - if (deployment_?.isDefined && (deployment_?.get ne null)) deployment_? - else { - val newDeployment = try { - lookupInConfig(address) - } catch { - case e: ConfigurationException ⇒ - app.eventHandler.error(e, this, e.getMessage) //TODO FIXME I do not condone log AND rethrow - throw e - } - - newDeployment match { - case None | Some(null) ⇒ None - case Some(d) ⇒ deploy(d); newDeployment // deploy and cache it - } + instance.lookupDeploymentFor(address) match { + case s @ Some(d) if d ne null ⇒ s + case _ ⇒ + lookupInConfig(address) match { + case None | Some(null) ⇒ None + case s @ Some(d) ⇒ deploy(d); s // deploy and cache it + } } } diff --git a/akka-remote/src/main/java/akka/remote/RemoteProtocol.java b/akka-remote/src/main/java/akka/remote/RemoteProtocol.java index 1efeb0e27f..8d1d7f8c94 100644 --- a/akka-remote/src/main/java/akka/remote/RemoteProtocol.java +++ b/akka-remote/src/main/java/akka/remote/RemoteProtocol.java @@ -2115,10 +2115,10 @@ public final class RemoteProtocol { boolean hasCookie(); String getCookie(); - // optional .Endpoint origin = 3; + // optional .AddressProtocol origin = 3; boolean hasOrigin(); - akka.remote.RemoteProtocol.Endpoint getOrigin(); - akka.remote.RemoteProtocol.EndpointOrBuilder getOriginOrBuilder(); + akka.remote.RemoteProtocol.AddressProtocol getOrigin(); + akka.remote.RemoteProtocol.AddressProtocolOrBuilder getOriginOrBuilder(); } public static final class RemoteControlProtocol extends com.google.protobuf.GeneratedMessage @@ -2191,23 +2191,23 @@ public final class RemoteProtocol { } } - // optional .Endpoint origin = 3; + // optional .AddressProtocol origin = 3; public static final int ORIGIN_FIELD_NUMBER = 3; - private akka.remote.RemoteProtocol.Endpoint origin_; + private akka.remote.RemoteProtocol.AddressProtocol origin_; public boolean hasOrigin() { return ((bitField0_ & 0x00000004) == 0x00000004); } - public akka.remote.RemoteProtocol.Endpoint getOrigin() { + public akka.remote.RemoteProtocol.AddressProtocol getOrigin() { return origin_; } - public akka.remote.RemoteProtocol.EndpointOrBuilder getOriginOrBuilder() { + public akka.remote.RemoteProtocol.AddressProtocolOrBuilder getOriginOrBuilder() { return origin_; } private void initFields() { commandType_ = akka.remote.RemoteProtocol.CommandType.CONNECT; cookie_ = ""; - origin_ = akka.remote.RemoteProtocol.Endpoint.getDefaultInstance(); + origin_ = akka.remote.RemoteProtocol.AddressProtocol.getDefaultInstance(); } private byte memoizedIsInitialized = -1; public final boolean isInitialized() { @@ -2391,7 +2391,7 @@ public final class RemoteProtocol { cookie_ = ""; bitField0_ = (bitField0_ & ~0x00000002); if (originBuilder_ == null) { - origin_ = akka.remote.RemoteProtocol.Endpoint.getDefaultInstance(); + origin_ = akka.remote.RemoteProtocol.AddressProtocol.getDefaultInstance(); } else { originBuilder_.clear(); } @@ -2533,7 +2533,7 @@ public final class RemoteProtocol { break; } case 26: { - akka.remote.RemoteProtocol.Endpoint.Builder subBuilder = akka.remote.RemoteProtocol.Endpoint.newBuilder(); + akka.remote.RemoteProtocol.AddressProtocol.Builder subBuilder = akka.remote.RemoteProtocol.AddressProtocol.newBuilder(); if (hasOrigin()) { subBuilder.mergeFrom(getOrigin()); } @@ -2607,21 +2607,21 @@ public final class RemoteProtocol { onChanged(); } - // optional .Endpoint origin = 3; - private akka.remote.RemoteProtocol.Endpoint origin_ = akka.remote.RemoteProtocol.Endpoint.getDefaultInstance(); + // optional .AddressProtocol origin = 3; + private akka.remote.RemoteProtocol.AddressProtocol origin_ = akka.remote.RemoteProtocol.AddressProtocol.getDefaultInstance(); private com.google.protobuf.SingleFieldBuilder< - akka.remote.RemoteProtocol.Endpoint, akka.remote.RemoteProtocol.Endpoint.Builder, akka.remote.RemoteProtocol.EndpointOrBuilder> originBuilder_; + akka.remote.RemoteProtocol.AddressProtocol, akka.remote.RemoteProtocol.AddressProtocol.Builder, akka.remote.RemoteProtocol.AddressProtocolOrBuilder> originBuilder_; public boolean hasOrigin() { return ((bitField0_ & 0x00000004) == 0x00000004); } - public akka.remote.RemoteProtocol.Endpoint getOrigin() { + public akka.remote.RemoteProtocol.AddressProtocol getOrigin() { if (originBuilder_ == null) { return origin_; } else { return originBuilder_.getMessage(); } } - public Builder setOrigin(akka.remote.RemoteProtocol.Endpoint value) { + public Builder setOrigin(akka.remote.RemoteProtocol.AddressProtocol value) { if (originBuilder_ == null) { if (value == null) { throw new NullPointerException(); @@ -2635,7 +2635,7 @@ public final class RemoteProtocol { return this; } public Builder setOrigin( - akka.remote.RemoteProtocol.Endpoint.Builder builderForValue) { + akka.remote.RemoteProtocol.AddressProtocol.Builder builderForValue) { if (originBuilder_ == null) { origin_ = builderForValue.build(); onChanged(); @@ -2645,12 +2645,12 @@ public final class RemoteProtocol { bitField0_ |= 0x00000004; return this; } - public Builder mergeOrigin(akka.remote.RemoteProtocol.Endpoint value) { + public Builder mergeOrigin(akka.remote.RemoteProtocol.AddressProtocol value) { if (originBuilder_ == null) { if (((bitField0_ & 0x00000004) == 0x00000004) && - origin_ != akka.remote.RemoteProtocol.Endpoint.getDefaultInstance()) { + origin_ != akka.remote.RemoteProtocol.AddressProtocol.getDefaultInstance()) { origin_ = - akka.remote.RemoteProtocol.Endpoint.newBuilder(origin_).mergeFrom(value).buildPartial(); + akka.remote.RemoteProtocol.AddressProtocol.newBuilder(origin_).mergeFrom(value).buildPartial(); } else { origin_ = value; } @@ -2663,7 +2663,7 @@ public final class RemoteProtocol { } public Builder clearOrigin() { if (originBuilder_ == null) { - origin_ = akka.remote.RemoteProtocol.Endpoint.getDefaultInstance(); + origin_ = akka.remote.RemoteProtocol.AddressProtocol.getDefaultInstance(); onChanged(); } else { originBuilder_.clear(); @@ -2671,12 +2671,12 @@ public final class RemoteProtocol { bitField0_ = (bitField0_ & ~0x00000004); return this; } - public akka.remote.RemoteProtocol.Endpoint.Builder getOriginBuilder() { + public akka.remote.RemoteProtocol.AddressProtocol.Builder getOriginBuilder() { bitField0_ |= 0x00000004; onChanged(); return getOriginFieldBuilder().getBuilder(); } - public akka.remote.RemoteProtocol.EndpointOrBuilder getOriginOrBuilder() { + public akka.remote.RemoteProtocol.AddressProtocolOrBuilder getOriginOrBuilder() { if (originBuilder_ != null) { return originBuilder_.getMessageOrBuilder(); } else { @@ -2684,11 +2684,11 @@ public final class RemoteProtocol { } } private com.google.protobuf.SingleFieldBuilder< - akka.remote.RemoteProtocol.Endpoint, akka.remote.RemoteProtocol.Endpoint.Builder, akka.remote.RemoteProtocol.EndpointOrBuilder> + akka.remote.RemoteProtocol.AddressProtocol, akka.remote.RemoteProtocol.AddressProtocol.Builder, akka.remote.RemoteProtocol.AddressProtocolOrBuilder> getOriginFieldBuilder() { if (originBuilder_ == null) { originBuilder_ = new com.google.protobuf.SingleFieldBuilder< - akka.remote.RemoteProtocol.Endpoint, akka.remote.RemoteProtocol.Endpoint.Builder, akka.remote.RemoteProtocol.EndpointOrBuilder>( + akka.remote.RemoteProtocol.AddressProtocol, akka.remote.RemoteProtocol.AddressProtocol.Builder, akka.remote.RemoteProtocol.AddressProtocolOrBuilder>( origin_, getParentForChildren(), isClean()); @@ -2708,454 +2708,6 @@ public final class RemoteProtocol { // @@protoc_insertion_point(class_scope:RemoteControlProtocol) } - public interface EndpointOrBuilder - extends com.google.protobuf.MessageOrBuilder { - - // required string host = 1; - boolean hasHost(); - String getHost(); - - // required uint32 port = 2; - boolean hasPort(); - int getPort(); - } - public static final class Endpoint extends - com.google.protobuf.GeneratedMessage - implements EndpointOrBuilder { - // Use Endpoint.newBuilder() to construct. - private Endpoint(Builder builder) { - super(builder); - } - private Endpoint(boolean noInit) {} - - private static final Endpoint defaultInstance; - public static Endpoint getDefaultInstance() { - return defaultInstance; - } - - public Endpoint getDefaultInstanceForType() { - return defaultInstance; - } - - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return akka.remote.RemoteProtocol.internal_static_Endpoint_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return akka.remote.RemoteProtocol.internal_static_Endpoint_fieldAccessorTable; - } - - private int bitField0_; - // required string host = 1; - public static final int HOST_FIELD_NUMBER = 1; - private java.lang.Object host_; - public boolean hasHost() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - public String getHost() { - java.lang.Object ref = host_; - if (ref instanceof String) { - return (String) ref; - } else { - com.google.protobuf.ByteString bs = - (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - if (com.google.protobuf.Internal.isValidUtf8(bs)) { - host_ = s; - } - return s; - } - } - private com.google.protobuf.ByteString getHostBytes() { - java.lang.Object ref = host_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((String) ref); - host_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - // required uint32 port = 2; - public static final int PORT_FIELD_NUMBER = 2; - private int port_; - public boolean hasPort() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - public int getPort() { - return port_; - } - - private void initFields() { - host_ = ""; - port_ = 0; - } - private byte memoizedIsInitialized = -1; - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized != -1) return isInitialized == 1; - - if (!hasHost()) { - memoizedIsInitialized = 0; - return false; - } - if (!hasPort()) { - memoizedIsInitialized = 0; - return false; - } - memoizedIsInitialized = 1; - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeBytes(1, getHostBytes()); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeUInt32(2, port_); - } - getUnknownFields().writeTo(output); - } - - private int memoizedSerializedSize = -1; - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += com.google.protobuf.CodedOutputStream - .computeBytesSize(1, getHostBytes()); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += com.google.protobuf.CodedOutputStream - .computeUInt32Size(2, port_); - } - size += getUnknownFields().getSerializedSize(); - memoizedSerializedSize = size; - return size; - } - - private static final long serialVersionUID = 0L; - @java.lang.Override - protected java.lang.Object writeReplace() - throws java.io.ObjectStreamException { - return super.writeReplace(); - } - - public static akka.remote.RemoteProtocol.Endpoint parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); - } - public static akka.remote.RemoteProtocol.Endpoint parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); - } - public static akka.remote.RemoteProtocol.Endpoint parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); - } - public static akka.remote.RemoteProtocol.Endpoint parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); - } - public static akka.remote.RemoteProtocol.Endpoint parseFrom(java.io.InputStream input) - throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); - } - public static akka.remote.RemoteProtocol.Endpoint parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); - } - public static akka.remote.RemoteProtocol.Endpoint parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - Builder builder = newBuilder(); - if (builder.mergeDelimitedFrom(input)) { - return builder.buildParsed(); - } else { - return null; - } - } - public static akka.remote.RemoteProtocol.Endpoint parseDelimitedFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - Builder builder = newBuilder(); - if (builder.mergeDelimitedFrom(input, extensionRegistry)) { - return builder.buildParsed(); - } else { - return null; - } - } - public static akka.remote.RemoteProtocol.Endpoint parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); - } - public static akka.remote.RemoteProtocol.Endpoint parseFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); - } - - public static Builder newBuilder() { return Builder.create(); } - public Builder newBuilderForType() { return newBuilder(); } - public static Builder newBuilder(akka.remote.RemoteProtocol.Endpoint prototype) { - return newBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { return newBuilder(this); } - - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessage.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder - implements akka.remote.RemoteProtocol.EndpointOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return akka.remote.RemoteProtocol.internal_static_Endpoint_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return akka.remote.RemoteProtocol.internal_static_Endpoint_fieldAccessorTable; - } - - // Construct using akka.remote.RemoteProtocol.Endpoint.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - private Builder(BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - } - } - private static Builder create() { - return new Builder(); - } - - public Builder clear() { - super.clear(); - host_ = ""; - bitField0_ = (bitField0_ & ~0x00000001); - port_ = 0; - bitField0_ = (bitField0_ & ~0x00000002); - return this; - } - - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return akka.remote.RemoteProtocol.Endpoint.getDescriptor(); - } - - public akka.remote.RemoteProtocol.Endpoint getDefaultInstanceForType() { - return akka.remote.RemoteProtocol.Endpoint.getDefaultInstance(); - } - - public akka.remote.RemoteProtocol.Endpoint build() { - akka.remote.RemoteProtocol.Endpoint result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - private akka.remote.RemoteProtocol.Endpoint buildParsed() - throws com.google.protobuf.InvalidProtocolBufferException { - akka.remote.RemoteProtocol.Endpoint result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException( - result).asInvalidProtocolBufferException(); - } - return result; - } - - public akka.remote.RemoteProtocol.Endpoint buildPartial() { - akka.remote.RemoteProtocol.Endpoint result = new akka.remote.RemoteProtocol.Endpoint(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { - to_bitField0_ |= 0x00000001; - } - result.host_ = host_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } - result.port_ = port_; - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof akka.remote.RemoteProtocol.Endpoint) { - return mergeFrom((akka.remote.RemoteProtocol.Endpoint)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(akka.remote.RemoteProtocol.Endpoint other) { - if (other == akka.remote.RemoteProtocol.Endpoint.getDefaultInstance()) return this; - if (other.hasHost()) { - setHost(other.getHost()); - } - if (other.hasPort()) { - setPort(other.getPort()); - } - this.mergeUnknownFields(other.getUnknownFields()); - return this; - } - - public final boolean isInitialized() { - if (!hasHost()) { - - return false; - } - if (!hasPort()) { - - return false; - } - return true; - } - - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.protobuf.UnknownFieldSet.Builder unknownFields = - com.google.protobuf.UnknownFieldSet.newBuilder( - this.getUnknownFields()); - while (true) { - int tag = input.readTag(); - switch (tag) { - case 0: - this.setUnknownFields(unknownFields.build()); - onChanged(); - return this; - default: { - if (!parseUnknownField(input, unknownFields, - extensionRegistry, tag)) { - this.setUnknownFields(unknownFields.build()); - onChanged(); - return this; - } - break; - } - case 10: { - bitField0_ |= 0x00000001; - host_ = input.readBytes(); - break; - } - case 16: { - bitField0_ |= 0x00000002; - port_ = input.readUInt32(); - break; - } - } - } - } - - private int bitField0_; - - // required string host = 1; - private java.lang.Object host_ = ""; - public boolean hasHost() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - public String getHost() { - java.lang.Object ref = host_; - if (!(ref instanceof String)) { - String s = ((com.google.protobuf.ByteString) ref).toStringUtf8(); - host_ = s; - return s; - } else { - return (String) ref; - } - } - public Builder setHost(String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000001; - host_ = value; - onChanged(); - return this; - } - public Builder clearHost() { - bitField0_ = (bitField0_ & ~0x00000001); - host_ = getDefaultInstance().getHost(); - onChanged(); - return this; - } - void setHost(com.google.protobuf.ByteString value) { - bitField0_ |= 0x00000001; - host_ = value; - onChanged(); - } - - // required uint32 port = 2; - private int port_ ; - public boolean hasPort() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - public int getPort() { - return port_; - } - public Builder setPort(int value) { - bitField0_ |= 0x00000002; - port_ = value; - onChanged(); - return this; - } - public Builder clearPort() { - bitField0_ = (bitField0_ & ~0x00000002); - port_ = 0; - onChanged(); - return this; - } - - // @@protoc_insertion_point(builder_scope:Endpoint) - } - - static { - defaultInstance = new Endpoint(true); - defaultInstance.initFields(); - } - - // @@protoc_insertion_point(class_scope:Endpoint) - } - public interface ActorRefProtocolOrBuilder extends com.google.protobuf.MessageOrBuilder { @@ -7252,11 +6804,6 @@ public final class RemoteProtocol { private static com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_RemoteControlProtocol_fieldAccessorTable; - private static com.google.protobuf.Descriptors.Descriptor - internal_static_Endpoint_descriptor; - private static - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_Endpoint_fieldAccessorTable; private static com.google.protobuf.Descriptors.Descriptor internal_static_ActorRefProtocol_descriptor; private static @@ -7314,39 +6861,38 @@ public final class RemoteProtocol { "ssage\030\002 \001(\0132\020.MessageProtocol\022%\n\texcepti" + "on\030\003 \001(\0132\022.ExceptionProtocol\022!\n\006sender\030\004" + " \001(\0132\021.ActorRefProtocol\022(\n\010metadata\030\005 \003(" + - "\0132\026.MetadataEntryProtocol\"e\n\025RemoteContr" + + "\0132\026.MetadataEntryProtocol\"l\n\025RemoteContr" + "olProtocol\022!\n\013commandType\030\001 \002(\0162\014.Comman", - "dType\022\016\n\006cookie\030\002 \001(\t\022\031\n\006origin\030\003 \001(\0132\t." + - "Endpoint\"&\n\010Endpoint\022\014\n\004host\030\001 \002(\t\022\014\n\004po" + - "rt\030\002 \002(\r\"?\n\020ActorRefProtocol\022\017\n\007address\030" + - "\001 \002(\t\022\014\n\004host\030\002 \002(\t\022\014\n\004port\030\003 \002(\r\";\n\017Mes" + - "sageProtocol\022\017\n\007message\030\001 \002(\014\022\027\n\017message" + - "Manifest\030\002 \001(\014\")\n\014UuidProtocol\022\014\n\004high\030\001" + - " \002(\004\022\013\n\003low\030\002 \002(\004\"3\n\025MetadataEntryProtoc" + - "ol\022\013\n\003key\030\001 \002(\t\022\r\n\005value\030\002 \002(\014\"1\n\017Addres" + - "sProtocol\022\020\n\010hostname\030\001 \002(\t\022\014\n\004port\030\002 \002(" + - "\r\"7\n\021ExceptionProtocol\022\021\n\tclassname\030\001 \002(", - "\t\022\017\n\007message\030\002 \002(\t\"\256\001\n!RemoteSystemDaemo" + - "nMessageProtocol\0223\n\013messageType\030\001 \002(\0162\036." + - "RemoteSystemDaemonMessageType\022\024\n\014actorAd" + - "dress\030\002 \001(\t\022\017\n\007payload\030\003 \001(\014\022-\n\026replicat" + - "eActorFromUuid\030\004 \001(\0132\r.UuidProtocol\"y\n\035D" + - "urableMailboxMessageProtocol\022$\n\trecipien" + - "t\030\001 \002(\0132\021.ActorRefProtocol\022!\n\006sender\030\002 \001" + - "(\0132\021.ActorRefProtocol\022\017\n\007message\030\003 \002(\014*(" + - "\n\013CommandType\022\013\n\007CONNECT\020\001\022\014\n\010SHUTDOWN\020\002" + - "*K\n\026ReplicationStorageType\022\r\n\tTRANSIENT\020", - "\001\022\023\n\017TRANSACTION_LOG\020\002\022\r\n\tDATA_GRID\020\003*>\n" + - "\027ReplicationStrategyType\022\021\n\rWRITE_THROUG" + - "H\020\001\022\020\n\014WRITE_BEHIND\020\002*\241\002\n\035RemoteSystemDa" + - "emonMessageType\022\010\n\004STOP\020\001\022\007\n\003USE\020\002\022\013\n\007RE" + - "LEASE\020\003\022\022\n\016MAKE_AVAILABLE\020\004\022\024\n\020MAKE_UNAV" + - "AILABLE\020\005\022\016\n\nDISCONNECT\020\006\022\r\n\tRECONNECT\020\007" + - "\022\n\n\006RESIGN\020\010\022\n\n\006GOSSIP\020\t\022\031\n\025FAIL_OVER_CO" + - "NNECTIONS\020\024\022\026\n\022FUNCTION_FUN0_UNIT\020\025\022\025\n\021F" + - "UNCTION_FUN0_ANY\020\026\022\032\n\026FUNCTION_FUN1_ARG_" + - "UNIT\020\027\022\031\n\025FUNCTION_FUN1_ARG_ANY\020\030B\017\n\013akk", - "a.remoteH\001" + "dType\022\016\n\006cookie\030\002 \001(\t\022 \n\006origin\030\003 \001(\0132\020." + + "AddressProtocol\"?\n\020ActorRefProtocol\022\017\n\007a" + + "ddress\030\001 \002(\t\022\014\n\004host\030\002 \002(\t\022\014\n\004port\030\003 \002(\r" + + "\";\n\017MessageProtocol\022\017\n\007message\030\001 \002(\014\022\027\n\017" + + "messageManifest\030\002 \001(\014\")\n\014UuidProtocol\022\014\n" + + "\004high\030\001 \002(\004\022\013\n\003low\030\002 \002(\004\"3\n\025MetadataEntr" + + "yProtocol\022\013\n\003key\030\001 \002(\t\022\r\n\005value\030\002 \002(\014\"1\n" + + "\017AddressProtocol\022\020\n\010hostname\030\001 \002(\t\022\014\n\004po" + + "rt\030\002 \002(\r\"7\n\021ExceptionProtocol\022\021\n\tclassna" + + "me\030\001 \002(\t\022\017\n\007message\030\002 \002(\t\"\256\001\n!RemoteSyst", + "emDaemonMessageProtocol\0223\n\013messageType\030\001" + + " \002(\0162\036.RemoteSystemDaemonMessageType\022\024\n\014" + + "actorAddress\030\002 \001(\t\022\017\n\007payload\030\003 \001(\014\022-\n\026r" + + "eplicateActorFromUuid\030\004 \001(\0132\r.UuidProtoc" + + "ol\"y\n\035DurableMailboxMessageProtocol\022$\n\tr" + + "ecipient\030\001 \002(\0132\021.ActorRefProtocol\022!\n\006sen" + + "der\030\002 \001(\0132\021.ActorRefProtocol\022\017\n\007message\030" + + "\003 \002(\014*(\n\013CommandType\022\013\n\007CONNECT\020\001\022\014\n\010SHU" + + "TDOWN\020\002*K\n\026ReplicationStorageType\022\r\n\tTRA" + + "NSIENT\020\001\022\023\n\017TRANSACTION_LOG\020\002\022\r\n\tDATA_GR", + "ID\020\003*>\n\027ReplicationStrategyType\022\021\n\rWRITE" + + "_THROUGH\020\001\022\020\n\014WRITE_BEHIND\020\002*\241\002\n\035RemoteS" + + "ystemDaemonMessageType\022\010\n\004STOP\020\001\022\007\n\003USE\020" + + "\002\022\013\n\007RELEASE\020\003\022\022\n\016MAKE_AVAILABLE\020\004\022\024\n\020MA" + + "KE_UNAVAILABLE\020\005\022\016\n\nDISCONNECT\020\006\022\r\n\tRECO" + + "NNECT\020\007\022\n\n\006RESIGN\020\010\022\n\n\006GOSSIP\020\t\022\031\n\025FAIL_" + + "OVER_CONNECTIONS\020\024\022\026\n\022FUNCTION_FUN0_UNIT" + + "\020\025\022\025\n\021FUNCTION_FUN0_ANY\020\026\022\032\n\026FUNCTION_FU" + + "N1_ARG_UNIT\020\027\022\031\n\025FUNCTION_FUN1_ARG_ANY\020\030" + + "B\017\n\013akka.remoteH\001" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { @@ -7377,16 +6923,8 @@ public final class RemoteProtocol { new java.lang.String[] { "CommandType", "Cookie", "Origin", }, akka.remote.RemoteProtocol.RemoteControlProtocol.class, akka.remote.RemoteProtocol.RemoteControlProtocol.Builder.class); - internal_static_Endpoint_descriptor = - getDescriptor().getMessageTypes().get(3); - internal_static_Endpoint_fieldAccessorTable = new - com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_Endpoint_descriptor, - new java.lang.String[] { "Host", "Port", }, - akka.remote.RemoteProtocol.Endpoint.class, - akka.remote.RemoteProtocol.Endpoint.Builder.class); internal_static_ActorRefProtocol_descriptor = - getDescriptor().getMessageTypes().get(4); + getDescriptor().getMessageTypes().get(3); internal_static_ActorRefProtocol_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_ActorRefProtocol_descriptor, @@ -7394,7 +6932,7 @@ public final class RemoteProtocol { akka.remote.RemoteProtocol.ActorRefProtocol.class, akka.remote.RemoteProtocol.ActorRefProtocol.Builder.class); internal_static_MessageProtocol_descriptor = - getDescriptor().getMessageTypes().get(5); + getDescriptor().getMessageTypes().get(4); internal_static_MessageProtocol_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_MessageProtocol_descriptor, @@ -7402,7 +6940,7 @@ public final class RemoteProtocol { akka.remote.RemoteProtocol.MessageProtocol.class, akka.remote.RemoteProtocol.MessageProtocol.Builder.class); internal_static_UuidProtocol_descriptor = - getDescriptor().getMessageTypes().get(6); + getDescriptor().getMessageTypes().get(5); internal_static_UuidProtocol_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_UuidProtocol_descriptor, @@ -7410,7 +6948,7 @@ public final class RemoteProtocol { akka.remote.RemoteProtocol.UuidProtocol.class, akka.remote.RemoteProtocol.UuidProtocol.Builder.class); internal_static_MetadataEntryProtocol_descriptor = - getDescriptor().getMessageTypes().get(7); + getDescriptor().getMessageTypes().get(6); internal_static_MetadataEntryProtocol_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_MetadataEntryProtocol_descriptor, @@ -7418,7 +6956,7 @@ public final class RemoteProtocol { akka.remote.RemoteProtocol.MetadataEntryProtocol.class, akka.remote.RemoteProtocol.MetadataEntryProtocol.Builder.class); internal_static_AddressProtocol_descriptor = - getDescriptor().getMessageTypes().get(8); + getDescriptor().getMessageTypes().get(7); internal_static_AddressProtocol_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_AddressProtocol_descriptor, @@ -7426,7 +6964,7 @@ public final class RemoteProtocol { akka.remote.RemoteProtocol.AddressProtocol.class, akka.remote.RemoteProtocol.AddressProtocol.Builder.class); internal_static_ExceptionProtocol_descriptor = - getDescriptor().getMessageTypes().get(9); + getDescriptor().getMessageTypes().get(8); internal_static_ExceptionProtocol_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_ExceptionProtocol_descriptor, @@ -7434,7 +6972,7 @@ public final class RemoteProtocol { akka.remote.RemoteProtocol.ExceptionProtocol.class, akka.remote.RemoteProtocol.ExceptionProtocol.Builder.class); internal_static_RemoteSystemDaemonMessageProtocol_descriptor = - getDescriptor().getMessageTypes().get(10); + getDescriptor().getMessageTypes().get(9); internal_static_RemoteSystemDaemonMessageProtocol_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_RemoteSystemDaemonMessageProtocol_descriptor, @@ -7442,7 +6980,7 @@ public final class RemoteProtocol { akka.remote.RemoteProtocol.RemoteSystemDaemonMessageProtocol.class, akka.remote.RemoteProtocol.RemoteSystemDaemonMessageProtocol.Builder.class); internal_static_DurableMailboxMessageProtocol_descriptor = - getDescriptor().getMessageTypes().get(11); + getDescriptor().getMessageTypes().get(10); internal_static_DurableMailboxMessageProtocol_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_DurableMailboxMessageProtocol_descriptor, diff --git a/akka-remote/src/main/protocol/RemoteProtocol.proto b/akka-remote/src/main/protocol/RemoteProtocol.proto index 9d6ad23bd7..d777009950 100644 --- a/akka-remote/src/main/protocol/RemoteProtocol.proto +++ b/akka-remote/src/main/protocol/RemoteProtocol.proto @@ -33,12 +33,7 @@ message RemoteMessageProtocol { message RemoteControlProtocol { required CommandType commandType = 1; optional string cookie = 2; - optional Endpoint origin = 3; -} - -message Endpoint { - required string host = 1; - required uint32 port = 2; + optional AddressProtocol origin = 3; } /** diff --git a/akka-remote/src/main/scala/akka/remote/netty/NettyRemoteSupport.scala b/akka-remote/src/main/scala/akka/remote/netty/NettyRemoteSupport.scala index f70e479a11..0a53cce810 100644 --- a/akka-remote/src/main/scala/akka/remote/netty/NettyRemoteSupport.scala +++ b/akka-remote/src/main/scala/akka/remote/netty/NettyRemoteSupport.scala @@ -210,7 +210,7 @@ class ActiveRemoteClient private[akka] ( def sendSecureCookie(connection: ChannelFuture) { val handshake = RemoteControlProtocol.newBuilder.setCommandType(CommandType.CONNECT) if (SECURE_COOKIE.nonEmpty) handshake.setCookie(SECURE_COOKIE.get) - handshake.setOrigin(RemoteProtocol.Endpoint.newBuilder().setHost(app.hostname).setPort(app.port).build) + handshake.setOrigin(RemoteProtocol.AddressProtocol.newBuilder().setHostname(app.hostname).setPort(app.port).build) connection.getChannel.write(createControlEnvelope(handshake.build)) } @@ -646,14 +646,13 @@ class RemoteServerHandler( event.getMessage match { case null ⇒ throw new IllegalActorStateException("Message in remote MessageEvent is null [" + event + "]") case remote: AkkaRemoteProtocol if remote.hasMessage ⇒ handleRemoteMessageProtocol(remote.getMessage, event.getChannel) - //case remote: AkkaRemoteProtocol if remote.hasInstruction => RemoteServer cannot receive control messages (yet) + case remote: AkkaRemoteProtocol if remote.hasInstruction ⇒ //Doesn't handle instructions case _ ⇒ //ignore } } override def exceptionCaught(ctx: ChannelHandlerContext, event: ExceptionEvent) = { app.eventHandler.error(event.getCause, this, "Unexpected exception from remote downstream") - event.getChannel.close server.notifyListeners(RemoteServerError(event.getCause, server)) } From a044e41008e9842d4210681f10f1ef9826e68c0c Mon Sep 17 00:00:00 2001 From: Viktor Klang Date: Thu, 3 Nov 2011 20:34:48 +0100 Subject: [PATCH 43/57] Removing outdated and wrong serialization docs --- akka-docs/java/index.rst | 1 - akka-docs/java/serialization.rst | 178 ------ akka-docs/scala/index.rst | 1 - akka-docs/scala/serialization.rst | 992 ------------------------------ 4 files changed, 1172 deletions(-) delete mode 100644 akka-docs/java/serialization.rst delete mode 100644 akka-docs/scala/serialization.rst diff --git a/akka-docs/java/index.rst b/akka-docs/java/index.rst index d9e900fd22..28078bcab6 100644 --- a/akka-docs/java/index.rst +++ b/akka-docs/java/index.rst @@ -14,7 +14,6 @@ Java API stm transactors remote-actors - serialization fault-tolerance dispatchers routing diff --git a/akka-docs/java/serialization.rst b/akka-docs/java/serialization.rst deleted file mode 100644 index 2a10a813bb..0000000000 --- a/akka-docs/java/serialization.rst +++ /dev/null @@ -1,178 +0,0 @@ -.. _serialization-java: - -Serialization (Java) -==================== - -.. sidebar:: Contents - - .. contents:: :local: - -Akka serialization module has been documented extensively under the :ref:`serialization-scala` section. In this section we will point out the different APIs that are available in Akka for Java based serialization of ActorRefs. The Scala APIs of ActorSerialization has implicit Format objects that set up the type class based serialization. In the Java API, the Format objects need to be specified explicitly. - -Serialization of a Stateless Actor ----------------------------------- - -Step 1: Define the Actor - -.. code-block:: scala - - import akka.actor.UntypedActor; - - public class SerializationTestActor extends UntypedActor { - public void onReceive(Object msg) { - getContext().tryReply("got it!"); - } - } - -Step 2: Define the typeclass instance for the actor - -Note how the generated Java classes are accessed using the $class based naming convention of the Scala compiler. - -.. code-block:: scala - - import akka.serialization.StatelessActorFormat; - - class SerializationTestActorFormat implements StatelessActorFormat { - @Override - public SerializationTestActor fromBinary(byte[] bytes, SerializationTestActor act) { - return (SerializationTestActor) StatelessActorFormat$class.fromBinary(this, bytes, act); - } - - @Override - public byte[] toBinary(SerializationTestActor ac) { - return StatelessActorFormat$class.toBinary(this, ac); - } - } - -Step 3: Serialize and de-serialize - -The following JUnit snippet first creates an actor using the default constructor. The actor is, as we saw above a stateless one. Then it is serialized and de-serialized to get back the original actor. Being stateless, the de-serialized version behaves in the same way on a message as the original actor. - -.. code-block:: java - - import akka.actor.ActorRef; - import akka.actor.ActorTimeoutException; - import akka.actor.Actors; - import akka.actor.UntypedActor; - import akka.serialization.Format; - import akka.serialization.StatelessActorFormat; - import static akka.serialization.ActorSerialization.*; - - @Test public void mustBeAbleToSerializeAfterCreateActorRefFromClass() { - ActorRef ref = Actors.actorOf(SerializationTestActor.class); - assertNotNull(ref); - try { - Object result = ref.ask("Hello").get(); - assertEquals("got it!", result); - } catch (ActorTimeoutException ex) { - fail("actor should not time out"); - } - - Format f = new SerializationTestActorFormat(); - byte[] bytes = toBinaryJ(ref, f, false); - ActorRef r = fromBinaryJ(bytes, f); - assertNotNull(r); - - try { - Object result = r.ask("Hello").get(); - assertEquals("got it!", result); - } catch (ActorTimeoutException ex) { - fail("actor should not time out"); - } - ref.stop(); - r.stop(); - } - -Serialization of a Stateful Actor ---------------------------------- - -Let's now have a look at how to serialize an actor that carries a state with it. Here the expectation is that the serialization of the actor will also persist the state information. And after de-serialization we will get back the state with which it was serialized. - -Step 1: Define the Actor - -.. code-block:: scala - - import akka.actor.UntypedActor; - - public class MyUntypedActor extends UntypedActor { - int count = 0; - - public void onReceive(Object msg) { - if (msg.equals("hello")) { - count = count + 1; - getContext().reply("world " + count); - } else if (msg instanceof String) { - count = count + 1; - getContext().reply("hello " + msg + " " + count); - } else { - throw new IllegalArgumentException("invalid message type"); - } - } - } - -Note the actor has a state in the form of an Integer. And every message that the actor receives, it replies with an addition to the integer member. - -Step 2: Define the instance of the typeclass - -.. code-block:: java - - import akka.actor.UntypedActor; - import akka.serialization.Format; - import akka.serialization.SerializerFactory; - - class MyUntypedActorFormat implements Format { - @Override - public MyUntypedActor fromBinary(byte[] bytes, MyUntypedActor act) { - ProtobufProtocol.Counter p = - (ProtobufProtocol.Counter) new SerializerFactory().getProtobuf().fromBinary(bytes, ProtobufProtocol.Counter.class); - act.count = p.getCount(); - return act; - } - - @Override - public byte[] toBinary(MyUntypedActor ac) { - return ProtobufProtocol.Counter.newBuilder().setCount(ac.count()).build().toByteArray(); - } - } - -Note the usage of Protocol Buffers to serialize the state of the actor. ProtobufProtocol.Counter is something -you need to define yourself - -Step 3: Serialize and de-serialize - -.. code-block:: java - - import akka.actor.ActorRef; - import akka.actor.ActorTimeoutException; - import akka.actor.Actors; - import static akka.serialization.ActorSerialization.*; - - @Test public void mustBeAbleToSerializeAStatefulActor() { - ActorRef ref = Actors.actorOf(MyUntypedActor.class); - assertNotNull(ref); - try { - Object result = ref.ask("hello").get(); - assertEquals("world 1", result); - result = ref.ask("hello").get(); - assertEquals("world 2", result); - } catch (ActorTimeoutException ex) { - fail("actor should not time out"); - } - - Format f = new MyUntypedActorFormat(); - byte[] bytes = toBinaryJ(ref, f, false); - ActorRef r = fromBinaryJ(bytes, f); - assertNotNull(r); - try { - Object result = r.ask("hello").get(); - assertEquals("world 3", result); - result = r.ask("hello").get(); - assertEquals("world 4", result); - } catch (ActorTimeoutException ex) { - fail("actor should not time out"); - } - ref.stop(); - r.stop(); - } - -Note how the de-serialized version starts with the state value with which it was earlier serialized. diff --git a/akka-docs/scala/index.rst b/akka-docs/scala/index.rst index 0c8111cab0..f05b19eace 100644 --- a/akka-docs/scala/index.rst +++ b/akka-docs/scala/index.rst @@ -15,7 +15,6 @@ Scala API stm transactors remote-actors - serialization fault-tolerance dispatchers routing diff --git a/akka-docs/scala/serialization.rst b/akka-docs/scala/serialization.rst deleted file mode 100644 index 21618b9905..0000000000 --- a/akka-docs/scala/serialization.rst +++ /dev/null @@ -1,992 +0,0 @@ - -.. _serialization-scala: - -####################### - Serialization (Scala) -####################### - -.. sidebar:: Contents - - .. contents:: :local: - -Module stability: **SOLID** - - -Serialization of ActorRef -========================= - -An Actor can be serialized in two different ways: - -* Serializable RemoteActorRef - Serialized to an immutable, network-aware Actor - reference that can be freely shared across the network. They "remember" and - stay mapped to their original Actor instance and host node, and will always - work as expected. - -* Serializable LocalActorRef - Serialized by doing a deep copy of both the - ActorRef and the Actor instance itself. Can be used to physically move an - Actor from one node to another and continue the execution there. - -Both of these can be sent as messages over the network and/or store them to -disk, in a persistent storage backend etc. - -Actor serialization in Akka is implemented through a type class ``Format[T <: -Actor]`` which publishes the ``fromBinary`` and ``toBinary`` methods for -serialization. Here's the complete definition of the type class:: - - /** - * Type class definition for Actor Serialization - */ - trait FromBinary[T <: Actor] { - def fromBinary(bytes: Array[Byte], act: T): T - } - - trait ToBinary[T <: Actor] { - def toBinary(t: T): Array[Byte] - } - - // client needs to implement Format[] for the respective actor - trait Format[T <: Actor] extends FromBinary[T] with ToBinary[T] - - -Deep serialization of an Actor and ActorRef -------------------------------------------- - -You can serialize the whole actor deeply, e.g. both the ``ActorRef`` and then -instance of its ``Actor``. This can be useful if you want to move an actor from -one node to another, or if you want to store away an actor, with its state, into -a database. - -Here is an example of how to serialize an Actor. - -Step 1: Define the actor:: - - class MyActor extends Actor { - var count = 0 - - def receive = { - case "hello" => - count = count + 1 - self.reply("world " + count) - } - } - -Step 2: Implement the type class for the actor. ProtobufProtocol.Counter is -something you need to define yourself, as explained in the Protobuf section:: - - import akka.serialization.{Serializer, Format} - import akka.actor.Actor - import akka.actor.Actor._ - - object BinaryFormatMyActor { - implicit object MyActorFormat extends Format[MyActor] { - def fromBinary(bytes: Array[Byte], act: MyActor) = { - val p = Serializer.Protobuf.fromBinary(bytes, Some(classOf[ProtobufProtocol.Counter])).asInstanceOf[ProtobufProtocol.Counter] - act.count = p.getCount - act - } - def toBinary(ac: MyActor) = - ProtobufProtocol.Counter.newBuilder.setCount(ac.count).build.toByteArray - } - } - -Step 3: Import the type class module definition and serialize / de-serialize:: - - it("should be able to serialize and de-serialize a stateful actor") { - import akka.serialization.ActorSerialization._ - import BinaryFormatMyActor._ - - val actor1 = actorOf[MyActor] - (actor1 ? "hello").as[String].getOrElse("_") should equal("world 1") - (actor1 ? "hello").as[String].getOrElse("_") should equal("world 2") - - val bytes = toBinary(actor1) - val actor2 = fromBinary(bytes) - (actor2 ? "hello").as[String].getOrElse("_") should equal("world 3") - } - -Helper Type Class for Stateless Actors --------------------------------------- - -If your actor is stateless, then you can use the helper trait that Akka provides -to serialize / de-serialize. Here's the definition:: - - trait StatelessActorFormat[T <: Actor] extends Format[T] { - def fromBinary(bytes: Array[Byte], act: T) = act - def toBinary(ac: T) = Array.empty[Byte] - } - -Then you use it as follows:: - - class MyStatelessActor extends Actor { - def receive = { - case "hello" => - self.reply("world") - } - } - -Just create an object for the helper trait for your actor:: - - object BinaryFormatMyStatelessActor { - implicit object MyStatelessActorFormat extends StatelessActorFormat[MyStatelessActor] - } - -and use it for serialization:: - - it("should be able to serialize and de-serialize a stateless actor") { - import akka.serialization.ActorSerialization._ - import BinaryFormatMyStatelessActor._ - - val actor1 = actorOf[MyStatelessActor] - (actor1 ? "hello").as[String].getOrElse("_") should equal("world") - (actor1 ? "hello").as[String].getOrElse("_") should equal("world") - - val bytes = toBinary(actor1) - val actor2 = fromBinary(bytes) - (actor2 ? "hello").as[String].getOrElse("_") should equal("world") - } - - -Helper Type Class for actors with external serializer ------------------------------------------------------ - -Use the trait ``SerializerBasedActorFormat`` for specifying serializers:: - - trait SerializerBasedActorFormat[T <: Actor] extends Format[T] { - val serializer: Serializer - def fromBinary(bytes: Array[Byte], act: T) = serializer.fromBinary(bytes, Some(act.self.actorClass)).asInstanceOf[T] - def toBinary(ac: T) = serializer.toBinary(ac) - } - -For a Java serializable actor:: - - class MyJavaSerializableActor extends Actor with scala.Serializable { - var count = 0 - - def receive = { - case "hello" => - count = count + 1 - self.reply("world " + count) - } - } - -Create a module for the type class:: - - import akka.serialization.{SerializerBasedActorFormat, Serializer} - - object BinaryFormatMyJavaSerializableActor { - implicit object MyJavaSerializableActorFormat extends SerializerBasedActorFormat[MyJavaSerializableActor] { - val serializer = Serializer.Java - } - } - -and serialize / de-serialize:: - - it("should be able to serialize and de-serialize a stateful actor with a given serializer") { - import akka.actor.Actor._ - import akka.serialization.ActorSerialization._ - import BinaryFormatMyJavaSerializableActor._ - - val actor1 = actorOf[MyJavaSerializableActor] - (actor1 ? "hello").as[String].getOrElse("_") should equal("world 1") - (actor1 ? "hello").as[String].getOrElse("_") should equal("world 2") - - val bytes = toBinary(actor1) - val actor2 = fromBinary(bytes) - (actor2 ? "hello").as[String].getOrElse("_") should equal("world 3") - } - - -Serialization of a RemoteActorRef -================================= - -You can serialize an ``ActorRef`` to an immutable, network-aware Actor reference -that can be freely shared across the network, a reference that "remembers" and -stay mapped to its original Actor instance and host node, and will always work -as expected. - -The ``RemoteActorRef`` serialization is based upon Protobuf (Google Protocol -Buffers) and you don't need to do anything to use it, it works on any -``ActorRef``. - -Currently Akka will **not** autodetect an ``ActorRef`` as part of your message -and serialize it for you automatically, so you have to do that manually or as -part of your custom serialization mechanisms. - -Here is an example of how to serialize an Actor:: - - import akka.serialization.RemoteActorSerialization._ - - val actor1 = actorOf[MyActor] - - val bytes = toRemoteActorRefProtocol(actor1).toByteArray - -To deserialize the ``ActorRef`` to a ``RemoteActorRef`` you need to use the -``fromBinaryToRemoteActorRef(bytes: Array[Byte])`` method on the ``ActorRef`` -companion object:: - - import akka.serialization.RemoteActorSerialization._ - val actor2 = fromBinaryToRemoteActorRef(bytes) - -You can also pass in a class loader to load the ``ActorRef`` class and -dependencies from:: - - import akka.serialization.RemoteActorSerialization._ - val actor2 = fromBinaryToRemoteActorRef(bytes, classLoader) - - -Deep serialization of a TypedActor -================================== - -Serialization of typed actors works almost the same way as untyped actors. You -can serialize the whole actor deeply, e.g. both the 'proxied ActorRef' and the -instance of its ``TypedActor``. - -Here is the example from above implemented as a TypedActor. - - -Step 1: Define the actor:: - - import akka.actor.TypedActor - - trait MyTypedActor { - def requestReply(s: String) : String - def oneWay() : Unit - } - - class MyTypedActorImpl extends TypedActor with MyTypedActor { - var count = 0 - - override def requestReply(message: String) : String = { - count = count + 1 - "world " + count - } - - override def oneWay() { - count = count + 1 - } - } - -Step 2: Implement the type class for the actor:: - - import akka.serialization.{Serializer, Format} - - class MyTypedActorFormat extends Format[MyTypedActorImpl] { - def fromBinary(bytes: Array[Byte], act: MyTypedActorImpl) = { - val p = Serializer.Protobuf.fromBinary(bytes, Some(classOf[ProtobufProtocol.Counter])).asInstanceOf[ProtobufProtocol.Counter] - act.count = p.getCount - act - } - def toBinary(ac: MyTypedActorImpl) = ProtobufProtocol.Counter.newBuilder.setCount(ac.count).build.toByteArray - } - -Step 3: Import the type class module definition and serialize / de-serialize:: - - import akka.serialization.TypedActorSerialization._ - - val typedActor1 = TypedActor.newInstance(classOf[MyTypedActor], classOf[MyTypedActorImpl], 1000) - - val f = new MyTypedActorFormat - val bytes = toBinaryJ(typedActor1, f) - - val typedActor2: MyTypedActor = fromBinaryJ(bytes, f) //type hint needed - typedActor2.requestReply("hello") - - - -Serialization of a remote typed ActorRef -======================================== - -To deserialize the TypedActor to a ``RemoteTypedActorRef`` (an aspectwerkz proxy -to a RemoteActorRef) you need to use the -``fromBinaryToRemoteTypedActorRef(bytes: Array[Byte])`` method on -``RemoteTypedActorSerialization`` object:: - - import akka.serialization.RemoteTypedActorSerialization._ - val typedActor = fromBinaryToRemoteTypedActorRef(bytes) - - // you can also pass in a class loader - val typedActor2 = fromBinaryToRemoteTypedActorRef(bytes, classLoader) - - -Compression -=========== - -Akka has a helper class for doing compression of binary data. This can be useful -for example when storing data in one of the backing storages. It currently -supports LZF which is a very fast compression algorithm suited for runtime -dynamic compression. - -Here is an example of how it can be used::: - - import akka.serialization.Compression - - val bytes: Array[Byte] = ... - val compressBytes = Compression.LZF.compress(bytes) - val uncompressBytes = Compression.LZF.uncompress(compressBytes) - - -Using the Serializable trait and Serializer class for custom serialization -========================================================================== - -If you are sending messages to a remote Actor and these messages implement one -of the predefined interfaces/traits in the ``akka.serialization.Serializable.*`` -object, then Akka will transparently detect which serialization format it should -use as wire protocol and will automatically serialize and deserialize the -message according to this protocol. - -Each serialization interface/trait in ``akka.serialization.Serializable.*`` has -a matching serializer in ``akka.serialization.Serializer.*``. - -Note however that if you are using one of the Serializable interfaces then you -don’t have to do anything else in regard to sending remote messages. - -The ones currently supported are (besides the default which is regular Java -serialization): - -- ScalaJSON (Scala only) -- JavaJSON (Java but some Scala structures) -- Protobuf (Scala and Java) - -Apart from the above, Akka also supports Scala object serialization through -`SJSON `_ that implements APIs -similar to ``akka.serialization.Serializer.*``. See the section on SJSON below -for details. - - -Protobuf -======== - -Akka supports using `Google Protocol Buffers`_ to serialize your -objects. Protobuf is a very efficient network serialization protocol which is -also used internally by Akka. The remote actors understand Protobuf messages so -if you just send them as they are they will be correctly serialized and -unserialized. - -.. _Google Protocol Buffers: http://code.google.com/p/protobuf - -Here is an example. - -Let's say you have this Protobuf message specification that you want to use as -message between remote actors. First you need to compiled it with 'protoc' -compiler:: - - message ProtobufPOJO { - required uint64 id = 1; - required string name = 2; - required bool status = 3; - } - -When you compile the spec you will among other things get a message builder. You -then use this builder to create the messages to send over the wire:: - - val resultFuture = remoteActor ? ProtobufPOJO.newBuilder - .setId(11) - .setStatus(true) - .setName("Coltrane") - .build - -The remote Actor can then receive the Protobuf message typed as-is:: - - class MyRemoteActor extends Actor { - def receive = { - case pojo: ProtobufPOJO => - val id = pojo.getId - val status = pojo.getStatus - val name = pojo.getName - ... - } - } - - -JSON: Scala -=========== - -Use the ``akka.serialization.Serializable.ScalaJSON`` base class with its toJSON -method. Akka’s Scala JSON is based upon the SJSON library. - -For your POJOs to be able to serialize themselves you have to extend the -ScalaJSON[] trait as follows. JSON serialization is based on a type class -protocol which you need to define for your own abstraction. The instance of the -type class is defined as an implicit object which is used for serialization and -de-serialization. You also need to implement the methods in terms of the APIs -which sjson publishes. - -.. code-block:: scala - - import akka.serialization._ - import akka.serialization.Serializable.ScalaJSON - import akka.serialization.JsonSerialization._ - import akka.serialization.DefaultProtocol._ - - case class MyMessage(val id: String, val value: Tuple2[String, Int]) extends ScalaJSON[MyMessage] { - // type class instance - implicit val MyMessageFormat: sjson.json.Format[MyMessage] = - asProduct2("id", "value")(MyMessage)(MyMessage.unapply(_).get) - - def toJSON: String = JsValue.toJson(tojson(this)) - def toBytes: Array[Byte] = tobinary(this) - def fromBytes(bytes: Array[Byte]) = frombinary[MyMessage](bytes) - def fromJSON(js: String) = fromjson[MyMessage](Js(js)) - } - - // sample test case - it("should be able to serialize and de-serialize MyMessage") { - val s = MyMessage("Target", ("cooker", 120)) - s.fromBytes(s.toBytes) should equal(s) - s.fromJSON(s.toJSON) should equal(s) - } - -Use akka.serialization.Serializers.ScalaJSON to do generic JSON serialization, -e.g. serialize object that does not extend ScalaJSON using the JSON -serializer. Serialization using Serializer can be done in two ways :- - -1. Type class based serialization (recommended) -2. Reflection based serialization - -We will discuss both of these techniques in this section. For more details refer -to the discussion in the next section SJSON: Scala. - - -Serializer API using type classes ---------------------------------- - -Here are the steps that you need to follow: - -1. Define your class:: - - case class MyMessage(val id: String, val value: Tuple2[String, Int]) - -2. Define the type class instance:: - - import akka.serialization.DefaultProtocol._ - implicit val MyMessageFormat: sjson.json.Format[MyMessage] = - asProduct2("id", "value")(MyMessage)(MyMessage.unapply(_).get) - -3. Serialize:: - - import akka.serialization.Serializer.ScalaJSON - import akka.serialization.JsonSerialization._ - - val o = MyMessage("dg", ("akka", 100)) - fromjson[MyMessage](tojson(o)) should equal(o) - frombinary[MyMessage](tobinary(o)) should equal(o) - - -Serializer API using reflection -------------------------------- - -You can also use the Serializer abstraction to serialize using the reflection -based serialization API of sjson. But we recommend using the type class based -one, because reflection based serialization has limitations due to type -erasure. Here's an example of reflection based serialization:: - - import scala.reflect.BeanInfo - import akka.serialization.Serializer - - @BeanInfo case class Foo(name: String) { - def this() = this(null) // default constructor is necessary for deserialization - } - - val foo = Foo("bar") - - val json = Serializer.ScalaJSON.toBinary(foo) - - val fooCopy = Serializer.ScalaJSON.fromBinary(json) // returns a JsObject as an AnyRef - - val fooCopy2 = Serializer.ScalaJSON.fromJSON(new String(json)) // can also take a string as input - - val fooCopy3 = Serializer.ScalaJSON.fromBinary[Foo](json).asInstanceOf[Foo] - -Classes without a @BeanInfo annotation cannot be serialized as JSON. -So if you see something like that:: - - scala> Serializer.ScalaJSON.out(bar) - Serializer.ScalaJSON.out(bar) - java.lang.UnsupportedOperationException: Class class Bar not supported for conversion - at sjson.json.JsBean$class.toJSON(JsBean.scala:210) - at sjson.json.Serializer$SJSON$.toJSON(Serializer.scala:107) - at sjson.json.Serializer$SJSON$class.out(Serializer.scala:37) - at sjson.json.Serializer$SJSON$.out(Serializer.scala:107) - at akka.serialization.Serializer$ScalaJSON... - -it means, that you haven't got a @BeanInfo annotation on your class. - -You may also see this exception when trying to serialize a case class without -any attributes, like this:: - - @BeanInfo case class Empty() // cannot be serialized - - -SJSON: Scala -============ - -SJSON supports serialization of Scala objects into JSON. It implements support -for built in Scala structures like List, Map or String as well as custom -objects. SJSON is available as an Apache 2 licensed project on Github `here -`_. - -Example: I have a Scala object as:: - - val addr = Address("Market Street", "San Francisco", "956871") - -where Address is a custom class defined by the user. Using SJSON, I can store it -as JSON and retrieve as plain old Scala object. Here’s the simple assertion that -validates the invariant. Note that during de-serialziation, the class name is -specified. Hence what it gives back is an instance of Address:: - - val serializer = sjson.json.Serializer.SJSON - - addr should equal( - serializer.in[Address](serializer.out(addr))) - -Note, that the class needs to have a default constructor. Otherwise the -deserialization into the specified class will fail. - -There are situations, particularly when writing generic persistence libraries in -Akka, when the exact class is not known during de-serialization. Using SJSON I -can get it as AnyRef or Nothing:: - - serializer.in[AnyRef](serializer.out(addr)) - -or just as:: - - serializer.in(serializer.out(addr)) - -What you get back from is a JsValue, an abstraction of the JSON object -model. For details of JsValueimplementation, refer to `dispatch-json -`_ that SJSON uses as the underlying JSON -parser implementation. Once I have the JsValue model, I can use use extractors -to get back individual attributes:: - - val serializer = sjson.json.Serializer.SJSON - - val a = serializer.in[AnyRef](serializer.out(addr)) - - // use extractors - val c = 'city ? str - val c(_city) = a - _city should equal("San Francisco") - - val s = 'street ? str - val s(_street) = a - _street should equal("Market Street") - - val z = 'zip ? str - val z(_zip) = a - _zip should equal("956871") - - -Serialization of Embedded Objects ---------------------------------- - -SJSON supports serialization of Scala objects that have other embedded -objects. Suppose you have the following Scala classes .. Here Contact has an -embedded Address Map:: - - @BeanInfo - case class Contact(name: String, - @(JSONTypeHint @field)(value = classOf[Address]) - addresses: Map[String, Address]) { - - override def toString = "name = " + name + " addresses = " + - addresses.map(a => a._1 + ":" + a._2.toString).mkString(",") - } - - @BeanInfo - case class Address(street: String, city: String, zip: String) { - override def toString = "address = " + street + "/" + city + "/" + zip - } - -With SJSON, I can do the following:: - - val a1 = Address("Market Street", "San Francisco", "956871") - val a2 = Address("Monroe Street", "Denver", "80231") - val a3 = Address("North Street", "Atlanta", "987671") - - val c = Contact("Bob", Map("residence" -> a1, "office" -> a2, "club" -> a3)) - val co = serializer.out(c) - - val serializer = sjson.json.Serializer.SJSON - - // with class specified - c should equal(serializer.in[Contact](co)) - - // no class specified - val a = serializer.in[AnyRef](co) - - // extract name - val n = 'name ? str - val n(_name) = a - "Bob" should equal(_name) - - // extract addresses - val addrs = 'addresses ? obj - val addrs(_addresses) = a - - // extract residence from addresses - val res = 'residence ? obj - val res(_raddr) = _addresses - - // make an Address bean out of _raddr - val address = JsBean.fromJSON(_raddr, Some(classOf[Address])) - a1 should equal(address) - - object r { def ># [T](f: JsF[T]) = f(a.asInstanceOf[JsValue]) } - - // still better: chain 'em up - "Market Street" should equal( - (r ># { ('addresses ? obj) andThen ('residence ? obj) andThen ('street ? str) })) - - - -Changing property names during serialization --------------------------------------------- - -.. code-block:: scala - - @BeanInfo - case class Book(id: Number, - title: String, @(JSONProperty @getter)(value = "ISBN") isbn: String) { - - override def toString = "id = " + id + " title = " + title + " isbn = " + isbn - } - -When this will be serialized out, the property name will be changed:: - - val b = new Book(100, "A Beautiful Mind", "012-456372") - val jsBook = Js(JsBean.toJSON(b)) - val expected_book_map = Map( - JsString("id") -> JsNumber(100), - JsString("title") -> JsString("A Beautiful Mind"), - JsString("ISBN") -> JsString("012-456372") - ) - - - -Serialization with ignore properties ------------------------------------- - -When serializing objects, some of the properties can be ignored -declaratively. Consider the following class declaration:: - - @BeanInfo - case class Journal(id: BigDecimal, - title: String, - author: String, - @(JSONProperty @getter)(ignore = true) issn: String) { - - override def toString = - "Journal: " + id + "/" + title + "/" + author + - (issn match { - case null => "" - case _ => "/" + issn - }) - } - -The annotation ``@JSONProperty`` can be used to selectively ignore fields. When -I serialize a Journal object out and then back in, the content of issn field -will be null:: - - val serializer = sjson.json.Serializer.SJSON - - it("should ignore issn field") { - val j = Journal(100, "IEEE Computer", "Alex Payne", "012-456372") - serializer.in[Journal](serializer.out(j)).asInstanceOf[Journal].issn should equal(null) - } - -Similarly, we can ignore properties of an object **only** if they are null and -not ignore otherwise. Just specify the annotation ``@JSONProperty`` as -``@JSONProperty {val ignoreIfNull = true}``. - - - -Serialization with Type Hints for Generic Data Members ------------------------------------------------------- - -Consider the following Scala class:: - - @BeanInfo - case class Contact(name: String, - @(JSONTypeHint @field)(value = classOf[Address]) - addresses: Map[String, Address]) { - - override def toString = "name = " + name + " addresses = " + - addresses.map(a => a._1 + ":" + a._2.toString).mkString(",") - } - -Because of erasure, you need to add the type hint declaratively through the -annotation @JSONTypeHint that SJSON will pick up during serialization. Now we -can say:: - - val serializer = sjson.json.Serializer.SJSON - - val c = Contact("Bob", Map("residence" -> a1, "office" -> a2, "club" -> a3)) - val co = serializer.out(c) - - it("should give an instance of Contact") { - c should equal(serializer.in[Contact](co)) - } - -With optional generic data members, we need to provide the hint to SJSON through -another annotation ``@OptionTypeHint``:: - - @BeanInfo - case class ContactWithOptionalAddr(name: String, - @(JSONTypeHint @field)(value = classOf[Address]) - @(OptionTypeHint @field)(value = classOf[Map[_,_]]) - addresses: Option[Map[String, Address]]) { - - override def toString = "name = " + name + " " + - (addresses match { - case None => "" - case Some(ad) => " addresses = " + ad.map(a => a._1 + ":" + a._2.toString).mkString(",") - }) - } - -Serialization works ok with optional members annotated as above:: - - val serializer = sjson.json.Serializer.SJSON - - describe("Bean with optional bean member serialization") { - it("should serialize with Option defined") { - val c = new ContactWithOptionalAddr("Debasish Ghosh", - Some(Map("primary" -> new Address("10 Market Street", "San Francisco, CA", "94111"), - "secondary" -> new Address("3300 Tamarac Drive", "Denver, CO", "98301")))) - c should equal( - serializer.in[ContactWithOptionalAddr](serializer.out(c))) - } - } - -You can also specify a custom ClassLoader while using the SJSON serializer:: - - object SJSON { - val classLoader = //.. specify a custom classloader - } - - import SJSON._ - serializer.out(..) - - //.. - - -Fighting Type Erasure ---------------------- - -Because of type erasure, it's not always possible to infer the correct type -during de-serialization of objects. Consider the following example:: - - abstract class A - @BeanInfo case class B(param1: String) extends A - @BeanInfo case class C(param1: String, param2: String) extends A - - @BeanInfo case class D(@(JSONTypeHint @field)(value = classOf[A])param1: List[A]) - -and the serialization code like the following:: - - object TestSerialize{ - def main(args: Array[String]) { - val test1 = new D(List(B("hello1"))) - val json = sjson.json.Serializer.SJSON.out(test1) - val res = sjson.json.Serializer.SJSON.in[D](json) - val res1: D = res.asInstanceOf[D] - println(res1) - } - } - -Note that the type hint on class D says A, but the actual instances that have -been put into the object before serialization is one of the derived classes -(B). During de-serialization, we have no idea of what can be inside D. The -serializer.in API will fail since all hint it has is for A, which is -abstract. In such cases, we need to handle the de-serialization by using -extractors over the underlying data structure that we use for storing JSON -objects, which is JsValue. Here's an example:: - - val serializer = sjson.json.Serializer.SJSON - - val test1 = new D(List(B("hello1"))) - val json = serializer.out(test1) - - // create a JsValue from the string - val js = Js(new String(json)) - - // extract the named list argument - val m = (Symbol("param1") ? list) - val m(_m) = js - - // extract the string within - val s = (Symbol("param1") ? str) - - // form a list of B's - val result = _m.map{ e => - val s(_s) = e - B(_s) - } - - // form a D - println("result = " + D(result)) - -The above snippet de-serializes correctly using extractors defined on -JsValue. For more details on JsValue and the extractors, please refer to -`dispatch-json `_ . - -**NOTE**: Serialization with SJSON is based on bean introspection. In the -current version of Scala (2.8.0.Beta1 and 2.7.7) there is a bug where bean -introspection does not work properly for classes enclosed within another -class. Please ensure that the beans are the top level classes in your -application. They can be within objects though. A ticket has been filed in the -Scala Tracker and also fixed in the trunk. Here's the `ticket -`_ . - - -Type class based Serialization ------------------------------- - -If type erasure hits you, reflection based serialization may not be the right -option. In fact the last section shows some of the scenarios which may not be -possible to handle using reflection based serialization of sjson. sjson also -supports type class based serialization where you can provide a custom protocol -for serialization as part of the type class implementation. - -Here's a sample session at the REPL which shows the default serialization -protocol of sjson:: - - scala> import sjson.json._ - import sjson.json._ - - scala> import DefaultProtocol._ - import DefaultProtocol._ - - scala> val str = "debasish" - str: java.lang.String = debasish - - scala> import JsonSerialization._ - import JsonSerialization._ - - scala> tojson(str) - res0: dispatch.json.JsValue = "debasish" - - scala> fromjson[String](res0) - res1: String = debasish - -You can use serialization of generic data types using the default protocol as -well:: - - scala> val list = List(10, 12, 14, 18) - list: List[Int] = List(10, 12, 14, 18) - - scala> tojson(list) - res2: dispatch.json.JsValue = [10, 12, 14, 18] - - scala> fromjson[List[Int]](res2) - res3: List[Int] = List(10, 12, 14, 18) - -You can also define your own custom protocol, which as to be an implementation -of the following type class:: - - trait Writes[T] { - def writes(o: T): JsValue - } - - trait Reads[T] { - def reads(json: JsValue): T - } - - trait Format[T] extends Writes[T] with Reads[T] - -Consider a case class and a custom protocol to serialize it into JSON. Here's -the type class implementation:: - - object Protocols { - case class Person(lastName: String, firstName: String, age: Int) - object PersonProtocol extends DefaultProtocol { - import dispatch.json._ - import JsonSerialization._ - - implicit object PersonFormat extends Format[Person] { - def reads(json: JsValue): Person = json match { - case JsObject(m) => - Person(fromjson[String](m(JsString("lastName"))), - fromjson[String](m(JsString("firstName"))), fromjson[Int](m(JsString("age")))) - case _ => throw new RuntimeException("JsObject expected") - } - - def writes(p: Person): JsValue = - JsObject(List( - (tojson("lastName").asInstanceOf[JsString], tojson(p.lastName)), - (tojson("firstName").asInstanceOf[JsString], tojson(p.firstName)), - (tojson("age").asInstanceOf[JsString], tojson(p.age)) )) - } - } - } - -and the serialization in action in the REPL:: - - scala> import sjson.json._ - import sjson.json._ - - scala> import Protocols._ - import Protocols._ - - scala> import PersonProtocol._ - import PersonProtocol._ - - scala> val p = Person("ghosh", "debasish", 20) - p: sjson.json.Protocols.Person = Person(ghosh,debasish,20) - - scala> import JsonSerialization._ - import JsonSerialization._ - - scala> tojson[Person](p) - res1: dispatch.json.JsValue = {"lastName" : "ghosh", "firstName" : "debasish", "age" : 20} - - scala> fromjson[Person](res1) - res2: sjson.json.Protocols.Person = Person(ghosh,debasish,20) - -There are other nifty ways to implement case class serialization using -sjson. For more details, have a look at the `wiki -`_ -for sjson. - - -JSON: Java -========== - -Use the ``akka.serialization.Serializable.JavaJSON`` base class with its -toJSONmethod. Akka’s Java JSON is based upon the Jackson library. - -For your POJOs to be able to serialize themselves you have to extend the -JavaJSON base class. - -.. code-block:: java - - import akka.serialization.Serializable.JavaJSON; - import akka.serialization.SerializerFactory; - - class MyMessage extends JavaJSON { - private String name = null; - public MyMessage(String name) { - this.name = name; - } - public String getName() { - return name; - } - } - - MyMessage message = new MyMessage("json"); - String json = message.toJSON(); - SerializerFactory factory = new SerializerFactory(); - MyMessage messageCopy = factory.getJavaJSON().in(json); - -Use the akka.serialization.SerializerFactory.getJavaJSON to do generic JSON -serialization, e.g. serialize object that does not extend JavaJSON using the -JSON serializer. - -.. code-block:: java - - Foo foo = new Foo(); - SerializerFactory factory = new SerializerFactory(); - String json = factory.getJavaJSON().out(foo); - Foo fooCopy = factory.getJavaJSON().in(json, Foo.class); - - - From a75310a181180e600d24438bba64d9ce1cb3204c Mon Sep 17 00:00:00 2001 From: Viktor Klang Date: Fri, 4 Nov 2011 00:39:02 +0100 Subject: [PATCH 44/57] Removing unused code in ReflectiveAccess, fixing a performance-related issue in LocalDeployer and switched back to non-systemServices in the LocalActorRefProviderSpec --- .../actor/LocalActorRefProviderSpec.scala | 2 +- .../src/main/scala/akka/actor/Deployer.scala | 14 +-- .../main/scala/akka/dispatch/Dispatcher.scala | 4 +- .../scala/akka/util/ReflectiveAccess.scala | 106 ------------------ 4 files changed, 5 insertions(+), 121 deletions(-) diff --git a/akka-actor-tests/src/test/scala/akka/actor/LocalActorRefProviderSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/LocalActorRefProviderSpec.scala index b6f7196f81..3a78aa54a0 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/LocalActorRefProviderSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/LocalActorRefProviderSpec.scala @@ -20,7 +20,7 @@ class LocalActorRefProviderSpec extends AkkaSpec { (0 until 100) foreach { i ⇒ // 100 concurrent runs val address = "new-actor" + i implicit val timeout = Timeout(30 seconds) - ((1 to 4) map { _ ⇒ Future { provider.actorOf(Props(c ⇒ { case _ ⇒ }), app.guardian, address, true) } }).map(_.get).distinct.size must be(1) + ((1 to 4) map { _ ⇒ Future { provider.actorOf(Props(c ⇒ { case _ ⇒ }), app.guardian, address) } }).map(_.get).distinct.size must be(1) } } } diff --git a/akka-actor/src/main/scala/akka/actor/Deployer.scala b/akka-actor/src/main/scala/akka/actor/Deployer.scala index e900893604..bb0733c3b9 100644 --- a/akka-actor/src/main/scala/akka/actor/Deployer.scala +++ b/akka-actor/src/main/scala/akka/actor/Deployer.scala @@ -37,7 +37,7 @@ class Deployer(val app: AkkaApplication) extends ActorDeployer { val deploymentConfig = new DeploymentConfig(app) lazy val instance: ActorDeployer = { - val deployer = if (app.reflective.ClusterModule.isEnabled) app.reflective.ClusterModule.clusterDeployer else LocalDeployer + val deployer = LocalDeployer deployer.init(deploymentsInConfig) deployer } @@ -71,16 +71,8 @@ class Deployer(val app: AkkaApplication) extends ActorDeployer { } } - private[akka] def lookupDeploymentFor(address: String): Option[Deploy] = { - instance.lookupDeploymentFor(address) match { - case s @ Some(d) if d ne null ⇒ s - case _ ⇒ - lookupInConfig(address) match { - case None | Some(null) ⇒ None - case s @ Some(d) ⇒ deploy(d); s // deploy and cache it - } - } - } + private[akka] def lookupDeploymentFor(address: String): Option[Deploy] = + instance.lookupDeploymentFor(address) private[akka] def deploymentsInConfig: List[Deploy] = { for { diff --git a/akka-actor/src/main/scala/akka/dispatch/Dispatcher.scala b/akka-actor/src/main/scala/akka/dispatch/Dispatcher.scala index 946bac8a9c..06e6c6442a 100644 --- a/akka-actor/src/main/scala/akka/dispatch/Dispatcher.scala +++ b/akka-actor/src/main/scala/akka/dispatch/Dispatcher.scala @@ -65,7 +65,7 @@ import akka.AkkaApplication */ class Dispatcher( _app: AkkaApplication, - _name: String, + val name: String, val throughput: Int, val throughputDeadlineTime: Int, val mailboxType: MailboxType, @@ -73,8 +73,6 @@ class Dispatcher( val timeoutMs: Long) extends MessageDispatcher(_app) { - val name = "akka:event-driven:dispatcher:" + _name - protected[akka] val executorServiceFactory = executorServiceFactoryProvider.createExecutorServiceFactory(name) protected[akka] val executorService = new AtomicReference[ExecutorService](new LazyExecutorServiceWrapper(executorServiceFactory.createExecutorService)) diff --git a/akka-actor/src/main/scala/akka/util/ReflectiveAccess.scala b/akka-actor/src/main/scala/akka/util/ReflectiveAccess.scala index f507b08ba6..7d26a1c489 100644 --- a/akka-actor/src/main/scala/akka/util/ReflectiveAccess.scala +++ b/akka-actor/src/main/scala/akka/util/ReflectiveAccess.scala @@ -135,110 +135,4 @@ class ReflectiveAccess(val app: AkkaApplication) { case Left(e) ⇒ throw e } } - - /** - * Reflective access to the Cluster module. - * - * @author Jonas Bonér - */ - object ClusterModule { - lazy val isEnabled = app.AkkaConfig.ClusterEnabled //&& clusterInstance.isDefined - - lazy val clusterRefClass: Class[_] = getClassFor("akka.cluster.ClusterActorRef") match { - case Left(e) ⇒ throw e - case Right(b) ⇒ b - } - - def newClusteredActorRef(props: RoutedProps): ActorRef = { - val params: Array[Class[_]] = Array(classOf[RoutedProps]) - val args: Array[AnyRef] = Array(props) - - createInstance(clusterRefClass, params, args) match { - case Left(e) ⇒ throw e - case Right(b) ⇒ b.asInstanceOf[ActorRef] - } - } - - def ensureEnabled() { - if (!isEnabled) { - val e = new ModuleNotAvailableException( - "Can't load the cluster module, make sure it is enabled in the config ('akka.enabled-modules = [\"cluster\"])' and that akka-cluster.jar is on the classpath") - app.eventHandler.debug(this, e.toString) - throw e - } - } - - lazy val clusterInstance: Option[Cluster] = getObjectFor("akka.cluster.Cluster$") match { - case Right(value) ⇒ Some(value) - case Left(exception) ⇒ - app.eventHandler.debug(this, exception.toString) - None - } - - lazy val clusterDeployerInstance: Option[ActorDeployer] = getObjectFor("akka.cluster.ClusterDeployer$") match { - case Right(value) ⇒ Some(value) - case Left(exception) ⇒ - app.eventHandler.debug(this, exception.toString) - None - } - - lazy val transactionLogInstance: Option[TransactionLogObject] = getObjectFor("akka.cluster.TransactionLog$") match { - case Right(value) ⇒ Some(value) - case Left(exception) ⇒ - app.eventHandler.debug(this, exception.toString) - None - } - - lazy val node: ClusterNode = { - ensureEnabled() - clusterInstance.get.node - } - - lazy val clusterDeployer: ActorDeployer = { - ensureEnabled() - clusterDeployerInstance.get - } - - lazy val transactionLog: TransactionLogObject = { - ensureEnabled() - transactionLogInstance.get - } - - type Cluster = { - def node: ClusterNode - } - - type Mailbox = { - def enqueue(message: Envelope) - def dequeue: Envelope - } - - type TransactionLogObject = { - def newLogFor( - id: String, - isAsync: Boolean, - replicationScheme: ReplicationScheme): TransactionLog - - def logFor( - id: String, - isAsync: Boolean, - replicationScheme: ReplicationScheme): TransactionLog - - def shutdown() - } - - type TransactionLog = { - def recordEntry(messageHandle: Envelope, actorRef: LocalActorRef) - def recordEntry(entry: Array[Byte]) - def recordSnapshot(snapshot: Array[Byte]) - def entries: Vector[Array[Byte]] - def entriesFromLatestSnapshot: Tuple2[Array[Byte], Vector[Array[Byte]]] - def entriesInRange(from: Long, to: Long): Vector[Array[Byte]] - def latestSnapshotAndSubsequentEntries: (Option[Array[Byte]], Vector[Array[Byte]]) - def latestEntryId: Long - def latestSnapshotId: Long - def delete() - def close() - } - } } From d8d322c6e8312d93df810a4bc04c524e79d63dcd Mon Sep 17 00:00:00 2001 From: Viktor Klang Date: Fri, 4 Nov 2011 10:11:07 +0100 Subject: [PATCH 45/57] Moving in Deployer udner the provider --- .../test/scala/akka/actor/DeployerSpec.scala | 2 +- .../akka/actor/LocalActorRefProviderSpec.scala | 2 +- .../routing/ConfiguredLocalRoutingSpec.scala | 12 ++++++------ .../src/main/scala/akka/AkkaApplication.scala | 3 --- .../scala/akka/actor/ActorRefProvider.scala | 9 ++++++++- .../src/main/scala/akka/actor/Deployer.scala | 18 ++++++------------ .../akka/remote/RemoteActorRefProvider.scala | 4 +++- 7 files changed, 25 insertions(+), 25 deletions(-) diff --git a/akka-actor-tests/src/test/scala/akka/actor/DeployerSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/DeployerSpec.scala index 4917edd341..b35f08ec9b 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/DeployerSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/DeployerSpec.scala @@ -13,7 +13,7 @@ class DeployerSpec extends AkkaSpec { "A Deployer" must { "be able to parse 'akka.actor.deployment._' config elements" in { - val deployment = app.deployer.lookupInConfig("service-ping") + val deployment = app.provider.deployer.lookupInConfig("service-ping") deployment must be('defined) deployment must equal(Some( diff --git a/akka-actor-tests/src/test/scala/akka/actor/LocalActorRefProviderSpec.scala b/akka-actor-tests/src/test/scala/akka/actor/LocalActorRefProviderSpec.scala index 3a78aa54a0..4b93d37d2c 100644 --- a/akka-actor-tests/src/test/scala/akka/actor/LocalActorRefProviderSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/actor/LocalActorRefProviderSpec.scala @@ -19,7 +19,7 @@ class LocalActorRefProviderSpec extends AkkaSpec { (0 until 100) foreach { i ⇒ // 100 concurrent runs val address = "new-actor" + i - implicit val timeout = Timeout(30 seconds) + implicit val timeout = Timeout(5 seconds) ((1 to 4) map { _ ⇒ Future { provider.actorOf(Props(c ⇒ { case _ ⇒ }), app.guardian, address) } }).map(_.get).distinct.size must be(1) } } diff --git a/akka-actor-tests/src/test/scala/akka/routing/ConfiguredLocalRoutingSpec.scala b/akka-actor-tests/src/test/scala/akka/routing/ConfiguredLocalRoutingSpec.scala index 6d1d5e1da0..7b8a6aa751 100644 --- a/akka-actor-tests/src/test/scala/akka/routing/ConfiguredLocalRoutingSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/routing/ConfiguredLocalRoutingSpec.scala @@ -16,7 +16,7 @@ class ConfiguredLocalRoutingSpec extends AkkaSpec { "be able to shut down its instance" in { val address = "round-robin-0" - app.deployer.deploy( + app.provider.deployer.deploy( Deploy( address, None, @@ -52,7 +52,7 @@ class ConfiguredLocalRoutingSpec extends AkkaSpec { "deliver messages in a round robin fashion" in { val address = "round-robin-1" - app.deployer.deploy( + app.provider.deployer.deploy( Deploy( address, None, @@ -97,7 +97,7 @@ class ConfiguredLocalRoutingSpec extends AkkaSpec { "deliver a broadcast message using the !" in { val address = "round-robin-2" - app.deployer.deploy( + app.provider.deployer.deploy( Deploy( address, None, @@ -132,7 +132,7 @@ class ConfiguredLocalRoutingSpec extends AkkaSpec { "be able to shut down its instance" in { val address = "random-0" - app.deployer.deploy( + app.provider.deployer.deploy( Deploy( address, None, @@ -166,7 +166,7 @@ class ConfiguredLocalRoutingSpec extends AkkaSpec { "deliver messages in a random fashion" in { val address = "random-1" - app.deployer.deploy( + app.provider.deployer.deploy( Deploy( address, None, @@ -211,7 +211,7 @@ class ConfiguredLocalRoutingSpec extends AkkaSpec { "deliver a broadcast message using the !" in { val address = "random-2" - app.deployer.deploy( + app.provider.deployer.deploy( Deploy( address, None, diff --git a/akka-actor/src/main/scala/akka/AkkaApplication.scala b/akka-actor/src/main/scala/akka/AkkaApplication.scala index 3e7ac72cda..72010323b9 100644 --- a/akka-actor/src/main/scala/akka/AkkaApplication.scala +++ b/akka-actor/src/main/scala/akka/AkkaApplication.scala @@ -194,9 +194,6 @@ class AkkaApplication(val name: String, val config: Configuration) extends Actor // TODO think about memory consistency effects when doing funky stuff inside constructor val deadLetters = new DeadLetterActorRef(this) - // TODO think about memory consistency effects when doing funky stuff inside an ActorRefProvider's constructor - val deployer = new Deployer(this) - val deathWatch = provider.createDeathWatch() // TODO think about memory consistency effects when doing funky stuff inside constructor diff --git a/akka-actor/src/main/scala/akka/actor/ActorRefProvider.scala b/akka-actor/src/main/scala/akka/actor/ActorRefProvider.scala index 973ed36ef6..920ed18be9 100644 --- a/akka-actor/src/main/scala/akka/actor/ActorRefProvider.scala +++ b/akka-actor/src/main/scala/akka/actor/ActorRefProvider.scala @@ -25,6 +25,11 @@ trait ActorRefProvider { def actorFor(address: String): Option[ActorRef] + /** + * What deployer will be used to resolve deployment configuration? + */ + private[akka] def deployer: Deployer + private[akka] def actorOf(props: Props, supervisor: ActorRef, address: String, systemService: Boolean): ActorRef private[akka] def evict(address: String): Boolean @@ -92,6 +97,8 @@ class ActorRefProviderException(message: String) extends AkkaException(message) */ class LocalActorRefProvider(val app: AkkaApplication) extends ActorRefProvider { + private[akka] val deployer: Deployer = new Deployer(app) + val terminationFuture = new DefaultPromise[AkkaApplication.ExitStatus](Timeout.never)(app.dispatcher) /** @@ -152,7 +159,7 @@ class LocalActorRefProvider(val app: AkkaApplication) extends ActorRefProvider { actors.putIfAbsent(address, newFuture) match { case null ⇒ val actor: ActorRef = try { - (if (systemService) None else app.deployer.lookupDeploymentFor(address)) match { // see if the deployment already exists, if so use it, if not create actor + (if (systemService) None else deployer.lookupDeployment(address)) match { // see if the deployment already exists, if so use it, if not create actor // create a local actor case None | Some(DeploymentConfig.Deploy(_, _, DeploymentConfig.Direct, _, _, DeploymentConfig.LocalScope)) ⇒ diff --git a/akka-actor/src/main/scala/akka/actor/Deployer.scala b/akka-actor/src/main/scala/akka/actor/Deployer.scala index bb0733c3b9..f550c34bfa 100644 --- a/akka-actor/src/main/scala/akka/actor/Deployer.scala +++ b/akka-actor/src/main/scala/akka/actor/Deployer.scala @@ -36,8 +36,8 @@ class Deployer(val app: AkkaApplication) extends ActorDeployer { val deploymentConfig = new DeploymentConfig(app) - lazy val instance: ActorDeployer = { - val deployer = LocalDeployer + val instance: ActorDeployer = { + val deployer = new LocalDeployer() deployer.init(deploymentsInConfig) deployer } @@ -323,20 +323,14 @@ class Deployer(val app: AkkaApplication) extends ActorDeployer { * * @author Jonas Bonér */ -object LocalDeployer extends ActorDeployer { +class LocalDeployer extends ActorDeployer { private val deployments = new ConcurrentHashMap[String, Deploy] - private[akka] def init(deployments: Seq[Deploy]) { - deployments foreach (deploy(_)) // deploy - } + private[akka] def init(deployments: Seq[Deploy]): Unit = deployments foreach deploy // deploy - private[akka] def shutdown() { - deployments.clear() //TODO do something else/more? - } + private[akka] def shutdown(): Unit = deployments.clear() //TODO do something else/more? - private[akka] def deploy(deployment: Deploy) { - deployments.putIfAbsent(deployment.address, deployment) - } + private[akka] def deploy(deployment: Deploy): Unit = deployments.putIfAbsent(deployment.address, deployment) private[akka] def lookupDeploymentFor(address: String): Option[Deploy] = Option(deployments.get(address)) } diff --git a/akka-remote/src/main/scala/akka/remote/RemoteActorRefProvider.scala b/akka-remote/src/main/scala/akka/remote/RemoteActorRefProvider.scala index 99c47e5285..dc6b18c6d9 100644 --- a/akka-remote/src/main/scala/akka/remote/RemoteActorRefProvider.scala +++ b/akka-remote/src/main/scala/akka/remote/RemoteActorRefProvider.scala @@ -44,6 +44,8 @@ class RemoteActorRefProvider(val app: AkkaApplication) extends ActorRefProvider private[akka] def theOneWhoWalksTheBubblesOfSpaceTime: ActorRef = local.theOneWhoWalksTheBubblesOfSpaceTime private[akka] def terminationFuture = local.terminationFuture + private[akka] def deployer: Deployer = local.deployer + def defaultDispatcher = app.dispatcher def defaultTimeout = app.AkkaConfig.ActorTimeout @@ -55,7 +57,7 @@ class RemoteActorRefProvider(val app: AkkaApplication) extends ActorRefProvider actors.putIfAbsent(address, newFuture) match { // we won the race -- create the actor and resolve the future case null ⇒ val actor: ActorRef = try { - app.deployer.lookupDeploymentFor(address) match { + deployer.lookupDeploymentFor(address) match { case Some(DeploymentConfig.Deploy(_, _, routerType, nrOfInstances, failureDetectorType, DeploymentConfig.RemoteScope(remoteAddresses))) ⇒ // FIXME move to AccrualFailureDetector as soon as we have the Gossiper up and running and remove the option to select impl in the akka.conf file since we only have one From 1e3ab2645f6a93f6a1c160b5d45dfcb088fb869a Mon Sep 17 00:00:00 2001 From: Derek Williams Date: Sat, 5 Nov 2011 12:48:19 -0600 Subject: [PATCH 46/57] Slight tweak to solution for ticket 1313 --- .../test/scala/akka/dispatch/FutureSpec.scala | 17 ++++++------ .../src/main/scala/akka/dispatch/Future.scala | 26 +++++++++++++------ 2 files changed, 26 insertions(+), 17 deletions(-) diff --git a/akka-actor-tests/src/test/scala/akka/dispatch/FutureSpec.scala b/akka-actor-tests/src/test/scala/akka/dispatch/FutureSpec.scala index c5d40b8701..256bb4f9ca 100644 --- a/akka-actor-tests/src/test/scala/akka/dispatch/FutureSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/dispatch/FutureSpec.scala @@ -835,20 +835,19 @@ class FutureSpec extends AkkaSpec with Checkers with BeforeAndAfterAll { } "should not deadlock with nested await (ticket 1313)" in { - - val simple = Future() map (_ ⇒ (Future() map (_ ⇒ ())).get) + val simple = Future() map (_ ⇒ (Future(()) map (_ ⇒ ())).get) simple.await must be('completed) - val latch = new StandardLatch + val l1, l2 = new StandardLatch val complex = Future() map { _ ⇒ + Future.blocking() val nested = Future() - nested.await - nested foreach (_ ⇒ latch.open) - Future.redispatchTasks - latch.await + nested foreach (_ ⇒ l1.open) + l1.await // make sure nested is completed + nested foreach (_ ⇒ l2.open) + l2.await } - complex.await must be('completed) - + assert(complex.await.isCompleted) } } } diff --git a/akka-actor/src/main/scala/akka/dispatch/Future.scala b/akka-actor/src/main/scala/akka/dispatch/Future.scala index 737f2eedef..b51e4baf65 100644 --- a/akka-actor/src/main/scala/akka/dispatch/Future.scala +++ b/akka-actor/src/main/scala/akka/dispatch/Future.scala @@ -360,28 +360,38 @@ object Future { // TODO make variant of flow(timeout)(body) which does NOT break type inference /** - * Send queued tasks back to the dispatcher to be executed. This is needed if the current - * task may block while waiting for something to happen in a queued task. + * Assures that any Future tasks initiated in the current thread will be + * executed asynchronously, including any tasks currently queued to be + * executed in the current thread. This is needed if the current task may + * block, causing delays in executing the remaining tasks which in some + * cases may cause a deadlock. * - * Example: + * Note: Calling 'Future.await' will automatically trigger this method. + * + * For example, in the following block of code the call to 'latch.open' + * might not be executed until after the call to 'latch.await', causing + * a deadlock. By adding 'Future.blocking()' the call to 'latch.open' + * will instead be dispatched separately from the current block, allowing + * it to be run in parallel: *

    * val latch = new StandardLatch
    * val future = Future() map { _ ⇒
+   *   Future.blocking()
    *   val nested = Future()
-   *   nested.await
    *   nested foreach (_ ⇒ latch.open)
-   *   Future.redispatchTasks
    *   latch.await
    * }
    * 
*/ - def redispatchTasks()(implicit dispatcher: MessageDispatcher): Unit = + def blocking()(implicit dispatcher: MessageDispatcher): Unit = _taskStack.get match { case Some(taskStack) if taskStack.nonEmpty ⇒ val tasks = taskStack.elems taskStack.clear() + _taskStack set None dispatchTask(() ⇒ _taskStack.get.get.elems = tasks, true) - case _ ⇒ // nothing to do + case Some(_) ⇒ _taskStack set None + case _ ⇒ // already None } private val _taskStack = new ThreadLocal[Option[Stack[() ⇒ Unit]]]() { @@ -878,7 +888,7 @@ class DefaultPromise[T](val timeout: Timeout)(implicit val dispatcher: MessageDi } def await(atMost: Duration): this.type = if (value.isDefined) this else { - Future.redispatchTasks() + Future.blocking() val waitNanos = if (timeout.duration.isFinite && atMost.isFinite) From 3681d0fe4e16e2f9d16466e7b1f99e41b4e0ec48 Mon Sep 17 00:00:00 2001 From: Patrik Nordwall Date: Mon, 31 Oct 2011 16:15:53 +0100 Subject: [PATCH 47/57] Separate latency and throughput measurement in performance tests. Fixes #1333 * TradingThroughputPerformanceSpec and microbench.TellThroughputPerformanceSpec for throughput with high load * TradingLatencyPerformanceSpec and microbench.TellLatencyPerformanceSpec for latency with moderate load * Removed usage of JUnit * Removed all usage of latches for flow control, instead replies with ordinary tell. This means that trading sample generates 4 msg for each transaction. * Removed req-rsp test from trading, since it adds complexity and isn't realistic --- .../microbench/PerformanceSpec.scala | 90 ---------- .../TellLatencyPerformanceSpec.scala | 140 +++++++++++++++ .../microbench/TellPerformanceSpec.scala | 125 ------------- .../TellThroughputPerformanceSpec.scala | 132 ++++++++++++++ .../trading/common/AkkaPerformanceTest.scala | 86 --------- .../trading/common/BenchmarkScenarios.scala | 62 ------- .../trading/common/PerformanceTest.scala | 160 ----------------- .../akka/performance/trading/common/Rsp.scala | 3 - .../trading/domain/LatchMessage.scala | 16 -- .../performance/trading/domain/Order.scala | 12 +- .../trading/domain/TradeObserver.scala | 4 +- .../trading/oneway/OneWayMatchingEngine.scala | 24 --- .../trading/oneway/OneWayOrderReceiver.scala | 19 -- .../oneway/OneWayPerformanceTest.scala | 58 ------ .../trading/oneway/OneWayTradingSystem.scala | 20 --- .../trading/response/RspPerformanceTest.scala | 25 --- .../{common => system}/MatchingEngine.scala | 31 ++-- .../{common => system}/OrderReceiver.scala | 10 +- .../akka/performance/trading/system/Rsp.scala | 5 + .../TradingLatencyPerformanceSpec.scala | 169 ++++++++++++++++++ .../{common => system}/TradingSystem.scala | 2 +- .../TradingThroughputPerformanceSpec.scala | 157 ++++++++++++++++ .../workbench/PerformanceSpec.scala | 113 ++++++++++++ .../akka/performance/workbench/Report.scala | 15 +- .../akka/performance/workbench/Stats.scala | 11 +- 25 files changed, 765 insertions(+), 724 deletions(-) delete mode 100644 akka-actor-tests/src/test/scala/akka/performance/microbench/PerformanceSpec.scala create mode 100644 akka-actor-tests/src/test/scala/akka/performance/microbench/TellLatencyPerformanceSpec.scala delete mode 100644 akka-actor-tests/src/test/scala/akka/performance/microbench/TellPerformanceSpec.scala create mode 100644 akka-actor-tests/src/test/scala/akka/performance/microbench/TellThroughputPerformanceSpec.scala delete mode 100644 akka-actor-tests/src/test/scala/akka/performance/trading/common/AkkaPerformanceTest.scala delete mode 100644 akka-actor-tests/src/test/scala/akka/performance/trading/common/BenchmarkScenarios.scala delete mode 100644 akka-actor-tests/src/test/scala/akka/performance/trading/common/PerformanceTest.scala delete mode 100644 akka-actor-tests/src/test/scala/akka/performance/trading/common/Rsp.scala delete mode 100644 akka-actor-tests/src/test/scala/akka/performance/trading/domain/LatchMessage.scala delete mode 100644 akka-actor-tests/src/test/scala/akka/performance/trading/oneway/OneWayMatchingEngine.scala delete mode 100644 akka-actor-tests/src/test/scala/akka/performance/trading/oneway/OneWayOrderReceiver.scala delete mode 100644 akka-actor-tests/src/test/scala/akka/performance/trading/oneway/OneWayPerformanceTest.scala delete mode 100644 akka-actor-tests/src/test/scala/akka/performance/trading/oneway/OneWayTradingSystem.scala delete mode 100644 akka-actor-tests/src/test/scala/akka/performance/trading/response/RspPerformanceTest.scala rename akka-actor-tests/src/test/scala/akka/performance/trading/{common => system}/MatchingEngine.scala (64%) rename akka-actor-tests/src/test/scala/akka/performance/trading/{common => system}/OrderReceiver.scala (86%) create mode 100644 akka-actor-tests/src/test/scala/akka/performance/trading/system/Rsp.scala create mode 100644 akka-actor-tests/src/test/scala/akka/performance/trading/system/TradingLatencyPerformanceSpec.scala rename akka-actor-tests/src/test/scala/akka/performance/trading/{common => system}/TradingSystem.scala (98%) create mode 100644 akka-actor-tests/src/test/scala/akka/performance/trading/system/TradingThroughputPerformanceSpec.scala create mode 100644 akka-actor-tests/src/test/scala/akka/performance/workbench/PerformanceSpec.scala diff --git a/akka-actor-tests/src/test/scala/akka/performance/microbench/PerformanceSpec.scala b/akka-actor-tests/src/test/scala/akka/performance/microbench/PerformanceSpec.scala deleted file mode 100644 index a2bbdc9a22..0000000000 --- a/akka-actor-tests/src/test/scala/akka/performance/microbench/PerformanceSpec.scala +++ /dev/null @@ -1,90 +0,0 @@ -package akka.performance.microbench - -import scala.collection.immutable.TreeMap - -import org.apache.commons.math.stat.descriptive.DescriptiveStatistics -import org.apache.commons.math.stat.descriptive.SynchronizedDescriptiveStatistics -import org.scalatest.BeforeAndAfterEach - -import akka.actor.simpleName -import akka.performance.workbench.BenchResultRepository -import akka.performance.workbench.Report -import akka.performance.workbench.Stats -import akka.testkit.AkkaSpec -import akka.AkkaApplication - -trait PerformanceSpec extends AkkaSpec with BeforeAndAfterEach { - - def app: AkkaApplication - - def isBenchmark() = System.getProperty("benchmark") == "true" - - def minClients() = System.getProperty("benchmark.minClients", "1").toInt; - - def maxClients() = System.getProperty("benchmark.maxClients", "40").toInt; - - def repeatFactor() = { - val defaultRepeatFactor = if (isBenchmark) "150" else "2" - System.getProperty("benchmark.repeatFactor", defaultRepeatFactor).toInt - } - - def sampling = { - System.getProperty("benchmark.sampling", "200").toInt - } - - var stat: DescriptiveStatistics = _ - - override def beforeEach() { - stat = new SynchronizedDescriptiveStatistics - } - - val resultRepository = BenchResultRepository() - lazy val report = new Report(app, resultRepository, compareResultWith) - - /** - * To compare two tests with each other you can override this method, in - * the test. For example Some("OneWayPerformanceTest") - */ - def compareResultWith: Option[String] = None - - def logMeasurement(scenario: String, numberOfClients: Int, durationNs: Long) { - try { - val name = simpleName(this) - val durationS = durationNs.toDouble / 1000000000.0 - - val percentiles = TreeMap[Int, Long]( - 5 -> (stat.getPercentile(5.0) / 1000).toLong, - 25 -> (stat.getPercentile(25.0) / 1000).toLong, - 50 -> (stat.getPercentile(50.0) / 1000).toLong, - 75 -> (stat.getPercentile(75.0) / 1000).toLong, - 95 -> (stat.getPercentile(95.0) / 1000).toLong) - - val n = stat.getN * sampling - - val stats = Stats( - name, - load = numberOfClients, - timestamp = TestStart.startTime, - durationNanos = durationNs, - n = n, - min = (stat.getMin / 1000).toLong, - max = (stat.getMax / 1000).toLong, - mean = (stat.getMean / 1000).toLong, - tps = (n.toDouble / durationS), - percentiles) - - resultRepository.add(stats) - - report.html(resultRepository.get(name)) - } catch { - // don't fail test due to problems saving bench report - case e: Exception ⇒ app.eventHandler.error(this, e.getMessage) - } - } - -} - -object TestStart { - val startTime = System.currentTimeMillis -} - diff --git a/akka-actor-tests/src/test/scala/akka/performance/microbench/TellLatencyPerformanceSpec.scala b/akka-actor-tests/src/test/scala/akka/performance/microbench/TellLatencyPerformanceSpec.scala new file mode 100644 index 0000000000..14acef4373 --- /dev/null +++ b/akka-actor-tests/src/test/scala/akka/performance/microbench/TellLatencyPerformanceSpec.scala @@ -0,0 +1,140 @@ +package akka.performance.microbench + +import akka.performance.workbench.PerformanceSpec +import java.util.concurrent.CountDownLatch +import java.util.concurrent.TimeUnit +import org.apache.commons.math.stat.descriptive.DescriptiveStatistics +import org.junit.runner.RunWith +import akka.actor.Actor +import akka.actor.ActorRef +import akka.actor.PoisonPill +import akka.actor.Props +import java.util.Random +import org.apache.commons.math.stat.descriptive.SynchronizedDescriptiveStatistics + +// -server -Xms512M -Xmx1024M -XX:+UseConcMarkSweepGC -Dbenchmark=true -Dbenchmark.repeatFactor=500 +@org.junit.runner.RunWith(classOf[org.scalatest.junit.JUnitRunner]) +class TellLatencyPerformanceSpec extends PerformanceSpec { + import TellLatencyPerformanceSpec._ + + val clientDispatcher = app.dispatcherFactory.newDispatcher("client-dispatcher") + .withNewThreadPoolWithLinkedBlockingQueueWithUnboundedCapacity + .setCorePoolSize(8) + .build + + val repeat = 200L * repeatFactor + def clientDelayMicros = { + System.getProperty("benchmark.clientDelayMicros", "250").toInt + } + + var stat: DescriptiveStatistics = _ + + override def beforeEach() { + stat = new SynchronizedDescriptiveStatistics + } + + "Tell" must { + "warmup" in { + runScenario(2, warmup = true) + } + "warmup more" in { + runScenario(4, warmup = true) + } + "perform with load 1" in { + runScenario(1) + } + "perform with load 2" in { + runScenario(2) + } + "perform with load 4" in { + runScenario(4) + } + "perform with load 6" in { + runScenario(6) + } + "perform with load 8" in { + runScenario(8) + } + + def runScenario(numberOfClients: Int, warmup: Boolean = false) { + if (acceptClients(numberOfClients)) { + + val latch = new CountDownLatch(numberOfClients) + val repeatsPerClient = repeat / numberOfClients + val clients = (for (i ← 0 until numberOfClients) yield { + val destination = app.actorOf[Destination] + val w4 = app.actorOf(new Waypoint(destination)) + val w3 = app.actorOf(new Waypoint(w4)) + val w2 = app.actorOf(new Waypoint(w3)) + val w1 = app.actorOf(new Waypoint(w2)) + Props(new Client(w1, latch, repeatsPerClient, clientDelayMicros, stat)).withDispatcher(clientDispatcher) + }).toList.map(app.actorOf(_)) + + val start = System.nanoTime + clients.foreach(_ ! Run) + val ok = latch.await((5000000 + 500 * repeat) * timeDilation, TimeUnit.MICROSECONDS) + val durationNs = (System.nanoTime - start) + + if (!warmup) { + ok must be(true) + logMeasurement(numberOfClients, durationNs, stat) + } + clients.foreach(_ ! PoisonPill) + + } + } + } +} + +object TellLatencyPerformanceSpec { + + val random: Random = new Random(0) + + case object Run + case class Msg(nanoTime: Long = System.nanoTime) + + class Waypoint(next: ActorRef) extends Actor { + def receive = { + case msg: Msg ⇒ next forward msg + } + } + + class Destination extends Actor { + def receive = { + case msg: Msg ⇒ sender ! msg + } + } + + class Client( + actor: ActorRef, + latch: CountDownLatch, + repeat: Long, + delayMicros: Int, + stat: DescriptiveStatistics) extends Actor { + + var sent = 0L + var received = 0L + + def receive = { + case Msg(sendTime) ⇒ + val duration = System.nanoTime - sendTime + stat.addValue(duration) + received += 1 + if (sent < repeat) { + PerformanceSpec.shortDelay(delayMicros, received) + actor ! Msg() + sent += 1 + } else if (received >= repeat) { + latch.countDown() + } + case Run ⇒ + // random initial delay to spread requests + val initialDelay = random.nextInt(20) + Thread.sleep(initialDelay) + actor ! Msg() + sent += 1 + } + + } + +} \ No newline at end of file diff --git a/akka-actor-tests/src/test/scala/akka/performance/microbench/TellPerformanceSpec.scala b/akka-actor-tests/src/test/scala/akka/performance/microbench/TellPerformanceSpec.scala deleted file mode 100644 index 72c2f016c2..0000000000 --- a/akka-actor-tests/src/test/scala/akka/performance/microbench/TellPerformanceSpec.scala +++ /dev/null @@ -1,125 +0,0 @@ -package akka.performance.microbench - -import java.util.concurrent.CountDownLatch -import java.util.concurrent.TimeUnit - -import org.apache.commons.math.stat.descriptive.DescriptiveStatistics -import org.junit.runner.RunWith - -import akka.actor.Actor -import akka.actor.ActorRef -import akka.actor.PoisonPill -import akka.actor.Props - -// -server -Xms512M -Xmx1024M -XX:+UseConcMarkSweepGC -Dbenchmark=true -Dbenchmark.repeatFactor=500 -@org.junit.runner.RunWith(classOf[org.scalatest.junit.JUnitRunner]) -class TellPerformanceSpec extends PerformanceSpec { - import TellPerformanceSpec._ - - val clientDispatcher = app.dispatcherFactory.newDispatcher("client-dispatcher") - .withNewThreadPoolWithLinkedBlockingQueueWithUnboundedCapacity - .setCorePoolSize(maxClients) - .build - - val repeat = repeatFactor * 30000 - - "Tell" must { - "warmup" in { - runScenario(2, warmup = true) - } - "perform with load 1" in { - runScenario(1) - } - "perform with load 2" in { - runScenario(2) - } - "perform with load 4" in { - runScenario(4) - } - "perform with load 6" in { - runScenario(6) - } - "perform with load 8" in { - runScenario(8) - } - - def runScenario(numberOfClients: Int, warmup: Boolean = false) { - if (numberOfClients <= maxClients) { - - val latch = new CountDownLatch(numberOfClients) - val repeatsPerClient = repeat / numberOfClients - val clients = (for (i ← 0 until numberOfClients) yield { - val c = app.actorOf[Destination] - val b = app.actorOf(new Waypoint(c)) - val a = app.actorOf(new Waypoint(b)) - Props(new Client(a, latch, repeatsPerClient, sampling, stat)).withDispatcher(clientDispatcher) - }).toList.map(app.actorOf(_)) - - val start = System.nanoTime - clients.foreach(_ ! Run) - latch.await(30, TimeUnit.SECONDS) must be(true) - val durationNs = (System.nanoTime - start) - - if (!warmup) { - logMeasurement("one-way tell", numberOfClients, durationNs) - } - clients.foreach(_ ! PoisonPill) - - } - } - } -} - -object TellPerformanceSpec { - - case object Run - case class Msg(latch: Option[CountDownLatch]) - - class Waypoint(next: ActorRef) extends Actor { - def receive = { - case msg: Msg ⇒ next ! msg - } - } - - class Destination extends Actor { - def receive = { - case Msg(latch) ⇒ latch.foreach(_.countDown()) - } - } - - class Client( - actor: ActorRef, - latch: CountDownLatch, - repeat: Int, - sampling: Int, - stat: DescriptiveStatistics) extends Actor { - - def receive = { - case Run ⇒ - val msgWithoutLatch = Msg(None) - for (n ← 1 to repeat) { - if (measureLatency(n)) { - val t0 = System.nanoTime - tellAndAwait() - val duration = System.nanoTime - t0 - stat.addValue(duration) - } else if (measureLatency(n + 1) || n == repeat) { - tellAndAwait() - } else { - actor ! msgWithoutLatch - } - } - latch.countDown() - } - - def tellAndAwait() { - val msgLatch = new CountDownLatch(1) - actor ! Msg(Some(msgLatch)) - val ok = msgLatch.await(10, TimeUnit.SECONDS) - if (!ok) app.eventHandler.error(this, "Too long delay") - } - - def measureLatency(n: Int) = (n % sampling == 0) - } - -} \ No newline at end of file diff --git a/akka-actor-tests/src/test/scala/akka/performance/microbench/TellThroughputPerformanceSpec.scala b/akka-actor-tests/src/test/scala/akka/performance/microbench/TellThroughputPerformanceSpec.scala new file mode 100644 index 0000000000..5f2c3ec74f --- /dev/null +++ b/akka-actor-tests/src/test/scala/akka/performance/microbench/TellThroughputPerformanceSpec.scala @@ -0,0 +1,132 @@ +package akka.performance.microbench + +import akka.performance.workbench.PerformanceSpec +import java.util.concurrent.CountDownLatch +import java.util.concurrent.TimeUnit +import org.apache.commons.math.stat.descriptive.DescriptiveStatistics +import org.junit.runner.RunWith +import akka.actor.Actor +import akka.actor.ActorRef +import akka.actor.PoisonPill +import akka.actor.Props +import akka.dispatch.Dispatchers +import akka.dispatch.Dispatcher +import akka.dispatch.Dispatchers + +// -server -Xms512M -Xmx1024M -XX:+UseParallelGC -Dbenchmark=true -Dbenchmark.repeatFactor=500 +@org.junit.runner.RunWith(classOf[org.scalatest.junit.JUnitRunner]) +class TellThroughputPerformanceSpec extends PerformanceSpec { + import TellThroughputPerformanceSpec._ + + val clientDispatcher = app.dispatcherFactory.newDispatcher("client-dispatcher") + .withNewThreadPoolWithLinkedBlockingQueueWithUnboundedCapacity + .setCorePoolSize(maxClients) + .build + + val destinationDispatcher = app.dispatcherFactory.newDispatcher("destination-dispatcher") + .withNewThreadPoolWithLinkedBlockingQueueWithUnboundedCapacity + .setCorePoolSize(maxClients) + .build + + val repeat = 30000L * repeatFactor + + "Tell" must { + "warmup" in { + runScenario(4, warmup = true) + } + "warmup more" in { + runScenario(4, warmup = true) + } + "perform with load 1" in { + runScenario(1) + } + "perform with load 2" in { + runScenario(2) + } + "perform with load 4" in { + runScenario(4) + } + "perform with load 6" in { + runScenario(6) + } + "perform with load 8" in { + runScenario(8) + } + "perform with load 10" in { + runScenario(10) + } + "perform with load 12" in { + runScenario(12) + } + "perform with load 14" in { + runScenario(14) + } + "perform with load 16" in { + runScenario(16) + } + + def runScenario(numberOfClients: Int, warmup: Boolean = false) { + if (acceptClients(numberOfClients)) { + + val latch = new CountDownLatch(numberOfClients) + val repeatsPerClient = repeat / numberOfClients + val destinations = for (i ← 0 until numberOfClients) + yield app.actorOf(Props(new Destination).withDispatcher(destinationDispatcher)) + val clients = for (dest ← destinations) + yield app.actorOf(Props(new Client(dest, latch, repeatsPerClient)).withDispatcher(clientDispatcher)) + + val start = System.nanoTime + clients.foreach(_ ! Run) + val ok = latch.await((5000000 + 500 * repeat) * timeDilation, TimeUnit.MICROSECONDS) + val durationNs = (System.nanoTime - start) + + if (!warmup) { + ok must be(true) + logMeasurement(numberOfClients, durationNs, repeat) + } + clients.foreach(_ ! PoisonPill) + destinations.foreach(_ ! PoisonPill) + + } + } + } +} + +object TellThroughputPerformanceSpec { + + case object Run + case object Msg + + class Destination extends Actor { + def receive = { + case Msg ⇒ sender ! Msg + } + } + + class Client( + actor: ActorRef, + latch: CountDownLatch, + repeat: Long) extends Actor { + + var sent = 0L + var received = 0L + + def receive = { + case Msg ⇒ + received += 1 + if (sent < repeat) { + actor ! Msg + sent += 1 + } else if (received >= repeat) { + latch.countDown() + } + case Run ⇒ + for (i ← 0L until math.min(1000L, repeat)) { + actor ! Msg + sent += 1 + } + } + + } + +} \ No newline at end of file diff --git a/akka-actor-tests/src/test/scala/akka/performance/trading/common/AkkaPerformanceTest.scala b/akka-actor-tests/src/test/scala/akka/performance/trading/common/AkkaPerformanceTest.scala deleted file mode 100644 index 697b8b299f..0000000000 --- a/akka-actor-tests/src/test/scala/akka/performance/trading/common/AkkaPerformanceTest.scala +++ /dev/null @@ -1,86 +0,0 @@ -package akka.performance.trading.common - -import java.util.concurrent.CountDownLatch -import java.util.concurrent.TimeUnit -import akka.performance.trading.domain._ -import akka.performance.trading.common._ -import akka.actor.{ Props, ActorRef, Actor, PoisonPill } -import akka.AkkaApplication - -abstract class AkkaPerformanceTest(val app: AkkaApplication) extends BenchmarkScenarios { - - type TS = AkkaTradingSystem - - val clientDispatcher = app.dispatcherFactory.newDispatcher("client-dispatcher") - .withNewThreadPoolWithLinkedBlockingQueueWithUnboundedCapacity - .setCorePoolSize(maxClients) - .setMaxPoolSize(maxClients) - .build - - override def createTradingSystem: TS = new AkkaTradingSystem(app) - - /** - * Implemented in subclass - */ - def placeOrder(orderReceiver: ActorRef, order: Order, await: Boolean): Rsp - - override def runScenario(scenario: String, orders: List[Order], repeat: Int, numberOfClients: Int, delayMs: Int) = { - val totalNumberOfRequests = orders.size * repeat - val repeatsPerClient = repeat / numberOfClients - val oddRepeats = repeat - (repeatsPerClient * numberOfClients) - val latch = new CountDownLatch(numberOfClients) - val receivers = tradingSystem.orderReceivers.toIndexedSeq - val start = System.nanoTime - val clients = (for (i ← 0 until numberOfClients) yield { - val receiver = receivers(i % receivers.size) - Props(new Client(receiver, orders, latch, repeatsPerClient + (if (i < oddRepeats) 1 else 0), sampling, delayMs)).withDispatcher(clientDispatcher) - }).toList.map(app.actorOf(_)) - - clients.foreach(_ ! "run") - val ok = latch.await((5000 + (2 + delayMs) * totalNumberOfRequests) * timeDilation, TimeUnit.MILLISECONDS) - val durationNs = (System.nanoTime - start) - - assert(ok) - assert((orders.size / 2) * repeat == TotalTradeCounter.counter.get) - logMeasurement(scenario, numberOfClients, durationNs) - clients.foreach(_ ! PoisonPill) - } - - class Client( - orderReceiver: ActorRef, - orders: List[Order], - latch: CountDownLatch, - repeat: Int, - sampling: Int, - delayMs: Int = 0) extends Actor { - - def receive = { - case "run" ⇒ - var n = 0 - for (r ← 1 to repeat; o ← orders) { - n += 1 - - val rsp = - if (measureLatency(n)) { - val t0 = System.nanoTime - val rsp = placeOrder(orderReceiver, o, await = true) - val duration = System.nanoTime - t0 - stat.addValue(duration) - rsp - } else { - val await = measureLatency(n + 1) || (r == repeat) - placeOrder(orderReceiver, o, await) - } - if (!rsp.status) { - app.eventHandler.error(this, "Invalid rsp") - } - delay(delayMs) - } - latch.countDown() - } - - def measureLatency(n: Int) = (n % sampling == 0) - } - -} - diff --git a/akka-actor-tests/src/test/scala/akka/performance/trading/common/BenchmarkScenarios.scala b/akka-actor-tests/src/test/scala/akka/performance/trading/common/BenchmarkScenarios.scala deleted file mode 100644 index 54c6f36ce8..0000000000 --- a/akka-actor-tests/src/test/scala/akka/performance/trading/common/BenchmarkScenarios.scala +++ /dev/null @@ -1,62 +0,0 @@ -package akka.performance.trading.common - -import org.junit._ -import akka.performance.trading.domain._ - -trait BenchmarkScenarios extends PerformanceTest { - - @Test - def complexScenario1 = complexScenario(1) - @Test - def complexScenario2 = complexScenario(2) - @Test - def complexScenario4 = complexScenario(4) - @Test - def complexScenario6 = complexScenario(6) - @Test - def complexScenario8 = complexScenario(8) - @Test - def complexScenario10 = complexScenario(10) - @Test - def complexScenario20 = complexScenario(20) - @Test - def complexScenario30 = complexScenario(30) - @Test - def complexScenario40 = complexScenario(40) - @Test - def complexScenario60 = complexScenario(60) - @Test - def complexScenario80 = complexScenario(80) - @Test - def complexScenario100 = complexScenario(100) - /* - @Test - def complexScenario200 = complexScenario(200) - @Test - def complexScenario300 = complexScenario(300) - @Test - def complexScenario400 = complexScenario(400) - */ - - def complexScenario(numberOfClients: Int) { - Assume.assumeTrue(numberOfClients >= minClients) - Assume.assumeTrue(numberOfClients <= maxClients) - - val repeat = 500 * repeatFactor - - val prefixes = "A" :: "B" :: "C" :: "D" :: "E" :: Nil - val askOrders = for { - s ← prefixes - i ← 1 to 3 - } yield new Ask(s + i, 100 - i, 1000) - val bidOrders = for { - s ← prefixes - i ← 1 to 3 - } yield new Bid(s + i, 100 - i, 1000) - val orders = askOrders ::: bidOrders - - runScenario("benchmark", orders, repeat, numberOfClients, 0) - } - -} - diff --git a/akka-actor-tests/src/test/scala/akka/performance/trading/common/PerformanceTest.scala b/akka-actor-tests/src/test/scala/akka/performance/trading/common/PerformanceTest.scala deleted file mode 100644 index dd400dc82e..0000000000 --- a/akka-actor-tests/src/test/scala/akka/performance/trading/common/PerformanceTest.scala +++ /dev/null @@ -1,160 +0,0 @@ -package akka.performance.trading.common - -import java.util.Random -import scala.collection.immutable.TreeMap -import org.apache.commons.math.stat.descriptive.DescriptiveStatistics -import org.apache.commons.math.stat.descriptive.SynchronizedDescriptiveStatistics -import org.junit.After -import org.junit.Before -import org.scalatest.junit.JUnitSuite -import akka.performance.trading.domain.Ask -import akka.performance.trading.domain.Bid -import akka.performance.trading.domain.Order -import akka.performance.trading.domain.TotalTradeCounter -import akka.performance.workbench.BenchResultRepository -import akka.performance.workbench.Report -import akka.performance.workbench.Stats -import akka.AkkaApplication -import akka.actor.simpleName - -trait PerformanceTest extends JUnitSuite { - - def app: AkkaApplication - - var isWarm = false - - def isBenchmark() = System.getProperty("benchmark") == "true" - - def minClients() = System.getProperty("benchmark.minClients", "1").toInt; - - def maxClients() = System.getProperty("benchmark.maxClients", "40").toInt; - - def repeatFactor() = { - val defaultRepeatFactor = if (isBenchmark) "150" else "2" - System.getProperty("benchmark.repeatFactor", defaultRepeatFactor).toInt - } - - def warmupRepeatFactor() = { - val defaultRepeatFactor = if (isBenchmark) "200" else "1" - System.getProperty("benchmark.warmupRepeatFactor", defaultRepeatFactor).toInt - } - - def randomSeed() = { - System.getProperty("benchmark.randomSeed", "0").toInt - } - - def timeDilation() = { - System.getProperty("benchmark.timeDilation", "1").toLong - } - - def sampling = { - System.getProperty("benchmark.sampling", "200").toInt - } - - var stat: DescriptiveStatistics = _ - - val resultRepository = BenchResultRepository() - lazy val report = new Report(app, resultRepository, compareResultWith) - - type TS <: TradingSystem - - var tradingSystem: TS = _ - val random: Random = new Random(randomSeed) - - def createTradingSystem(): TS - - def placeOrder(orderReceiver: TS#OR, order: Order, await: Boolean): Rsp - - def runScenario(scenario: String, orders: List[Order], repeat: Int, numberOfClients: Int, delayMs: Int) - - @Before - def setUp() { - stat = new SynchronizedDescriptiveStatistics - tradingSystem = createTradingSystem() - tradingSystem.start() - warmUp() - TotalTradeCounter.reset() - stat = new SynchronizedDescriptiveStatistics - } - - @After - def tearDown() { - tradingSystem.shutdown() - stat = null - } - - def warmUp() { - val bid = new Bid("A1", 100, 1000) - val ask = new Ask("A1", 100, 1000) - - val orderReceiver = tradingSystem.orderReceivers.head - val loopCount = if (isWarm) 1 else 10 * warmupRepeatFactor - - for (i ← 1 to loopCount) { - placeOrder(orderReceiver, bid, true) - placeOrder(orderReceiver, ask, true) - } - isWarm = true - } - - /** - * To compare two tests with each other you can override this method, in - * the test. For example Some("OneWayPerformanceTest") - */ - def compareResultWith: Option[String] = None - - def logMeasurement(scenario: String, numberOfClients: Int, durationNs: Long) { - try { - val name = simpleName(this) - val durationS = durationNs.toDouble / 1000000000.0 - - val percentiles = TreeMap[Int, Long]( - 5 -> (stat.getPercentile(5.0) / 1000).toLong, - 25 -> (stat.getPercentile(25.0) / 1000).toLong, - 50 -> (stat.getPercentile(50.0) / 1000).toLong, - 75 -> (stat.getPercentile(75.0) / 1000).toLong, - 95 -> (stat.getPercentile(95.0) / 1000).toLong) - - val n = stat.getN * sampling - - val stats = Stats( - name, - load = numberOfClients, - timestamp = TestStart.startTime, - durationNanos = durationNs, - n = n, - min = (stat.getMin / 1000).toLong, - max = (stat.getMax / 1000).toLong, - mean = (stat.getMean / 1000).toLong, - tps = (n.toDouble / durationS), - percentiles) - - resultRepository.add(stats) - - report.html(resultRepository.get(name)) - } catch { - // don't fail test due to problems saving bench report - case e: Exception ⇒ app.eventHandler.error(this, e.getMessage) - } - } - - def delay(delayMs: Int) { - val adjustedDelay = - if (delayMs >= 5) { - val dist = 0.2 * delayMs - (delayMs + random.nextGaussian * dist).intValue - } else { - delayMs - } - - if (adjustedDelay > 0) { - Thread.sleep(adjustedDelay) - } - } - -} - -object TestStart { - val startTime = System.currentTimeMillis -} - diff --git a/akka-actor-tests/src/test/scala/akka/performance/trading/common/Rsp.scala b/akka-actor-tests/src/test/scala/akka/performance/trading/common/Rsp.scala deleted file mode 100644 index 683ff3d331..0000000000 --- a/akka-actor-tests/src/test/scala/akka/performance/trading/common/Rsp.scala +++ /dev/null @@ -1,3 +0,0 @@ -package akka.performance.trading.common - -case class Rsp(status: Boolean) diff --git a/akka-actor-tests/src/test/scala/akka/performance/trading/domain/LatchMessage.scala b/akka-actor-tests/src/test/scala/akka/performance/trading/domain/LatchMessage.scala deleted file mode 100644 index 34675c8b26..0000000000 --- a/akka-actor-tests/src/test/scala/akka/performance/trading/domain/LatchMessage.scala +++ /dev/null @@ -1,16 +0,0 @@ -package akka.performance.trading.domain - -import java.util.concurrent.CountDownLatch -import java.util.concurrent.TimeUnit - -trait LatchMessage { - val count: Int - lazy val latch: CountDownLatch = new CountDownLatch(count) -} - -object LatchOrder { - def apply(order: Order) = order match { - case bid: Bid ⇒ new Bid(order.orderbookSymbol, order.price, order.volume) with LatchMessage { val count = 2 } - case ask: Ask ⇒ new Ask(order.orderbookSymbol, order.price, order.volume) with LatchMessage { val count = 2 } - } -} diff --git a/akka-actor-tests/src/test/scala/akka/performance/trading/domain/Order.scala b/akka-actor-tests/src/test/scala/akka/performance/trading/domain/Order.scala index 9007243863..f8919d05e7 100644 --- a/akka-actor-tests/src/test/scala/akka/performance/trading/domain/Order.scala +++ b/akka-actor-tests/src/test/scala/akka/performance/trading/domain/Order.scala @@ -4,26 +4,34 @@ trait Order { def orderbookSymbol: String def price: Long def volume: Long + def nanoTime: Long + def withNanoTime: Order } case class Bid( orderbookSymbol: String, price: Long, - volume: Long) + volume: Long, + nanoTime: Long = 0L) extends Order { def split(newVolume: Long) = { new Bid(orderbookSymbol, price, newVolume) } + + def withNanoTime: Bid = copy(nanoTime = System.nanoTime) } case class Ask( orderbookSymbol: String, price: Long, - volume: Long) + volume: Long, + nanoTime: Long = 0L) extends Order { def split(newVolume: Long) = { new Ask(orderbookSymbol, price, newVolume) } + + def withNanoTime: Ask = copy(nanoTime = System.nanoTime) } diff --git a/akka-actor-tests/src/test/scala/akka/performance/trading/domain/TradeObserver.scala b/akka-actor-tests/src/test/scala/akka/performance/trading/domain/TradeObserver.scala index 6476c3faf1..123d785e17 100644 --- a/akka-actor-tests/src/test/scala/akka/performance/trading/domain/TradeObserver.scala +++ b/akka-actor-tests/src/test/scala/akka/performance/trading/domain/TradeObserver.scala @@ -8,7 +8,9 @@ abstract trait TradeObserver { trait SimpleTradeObserver extends TradeObserver { override def trade(bid: Bid, ask: Ask) { - val c = TotalTradeCounter.counter.incrementAndGet + if (!Orderbook.useDummyOrderbook) { + TotalTradeCounter.counter.incrementAndGet + } } } diff --git a/akka-actor-tests/src/test/scala/akka/performance/trading/oneway/OneWayMatchingEngine.scala b/akka-actor-tests/src/test/scala/akka/performance/trading/oneway/OneWayMatchingEngine.scala deleted file mode 100644 index 44ce92a92d..0000000000 --- a/akka-actor-tests/src/test/scala/akka/performance/trading/oneway/OneWayMatchingEngine.scala +++ /dev/null @@ -1,24 +0,0 @@ -package akka.performance.trading.oneway - -import akka.actor._ -import akka.dispatch.MessageDispatcher -import akka.performance.trading.domain.Order -import akka.performance.trading.domain.Orderbook -import akka.performance.trading.common.AkkaMatchingEngine - -class OneWayMatchingEngine(meId: String, orderbooks: List[Orderbook]) extends AkkaMatchingEngine(meId, orderbooks) { - - override def handleOrder(order: Order) { - orderbooksMap.get(order.orderbookSymbol) match { - case Some(orderbook) ⇒ - standby.foreach(_ ! order) - - orderbook.addOrder(order) - orderbook.matchOrders() - - case None ⇒ - app.eventHandler.warning(this, "Orderbook not handled by this MatchingEngine: " + order.orderbookSymbol) - } - } - -} diff --git a/akka-actor-tests/src/test/scala/akka/performance/trading/oneway/OneWayOrderReceiver.scala b/akka-actor-tests/src/test/scala/akka/performance/trading/oneway/OneWayOrderReceiver.scala deleted file mode 100644 index daeabfb36b..0000000000 --- a/akka-actor-tests/src/test/scala/akka/performance/trading/oneway/OneWayOrderReceiver.scala +++ /dev/null @@ -1,19 +0,0 @@ -package akka.performance.trading.oneway - -import akka.actor._ -import akka.dispatch.MessageDispatcher -import akka.performance.trading.domain._ -import akka.performance.trading.common.AkkaOrderReceiver - -class OneWayOrderReceiver extends AkkaOrderReceiver { - - override def placeOrder(order: Order) = { - val matchingEngine = matchingEngineForOrderbook.get(order.orderbookSymbol) - matchingEngine match { - case Some(m) ⇒ - m ! order - case None ⇒ - app.eventHandler.warning(this, "Unknown orderbook: " + order.orderbookSymbol) - } - } -} diff --git a/akka-actor-tests/src/test/scala/akka/performance/trading/oneway/OneWayPerformanceTest.scala b/akka-actor-tests/src/test/scala/akka/performance/trading/oneway/OneWayPerformanceTest.scala deleted file mode 100644 index ef0d97ece2..0000000000 --- a/akka-actor-tests/src/test/scala/akka/performance/trading/oneway/OneWayPerformanceTest.scala +++ /dev/null @@ -1,58 +0,0 @@ -package akka.performance.trading.oneway - -import java.util.concurrent.TimeUnit -import org.junit.Test -import akka.performance.trading.common.AkkaPerformanceTest -import akka.performance.trading.common.Rsp -import akka.performance.trading.domain._ -import akka.actor.{ Props, ActorRef } -import akka.AkkaApplication - -// -server -Xms512M -Xmx1024M -XX:+UseConcMarkSweepGC -Dbenchmark.useDummyOrderbook=true -Dbenchmark=true -Dbenchmark.minClients=1 -Dbenchmark.maxClients=40 -Dbenchmark.repeatFactor=500 -class OneWayPerformanceTest extends AkkaPerformanceTest(AkkaApplication()) { - - val Ok = new Rsp(true) - - override def createTradingSystem: TS = new OneWayTradingSystem(app) { - override def createMatchingEngine(meId: String, orderbooks: List[Orderbook]) = meDispatcher match { - case Some(d) ⇒ app.actorOf(Props(new OneWayMatchingEngine(meId, orderbooks) with LatchMessageCountDown).withDispatcher(d)) - case _ ⇒ app.actorOf(new OneWayMatchingEngine(meId, orderbooks) with LatchMessageCountDown) - } - } - - override def placeOrder(orderReceiver: ActorRef, order: Order, await: Boolean): Rsp = { - if (await) { - val newOrder = LatchOrder(order) - orderReceiver ! newOrder - val ok = newOrder.latch.await(10, TimeUnit.SECONDS) - new Rsp(ok) - } else { - orderReceiver ! order - Ok - } - } - - // need this so that junit will detect this as a test case - @Test - def dummy {} - - override def compareResultWith = Some("RspPerformanceTest") - - def createLatchOrder(order: Order) = order match { - case bid: Bid ⇒ new Bid(order.orderbookSymbol, order.price, order.volume) with LatchMessage { val count = 2 } - case ask: Ask ⇒ new Ask(order.orderbookSymbol, order.price, order.volume) with LatchMessage { val count = 2 } - } - -} - -trait LatchMessageCountDown extends OneWayMatchingEngine { - - override def handleOrder(order: Order) { - super.handleOrder(order) - order match { - case x: LatchMessage ⇒ x.latch.countDown - case _ ⇒ - } - } -} - diff --git a/akka-actor-tests/src/test/scala/akka/performance/trading/oneway/OneWayTradingSystem.scala b/akka-actor-tests/src/test/scala/akka/performance/trading/oneway/OneWayTradingSystem.scala deleted file mode 100644 index f841c8288b..0000000000 --- a/akka-actor-tests/src/test/scala/akka/performance/trading/oneway/OneWayTradingSystem.scala +++ /dev/null @@ -1,20 +0,0 @@ -package akka.performance.trading.oneway - -import akka.performance.trading.common.AkkaTradingSystem -import akka.performance.trading.domain.Orderbook -import akka.actor.{ Props, ActorRef } -import akka.AkkaApplication - -class OneWayTradingSystem(_app: AkkaApplication) extends AkkaTradingSystem(_app) { - - override def createMatchingEngine(meId: String, orderbooks: List[Orderbook]) = meDispatcher match { - case Some(d) ⇒ app.actorOf(Props(new OneWayMatchingEngine(meId, orderbooks)).withDispatcher(d)) - case _ ⇒ app.actorOf(Props(new OneWayMatchingEngine(meId, orderbooks))) - } - - override def createOrderReceiver() = orDispatcher match { - case Some(d) ⇒ app.actorOf(Props[OneWayOrderReceiver].withDispatcher(d)) - case _ ⇒ app.actorOf(Props[OneWayOrderReceiver]) - } - -} diff --git a/akka-actor-tests/src/test/scala/akka/performance/trading/response/RspPerformanceTest.scala b/akka-actor-tests/src/test/scala/akka/performance/trading/response/RspPerformanceTest.scala deleted file mode 100644 index 47d0a69e41..0000000000 --- a/akka-actor-tests/src/test/scala/akka/performance/trading/response/RspPerformanceTest.scala +++ /dev/null @@ -1,25 +0,0 @@ -package akka.performance.trading.response - -import org.junit.Test -import akka.actor.ActorRef -import akka.performance.trading.common.AkkaPerformanceTest -import akka.performance.trading.domain.Order -import akka.performance.trading.common.Rsp -import akka.AkkaApplication - -class RspPerformanceTest extends AkkaPerformanceTest(AkkaApplication()) { - - implicit def appl = app - - override def placeOrder(orderReceiver: ActorRef, order: Order, await: Boolean): Rsp = { - (orderReceiver ? order).get.asInstanceOf[Rsp] - } - - // need this so that junit will detect this as a test case - @Test - def dummy {} - - override def compareResultWith = Some("OneWayPerformanceTest") - -} - diff --git a/akka-actor-tests/src/test/scala/akka/performance/trading/common/MatchingEngine.scala b/akka-actor-tests/src/test/scala/akka/performance/trading/system/MatchingEngine.scala similarity index 64% rename from akka-actor-tests/src/test/scala/akka/performance/trading/common/MatchingEngine.scala rename to akka-actor-tests/src/test/scala/akka/performance/trading/system/MatchingEngine.scala index 9c88e67902..fa2f5f2493 100644 --- a/akka-actor-tests/src/test/scala/akka/performance/trading/common/MatchingEngine.scala +++ b/akka-actor-tests/src/test/scala/akka/performance/trading/system/MatchingEngine.scala @@ -1,4 +1,4 @@ -package akka.performance.trading.common +package akka.performance.trading.system import akka.performance.trading.domain._ import akka.actor._ @@ -11,7 +11,7 @@ trait MatchingEngine { val orderbooks: List[Orderbook] val supportedOrderbookSymbols = orderbooks map (_.symbol) protected val orderbooksMap: Map[String, Orderbook] = - Map() ++ (orderbooks map (o ⇒ (o.symbol, o))) + orderbooks.map(o ⇒ (o.symbol, o)).toMap } @@ -21,10 +21,10 @@ class AkkaMatchingEngine(val meId: String, val orderbooks: List[Orderbook]) var standby: Option[ActorRef] = None def receive = { - case standbyRef: ActorRef ⇒ - standby = Some(standbyRef) case order: Order ⇒ handleOrder(order) + case standbyRef: ActorRef ⇒ + standby = Some(standbyRef) case unknown ⇒ app.eventHandler.warning(this, "Received unknown message: " + unknown) } @@ -32,30 +32,21 @@ class AkkaMatchingEngine(val meId: String, val orderbooks: List[Orderbook]) def handleOrder(order: Order) { orderbooksMap.get(order.orderbookSymbol) match { case Some(orderbook) ⇒ - val pendingStandbyReply: Option[Future[_]] = - for (s ← standby) yield { s ? order } + standby.foreach(_ forward order) orderbook.addOrder(order) orderbook.matchOrders() - // wait for standby reply - pendingStandbyReply.foreach(waitForStandby(_)) - done(true) + + done(true, order) + case None ⇒ app.eventHandler.warning(this, "Orderbook not handled by this MatchingEngine: " + order.orderbookSymbol) - done(false) } } - def done(status: Boolean) { - sender ! new Rsp(status) - } - - def waitForStandby(pendingStandbyFuture: Future[_]) { - try { - pendingStandbyFuture.await - } catch { - case e: FutureTimeoutException ⇒ - app.eventHandler.error(this, "Standby timeout: " + e) + def done(status: Boolean, order: Order) { + if (standby.isEmpty) { + sender ! Rsp(order, status) } } diff --git a/akka-actor-tests/src/test/scala/akka/performance/trading/common/OrderReceiver.scala b/akka-actor-tests/src/test/scala/akka/performance/trading/system/OrderReceiver.scala similarity index 86% rename from akka-actor-tests/src/test/scala/akka/performance/trading/common/OrderReceiver.scala rename to akka-actor-tests/src/test/scala/akka/performance/trading/system/OrderReceiver.scala index 114fe7e349..b6d15e1185 100644 --- a/akka-actor-tests/src/test/scala/akka/performance/trading/common/OrderReceiver.scala +++ b/akka-actor-tests/src/test/scala/akka/performance/trading/system/OrderReceiver.scala @@ -1,4 +1,4 @@ -package akka.performance.trading.common +package akka.performance.trading.system import akka.performance.trading.domain._ import akka.actor._ @@ -28,20 +28,20 @@ class AkkaOrderReceiver extends Actor with OrderReceiver { type ME = ActorRef def receive = { + case order: Order ⇒ placeOrder(order) case routing @ MatchingEngineRouting(mapping) ⇒ refreshMatchingEnginePartitions(routing.asInstanceOf[MatchingEngineRouting[ActorRef]]) - case order: Order ⇒ placeOrder(order) - case unknown ⇒ app.eventHandler.warning(this, "Received unknown message: " + unknown) + case unknown ⇒ app.eventHandler.warning(this, "Received unknown message: " + unknown) } def placeOrder(order: Order) = { val matchingEngine = matchingEngineForOrderbook.get(order.orderbookSymbol) matchingEngine match { case Some(m) ⇒ - m.forward(order) + m forward order case None ⇒ app.eventHandler.warning(this, "Unknown orderbook: " + order.orderbookSymbol) - sender ! new Rsp(false) + sender ! Rsp(order, false) } } } diff --git a/akka-actor-tests/src/test/scala/akka/performance/trading/system/Rsp.scala b/akka-actor-tests/src/test/scala/akka/performance/trading/system/Rsp.scala new file mode 100644 index 0000000000..3151462e33 --- /dev/null +++ b/akka-actor-tests/src/test/scala/akka/performance/trading/system/Rsp.scala @@ -0,0 +1,5 @@ +package akka.performance.trading.system + +import akka.performance.trading.domain.Order + +case class Rsp(order: Order, status: Boolean) diff --git a/akka-actor-tests/src/test/scala/akka/performance/trading/system/TradingLatencyPerformanceSpec.scala b/akka-actor-tests/src/test/scala/akka/performance/trading/system/TradingLatencyPerformanceSpec.scala new file mode 100644 index 0000000000..83c75c41a2 --- /dev/null +++ b/akka-actor-tests/src/test/scala/akka/performance/trading/system/TradingLatencyPerformanceSpec.scala @@ -0,0 +1,169 @@ +package akka.performance.trading.system + +import java.util.concurrent.CountDownLatch +import java.util.concurrent.TimeUnit +import java.util.Random +import org.apache.commons.math.stat.descriptive.DescriptiveStatistics +import org.apache.commons.math.stat.descriptive.SynchronizedDescriptiveStatistics +import org.junit.runner.RunWith +import akka.actor.Actor +import akka.actor.ActorRef +import akka.actor.PoisonPill +import akka.actor.Props +import akka.performance.trading.domain.Ask +import akka.performance.trading.domain.Bid +import akka.performance.trading.domain.Order +import akka.performance.trading.domain.TotalTradeCounter +import akka.performance.workbench.PerformanceSpec +import akka.performance.trading.domain.Orderbook + +// -server -Xms512M -Xmx1024M -XX:+UseConcMarkSweepGC -Dbenchmark=true -Dbenchmark.repeatFactor=500 -Dbenchmark.useDummyOrderbook=true +@org.junit.runner.RunWith(classOf[org.scalatest.junit.JUnitRunner]) +class TradingLatencyPerformanceSpec extends PerformanceSpec { + + val clientDispatcher = app.dispatcherFactory.newDispatcher("client-dispatcher") + .withNewThreadPoolWithLinkedBlockingQueueWithUnboundedCapacity + .setCorePoolSize(maxClients) + .build + + var tradingSystem: AkkaTradingSystem = _ + + var stat: DescriptiveStatistics = _ + val random: Random = new Random(0) + + def clientDelayMicros = { + System.getProperty("benchmark.clientDelayMicros", "250").toInt + } + + override def beforeEach() { + super.beforeEach() + stat = new SynchronizedDescriptiveStatistics + tradingSystem = new AkkaTradingSystem(app) + tradingSystem.start() + TotalTradeCounter.reset() + stat = new SynchronizedDescriptiveStatistics + } + + override def afterEach() { + super.afterEach() + tradingSystem.shutdown() + stat = null + } + + getClass.getSimpleName must { + "warmup" in { + runScenario(4, warmup = true) + } + "warmup more" in { + runScenario(4, warmup = true) + } + "perform with load 1" in { + runScenario(1) + } + "perform with load 2" in { + runScenario(2) + } + "perform with load 4" in { + runScenario(4) + } + "perform with load 6" in { + runScenario(6) + } + "perform with load 8" in { + runScenario(8) + } + + } + + def runScenario(numberOfClients: Int, warmup: Boolean = false) { + if (acceptClients(numberOfClients)) { + + val repeat = 4L * repeatFactor + + val prefixes = "A" :: "B" :: "C" :: "D" :: Nil + val askOrders = for { + s ← prefixes + i ← 1 to 3 + } yield Ask(s + i, 100 - i, 1000) + val bidOrders = for { + s ← prefixes + i ← 1 to 3 + } yield Bid(s + i, 100 - i, 1000) + val orders = askOrders.zip(bidOrders).map(x ⇒ Seq(x._1, x._2)).flatten + + val ordersPerClient = repeat * orders.size / numberOfClients + val totalNumberOfOrders = ordersPerClient * numberOfClients + val latch = new CountDownLatch(numberOfClients) + val receivers = tradingSystem.orderReceivers.toIndexedSeq + val start = System.nanoTime + val clients = (for (i ← 0 until numberOfClients) yield { + val receiver = receivers(i % receivers.size) + val props = Props(new Client(receiver, orders, latch, ordersPerClient, clientDelayMicros)).withDispatcher(clientDispatcher) + app.actorOf(props) + }) + + clients.foreach(_ ! "run") + val ok = latch.await((5000000L + (clientDelayMicros + 500) * totalNumberOfOrders) * timeDilation, TimeUnit.MICROSECONDS) + val durationNs = (System.nanoTime - start) + + if (!warmup) { + ok must be(true) + if (!Orderbook.useDummyOrderbook) { + TotalTradeCounter.counter.get must be(totalNumberOfOrders / 2) + } + logMeasurement(numberOfClients, durationNs, stat) + } + clients.foreach(_ ! PoisonPill) + } + } + + class Client( + orderReceiver: ActorRef, + orders: List[Order], + latch: CountDownLatch, + repeat: Long, + delayMicros: Int = 0) extends Actor { + + var orderIterator = orders.toIterator + def nextOrder(): Order = { + if (!orderIterator.hasNext) { + orderIterator = orders.toIterator + } + orderIterator.next() + } + + var sent = 0L + var received = 0L + + def receive = { + case Rsp(order, status) ⇒ + if (!status) { + app.eventHandler.error(this, "Invalid rsp") + } + val duration = System.nanoTime - order.nanoTime + stat.addValue(duration) + received += 1 + if (sent < repeat) { + PerformanceSpec.shortDelay(delayMicros, received) + placeOrder() + sent += 1 + } else if (received >= repeat) { + latch.countDown() + } + + case "run" ⇒ + // random initial delay to spread requests + val initialDelay = random.nextInt(20) + Thread.sleep(initialDelay) + placeOrder() + sent += 1 + } + + def placeOrder() { + orderReceiver ! nextOrder().withNanoTime + } + + } + +} + diff --git a/akka-actor-tests/src/test/scala/akka/performance/trading/common/TradingSystem.scala b/akka-actor-tests/src/test/scala/akka/performance/trading/system/TradingSystem.scala similarity index 98% rename from akka-actor-tests/src/test/scala/akka/performance/trading/common/TradingSystem.scala rename to akka-actor-tests/src/test/scala/akka/performance/trading/system/TradingSystem.scala index 076639e4ae..c917e75fcb 100644 --- a/akka-actor-tests/src/test/scala/akka/performance/trading/common/TradingSystem.scala +++ b/akka-actor-tests/src/test/scala/akka/performance/trading/system/TradingSystem.scala @@ -1,4 +1,4 @@ -package akka.performance.trading.common +package akka.performance.trading.system import akka.performance.trading.domain.Orderbook import akka.performance.trading.domain.OrderbookRepository diff --git a/akka-actor-tests/src/test/scala/akka/performance/trading/system/TradingThroughputPerformanceSpec.scala b/akka-actor-tests/src/test/scala/akka/performance/trading/system/TradingThroughputPerformanceSpec.scala new file mode 100644 index 0000000000..a59f164e16 --- /dev/null +++ b/akka-actor-tests/src/test/scala/akka/performance/trading/system/TradingThroughputPerformanceSpec.scala @@ -0,0 +1,157 @@ +package akka.performance.trading.system + +import java.util.concurrent.CountDownLatch +import java.util.concurrent.TimeUnit +import java.util.Random +import org.apache.commons.math.stat.descriptive.DescriptiveStatistics +import org.apache.commons.math.stat.descriptive.SynchronizedDescriptiveStatistics +import org.junit.runner.RunWith +import akka.actor.Actor +import akka.actor.ActorRef +import akka.actor.PoisonPill +import akka.actor.Props +import akka.performance.trading.domain.Ask +import akka.performance.trading.domain.Bid +import akka.performance.trading.domain.Order +import akka.performance.trading.domain.TotalTradeCounter +import akka.performance.workbench.PerformanceSpec +import akka.performance.trading.domain.Orderbook + +// -server -Xms512M -Xmx1024M -XX:+UseParallelGC -Dbenchmark=true -Dbenchmark.repeatFactor=500 -Dbenchmark.useDummyOrderbook=true +@org.junit.runner.RunWith(classOf[org.scalatest.junit.JUnitRunner]) +class TradingThroughputPerformanceSpec extends PerformanceSpec { + + val clientDispatcher = app.dispatcherFactory.newDispatcher("client-dispatcher") + .withNewThreadPoolWithLinkedBlockingQueueWithUnboundedCapacity + .setCorePoolSize(maxClients) + .build + + var tradingSystem: AkkaTradingSystem = _ + + override def beforeEach() { + super.beforeEach() + tradingSystem = new AkkaTradingSystem(app) + tradingSystem.start() + TotalTradeCounter.reset() + } + + override def afterEach() { + super.afterEach() + tradingSystem.shutdown() + } + + getClass.getSimpleName must { + "warmup" in { + runScenario(4, warmup = true) + } + "warmup more" in { + runScenario(4, warmup = true) + } + "perform with load 1" in { + runScenario(1) + } + "perform with load 2" in { + runScenario(2) + } + "perform with load 4" in { + runScenario(4) + } + "perform with load 6" in { + runScenario(6) + } + "perform with load 8" in { + runScenario(8) + } + "perform with load 10" in { + runScenario(10) + } + + } + + def runScenario(numberOfClients: Int, warmup: Boolean = false) { + if (acceptClients(numberOfClients)) { + + val repeat = 400L * repeatFactor + + val prefixes = "A" :: "B" :: "C" :: "D" :: "E" :: "F" :: Nil + val askOrders = for { + s ← prefixes + i ← 1 to 4 + } yield Ask(s + i, 100 - i, 1000) + val bidOrders = for { + s ← prefixes + i ← 1 to 4 + } yield Bid(s + i, 100 - i, 1000) + val orders = askOrders.zip(bidOrders).map(x ⇒ Seq(x._1, x._2)).flatten + + val ordersPerClient = repeat * orders.size / numberOfClients + val totalNumberOfOrders = ordersPerClient * numberOfClients + val latch = new CountDownLatch(numberOfClients) + val receivers = tradingSystem.orderReceivers.toIndexedSeq + val start = System.nanoTime + val clients = (for (i ← 0 until numberOfClients) yield { + val receiver = receivers(i % receivers.size) + val props = Props(new Client(receiver, orders, latch, ordersPerClient)).withDispatcher(clientDispatcher) + app.actorOf(props) + }) + + clients.foreach(_ ! "run") + val ok = latch.await((5000000L + 500 * totalNumberOfOrders) * timeDilation, TimeUnit.MICROSECONDS) + val durationNs = (System.nanoTime - start) + + if (!warmup) { + ok must be(true) + if (!Orderbook.useDummyOrderbook) { + TotalTradeCounter.counter.get must be(totalNumberOfOrders / 2) + } + logMeasurement(numberOfClients, durationNs, totalNumberOfOrders) + } + clients.foreach(_ ! PoisonPill) + } + } + + class Client( + orderReceiver: ActorRef, + orders: List[Order], + latch: CountDownLatch, + repeat: Long) extends Actor { + + var orderIterator = orders.toIterator + def nextOrder(): Order = { + if (!orderIterator.hasNext) { + orderIterator = orders.toIterator + } + orderIterator.next() + } + + var sent = 0L + var received = 0L + + def receive = { + case Rsp(order, status) ⇒ + if (!status) { + app.eventHandler.error(this, "Invalid rsp") + } + received += 1 + if (sent < repeat) { + placeOrder() + sent += 1 + } else if (received >= repeat) { + latch.countDown() + } + + case "run" ⇒ + for (i ← 0L until math.min(1000L, repeat)) { + placeOrder() + sent += 1 + } + } + + def placeOrder() { + orderReceiver ! nextOrder() + } + + } + +} + diff --git a/akka-actor-tests/src/test/scala/akka/performance/workbench/PerformanceSpec.scala b/akka-actor-tests/src/test/scala/akka/performance/workbench/PerformanceSpec.scala new file mode 100644 index 0000000000..b1c5612024 --- /dev/null +++ b/akka-actor-tests/src/test/scala/akka/performance/workbench/PerformanceSpec.scala @@ -0,0 +1,113 @@ +package akka.performance.workbench + +import scala.collection.immutable.TreeMap + +import org.apache.commons.math.stat.descriptive.DescriptiveStatistics +import org.scalatest.BeforeAndAfterEach + +import akka.actor.simpleName +import akka.testkit.AkkaSpec +import akka.AkkaApplication + +trait PerformanceSpec extends AkkaSpec with BeforeAndAfterEach { + + def app: AkkaApplication + + def isBenchmark() = System.getProperty("benchmark") == "true" + + def minClients() = System.getProperty("benchmark.minClients", "1").toInt; + + def maxClients() = System.getProperty("benchmark.maxClients", "40").toInt; + + def repeatFactor() = { + val defaultRepeatFactor = if (isBenchmark) "150" else "2" + System.getProperty("benchmark.repeatFactor", defaultRepeatFactor).toInt + } + + def timeDilation() = { + System.getProperty("benchmark.timeDilation", "1").toLong + } + + val resultRepository = BenchResultRepository() + lazy val report = new Report(app, resultRepository, compareResultWith) + + /** + * To compare two tests with each other you can override this method, in + * the test. For example Some("OneWayPerformanceTest") + */ + def compareResultWith: Option[String] = None + + def acceptClients(numberOfClients: Int): Boolean = { + (minClients <= numberOfClients && numberOfClients <= maxClients) + } + + def logMeasurement(numberOfClients: Int, durationNs: Long, n: Long) { + val name = simpleName(this) + val durationS = durationNs.toDouble / 1000000000.0 + + val stats = Stats( + name, + load = numberOfClients, + timestamp = TestStart.startTime, + durationNanos = durationNs, + n = n, + tps = (n.toDouble / durationS)) + + logMeasurement(stats) + } + + def logMeasurement(numberOfClients: Int, durationNs: Long, stat: DescriptiveStatistics) { + val name = simpleName(this) + val durationS = durationNs.toDouble / 1000000000.0 + + val percentiles = TreeMap[Int, Long]( + 5 -> (stat.getPercentile(5.0) / 1000).toLong, + 25 -> (stat.getPercentile(25.0) / 1000).toLong, + 50 -> (stat.getPercentile(50.0) / 1000).toLong, + 75 -> (stat.getPercentile(75.0) / 1000).toLong, + 95 -> (stat.getPercentile(95.0) / 1000).toLong) + + val n = stat.getN + + val stats = Stats( + name, + load = numberOfClients, + timestamp = TestStart.startTime, + durationNanos = durationNs, + n = n, + min = (stat.getMin / 1000).toLong, + max = (stat.getMax / 1000).toLong, + mean = (stat.getMean / 1000).toLong, + tps = (n.toDouble / durationS), + percentiles) + + logMeasurement(stats) + } + + def logMeasurement(stats: Stats) { + try { + resultRepository.add(stats) + report.html(resultRepository.get(stats.name)) + } catch { + // don't fail test due to problems saving bench report + case e: Exception ⇒ app.eventHandler.error(e, this, e.getMessage) + } + } + +} + +object PerformanceSpec { + def shortDelay(micros: Int, n: Long) { + if (micros > 0) { + val sampling = 1000 / micros + if (n % sampling == 0) { + Thread.sleep(1) + } + } + } +} + +object TestStart { + val startTime = System.currentTimeMillis +} + diff --git a/akka-actor-tests/src/test/scala/akka/performance/workbench/Report.scala b/akka-actor-tests/src/test/scala/akka/performance/workbench/Report.scala index 9e13b032c5..232bdef36f 100644 --- a/akka-actor-tests/src/test/scala/akka/performance/workbench/Report.scala +++ b/akka-actor-tests/src/test/scala/akka/performance/workbench/Report.scala @@ -33,17 +33,20 @@ class Report( sb.append(resultTable) sb.append("\n\n") - sb.append(img(percentilesAndMeanChart(current))) sb.append(img(latencyAndThroughputChart(current))) compareWithHistoricalTpsChart(statistics).foreach(url ⇒ sb.append(img(url))) - for (stats ← statistics) { - compareWithHistoricalPercentiliesAndMeanChart(stats).foreach(url ⇒ sb.append(img(url))) - } + if (current.max > 0L) { + sb.append(img(percentilesAndMeanChart(current))) - for (stats ← statistics) { - comparePercentilesAndMeanChart(stats).foreach(url ⇒ sb.append(img(url))) + for (stats ← statistics) { + compareWithHistoricalPercentiliesAndMeanChart(stats).foreach(url ⇒ sb.append(img(url))) + } + + for (stats ← statistics) { + comparePercentilesAndMeanChart(stats).foreach(url ⇒ sb.append(img(url))) + } } sb.append("
\n") diff --git a/akka-actor-tests/src/test/scala/akka/performance/workbench/Stats.scala b/akka-actor-tests/src/test/scala/akka/performance/workbench/Stats.scala index 786c5e389f..ac351ad961 100644 --- a/akka-actor-tests/src/test/scala/akka/performance/workbench/Stats.scala +++ b/akka-actor-tests/src/test/scala/akka/performance/workbench/Stats.scala @@ -13,8 +13,17 @@ case class Stats( max: Long = 0L, mean: Double = 0.0, tps: Double = 0.0, - percentiles: TreeMap[Int, Long] = TreeMap.empty) { + percentiles: TreeMap[Int, Long] = Stats.emptyPercentiles) { def median: Long = percentiles(50) } +object Stats { + val emptyPercentiles = TreeMap[Int, Long]( + 5 -> 0L, + 25 -> 0L, + 50 -> 0L, + 75 -> 0L, + 95 -> 0L) +} + From fd130d0310f91bb23add65debf494dc9d486f36a Mon Sep 17 00:00:00 2001 From: Viktor Klang Date: Tue, 8 Nov 2011 11:25:15 +0100 Subject: [PATCH 48/57] Fixing ActorPoolSpec (more specifically the ActiveActorsPressure thingie-device) and stopping the typed actors after the test of the spec --- .../src/test/scala/akka/routing/ActorPoolSpec.scala | 1 + akka-actor/src/main/scala/akka/routing/Pool.scala | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/akka-actor-tests/src/test/scala/akka/routing/ActorPoolSpec.scala b/akka-actor-tests/src/test/scala/akka/routing/ActorPoolSpec.scala index 604032e978..f290ca1ae6 100644 --- a/akka-actor-tests/src/test/scala/akka/routing/ActorPoolSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/routing/ActorPoolSpec.scala @@ -351,6 +351,7 @@ class ActorPoolSpec extends AkkaSpec { val value = r.get value must equal(i * i) } + app.typedActor.stop(pool) } "provide default supervision of pooled actors" in { diff --git a/akka-actor/src/main/scala/akka/routing/Pool.scala b/akka-actor/src/main/scala/akka/routing/Pool.scala index dbf71bad04..4ab1a55ade 100644 --- a/akka-actor/src/main/scala/akka/routing/Pool.scala +++ b/akka-actor/src/main/scala/akka/routing/Pool.scala @@ -296,8 +296,10 @@ trait MailboxPressureCapacitor { trait ActiveActorsPressureCapacitor { def pressure(delegates: Seq[ActorRef]): Int = delegates count { - case a: LocalActorRef ⇒ !a.underlying.sender.isShutdown - case _ ⇒ false + case a: LocalActorRef ⇒ + val cell = a.underlying + cell.mailbox.isScheduled && cell.currentMessage != null + case _ ⇒ false } } From 48dbfda2554a33bcf73ef62c9f383a5a9da8650f Mon Sep 17 00:00:00 2001 From: Viktor Klang Date: Tue, 8 Nov 2011 12:30:46 +0100 Subject: [PATCH 49/57] Reducing sleep time for ActorPoolSpec for typed actors and removing defaultSupervisor from Props --- .../src/test/scala/akka/routing/ActorPoolSpec.scala | 2 +- akka-actor/src/main/scala/akka/actor/Props.scala | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/akka-actor-tests/src/test/scala/akka/routing/ActorPoolSpec.scala b/akka-actor-tests/src/test/scala/akka/routing/ActorPoolSpec.scala index f290ca1ae6..5ea6902b97 100644 --- a/akka-actor-tests/src/test/scala/akka/routing/ActorPoolSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/routing/ActorPoolSpec.scala @@ -345,7 +345,7 @@ class ActorPoolSpec extends AkkaSpec { def receive = _route }, Props().withTimeout(10 seconds).withFaultHandler(faultHandler)) - val results = for (i ← 1 to 20) yield (i, pool.sq(i, 100)) + val results = for (i ← 1 to 20) yield (i, pool.sq(i, 10)) for ((i, r) ← results) { val value = r.get diff --git a/akka-actor/src/main/scala/akka/actor/Props.scala b/akka-actor/src/main/scala/akka/actor/Props.scala index 393c442b51..c6732b6eca 100644 --- a/akka-actor/src/main/scala/akka/actor/Props.scala +++ b/akka-actor/src/main/scala/akka/actor/Props.scala @@ -28,7 +28,7 @@ object Props { case _ ⇒ Escalate } final val defaultFaultHandler: FaultHandlingStrategy = OneForOneStrategy(defaultDecider, None, None) - final val defaultSupervisor: Option[ActorRef] = None + final val noHotSwap: Stack[Actor.Receive] = Stack.empty final val randomAddress: String = "" From 39d169612fb273e701a671ff57c916d06bff1245 Mon Sep 17 00:00:00 2001 From: Viktor Klang Date: Tue, 8 Nov 2011 14:57:11 +0100 Subject: [PATCH 50/57] Dropping akka-http (see 1330) --- project/AkkaBuild.scala | 31 +++++-------------------------- 1 file changed, 5 insertions(+), 26 deletions(-) diff --git a/project/AkkaBuild.scala b/project/AkkaBuild.scala index 976a0639ab..5091d3c08e 100644 --- a/project/AkkaBuild.scala +++ b/project/AkkaBuild.scala @@ -25,8 +25,8 @@ object AkkaBuild extends Build { Unidoc.unidocExclude := Seq(samples.id, tutorials.id), rstdocDirectory <<= baseDirectory / "akka-docs" ), - aggregate = Seq(actor, testkit, actorTests, stm, http, remote, slf4j, akkaSbtPlugin, samples, tutorials, docs) - //aggregate = Seq(actor, testkit, actorTests, stm, http, slf4j, cluster, mailboxes, camel, camelTyped, samples, tutorials) + aggregate = Seq(actor, testkit, actorTests, stm, remote, slf4j, akkaSbtPlugin, samples, tutorials, docs) + //aggregate = Seq(actor, testkit, actorTests, stm, slf4j, cluster, mailboxes, camel, camelTyped, samples, tutorials) ) lazy val actor = Project( @@ -105,15 +105,6 @@ object AkkaBuild extends Build { // ) // ) configs (MultiJvm) - lazy val http = Project( - id = "akka-http", - base = file("akka-http"), - dependencies = Seq(actor, testkit % "test->test"), - settings = defaultSettings ++ Seq( - libraryDependencies ++= Dependencies.http - ) - ) - lazy val slf4j = Project( id = "akka-slf4j", base = file("akka-slf4j"), @@ -222,7 +213,7 @@ object AkkaBuild extends Build { // lazy val kernel = Project( // id = "akka-kernel", // base = file("akka-kernel"), - // dependencies = Seq(cluster, http, slf4j, spring), + // dependencies = Seq(cluster, slf4j, spring), // settings = defaultSettings ++ Seq( // libraryDependencies ++= Dependencies.kernel // ) @@ -312,7 +303,7 @@ object AkkaBuild extends Build { lazy val docs = Project( id = "akka-docs", base = file("akka-docs"), - dependencies = Seq(actor, testkit % "test->test", stm, http, remote, slf4j), + dependencies = Seq(actor, testkit % "test->test", stm, remote, slf4j), settings = defaultSettings ++ Seq( unmanagedSourceDirectories in Test <<= baseDirectory { _ ** "code" get }, libraryDependencies ++= Dependencies.docs, @@ -416,11 +407,6 @@ object Dependencies { protobuf, sjson, zkClient, zookeeper, zookeeperLock, Test.junit, Test.scalatest ) - val http = Seq( - jsr250, Provided.javaxServlet, Provided.jetty, Provided.jerseyServer, jsr311, commonsCodec, - Test.junit, Test.scalatest, Test.mockito - ) - val slf4j = Seq(slf4jApi) val mailboxes = Seq(Test.scalatest) @@ -437,8 +423,7 @@ object Dependencies { // val spring = Seq(springBeans, springContext, camelSpring, Test.junit, Test.scalatest) val kernel = Seq( - jettyUtil, jettyXml, jettyServlet, jerseyCore, jerseyJson, jerseyScala, - jacksonCore, staxApi, Provided.jerseyServer + jettyUtil, jettyXml, jettyServlet, jacksonCore, staxApi ) // TODO: resolve Jetty version conflict @@ -480,14 +465,9 @@ object Dependency { val h2Lzf = "voldemort.store.compress" % "h2-lzf" % "1.0" // ApacheV2 val jacksonCore = "org.codehaus.jackson" % "jackson-core-asl" % V.Jackson // ApacheV2 val jacksonMapper = "org.codehaus.jackson" % "jackson-mapper-asl" % V.Jackson // ApacheV2 - val jerseyCore = "com.sun.jersey" % "jersey-core" % V.Jersey // CDDL v1 - val jerseyJson = "com.sun.jersey" % "jersey-json" % V.Jersey // CDDL v1 - val jerseyScala = "com.sun.jersey.contribs" % "jersey-scala" % V.Jersey // CDDL v1 val jettyUtil = "org.eclipse.jetty" % "jetty-util" % V.Jetty // Eclipse license val jettyXml = "org.eclipse.jetty" % "jetty-xml" % V.Jetty // Eclipse license val jettyServlet = "org.eclipse.jetty" % "jetty-servlet" % V.Jetty // Eclipse license - val jsr250 = "javax.annotation" % "jsr250-api" % "1.0" // CDDL v1 - val jsr311 = "javax.ws.rs" % "jsr311-api" % "1.1" // CDDL v1 val log4j = "log4j" % "log4j" % "1.2.15" // ApacheV2 val mongoAsync = "com.mongodb.async" % "mongo-driver_2.9.0-1" % "0.2.7" // ApacheV2 val multiverse = "org.multiverse" % "multiverse-alpha" % V.Multiverse // ApacheV2 @@ -509,7 +489,6 @@ object Dependency { object Provided { val javaxServlet = "org.apache.geronimo.specs" % "geronimo-servlet_3.0_spec" % "1.0" % "provided" // CDDL v1 - val jerseyServer = "com.sun.jersey" % "jersey-server" % V.Jersey % "provided" // CDDL v1 val jetty = "org.eclipse.jetty" % "jetty-server" % V.Jetty % "provided" // Eclipse license } From 84706721f968650524fdad94cf79ea9552c3644a Mon Sep 17 00:00:00 2001 From: Viktor Klang Date: Tue, 8 Nov 2011 18:55:55 +0100 Subject: [PATCH 51/57] Renaming ActorCell.supervisor to 'parent', adding 'parent' to ActorContext --- .../src/main/scala/akka/actor/ActorCell.scala | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/akka-actor/src/main/scala/akka/actor/ActorCell.scala b/akka-actor/src/main/scala/akka/actor/ActorCell.scala index fe8a8cec5f..319d65a963 100644 --- a/akka-actor/src/main/scala/akka/actor/ActorCell.scala +++ b/akka-actor/src/main/scala/akka/actor/ActorCell.scala @@ -45,6 +45,7 @@ private[akka] trait ActorContext extends ActorRefFactory with TypedActorFactory def app: AkkaApplication + def parent: ActorRef } private[akka] object ActorCell { @@ -61,7 +62,7 @@ private[akka] class ActorCell( val app: AkkaApplication, val self: ActorRef with ScalaActorRef, val props: Props, - val supervisor: ActorRef, + val parent: ActorRef, var receiveTimeout: Option[Long], var hotswap: Stack[PartialFunction[Any, Unit]]) extends ActorContext { @@ -93,7 +94,7 @@ private[akka] class ActorCell( mailbox = dispatcher.createMailbox(this) // ➡➡➡ NEVER SEND THE SAME SYSTEM MESSAGE OBJECT TO TWO ACTORS ⬅⬅⬅ - supervisor.sendSystemMessage(akka.dispatch.Supervise(self)) + parent.sendSystemMessage(akka.dispatch.Supervise(self)) dispatcher.attach(this) } @@ -162,7 +163,7 @@ private[akka] class ActorCell( // prevent any further messages to be processed until the actor has been restarted dispatcher.suspend(this) } finally { - supervisor ! Failed(self, ActorInitializationException(self, "exception during creation", e)) + parent ! Failed(self, ActorInitializationException(self, "exception during creation", e)) } } @@ -193,7 +194,7 @@ private[akka] class ActorCell( // prevent any further messages to be processed until the actor has been restarted dispatcher.suspend(this) } finally { - supervisor ! Failed(self, ActorInitializationException(self, "exception during re-creation", e)) + parent ! Failed(self, ActorInitializationException(self, "exception during re-creation", e)) } } @@ -222,7 +223,7 @@ private[akka] class ActorCell( } } finally { try { - supervisor ! ChildTerminated(self) + parent ! ChildTerminated(self) app.deathWatch.publish(Terminated(self)) } finally { currentMessage = null @@ -287,11 +288,11 @@ private[akka] class ActorCell( if (e.isInstanceOf[InterruptedException]) { val ex = ActorInterruptedException(e) props.faultHandler.handleSupervisorFailing(self, children) - supervisor ! Failed(self, ex) + parent ! Failed(self, ex) throw e //Re-throw InterruptedExceptions as expected } else { props.faultHandler.handleSupervisorFailing(self, children) - supervisor ! Failed(self, e) + parent ! Failed(self, e) } } finally { checkReceiveTimeout // Reschedule receive timeout From 55d2a48887d9ba68cf6590cb9b5e3f9648229296 Mon Sep 17 00:00:00 2001 From: Viktor Klang Date: Tue, 8 Nov 2011 18:56:24 +0100 Subject: [PATCH 52/57] Adding a project definition for akka-amqp (but without code) --- project/AkkaBuild.scala | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/project/AkkaBuild.scala b/project/AkkaBuild.scala index 5091d3c08e..9b8f262541 100644 --- a/project/AkkaBuild.scala +++ b/project/AkkaBuild.scala @@ -25,8 +25,8 @@ object AkkaBuild extends Build { Unidoc.unidocExclude := Seq(samples.id, tutorials.id), rstdocDirectory <<= baseDirectory / "akka-docs" ), - aggregate = Seq(actor, testkit, actorTests, stm, remote, slf4j, akkaSbtPlugin, samples, tutorials, docs) - //aggregate = Seq(actor, testkit, actorTests, stm, slf4j, cluster, mailboxes, camel, camelTyped, samples, tutorials) + aggregate = Seq(actor, testkit, actorTests, stm, remote, slf4j, amqp, akkaSbtPlugin, samples, tutorials, docs) + //aggregate = Seq(cluster, mailboxes, camel, camelTyped) ) lazy val actor = Project( @@ -114,6 +114,15 @@ object AkkaBuild extends Build { ) ) + lazy val amqp = Project( + id = "akka-amqp", + base = file("akka-amqp"), + dependencies = Seq(actor, testkit % "test->test"), + settings = defaultSettings ++ Seq( + libraryDependencies ++= Dependencies.amqp + ) + ) + // lazy val mailboxes = Project( // id = "akka-durable-mailboxes", // base = file("akka-durable-mailboxes"), @@ -409,6 +418,8 @@ object Dependencies { val slf4j = Seq(slf4jApi) + val amqp = Seq(rabbit, commonsIo, protobuf) + val mailboxes = Seq(Test.scalatest) val beanstalkMailbox = Seq(beanstalk) @@ -451,6 +462,7 @@ object Dependency { val Slf4j = "1.6.0" val Spring = "3.0.5.RELEASE" val Zookeeper = "3.4.0" + val Rabbit = "2.3.1" } // Compile @@ -474,6 +486,7 @@ object Dependency { val netty = "org.jboss.netty" % "netty" % V.Netty // ApacheV2 val osgi = "org.osgi" % "org.osgi.core" % "4.2.0" // ApacheV2 val protobuf = "com.google.protobuf" % "protobuf-java" % V.Protobuf // New BSD + val rabbit = "com.rabbitmq" % "amqp-client" % V.Rabbit // Mozilla Public License val redis = "net.debasishg" %% "redisclient" % "2.4.0" // ApacheV2 val sjson = "net.debasishg" %% "sjson" % "0.15" // ApacheV2 val slf4jApi = "org.slf4j" % "slf4j-api" % V.Slf4j // MIT From 3021baa3e423d0e81e7806acf9ab449d10e1ce70 Mon Sep 17 00:00:00 2001 From: Viktor Klang Date: Tue, 8 Nov 2011 19:10:07 +0100 Subject: [PATCH 53/57] Fixing the BuilderParents generated by protobuf with FQN and fixing @returns => @return --- .../src/main/scala/akka/actor/Actor.scala | 4 ++-- .../src/main/scala/akka/actor/ActorRef.scala | 8 +++---- .../src/main/scala/akka/event/EventBus.scala | 4 ++-- .../src/main/scala/akka/util/Index.scala | 2 +- .../src/main/scala/akka/cluster/Cluster.scala | 2 +- .../main/java/akka/remote/RemoteProtocol.java | 22 +++++++++---------- .../java/akka/actor/ProtobufProtocol.java | 2 +- 7 files changed, 22 insertions(+), 22 deletions(-) diff --git a/akka-actor/src/main/scala/akka/actor/Actor.scala b/akka-actor/src/main/scala/akka/actor/Actor.scala index 2cce44bec8..a0d62bc76e 100644 --- a/akka-actor/src/main/scala/akka/actor/Actor.scala +++ b/akka-actor/src/main/scala/akka/actor/Actor.scala @@ -393,13 +393,13 @@ trait Actor { /** * Registers this actor as a Monitor for the provided ActorRef - * @returns the provided ActorRef + * @return the provided ActorRef */ def watch(subject: ActorRef): ActorRef = self startsMonitoring subject /** * Unregisters this actor as Monitor for the provided ActorRef - * @returns the provided ActorRef + * @return the provided ActorRef */ def unwatch(subject: ActorRef): ActorRef = self stopsMonitoring subject diff --git a/akka-actor/src/main/scala/akka/actor/ActorRef.scala b/akka-actor/src/main/scala/akka/actor/ActorRef.scala index 8ac11ffbae..d25572c3e0 100644 --- a/akka-actor/src/main/scala/akka/actor/ActorRef.scala +++ b/akka-actor/src/main/scala/akka/actor/ActorRef.scala @@ -122,7 +122,7 @@ abstract class ActorRef extends java.lang.Comparable[ActorRef] with Serializable * This means that this actor will get a Terminated()-message when the provided actor * is permanently terminated. * - * @returns the same ActorRef that is provided to it, to allow for cleaner invocations + * @return the same ActorRef that is provided to it, to allow for cleaner invocations */ def startsMonitoring(subject: ActorRef): ActorRef //TODO FIXME REMOVE THIS @@ -131,7 +131,7 @@ abstract class ActorRef extends java.lang.Comparable[ActorRef] with Serializable * This means that this actor will not get a Terminated()-message when the provided actor * is permanently terminated. * - * @returns the same ActorRef that is provided to it, to allow for cleaner invocations + * @return the same ActorRef that is provided to it, to allow for cleaner invocations */ def stopsMonitoring(subject: ActorRef): ActorRef //TODO FIXME REMOVE THIS @@ -202,7 +202,7 @@ class LocalActorRef private[akka] ( * This means that this actor will get a Terminated()-message when the provided actor * is permanently terminated. * - * @returns the same ActorRef that is provided to it, to allow for cleaner invocations + * @return the same ActorRef that is provided to it, to allow for cleaner invocations */ def startsMonitoring(subject: ActorRef): ActorRef = actorCell.startsMonitoring(subject) @@ -211,7 +211,7 @@ class LocalActorRef private[akka] ( * This means that this actor will not get a Terminated()-message when the provided actor * is permanently terminated. * - * @returns the same ActorRef that is provided to it, to allow for cleaner invocations + * @return the same ActorRef that is provided to it, to allow for cleaner invocations */ def stopsMonitoring(subject: ActorRef): ActorRef = actorCell.stopsMonitoring(subject) diff --git a/akka-actor/src/main/scala/akka/event/EventBus.scala b/akka-actor/src/main/scala/akka/event/EventBus.scala index 36b878dcb9..e66b68c7e8 100644 --- a/akka-actor/src/main/scala/akka/event/EventBus.scala +++ b/akka-actor/src/main/scala/akka/event/EventBus.scala @@ -22,13 +22,13 @@ trait EventBus { /** * Attempts to register the subscriber to the specified Classifier - * @returns true if successful and false if not (because it was already subscribed to that Classifier, or otherwise) + * @return true if successful and false if not (because it was already subscribed to that Classifier, or otherwise) */ def subscribe(subscriber: Subscriber, to: Classifier): Boolean /** * Attempts to deregister the subscriber from the specified Classifier - * @returns true if successful and false if not (because it wasn't subscribed to that Classifier, or otherwise) + * @return true if successful and false if not (because it wasn't subscribed to that Classifier, or otherwise) */ def unsubscribe(subscriber: Subscriber, from: Classifier): Boolean diff --git a/akka-actor/src/main/scala/akka/util/Index.scala b/akka-actor/src/main/scala/akka/util/Index.scala index afbb7a2c20..c8155f235c 100644 --- a/akka-actor/src/main/scala/akka/util/Index.scala +++ b/akka-actor/src/main/scala/akka/util/Index.scala @@ -119,7 +119,7 @@ class Index[K, V](val mapSize: Int, val valueComparator: Comparator[V]) { /** * Disassociates all the values for the specified key - * @returns None if the key wasn't associated at all, or Some(scala.Iterable[V]) if it was associated + * @return None if the key wasn't associated at all, or Some(scala.Iterable[V]) if it was associated */ def remove(key: K): Option[Iterable[V]] = { val set = container get key diff --git a/akka-cluster/src/main/scala/akka/cluster/Cluster.scala b/akka-cluster/src/main/scala/akka/cluster/Cluster.scala index db5f5306d9..7227839c9a 100644 --- a/akka-cluster/src/main/scala/akka/cluster/Cluster.scala +++ b/akka-cluster/src/main/scala/akka/cluster/Cluster.scala @@ -1275,7 +1275,7 @@ class DefaultClusterNode private[akka] ( * Update the list of connections to other nodes in the cluster. * Tail recursive, using lockless optimimistic concurrency. * - * @returns a Map with the remote socket addresses to of disconnected node connections + * @return a Map with the remote socket addresses to of disconnected node connections */ @tailrec final private[cluster] def connectToAllNewlyArrivedMembershipNodesInCluster( diff --git a/akka-remote/src/main/java/akka/remote/RemoteProtocol.java b/akka-remote/src/main/java/akka/remote/RemoteProtocol.java index 8d1d7f8c94..89ee558709 100644 --- a/akka-remote/src/main/java/akka/remote/RemoteProtocol.java +++ b/akka-remote/src/main/java/akka/remote/RemoteProtocol.java @@ -552,7 +552,7 @@ public final class RemoteProtocol { maybeForceBuilderInitialization(); } - private Builder(BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } @@ -1254,7 +1254,7 @@ public final class RemoteProtocol { maybeForceBuilderInitialization(); } - private Builder(BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } @@ -2371,7 +2371,7 @@ public final class RemoteProtocol { maybeForceBuilderInitialization(); } - private Builder(BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } @@ -2995,7 +2995,7 @@ public final class RemoteProtocol { maybeForceBuilderInitialization(); } - private Builder(BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } @@ -3471,7 +3471,7 @@ public final class RemoteProtocol { maybeForceBuilderInitialization(); } - private Builder(BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } @@ -3884,7 +3884,7 @@ public final class RemoteProtocol { maybeForceBuilderInitialization(); } - private Builder(BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } @@ -4317,7 +4317,7 @@ public final class RemoteProtocol { maybeForceBuilderInitialization(); } - private Builder(BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } @@ -4768,7 +4768,7 @@ public final class RemoteProtocol { maybeForceBuilderInitialization(); } - private Builder(BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } @@ -5238,7 +5238,7 @@ public final class RemoteProtocol { maybeForceBuilderInitialization(); } - private Builder(BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } @@ -5751,7 +5751,7 @@ public final class RemoteProtocol { maybeForceBuilderInitialization(); } - private Builder(BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } @@ -6383,7 +6383,7 @@ public final class RemoteProtocol { maybeForceBuilderInitialization(); } - private Builder(BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } diff --git a/akka-remote/src/test/java/akka/actor/ProtobufProtocol.java b/akka-remote/src/test/java/akka/actor/ProtobufProtocol.java index 4307c64e3f..f29c9efee3 100644 --- a/akka-remote/src/test/java/akka/actor/ProtobufProtocol.java +++ b/akka-remote/src/test/java/akka/actor/ProtobufProtocol.java @@ -273,7 +273,7 @@ public final class ProtobufProtocol { maybeForceBuilderInitialization(); } - private Builder(BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } From 01df0c3766ee348f761885d625a9a956d6ceee23 Mon Sep 17 00:00:00 2001 From: Viktor Klang Date: Tue, 8 Nov 2011 20:00:45 +0100 Subject: [PATCH 54/57] Removing the guard (ReentrantGuard) from RemoteServerModule and switching from executing reconnections and shutdowns in the HashWheelTimer instead of Future w. default dispatcher --- .../scala/akka/remote/RemoteInterface.scala | 2 -- .../remote/netty/NettyRemoteSupport.scala | 26 +++++++++---------- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/akka-actor/src/main/scala/akka/remote/RemoteInterface.scala b/akka-actor/src/main/scala/akka/remote/RemoteInterface.scala index 797ea7c1aa..6aca328f71 100644 --- a/akka-actor/src/main/scala/akka/remote/RemoteInterface.scala +++ b/akka-actor/src/main/scala/akka/remote/RemoteInterface.scala @@ -129,8 +129,6 @@ abstract class RemoteSupport(val app: AkkaApplication) extends RemoteServerModul * This is the interface for the RemoteServer functionality, it's used in Actor.remote */ trait RemoteServerModule extends RemoteModule { this: RemoteSupport ⇒ - protected val guard = new ReentrantGuard - /** * Signals whether the server is up and running or not */ diff --git a/akka-remote/src/main/scala/akka/remote/netty/NettyRemoteSupport.scala b/akka-remote/src/main/scala/akka/remote/netty/NettyRemoteSupport.scala index 0a53cce810..8f973bdadb 100644 --- a/akka-remote/src/main/scala/akka/remote/netty/NettyRemoteSupport.scala +++ b/akka-remote/src/main/scala/akka/remote/netty/NettyRemoteSupport.scala @@ -348,13 +348,17 @@ class ActiveRemoteClientHandler( implicit def _app = app + def runOnceNow(thunk: ⇒ Unit) = timer.newTimeout(new TimerTask() { + def run(timeout: Timeout) = try { thunk } finally { timeout.cancel() } + }, 0, TimeUnit.MILLISECONDS) + override def messageReceived(ctx: ChannelHandlerContext, event: MessageEvent) { try { event.getMessage match { case arp: AkkaRemoteProtocol if arp.hasInstruction ⇒ val rcp = arp.getInstruction rcp.getCommandType match { - case CommandType.SHUTDOWN ⇒ akka.dispatch.Future { client.module.shutdownClientConnection(remoteAddress) } + case CommandType.SHUTDOWN ⇒ runOnceNow { client.module.shutdownClientConnection(remoteAddress) } } case arp: AkkaRemoteProtocol if arp.hasMessage ⇒ @@ -380,7 +384,7 @@ class ActiveRemoteClientHandler( } } }, settings.RECONNECT_DELAY.toMillis, TimeUnit.MILLISECONDS) - } else akka.dispatch.Future { + } else runOnceNow { client.module.shutdownClientConnection(remoteAddress) // spawn in another thread } } @@ -409,7 +413,7 @@ class ActiveRemoteClientHandler( cause match { case e: ReadTimeoutException ⇒ - akka.dispatch.Future { + runOnceNow { client.module.shutdownClientConnection(remoteAddress) // spawn in another thread } case e: Exception ⇒ @@ -498,16 +502,14 @@ trait NettyRemoteServerModule extends RemoteServerModule { def name = currentServer.get match { case Some(server) ⇒ server.name - case None ⇒ - val a = app.defaultAddress - "NettyRemoteServer@" + a.getAddress.getHostAddress + ":" + a.getPort + case None ⇒ "NettyRemoteServer@" + app.hostname + ":" + app.port } private val _isRunning = new Switch(false) def isRunning = _isRunning.isOn - def start(_hostname: String, _port: Int, loader: Option[ClassLoader] = None): RemoteServerModule = guard withGuard { + def start(_hostname: String, _port: Int, loader: Option[ClassLoader] = None): RemoteServerModule = { try { _isRunning switchOn { app.eventHandler.debug(this, "Starting up remote server on [%s:%s]".format(_hostname, _port)) @@ -522,12 +524,10 @@ trait NettyRemoteServerModule extends RemoteServerModule { this } - def shutdownServerModule() = guard withGuard { - _isRunning switchOff { - currentServer.getAndSet(None) foreach { instance ⇒ - app.eventHandler.debug(this, "Shutting down remote server on %s:%s".format(instance.host, instance.port)) - instance.shutdown() - } + def shutdownServerModule() = _isRunning switchOff { + currentServer.getAndSet(None) foreach { instance ⇒ + app.eventHandler.debug(this, "Shutting down remote server on %s:%s".format(instance.host, instance.port)) + instance.shutdown() } } } From 7e66d93e464b9bd2e39f700dabd5f3e303e3b66f Mon Sep 17 00:00:00 2001 From: Viktor Klang Date: Tue, 8 Nov 2011 20:06:41 +0100 Subject: [PATCH 55/57] Removign dual logging of remote events, switching to only dumping it into the eventHandler --- .../main/scala/akka/remote/netty/NettyRemoteSupport.scala | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/akka-remote/src/main/scala/akka/remote/netty/NettyRemoteSupport.scala b/akka-remote/src/main/scala/akka/remote/netty/NettyRemoteSupport.scala index 8f973bdadb..318c614615 100644 --- a/akka-remote/src/main/scala/akka/remote/netty/NettyRemoteSupport.scala +++ b/akka-remote/src/main/scala/akka/remote/netty/NettyRemoteSupport.scala @@ -517,9 +517,7 @@ trait NettyRemoteServerModule extends RemoteServerModule { currentServer.set(Some(new NettyRemoteServer(app, this, _hostname, _port, loader))) } } catch { - case e: Exception ⇒ - app.eventHandler.error(e, this, e.getMessage) - notifyListeners(RemoteServerError(e, this)) + case e: Exception ⇒ notifyListeners(RemoteServerError(e, this)) } this } @@ -626,19 +624,16 @@ class RemoteServerHandler( override def channelConnected(ctx: ChannelHandlerContext, event: ChannelStateEvent) = { val clientAddress = getClientAddress(ctx) - app.eventHandler.debug(this, "Remote client [%s] connected to [%s]".format(clientAddress, server.name)) server.notifyListeners(RemoteServerClientConnected(server, clientAddress)) } override def channelDisconnected(ctx: ChannelHandlerContext, event: ChannelStateEvent) = { val clientAddress = getClientAddress(ctx) - app.eventHandler.debug(this, "Remote client [%s] disconnected from [%s]".format(clientAddress, server.name)) server.notifyListeners(RemoteServerClientDisconnected(server, clientAddress)) } override def channelClosed(ctx: ChannelHandlerContext, event: ChannelStateEvent) = { val clientAddress = getClientAddress(ctx) - app.eventHandler.debug("Remote client [%s] channel closed from [%s]".format(clientAddress, server.name), this) server.notifyListeners(RemoteServerClientClosed(server, clientAddress)) } From f12914f8f956cba8ab486a503a316890fbdb26d2 Mon Sep 17 00:00:00 2001 From: Viktor Klang Date: Tue, 8 Nov 2011 20:18:24 +0100 Subject: [PATCH 56/57] Turning all eventHandler log messages left in NettyRemoteSupport into debug messages and remove more dual entries (log + event) --- .../remote/netty/NettyRemoteSupport.scala | 56 ++++++------------- 1 file changed, 16 insertions(+), 40 deletions(-) diff --git a/akka-remote/src/main/scala/akka/remote/netty/NettyRemoteSupport.scala b/akka-remote/src/main/scala/akka/remote/netty/NettyRemoteSupport.scala index 318c614615..9c875d448d 100644 --- a/akka-remote/src/main/scala/akka/remote/netty/NettyRemoteSupport.scala +++ b/akka-remote/src/main/scala/akka/remote/netty/NettyRemoteSupport.scala @@ -149,8 +149,7 @@ abstract class RemoteClient private[akka] ( */ def send(request: RemoteMessageProtocol) { if (isRunning) { //TODO FIXME RACY - app.eventHandler.debug(this, "Sending to connection [%s] message [%s]".format(remoteAddress, new RemoteMessage(request, remoteSupport))) - + app.eventHandler.debug(this, "Sending message: " + new RemoteMessage(request, remoteSupport)) // tell try { val future = currentChannel.write(createMessageSendEnvelope(request)) @@ -228,7 +227,6 @@ class ActiveRemoteClient private[akka] ( if (!connection.isSuccess) { notifyListeners(RemoteClientError(connection.getCause, module, remoteAddress)) - app.eventHandler.error(connection.getCause, this, "Reconnection to [%s] has failed".format(remoteAddress)) false } else { @@ -255,7 +253,6 @@ class ActiveRemoteClient private[akka] ( if (!connection.isSuccess) { notifyListeners(RemoteClientError(connection.getCause, module, remoteAddress)) - app.eventHandler.error(connection.getCause, this, "Remote client connection to [%s] has failed".format(remoteAddress)) false } else { sendSecureCookie(connection) @@ -276,7 +273,7 @@ class ActiveRemoteClient private[akka] ( // Please note that this method does _not_ remove the ARC from the NettyRemoteClientModule's map of clients def shutdown() = runSwitch switchOff { - app.eventHandler.info(this, "Shutting down remote client [%s]".format(name)) + app.eventHandler.debug(this, "Shutting down remote client [%s]".format(name)) notifyListeners(RemoteClientShutdown(module, remoteAddress)) timer.stop() @@ -287,7 +284,7 @@ class ActiveRemoteClient private[akka] ( bootstrap = null connection = null - app.eventHandler.info(this, "[%s] has been shut down".format(name)) + app.eventHandler.debug(this, "[%s] has been shut down".format(name)) } private[akka] def isWithinReconnectionTimeWindow: Boolean = { @@ -296,9 +293,9 @@ class ActiveRemoteClient private[akka] ( true } else { val timeLeft = (RECONNECTION_TIME_WINDOW - (System.currentTimeMillis - reconnectionTimeWindowStart)) > 0 - if (timeLeft) { - app.eventHandler.info(this, "Will try to reconnect to remote server for another [%s] milliseconds".format(timeLeft)) - } + if (timeLeft) + app.eventHandler.debug(this, "Will try to reconnect to remote server for another [%s] milliseconds".format(timeLeft)) + timeLeft } } @@ -368,9 +365,7 @@ class ActiveRemoteClientHandler( throw new RemoteClientException("Unknown message received in remote client handler: " + other, client.module, client.remoteAddress) } } catch { - case e: Exception ⇒ - app.eventHandler.error(e, this, e.getMessage) - client.notifyListeners(RemoteClientError(e, client.module, client.remoteAddress)) + case e: Exception ⇒ client.notifyListeners(RemoteClientError(e, client.module, client.remoteAddress)) } } @@ -392,36 +387,30 @@ class ActiveRemoteClientHandler( override def channelConnected(ctx: ChannelHandlerContext, event: ChannelStateEvent) = { try { client.notifyListeners(RemoteClientConnected(client.module, client.remoteAddress)) - app.eventHandler.debug(this, "Remote client connected to [%s]".format(ctx.getChannel.getRemoteAddress)) client.resetReconnectionTimeWindow } catch { - case e: Exception ⇒ - app.eventHandler.error(e, this, e.getMessage) - client.notifyListeners(RemoteClientError(e, client.module, client.remoteAddress)) + case e: Exception ⇒ client.notifyListeners(RemoteClientError(e, client.module, client.remoteAddress)) } } override def channelDisconnected(ctx: ChannelHandlerContext, event: ChannelStateEvent) = { client.notifyListeners(RemoteClientDisconnected(client.module, client.remoteAddress)) - app.eventHandler.debug(this, "Remote client disconnected from [%s]".format(ctx.getChannel.getRemoteAddress)) } override def exceptionCaught(ctx: ChannelHandlerContext, event: ExceptionEvent) = { val cause = event.getCause if (cause ne null) { - app.eventHandler.error(event.getCause, this, "Unexpected exception [%s] from downstream in remote client [%s]".format(event.getCause, event)) - + client.notifyListeners(RemoteClientError(cause, client.module, client.remoteAddress)) cause match { case e: ReadTimeoutException ⇒ runOnceNow { client.module.shutdownClientConnection(remoteAddress) // spawn in another thread } case e: Exception ⇒ - client.notifyListeners(RemoteClientError(e, client.module, client.remoteAddress)) event.getChannel.close //FIXME Is this the correct behavior? } - } else app.eventHandler.error(this, "Unexpected exception from downstream in remote client [%s]".format(event)) + } else client.notifyListeners(RemoteClientError(new Exception("Unknown cause"), client.module, client.remoteAddress)) } } @@ -466,7 +455,6 @@ class NettyRemoteServer(val app: AkkaApplication, serverModule: NettyRemoteServe serverModule.notifyListeners(RemoteServerStarted(serverModule)) def shutdown() { - app.eventHandler.info(this, "Shutting down remote server [%s]".format(name)) try { val shutdownSignal = { val b = RemoteControlProtocol.newBuilder.setCommandType(CommandType.SHUTDOWN) @@ -481,8 +469,7 @@ class NettyRemoteServer(val app: AkkaApplication, serverModule: NettyRemoteServe executor.releaseExternalResources() serverModule.notifyListeners(RemoteServerShutdown(serverModule)) } catch { - case e: Exception ⇒ - app.eventHandler.error(e, this, e.getMessage) + case e: Exception ⇒ serverModule.notifyListeners(RemoteServerError(e, serverModule)) } } } @@ -511,11 +498,7 @@ trait NettyRemoteServerModule extends RemoteServerModule { def start(_hostname: String, _port: Int, loader: Option[ClassLoader] = None): RemoteServerModule = { try { - _isRunning switchOn { - app.eventHandler.debug(this, "Starting up remote server on [%s:%s]".format(_hostname, _port)) - - currentServer.set(Some(new NettyRemoteServer(app, this, _hostname, _port, loader))) - } + _isRunning switchOn { currentServer.set(Some(new NettyRemoteServer(app, this, _hostname, _port, loader))) } } catch { case e: Exception ⇒ notifyListeners(RemoteServerError(e, this)) } @@ -523,10 +506,7 @@ trait NettyRemoteServerModule extends RemoteServerModule { } def shutdownServerModule() = _isRunning switchOff { - currentServer.getAndSet(None) foreach { instance ⇒ - app.eventHandler.debug(this, "Shutting down remote server on %s:%s".format(instance.host, instance.port)) - instance.shutdown() - } + currentServer.getAndSet(None) foreach { _.shutdown() } } } @@ -647,9 +627,8 @@ class RemoteServerHandler( } override def exceptionCaught(ctx: ChannelHandlerContext, event: ExceptionEvent) = { - app.eventHandler.error(event.getCause, this, "Unexpected exception from remote downstream") - event.getChannel.close server.notifyListeners(RemoteServerError(event.getCause, server)) + event.getChannel.close } private def getClientAddress(ctx: ChannelHandlerContext): Option[InetSocketAddress] = @@ -673,14 +652,11 @@ class RemoteServerHandler( } } catch { case e: SecurityException ⇒ - app.eventHandler.error(e, this, e.getMessage) - write(channel, createErrorReplyMessage(e, request)) server.notifyListeners(RemoteServerError(e, server)) + write(channel, createErrorReplyMessage(e, request)) } } catch { - case e: Exception ⇒ - server.notifyListeners(RemoteServerError(e, server)) - app.eventHandler.error(e, this, e.getMessage) + case e: Exception ⇒ server.notifyListeners(RemoteServerError(e, server)) } } From 294c71d9cb25aa274db1d5be42bc70118fb47c08 Mon Sep 17 00:00:00 2001 From: Viktor Klang Date: Tue, 8 Nov 2011 20:43:38 +0100 Subject: [PATCH 57/57] Adding stubs for implementing support for outbound passive connections for remoting --- .../remote/netty/NettyRemoteSupport.scala | 31 ++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/akka-remote/src/main/scala/akka/remote/netty/NettyRemoteSupport.scala b/akka-remote/src/main/scala/akka/remote/netty/NettyRemoteSupport.scala index 9c875d448d..68f1a52d72 100644 --- a/akka-remote/src/main/scala/akka/remote/netty/NettyRemoteSupport.scala +++ b/akka-remote/src/main/scala/akka/remote/netty/NettyRemoteSupport.scala @@ -168,6 +168,30 @@ abstract class RemoteClient private[akka] ( } } +class PassiveRemoteClient(_app: AkkaApplication, + val currentChannel: Channel, + remoteSupport: RemoteSupport, + module: NettyRemoteClientModule, + remoteAddress: InetSocketAddress, + val loader: Option[ClassLoader] = None, + notifyListenersFun: (⇒ Any) ⇒ Unit) + extends RemoteClient(_app, remoteSupport, module, remoteAddress) { + + def notifyListeners(msg: ⇒ Any): Unit = notifyListenersFun(msg) + + def connect(reconnectIfAlreadyConnected: Boolean = false): Boolean = runSwitch switchOn { + notifyListeners(RemoteClientStarted(module, remoteAddress)) + app.eventHandler.debug(this, "Starting remote client connection to [%s]".format(remoteAddress)) + } + + def shutdown() = runSwitch switchOff { + app.eventHandler.debug(this, "Shutting down remote client [%s]".format(name)) + + notifyListeners(RemoteClientShutdown(module, remoteAddress)) + app.eventHandler.debug(this, "[%s] has been shut down".format(name)) + } +} + /** * RemoteClient represents a connection to an Akka node. Is used to send messages to remote actors on the node. * @@ -621,7 +645,12 @@ class RemoteServerHandler( event.getMessage match { case null ⇒ throw new IllegalActorStateException("Message in remote MessageEvent is null [" + event + "]") case remote: AkkaRemoteProtocol if remote.hasMessage ⇒ handleRemoteMessageProtocol(remote.getMessage, event.getChannel) - case remote: AkkaRemoteProtocol if remote.hasInstruction ⇒ //Doesn't handle instructions + case remote: AkkaRemoteProtocol if remote.hasInstruction ⇒ + remote.getInstruction.getCommandType match { + case CommandType.CONNECT ⇒ //TODO FIXME Create passive connection here + case CommandType.SHUTDOWN ⇒ //TODO FIXME Dispose passive connection here + case _ ⇒ //Unknown command + } case _ ⇒ //ignore } }