From 31cf3e64fd8178450d0bbc234b74eb2ec1b035d3 Mon Sep 17 00:00:00 2001 From: Debasish Ghosh Date: Sat, 5 Mar 2011 22:35:47 +0530 Subject: [PATCH 01/15] fixed repo of scalatest which was incorrectly pointing to ScalaToolsSnapshot --- project/build/AkkaProject.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/build/AkkaProject.scala b/project/build/AkkaProject.scala index 5101863efa..3e33e4c633 100644 --- a/project/build/AkkaProject.scala +++ b/project/build/AkkaProject.scala @@ -102,7 +102,7 @@ class AkkaParentProject(info: ProjectInfo) extends DefaultProject(info) { lazy val jerseyModuleConfig = ModuleConfiguration("com.sun.jersey", JavaNetRepo) lazy val multiverseModuleConfig = ModuleConfiguration("org.multiverse", CodehausRepo) lazy val nettyModuleConfig = ModuleConfiguration("org.jboss.netty", JBossRepo) - lazy val scalaTestModuleConfig = ModuleConfiguration("org.scalatest", ScalaToolsSnapshotRepo) + lazy val scalaTestModuleConfig = ModuleConfiguration("org.scalatest", ScalaToolsRelRepo) lazy val spdeModuleConfig = ModuleConfiguration("us.technically.spde", DatabinderRepo) lazy val processingModuleConfig = ModuleConfiguration("org.processing", DatabinderRepo) lazy val scalaModuleConfig = ModuleConfiguration("org.scala-lang", ScalaToolsSnapshotRepo) From fe5ead9d6b80ab156b23301c151464992fa9ea74 Mon Sep 17 00:00:00 2001 From: Debasish Ghosh Date: Sat, 5 Mar 2011 22:56:16 +0530 Subject: [PATCH 02/15] Fixed #675 : preStart() is called twice when creating new instance of TypedActor --- .../main/scala/akka/actor/TypedActor.scala | 5 +- .../actor/typed-actor/Issue675Spec.scala | 51 +++++++++++++++++++ 2 files changed, 52 insertions(+), 4 deletions(-) create mode 100644 akka-typed-actor/src/test/scala/actor/typed-actor/Issue675Spec.scala diff --git a/akka-typed-actor/src/main/scala/akka/actor/TypedActor.scala b/akka-typed-actor/src/main/scala/akka/actor/TypedActor.scala index 790e9824a1..ea072db84f 100644 --- a/akka-typed-actor/src/main/scala/akka/actor/TypedActor.scala +++ b/akka-typed-actor/src/main/scala/akka/actor/TypedActor.scala @@ -445,9 +445,8 @@ object TypedActor { * @param intfClass interface the typed actor implements * @param targetClass implementation class of the typed actor */ - def newInstance[T](intfClass: Class[T], targetClass: Class[_]): T = { + def newInstance[T](intfClass: Class[T], targetClass: Class[_]): T = newInstance(intfClass, targetClass, TypedActorConfiguration()) - } /** * Factory method for typed actor. @@ -759,7 +758,6 @@ object TypedActor { val typedActor = if (instance.isInstanceOf[TypedActor]) instance.asInstanceOf[TypedActor] else throw new IllegalArgumentException("Actor [" + targetClass.getName + "] is not a sub class of 'TypedActor'") - typedActor.preStart typedActor } @@ -768,7 +766,6 @@ object TypedActor { val typedActor = if (instance.isInstanceOf[TypedActor]) instance.asInstanceOf[TypedActor] else throw new IllegalArgumentException("Actor [" + instance.getClass.getName + "] is not a sub class of 'TypedActor'") - typedActor.preStart typedActor } diff --git a/akka-typed-actor/src/test/scala/actor/typed-actor/Issue675Spec.scala b/akka-typed-actor/src/test/scala/actor/typed-actor/Issue675Spec.scala new file mode 100644 index 0000000000..e978b61c45 --- /dev/null +++ b/akka-typed-actor/src/test/scala/actor/typed-actor/Issue675Spec.scala @@ -0,0 +1,51 @@ +/** + * Copyright (C) 2009-2011 Scalable Solutions AB + */ + +package akka.actor + +import org.scalatest.Spec +import org.scalatest.Assertions +import org.scalatest.matchers.ShouldMatchers +import org.scalatest.BeforeAndAfterEach +import org.scalatest.junit.JUnitRunner +import org.junit.runner.RunWith + +import Issue675Spec._ + + +object Issue675Spec { + var l = collection.mutable.ListBuffer.empty[String] + + trait RegistrationService { + def register(user: String, cred: String): Unit + } + + class RegistrationServiceImpl extends TypedActor with RegistrationService { + def register(user: String, cred: String): Unit = {} + + override def preStart() { + l += "RegistrationServiceImpl.preStart() called" + } + } +} + + +@RunWith(classOf[JUnitRunner]) +class Issue675Spec extends + Spec with + ShouldMatchers with + BeforeAndAfterEach { + + override def afterEach() { + Actor.registry.shutdownAll + } + + describe("TypedActor preStart method") { + it("should be invoked once") { + import Issue675Spec._ + val simplePojo = TypedActor.newInstance(classOf[RegistrationService], classOf[RegistrationServiceImpl]) + l.size should equal(1) + } + } +} From c9523585d5d1a234e06e53c5b34ce314088cb386 Mon Sep 17 00:00:00 2001 From: Viktor Klang Date: Fri, 4 Mar 2011 20:55:12 +0100 Subject: [PATCH 03/15] Adding support for MessageDispatcherConfigurator, which means that you can configure homegrown dispatchers in akka.conf --- .../scala/akka/dispatch/Dispatchers.scala | 96 +++++++++---------- .../scala/akka/dispatch/MessageHandling.scala | 39 +++++++- 2 files changed, 84 insertions(+), 51 deletions(-) diff --git a/akka-actor/src/main/scala/akka/dispatch/Dispatchers.scala b/akka-actor/src/main/scala/akka/dispatch/Dispatchers.scala index 616384ae43..e41eef444b 100644 --- a/akka-actor/src/main/scala/akka/dispatch/Dispatchers.scala +++ b/akka-actor/src/main/scala/akka/dispatch/Dispatchers.scala @@ -7,11 +7,10 @@ package akka.dispatch import akka.actor.{Actor, ActorRef} import akka.actor.newUuid import akka.config.Config._ -import akka.util.{Duration} +import akka.util.{Duration,ReflectiveAccess} import akka.config.ConfigMap -import java.util.concurrent.ThreadPoolExecutor.{AbortPolicy, CallerRunsPolicy, DiscardOldestPolicy, DiscardPolicy} import java.util.concurrent.TimeUnit /** @@ -165,6 +164,7 @@ object Dispatchers { * type = "GlobalExecutorBasedEventDriven" # Must be one of the following, all "Global*" are non-configurable * # (ExecutorBasedEventDrivenWorkStealing), ExecutorBasedEventDriven, * # GlobalExecutorBasedEventDriven + * # A FQCN to a class inheriting MessageDispatcherConfigurator with a no-arg visible constructor * keep-alive-time = 60 # Keep alive time for threads * core-pool-size-factor = 1.0 # No of core threads ... ceil(available processors * factor) * max-pool-size-factor = 4.0 # Max no of threads ... ceil(available processors * factor) @@ -178,54 +178,52 @@ object Dispatchers { * Gotcha: Only configures the dispatcher if possible * Returns: None if "type" isn't specified in the config * Throws: IllegalArgumentException if the value of "type" is not valid + * IllegalArgumentException if it cannot */ def from(cfg: ConfigMap): Option[MessageDispatcher] = { - lazy val name = cfg.getString("name", newUuid.toString) - - def configureThreadPool(createDispatcher: => (ThreadPoolConfig) => MessageDispatcher): ThreadPoolConfigDispatcherBuilder = { - import ThreadPoolConfigDispatcherBuilder.conf_? - - //Apply the following options to the config if they are present in the cfg - ThreadPoolConfigDispatcherBuilder(createDispatcher,ThreadPoolConfig()).configure( - conf_?(cfg getInt "keep-alive-time" )(time => _.setKeepAliveTime(Duration(time, TIME_UNIT))), - conf_?(cfg getDouble "core-pool-size-factor")(factor => _.setCorePoolSizeFromFactor(factor)), - conf_?(cfg getDouble "max-pool-size-factor" )(factor => _.setMaxPoolSizeFromFactor(factor)), - conf_?(cfg getInt "executor-bounds" )(bounds => _.setExecutorBounds(bounds)), - conf_?(cfg getBool "allow-core-timeout" )(allow => _.setAllowCoreThreadTimeout(allow)), - conf_?(cfg getString "rejection-policy" map { - case "abort" => new AbortPolicy() - case "caller-runs" => new CallerRunsPolicy() - case "discard-oldest" => new DiscardOldestPolicy() - case "discard" => new DiscardPolicy() - case x => throw new IllegalArgumentException("[%s] is not a valid rejectionPolicy!" format x) - })(policy => _.setRejectionPolicy(policy))) - } - - lazy val mailboxType: MailboxType = { - val capacity = cfg.getInt("mailbox-capacity", MAILBOX_CAPACITY) - // FIXME how do we read in isBlocking for mailbox? Now set to 'false'. - if (capacity < 0) UnboundedMailbox() - else BoundedMailbox(false, capacity, Duration(cfg.getInt("mailbox-push-timeout-time", MAILBOX_PUSH_TIME_OUT.toMillis.toInt), TIME_UNIT)) - } - - cfg.getString("type") map { - case "ExecutorBasedEventDriven" => - configureThreadPool(threadPoolConfig => new ExecutorBasedEventDrivenDispatcher( - name, - cfg.getInt("throughput", THROUGHPUT), - cfg.getInt("throughput-deadline-time", THROUGHPUT_DEADLINE_TIME_MILLIS), - mailboxType, - threadPoolConfig)).build - - case "ExecutorBasedEventDrivenWorkStealing" => - configureThreadPool(threadPoolConfig => new ExecutorBasedEventDrivenWorkStealingDispatcher( - name, - cfg.getInt("throughput", THROUGHPUT), - cfg.getInt("throughput-deadline-time", THROUGHPUT_DEADLINE_TIME_MILLIS), - mailboxType, - threadPoolConfig)).build - case "GlobalExecutorBasedEventDriven" => globalExecutorBasedEventDrivenDispatcher - case unknown => throw new IllegalArgumentException("Unknown dispatcher type [%s]" format unknown) - } + cfg.getString("type") map { + case "ExecutorBasedEventDriven" => new ExecutorBasedEventDrivenDispatcherConfigurator() + case "ExecutorBasedEventDrivenWorkStealing" => new ExecutorBasedEventDrivenWorkStealingDispatcherConfigurator() + case "GlobalExecutorBasedEventDriven" => GlobalExecutorBasedEventDrivenDispatcherConfigurator + case fqn => + ReflectiveAccess.getClassFor[MessageDispatcherConfigurator](fqn) match { + case Some(clazz) => + val instance = ReflectiveAccess.createInstance[MessageDispatcherConfigurator](clazz, Array[Class[_]](), Array[AnyRef]()) + if (instance.isEmpty) + throw new IllegalArgumentException("Cannot instantiate MessageDispatcherConfigurator type [%s], make sure it has a default no-args constructor" format fqn) + else + instance.get + case None => + throw new IllegalArgumentException("Unknown MessageDispatcherConfigurator type [%s]" format fqn) + } + } map { + _ configure cfg + } } } + +object GlobalExecutorBasedEventDrivenDispatcherConfigurator extends MessageDispatcherConfigurator { + def configure(config: ConfigMap): MessageDispatcher = Dispatchers.globalExecutorBasedEventDrivenDispatcher +} + +class ExecutorBasedEventDrivenDispatcherConfigurator extends MessageDispatcherConfigurator { + def configure(config: ConfigMap): MessageDispatcher = { + configureThreadPool(config, threadPoolConfig => new ExecutorBasedEventDrivenDispatcher( + config.getString("name", newUuid.toString), + config.getInt("throughput", Dispatchers.THROUGHPUT), + config.getInt("throughput-deadline-time", Dispatchers.THROUGHPUT_DEADLINE_TIME_MILLIS), + mailboxType(config), + threadPoolConfig)).build + } +} + +class ExecutorBasedEventDrivenWorkStealingDispatcherConfigurator extends MessageDispatcherConfigurator { + def configure(config: ConfigMap): MessageDispatcher = { + configureThreadPool(config, threadPoolConfig => new ExecutorBasedEventDrivenWorkStealingDispatcher( + config.getString("name", newUuid.toString), + config.getInt("throughput", Dispatchers.THROUGHPUT), + config.getInt("throughput-deadline-time", Dispatchers.THROUGHPUT_DEADLINE_TIME_MILLIS), + mailboxType(config), + threadPoolConfig)).build + } +} \ No newline at end of file diff --git a/akka-actor/src/main/scala/akka/dispatch/MessageHandling.scala b/akka-actor/src/main/scala/akka/dispatch/MessageHandling.scala index cce4d2e871..3f0066227f 100644 --- a/akka-actor/src/main/scala/akka/dispatch/MessageHandling.scala +++ b/akka-actor/src/main/scala/akka/dispatch/MessageHandling.scala @@ -6,8 +6,10 @@ package akka.dispatch import java.util.concurrent._ import atomic. {AtomicInteger, AtomicBoolean, AtomicReference, AtomicLong} - -import akka.util.{Switch, ReentrantGuard, HashCode, ReflectiveAccess} +import akka.config.ConfigMap +import akka.config.Config.TIME_UNIT +import akka.util.{Duration, Switch, ReentrantGuard, HashCode, ReflectiveAccess} +import java.util.concurrent.ThreadPoolExecutor.{AbortPolicy, CallerRunsPolicy, DiscardOldestPolicy, DiscardPolicy} import akka.actor._ /** @@ -162,3 +164,36 @@ trait MessageDispatcher { */ def mailboxSize(actorRef: ActorRef): Int } + +/** + * Trait to be used for hooking in new dispatchers into Dispatchers.fromConfig + */ +abstract class MessageDispatcherConfigurator { + def configure(config: ConfigMap): MessageDispatcher + + def mailboxType(config: ConfigMap): MailboxType = { + val capacity = config.getInt("mailbox-capacity", Dispatchers.MAILBOX_CAPACITY) + // FIXME how do we read in isBlocking for mailbox? Now set to 'false'. + if (capacity < 0) UnboundedMailbox() + else BoundedMailbox(false, capacity, Duration(config.getInt("mailbox-push-timeout-time", Dispatchers.MAILBOX_PUSH_TIME_OUT.toMillis.toInt), TIME_UNIT)) + } + + def configureThreadPool(config: ConfigMap, createDispatcher: => (ThreadPoolConfig) => MessageDispatcher): ThreadPoolConfigDispatcherBuilder = { + import ThreadPoolConfigDispatcherBuilder.conf_? + + //Apply the following options to the config if they are present in the config + ThreadPoolConfigDispatcherBuilder(createDispatcher,ThreadPoolConfig()).configure( + conf_?(config getInt "keep-alive-time" )(time => _.setKeepAliveTime(Duration(time, TIME_UNIT))), + conf_?(config getDouble "core-pool-size-factor")(factor => _.setCorePoolSizeFromFactor(factor)), + conf_?(config getDouble "max-pool-size-factor" )(factor => _.setMaxPoolSizeFromFactor(factor)), + conf_?(config getInt "executor-bounds" )(bounds => _.setExecutorBounds(bounds)), + conf_?(config getBool "allow-core-timeout" )(allow => _.setAllowCoreThreadTimeout(allow)), + conf_?(config getString "rejection-policy" map { + case "abort" => new AbortPolicy() + case "caller-runs" => new CallerRunsPolicy() + case "discard-oldest" => new DiscardOldestPolicy() + case "discard" => new DiscardPolicy() + case x => throw new IllegalArgumentException("[%s] is not a valid rejectionPolicy!" format x) + })(policy => _.setRejectionPolicy(policy))) + } +} From 70a0602ef06d04550e69105d77568256cd23321f Mon Sep 17 00:00:00 2001 From: Viktor Klang Date: Sat, 5 Mar 2011 14:48:37 +0100 Subject: [PATCH 04/15] Updating the Remote protocol to support control messages --- .../akka/remote/protocol/RemoteProtocol.java | 2596 +++++++++++------ .../src/main/protocol/RemoteProtocol.proto | 20 + 2 files changed, 1724 insertions(+), 892 deletions(-) diff --git a/akka-remote/src/main/java/akka/remote/protocol/RemoteProtocol.java b/akka-remote/src/main/java/akka/remote/protocol/RemoteProtocol.java index 90e141546c..58e8badbfe 100644 --- a/akka-remote/src/main/java/akka/remote/protocol/RemoteProtocol.java +++ b/akka-remote/src/main/java/akka/remote/protocol/RemoteProtocol.java @@ -8,6 +8,71 @@ public final class RemoteProtocol { public static void registerAllExtensions( com.google.protobuf.ExtensionRegistry registry) { } + public enum CommandType + implements com.google.protobuf.ProtocolMessageEnum { + SHUTDOWN(0, 1), + ; + + + public final int getNumber() { return value; } + + public static CommandType valueOf(int value) { + switch (value) { + case 1: return SHUTDOWN; + 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 CommandType findValueByNumber(int number) { + return CommandType.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.protocol.RemoteProtocol.getDescriptor().getEnumTypes().get(0); + } + + private static final CommandType[] VALUES = { + SHUTDOWN, + }; + public static CommandType 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 CommandType(int index, int value) { + this.index = index; + this.value = value; + } + + static { + akka.remote.protocol.RemoteProtocol.getDescriptor(); + } + + // @@protoc_insertion_point(enum_scope:CommandType) + } + public enum ActorType implements com.google.protobuf.ProtocolMessageEnum { SCALA_ACTOR(0, 1), @@ -49,7 +114,7 @@ public final class RemoteProtocol { } public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { - return akka.remote.protocol.RemoteProtocol.getDescriptor().getEnumTypes().get(0); + return akka.remote.protocol.RemoteProtocol.getDescriptor().getEnumTypes().get(1); } private static final ActorType[] VALUES = { @@ -122,7 +187,7 @@ public final class RemoteProtocol { } public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { - return akka.remote.protocol.RemoteProtocol.getDescriptor().getEnumTypes().get(1); + return akka.remote.protocol.RemoteProtocol.getDescriptor().getEnumTypes().get(2); } private static final SerializationSchemeType[] VALUES = { @@ -189,7 +254,7 @@ public final class RemoteProtocol { } public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { - return akka.remote.protocol.RemoteProtocol.getDescriptor().getEnumTypes().get(2); + return akka.remote.protocol.RemoteProtocol.getDescriptor().getEnumTypes().get(3); } private static final LifeCycleType[] VALUES = { @@ -217,6 +282,1538 @@ public final class RemoteProtocol { // @@protoc_insertion_point(enum_scope:LifeCycleType) } + public static final class AkkaRemoteProtocol extends + com.google.protobuf.GeneratedMessage { + // Use AkkaRemoteProtocol.newBuilder() to construct. + private AkkaRemoteProtocol() { + initFields(); + } + 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.protocol.RemoteProtocol.internal_static_AkkaRemoteProtocol_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return akka.remote.protocol.RemoteProtocol.internal_static_AkkaRemoteProtocol_fieldAccessorTable; + } + + // optional .RemoteMessageProtocol message = 1; + public static final int MESSAGE_FIELD_NUMBER = 1; + private boolean hasMessage; + private akka.remote.protocol.RemoteProtocol.RemoteMessageProtocol message_; + public boolean hasMessage() { return hasMessage; } + public akka.remote.protocol.RemoteProtocol.RemoteMessageProtocol getMessage() { return message_; } + + // optional .RemoteControlProtocol instruction = 2; + public static final int INSTRUCTION_FIELD_NUMBER = 2; + private boolean hasInstruction; + private akka.remote.protocol.RemoteProtocol.RemoteControlProtocol instruction_; + public boolean hasInstruction() { return hasInstruction; } + public akka.remote.protocol.RemoteProtocol.RemoteControlProtocol getInstruction() { return instruction_; } + + private void initFields() { + message_ = akka.remote.protocol.RemoteProtocol.RemoteMessageProtocol.getDefaultInstance(); + instruction_ = akka.remote.protocol.RemoteProtocol.RemoteControlProtocol.getDefaultInstance(); + } + public final boolean isInitialized() { + if (hasMessage()) { + if (!getMessage().isInitialized()) return false; + } + if (hasInstruction()) { + if (!getInstruction().isInitialized()) return false; + } + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + if (hasMessage()) { + output.writeMessage(1, getMessage()); + } + if (hasInstruction()) { + output.writeMessage(2, getInstruction()); + } + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasMessage()) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getMessage()); + } + if (hasInstruction()) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getInstruction()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + public static akka.remote.protocol.RemoteProtocol.AkkaRemoteProtocol parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return newBuilder().mergeFrom(data).buildParsed(); + } + public static akka.remote.protocol.RemoteProtocol.AkkaRemoteProtocol 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.protocol.RemoteProtocol.AkkaRemoteProtocol parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return newBuilder().mergeFrom(data).buildParsed(); + } + public static akka.remote.protocol.RemoteProtocol.AkkaRemoteProtocol parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return newBuilder().mergeFrom(data, extensionRegistry) + .buildParsed(); + } + public static akka.remote.protocol.RemoteProtocol.AkkaRemoteProtocol parseFrom(java.io.InputStream input) + throws java.io.IOException { + return newBuilder().mergeFrom(input).buildParsed(); + } + public static akka.remote.protocol.RemoteProtocol.AkkaRemoteProtocol parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return newBuilder().mergeFrom(input, extensionRegistry) + .buildParsed(); + } + public static akka.remote.protocol.RemoteProtocol.AkkaRemoteProtocol 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.protocol.RemoteProtocol.AkkaRemoteProtocol 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.protocol.RemoteProtocol.AkkaRemoteProtocol parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return newBuilder().mergeFrom(input).buildParsed(); + } + public static akka.remote.protocol.RemoteProtocol.AkkaRemoteProtocol 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.protocol.RemoteProtocol.AkkaRemoteProtocol prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder { + private akka.remote.protocol.RemoteProtocol.AkkaRemoteProtocol result; + + // Construct using akka.remote.protocol.RemoteProtocol.AkkaRemoteProtocol.newBuilder() + private Builder() {} + + private static Builder create() { + Builder builder = new Builder(); + builder.result = new akka.remote.protocol.RemoteProtocol.AkkaRemoteProtocol(); + return builder; + } + + protected akka.remote.protocol.RemoteProtocol.AkkaRemoteProtocol internalGetResult() { + return result; + } + + public Builder clear() { + if (result == null) { + throw new IllegalStateException( + "Cannot call clear() after build()."); + } + result = new akka.remote.protocol.RemoteProtocol.AkkaRemoteProtocol(); + return this; + } + + public Builder clone() { + return create().mergeFrom(result); + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return akka.remote.protocol.RemoteProtocol.AkkaRemoteProtocol.getDescriptor(); + } + + public akka.remote.protocol.RemoteProtocol.AkkaRemoteProtocol getDefaultInstanceForType() { + return akka.remote.protocol.RemoteProtocol.AkkaRemoteProtocol.getDefaultInstance(); + } + + public boolean isInitialized() { + return result.isInitialized(); + } + public akka.remote.protocol.RemoteProtocol.AkkaRemoteProtocol build() { + if (result != null && !isInitialized()) { + throw newUninitializedMessageException(result); + } + return buildPartial(); + } + + private akka.remote.protocol.RemoteProtocol.AkkaRemoteProtocol buildParsed() + throws com.google.protobuf.InvalidProtocolBufferException { + if (!isInitialized()) { + throw newUninitializedMessageException( + result).asInvalidProtocolBufferException(); + } + return buildPartial(); + } + + public akka.remote.protocol.RemoteProtocol.AkkaRemoteProtocol buildPartial() { + if (result == null) { + throw new IllegalStateException( + "build() has already been called on this Builder."); + } + akka.remote.protocol.RemoteProtocol.AkkaRemoteProtocol returnMe = result; + result = null; + return returnMe; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof akka.remote.protocol.RemoteProtocol.AkkaRemoteProtocol) { + return mergeFrom((akka.remote.protocol.RemoteProtocol.AkkaRemoteProtocol)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(akka.remote.protocol.RemoteProtocol.AkkaRemoteProtocol other) { + if (other == akka.remote.protocol.RemoteProtocol.AkkaRemoteProtocol.getDefaultInstance()) return this; + if (other.hasMessage()) { + mergeMessage(other.getMessage()); + } + if (other.hasInstruction()) { + mergeInstruction(other.getInstruction()); + } + this.mergeUnknownFields(other.getUnknownFields()); + return this; + } + + 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()); + return this; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + this.setUnknownFields(unknownFields.build()); + return this; + } + break; + } + case 10: { + akka.remote.protocol.RemoteProtocol.RemoteMessageProtocol.Builder subBuilder = akka.remote.protocol.RemoteProtocol.RemoteMessageProtocol.newBuilder(); + if (hasMessage()) { + subBuilder.mergeFrom(getMessage()); + } + input.readMessage(subBuilder, extensionRegistry); + setMessage(subBuilder.buildPartial()); + break; + } + case 18: { + akka.remote.protocol.RemoteProtocol.RemoteControlProtocol.Builder subBuilder = akka.remote.protocol.RemoteProtocol.RemoteControlProtocol.newBuilder(); + if (hasInstruction()) { + subBuilder.mergeFrom(getInstruction()); + } + input.readMessage(subBuilder, extensionRegistry); + setInstruction(subBuilder.buildPartial()); + break; + } + } + } + } + + + // optional .RemoteMessageProtocol message = 1; + public boolean hasMessage() { + return result.hasMessage(); + } + public akka.remote.protocol.RemoteProtocol.RemoteMessageProtocol getMessage() { + return result.getMessage(); + } + public Builder setMessage(akka.remote.protocol.RemoteProtocol.RemoteMessageProtocol value) { + if (value == null) { + throw new NullPointerException(); + } + result.hasMessage = true; + result.message_ = value; + return this; + } + public Builder setMessage(akka.remote.protocol.RemoteProtocol.RemoteMessageProtocol.Builder builderForValue) { + result.hasMessage = true; + result.message_ = builderForValue.build(); + return this; + } + public Builder mergeMessage(akka.remote.protocol.RemoteProtocol.RemoteMessageProtocol value) { + if (result.hasMessage() && + result.message_ != akka.remote.protocol.RemoteProtocol.RemoteMessageProtocol.getDefaultInstance()) { + result.message_ = + akka.remote.protocol.RemoteProtocol.RemoteMessageProtocol.newBuilder(result.message_).mergeFrom(value).buildPartial(); + } else { + result.message_ = value; + } + result.hasMessage = true; + return this; + } + public Builder clearMessage() { + result.hasMessage = false; + result.message_ = akka.remote.protocol.RemoteProtocol.RemoteMessageProtocol.getDefaultInstance(); + return this; + } + + // optional .RemoteControlProtocol instruction = 2; + public boolean hasInstruction() { + return result.hasInstruction(); + } + public akka.remote.protocol.RemoteProtocol.RemoteControlProtocol getInstruction() { + return result.getInstruction(); + } + public Builder setInstruction(akka.remote.protocol.RemoteProtocol.RemoteControlProtocol value) { + if (value == null) { + throw new NullPointerException(); + } + result.hasInstruction = true; + result.instruction_ = value; + return this; + } + public Builder setInstruction(akka.remote.protocol.RemoteProtocol.RemoteControlProtocol.Builder builderForValue) { + result.hasInstruction = true; + result.instruction_ = builderForValue.build(); + return this; + } + public Builder mergeInstruction(akka.remote.protocol.RemoteProtocol.RemoteControlProtocol value) { + if (result.hasInstruction() && + result.instruction_ != akka.remote.protocol.RemoteProtocol.RemoteControlProtocol.getDefaultInstance()) { + result.instruction_ = + akka.remote.protocol.RemoteProtocol.RemoteControlProtocol.newBuilder(result.instruction_).mergeFrom(value).buildPartial(); + } else { + result.instruction_ = value; + } + result.hasInstruction = true; + return this; + } + public Builder clearInstruction() { + result.hasInstruction = false; + result.instruction_ = akka.remote.protocol.RemoteProtocol.RemoteControlProtocol.getDefaultInstance(); + return this; + } + + // @@protoc_insertion_point(builder_scope:AkkaRemoteProtocol) + } + + static { + defaultInstance = new AkkaRemoteProtocol(true); + akka.remote.protocol.RemoteProtocol.internalForceInit(); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:AkkaRemoteProtocol) + } + + public static final class RemoteMessageProtocol extends + com.google.protobuf.GeneratedMessage { + // Use RemoteMessageProtocol.newBuilder() to construct. + private RemoteMessageProtocol() { + initFields(); + } + 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.protocol.RemoteProtocol.internal_static_RemoteMessageProtocol_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return akka.remote.protocol.RemoteProtocol.internal_static_RemoteMessageProtocol_fieldAccessorTable; + } + + // required .UuidProtocol uuid = 1; + public static final int UUID_FIELD_NUMBER = 1; + private boolean hasUuid; + private akka.remote.protocol.RemoteProtocol.UuidProtocol uuid_; + public boolean hasUuid() { return hasUuid; } + public akka.remote.protocol.RemoteProtocol.UuidProtocol getUuid() { return uuid_; } + + // required .ActorInfoProtocol actorInfo = 2; + public static final int ACTORINFO_FIELD_NUMBER = 2; + private boolean hasActorInfo; + private akka.remote.protocol.RemoteProtocol.ActorInfoProtocol actorInfo_; + public boolean hasActorInfo() { return hasActorInfo; } + public akka.remote.protocol.RemoteProtocol.ActorInfoProtocol getActorInfo() { return actorInfo_; } + + // required bool oneWay = 3; + public static final int ONEWAY_FIELD_NUMBER = 3; + private boolean hasOneWay; + private boolean oneWay_ = false; + public boolean hasOneWay() { return hasOneWay; } + public boolean getOneWay() { return oneWay_; } + + // optional .MessageProtocol message = 4; + public static final int MESSAGE_FIELD_NUMBER = 4; + private boolean hasMessage; + private akka.remote.protocol.RemoteProtocol.MessageProtocol message_; + public boolean hasMessage() { return hasMessage; } + public akka.remote.protocol.RemoteProtocol.MessageProtocol getMessage() { return message_; } + + // optional .ExceptionProtocol exception = 5; + public static final int EXCEPTION_FIELD_NUMBER = 5; + private boolean hasException; + private akka.remote.protocol.RemoteProtocol.ExceptionProtocol exception_; + public boolean hasException() { return hasException; } + public akka.remote.protocol.RemoteProtocol.ExceptionProtocol getException() { return exception_; } + + // optional .UuidProtocol supervisorUuid = 6; + public static final int SUPERVISORUUID_FIELD_NUMBER = 6; + private boolean hasSupervisorUuid; + private akka.remote.protocol.RemoteProtocol.UuidProtocol supervisorUuid_; + public boolean hasSupervisorUuid() { return hasSupervisorUuid; } + public akka.remote.protocol.RemoteProtocol.UuidProtocol getSupervisorUuid() { return supervisorUuid_; } + + // optional .RemoteActorRefProtocol sender = 7; + public static final int SENDER_FIELD_NUMBER = 7; + private boolean hasSender; + private akka.remote.protocol.RemoteProtocol.RemoteActorRefProtocol sender_; + public boolean hasSender() { return hasSender; } + public akka.remote.protocol.RemoteProtocol.RemoteActorRefProtocol getSender() { return sender_; } + + // repeated .MetadataEntryProtocol metadata = 8; + public static final int METADATA_FIELD_NUMBER = 8; + private java.util.List metadata_ = + java.util.Collections.emptyList(); + public java.util.List getMetadataList() { + return metadata_; + } + public int getMetadataCount() { return metadata_.size(); } + public akka.remote.protocol.RemoteProtocol.MetadataEntryProtocol getMetadata(int index) { + return metadata_.get(index); + } + + // optional string cookie = 9; + public static final int COOKIE_FIELD_NUMBER = 9; + private boolean hasCookie; + private java.lang.String cookie_ = ""; + public boolean hasCookie() { return hasCookie; } + public java.lang.String getCookie() { return cookie_; } + + private void initFields() { + uuid_ = akka.remote.protocol.RemoteProtocol.UuidProtocol.getDefaultInstance(); + actorInfo_ = akka.remote.protocol.RemoteProtocol.ActorInfoProtocol.getDefaultInstance(); + message_ = akka.remote.protocol.RemoteProtocol.MessageProtocol.getDefaultInstance(); + exception_ = akka.remote.protocol.RemoteProtocol.ExceptionProtocol.getDefaultInstance(); + supervisorUuid_ = akka.remote.protocol.RemoteProtocol.UuidProtocol.getDefaultInstance(); + sender_ = akka.remote.protocol.RemoteProtocol.RemoteActorRefProtocol.getDefaultInstance(); + } + 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 (akka.remote.protocol.RemoteProtocol.MetadataEntryProtocol element : getMetadataList()) { + if (!element.isInitialized()) return false; + } + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + if (hasUuid()) { + output.writeMessage(1, getUuid()); + } + if (hasActorInfo()) { + output.writeMessage(2, getActorInfo()); + } + if (hasOneWay()) { + output.writeBool(3, getOneWay()); + } + if (hasMessage()) { + output.writeMessage(4, getMessage()); + } + if (hasException()) { + output.writeMessage(5, getException()); + } + if (hasSupervisorUuid()) { + output.writeMessage(6, getSupervisorUuid()); + } + if (hasSender()) { + output.writeMessage(7, getSender()); + } + for (akka.remote.protocol.RemoteProtocol.MetadataEntryProtocol element : getMetadataList()) { + output.writeMessage(8, element); + } + if (hasCookie()) { + output.writeString(9, getCookie()); + } + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasUuid()) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getUuid()); + } + if (hasActorInfo()) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getActorInfo()); + } + if (hasOneWay()) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(3, getOneWay()); + } + if (hasMessage()) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, getMessage()); + } + if (hasException()) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, getException()); + } + if (hasSupervisorUuid()) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, getSupervisorUuid()); + } + if (hasSender()) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(7, getSender()); + } + for (akka.remote.protocol.RemoteProtocol.MetadataEntryProtocol element : getMetadataList()) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(8, element); + } + if (hasCookie()) { + size += com.google.protobuf.CodedOutputStream + .computeStringSize(9, getCookie()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + public static akka.remote.protocol.RemoteProtocol.RemoteMessageProtocol parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return newBuilder().mergeFrom(data).buildParsed(); + } + public static akka.remote.protocol.RemoteProtocol.RemoteMessageProtocol 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.protocol.RemoteProtocol.RemoteMessageProtocol parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return newBuilder().mergeFrom(data).buildParsed(); + } + public static akka.remote.protocol.RemoteProtocol.RemoteMessageProtocol parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return newBuilder().mergeFrom(data, extensionRegistry) + .buildParsed(); + } + public static akka.remote.protocol.RemoteProtocol.RemoteMessageProtocol parseFrom(java.io.InputStream input) + throws java.io.IOException { + return newBuilder().mergeFrom(input).buildParsed(); + } + public static akka.remote.protocol.RemoteProtocol.RemoteMessageProtocol parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return newBuilder().mergeFrom(input, extensionRegistry) + .buildParsed(); + } + public static akka.remote.protocol.RemoteProtocol.RemoteMessageProtocol 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.protocol.RemoteProtocol.RemoteMessageProtocol 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.protocol.RemoteProtocol.RemoteMessageProtocol parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return newBuilder().mergeFrom(input).buildParsed(); + } + public static akka.remote.protocol.RemoteProtocol.RemoteMessageProtocol 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.protocol.RemoteProtocol.RemoteMessageProtocol prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder { + private akka.remote.protocol.RemoteProtocol.RemoteMessageProtocol result; + + // Construct using akka.remote.protocol.RemoteProtocol.RemoteMessageProtocol.newBuilder() + private Builder() {} + + private static Builder create() { + Builder builder = new Builder(); + builder.result = new akka.remote.protocol.RemoteProtocol.RemoteMessageProtocol(); + return builder; + } + + protected akka.remote.protocol.RemoteProtocol.RemoteMessageProtocol internalGetResult() { + return result; + } + + public Builder clear() { + if (result == null) { + throw new IllegalStateException( + "Cannot call clear() after build()."); + } + result = new akka.remote.protocol.RemoteProtocol.RemoteMessageProtocol(); + return this; + } + + public Builder clone() { + return create().mergeFrom(result); + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return akka.remote.protocol.RemoteProtocol.RemoteMessageProtocol.getDescriptor(); + } + + public akka.remote.protocol.RemoteProtocol.RemoteMessageProtocol getDefaultInstanceForType() { + return akka.remote.protocol.RemoteProtocol.RemoteMessageProtocol.getDefaultInstance(); + } + + public boolean isInitialized() { + return result.isInitialized(); + } + public akka.remote.protocol.RemoteProtocol.RemoteMessageProtocol build() { + if (result != null && !isInitialized()) { + throw newUninitializedMessageException(result); + } + return buildPartial(); + } + + private akka.remote.protocol.RemoteProtocol.RemoteMessageProtocol buildParsed() + throws com.google.protobuf.InvalidProtocolBufferException { + if (!isInitialized()) { + throw newUninitializedMessageException( + result).asInvalidProtocolBufferException(); + } + return buildPartial(); + } + + public akka.remote.protocol.RemoteProtocol.RemoteMessageProtocol buildPartial() { + if (result == null) { + throw new IllegalStateException( + "build() has already been called on this Builder."); + } + if (result.metadata_ != java.util.Collections.EMPTY_LIST) { + result.metadata_ = + java.util.Collections.unmodifiableList(result.metadata_); + } + akka.remote.protocol.RemoteProtocol.RemoteMessageProtocol returnMe = result; + result = null; + return returnMe; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof akka.remote.protocol.RemoteProtocol.RemoteMessageProtocol) { + return mergeFrom((akka.remote.protocol.RemoteProtocol.RemoteMessageProtocol)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(akka.remote.protocol.RemoteProtocol.RemoteMessageProtocol other) { + if (other == akka.remote.protocol.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.hasMessage()) { + mergeMessage(other.getMessage()); + } + if (other.hasException()) { + mergeException(other.getException()); + } + if (other.hasSupervisorUuid()) { + mergeSupervisorUuid(other.getSupervisorUuid()); + } + if (other.hasSender()) { + mergeSender(other.getSender()); + } + if (!other.metadata_.isEmpty()) { + if (result.metadata_.isEmpty()) { + result.metadata_ = new java.util.ArrayList(); + } + result.metadata_.addAll(other.metadata_); + } + if (other.hasCookie()) { + setCookie(other.getCookie()); + } + this.mergeUnknownFields(other.getUnknownFields()); + return this; + } + + 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()); + return this; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + this.setUnknownFields(unknownFields.build()); + return this; + } + break; + } + case 10: { + akka.remote.protocol.RemoteProtocol.UuidProtocol.Builder subBuilder = akka.remote.protocol.RemoteProtocol.UuidProtocol.newBuilder(); + if (hasUuid()) { + subBuilder.mergeFrom(getUuid()); + } + input.readMessage(subBuilder, extensionRegistry); + setUuid(subBuilder.buildPartial()); + break; + } + case 18: { + akka.remote.protocol.RemoteProtocol.ActorInfoProtocol.Builder subBuilder = akka.remote.protocol.RemoteProtocol.ActorInfoProtocol.newBuilder(); + if (hasActorInfo()) { + subBuilder.mergeFrom(getActorInfo()); + } + input.readMessage(subBuilder, extensionRegistry); + setActorInfo(subBuilder.buildPartial()); + break; + } + case 24: { + setOneWay(input.readBool()); + break; + } + case 34: { + akka.remote.protocol.RemoteProtocol.MessageProtocol.Builder subBuilder = akka.remote.protocol.RemoteProtocol.MessageProtocol.newBuilder(); + if (hasMessage()) { + subBuilder.mergeFrom(getMessage()); + } + input.readMessage(subBuilder, extensionRegistry); + setMessage(subBuilder.buildPartial()); + break; + } + case 42: { + akka.remote.protocol.RemoteProtocol.ExceptionProtocol.Builder subBuilder = akka.remote.protocol.RemoteProtocol.ExceptionProtocol.newBuilder(); + if (hasException()) { + subBuilder.mergeFrom(getException()); + } + input.readMessage(subBuilder, extensionRegistry); + setException(subBuilder.buildPartial()); + break; + } + case 50: { + akka.remote.protocol.RemoteProtocol.UuidProtocol.Builder subBuilder = akka.remote.protocol.RemoteProtocol.UuidProtocol.newBuilder(); + if (hasSupervisorUuid()) { + subBuilder.mergeFrom(getSupervisorUuid()); + } + input.readMessage(subBuilder, extensionRegistry); + setSupervisorUuid(subBuilder.buildPartial()); + break; + } + case 58: { + akka.remote.protocol.RemoteProtocol.RemoteActorRefProtocol.Builder subBuilder = akka.remote.protocol.RemoteProtocol.RemoteActorRefProtocol.newBuilder(); + if (hasSender()) { + subBuilder.mergeFrom(getSender()); + } + input.readMessage(subBuilder, extensionRegistry); + setSender(subBuilder.buildPartial()); + break; + } + case 66: { + akka.remote.protocol.RemoteProtocol.MetadataEntryProtocol.Builder subBuilder = akka.remote.protocol.RemoteProtocol.MetadataEntryProtocol.newBuilder(); + input.readMessage(subBuilder, extensionRegistry); + addMetadata(subBuilder.buildPartial()); + break; + } + case 74: { + setCookie(input.readString()); + break; + } + } + } + } + + + // required .UuidProtocol uuid = 1; + public boolean hasUuid() { + return result.hasUuid(); + } + public akka.remote.protocol.RemoteProtocol.UuidProtocol getUuid() { + return result.getUuid(); + } + public Builder setUuid(akka.remote.protocol.RemoteProtocol.UuidProtocol value) { + if (value == null) { + throw new NullPointerException(); + } + result.hasUuid = true; + result.uuid_ = value; + return this; + } + public Builder setUuid(akka.remote.protocol.RemoteProtocol.UuidProtocol.Builder builderForValue) { + result.hasUuid = true; + result.uuid_ = builderForValue.build(); + return this; + } + public Builder mergeUuid(akka.remote.protocol.RemoteProtocol.UuidProtocol value) { + if (result.hasUuid() && + result.uuid_ != akka.remote.protocol.RemoteProtocol.UuidProtocol.getDefaultInstance()) { + result.uuid_ = + akka.remote.protocol.RemoteProtocol.UuidProtocol.newBuilder(result.uuid_).mergeFrom(value).buildPartial(); + } else { + result.uuid_ = value; + } + result.hasUuid = true; + return this; + } + public Builder clearUuid() { + result.hasUuid = false; + result.uuid_ = akka.remote.protocol.RemoteProtocol.UuidProtocol.getDefaultInstance(); + return this; + } + + // required .ActorInfoProtocol actorInfo = 2; + public boolean hasActorInfo() { + return result.hasActorInfo(); + } + public akka.remote.protocol.RemoteProtocol.ActorInfoProtocol getActorInfo() { + return result.getActorInfo(); + } + public Builder setActorInfo(akka.remote.protocol.RemoteProtocol.ActorInfoProtocol value) { + if (value == null) { + throw new NullPointerException(); + } + result.hasActorInfo = true; + result.actorInfo_ = value; + return this; + } + public Builder setActorInfo(akka.remote.protocol.RemoteProtocol.ActorInfoProtocol.Builder builderForValue) { + result.hasActorInfo = true; + result.actorInfo_ = builderForValue.build(); + return this; + } + public Builder mergeActorInfo(akka.remote.protocol.RemoteProtocol.ActorInfoProtocol value) { + if (result.hasActorInfo() && + result.actorInfo_ != akka.remote.protocol.RemoteProtocol.ActorInfoProtocol.getDefaultInstance()) { + result.actorInfo_ = + akka.remote.protocol.RemoteProtocol.ActorInfoProtocol.newBuilder(result.actorInfo_).mergeFrom(value).buildPartial(); + } else { + result.actorInfo_ = value; + } + result.hasActorInfo = true; + return this; + } + public Builder clearActorInfo() { + result.hasActorInfo = false; + result.actorInfo_ = akka.remote.protocol.RemoteProtocol.ActorInfoProtocol.getDefaultInstance(); + return this; + } + + // required bool oneWay = 3; + public boolean hasOneWay() { + return result.hasOneWay(); + } + public boolean getOneWay() { + return result.getOneWay(); + } + public Builder setOneWay(boolean value) { + result.hasOneWay = true; + result.oneWay_ = value; + return this; + } + public Builder clearOneWay() { + result.hasOneWay = false; + result.oneWay_ = false; + return this; + } + + // optional .MessageProtocol message = 4; + public boolean hasMessage() { + return result.hasMessage(); + } + public akka.remote.protocol.RemoteProtocol.MessageProtocol getMessage() { + return result.getMessage(); + } + public Builder setMessage(akka.remote.protocol.RemoteProtocol.MessageProtocol value) { + if (value == null) { + throw new NullPointerException(); + } + result.hasMessage = true; + result.message_ = value; + return this; + } + public Builder setMessage(akka.remote.protocol.RemoteProtocol.MessageProtocol.Builder builderForValue) { + result.hasMessage = true; + result.message_ = builderForValue.build(); + return this; + } + public Builder mergeMessage(akka.remote.protocol.RemoteProtocol.MessageProtocol value) { + if (result.hasMessage() && + result.message_ != akka.remote.protocol.RemoteProtocol.MessageProtocol.getDefaultInstance()) { + result.message_ = + akka.remote.protocol.RemoteProtocol.MessageProtocol.newBuilder(result.message_).mergeFrom(value).buildPartial(); + } else { + result.message_ = value; + } + result.hasMessage = true; + return this; + } + public Builder clearMessage() { + result.hasMessage = false; + result.message_ = akka.remote.protocol.RemoteProtocol.MessageProtocol.getDefaultInstance(); + return this; + } + + // optional .ExceptionProtocol exception = 5; + public boolean hasException() { + return result.hasException(); + } + public akka.remote.protocol.RemoteProtocol.ExceptionProtocol getException() { + return result.getException(); + } + public Builder setException(akka.remote.protocol.RemoteProtocol.ExceptionProtocol value) { + if (value == null) { + throw new NullPointerException(); + } + result.hasException = true; + result.exception_ = value; + return this; + } + public Builder setException(akka.remote.protocol.RemoteProtocol.ExceptionProtocol.Builder builderForValue) { + result.hasException = true; + result.exception_ = builderForValue.build(); + return this; + } + public Builder mergeException(akka.remote.protocol.RemoteProtocol.ExceptionProtocol value) { + if (result.hasException() && + result.exception_ != akka.remote.protocol.RemoteProtocol.ExceptionProtocol.getDefaultInstance()) { + result.exception_ = + akka.remote.protocol.RemoteProtocol.ExceptionProtocol.newBuilder(result.exception_).mergeFrom(value).buildPartial(); + } else { + result.exception_ = value; + } + result.hasException = true; + return this; + } + public Builder clearException() { + result.hasException = false; + result.exception_ = akka.remote.protocol.RemoteProtocol.ExceptionProtocol.getDefaultInstance(); + return this; + } + + // optional .UuidProtocol supervisorUuid = 6; + public boolean hasSupervisorUuid() { + return result.hasSupervisorUuid(); + } + public akka.remote.protocol.RemoteProtocol.UuidProtocol getSupervisorUuid() { + return result.getSupervisorUuid(); + } + public Builder setSupervisorUuid(akka.remote.protocol.RemoteProtocol.UuidProtocol value) { + if (value == null) { + throw new NullPointerException(); + } + result.hasSupervisorUuid = true; + result.supervisorUuid_ = value; + return this; + } + public Builder setSupervisorUuid(akka.remote.protocol.RemoteProtocol.UuidProtocol.Builder builderForValue) { + result.hasSupervisorUuid = true; + result.supervisorUuid_ = builderForValue.build(); + return this; + } + public Builder mergeSupervisorUuid(akka.remote.protocol.RemoteProtocol.UuidProtocol value) { + if (result.hasSupervisorUuid() && + result.supervisorUuid_ != akka.remote.protocol.RemoteProtocol.UuidProtocol.getDefaultInstance()) { + result.supervisorUuid_ = + akka.remote.protocol.RemoteProtocol.UuidProtocol.newBuilder(result.supervisorUuid_).mergeFrom(value).buildPartial(); + } else { + result.supervisorUuid_ = value; + } + result.hasSupervisorUuid = true; + return this; + } + public Builder clearSupervisorUuid() { + result.hasSupervisorUuid = false; + result.supervisorUuid_ = akka.remote.protocol.RemoteProtocol.UuidProtocol.getDefaultInstance(); + return this; + } + + // optional .RemoteActorRefProtocol sender = 7; + public boolean hasSender() { + return result.hasSender(); + } + public akka.remote.protocol.RemoteProtocol.RemoteActorRefProtocol getSender() { + return result.getSender(); + } + public Builder setSender(akka.remote.protocol.RemoteProtocol.RemoteActorRefProtocol value) { + if (value == null) { + throw new NullPointerException(); + } + result.hasSender = true; + result.sender_ = value; + return this; + } + public Builder setSender(akka.remote.protocol.RemoteProtocol.RemoteActorRefProtocol.Builder builderForValue) { + result.hasSender = true; + result.sender_ = builderForValue.build(); + return this; + } + public Builder mergeSender(akka.remote.protocol.RemoteProtocol.RemoteActorRefProtocol value) { + if (result.hasSender() && + result.sender_ != akka.remote.protocol.RemoteProtocol.RemoteActorRefProtocol.getDefaultInstance()) { + result.sender_ = + akka.remote.protocol.RemoteProtocol.RemoteActorRefProtocol.newBuilder(result.sender_).mergeFrom(value).buildPartial(); + } else { + result.sender_ = value; + } + result.hasSender = true; + return this; + } + public Builder clearSender() { + result.hasSender = false; + result.sender_ = akka.remote.protocol.RemoteProtocol.RemoteActorRefProtocol.getDefaultInstance(); + return this; + } + + // repeated .MetadataEntryProtocol metadata = 8; + public java.util.List getMetadataList() { + return java.util.Collections.unmodifiableList(result.metadata_); + } + public int getMetadataCount() { + return result.getMetadataCount(); + } + public akka.remote.protocol.RemoteProtocol.MetadataEntryProtocol getMetadata(int index) { + return result.getMetadata(index); + } + public Builder setMetadata(int index, akka.remote.protocol.RemoteProtocol.MetadataEntryProtocol value) { + if (value == null) { + throw new NullPointerException(); + } + result.metadata_.set(index, value); + return this; + } + public Builder setMetadata(int index, akka.remote.protocol.RemoteProtocol.MetadataEntryProtocol.Builder builderForValue) { + result.metadata_.set(index, builderForValue.build()); + return this; + } + public Builder addMetadata(akka.remote.protocol.RemoteProtocol.MetadataEntryProtocol value) { + if (value == null) { + throw new NullPointerException(); + } + if (result.metadata_.isEmpty()) { + result.metadata_ = new java.util.ArrayList(); + } + result.metadata_.add(value); + return this; + } + public Builder addMetadata(akka.remote.protocol.RemoteProtocol.MetadataEntryProtocol.Builder builderForValue) { + if (result.metadata_.isEmpty()) { + result.metadata_ = new java.util.ArrayList(); + } + result.metadata_.add(builderForValue.build()); + return this; + } + public Builder addAllMetadata( + java.lang.Iterable values) { + if (result.metadata_.isEmpty()) { + result.metadata_ = new java.util.ArrayList(); + } + super.addAll(values, result.metadata_); + return this; + } + public Builder clearMetadata() { + result.metadata_ = java.util.Collections.emptyList(); + return this; + } + + // optional string cookie = 9; + public boolean hasCookie() { + return result.hasCookie(); + } + public java.lang.String getCookie() { + return result.getCookie(); + } + public Builder setCookie(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + result.hasCookie = true; + result.cookie_ = value; + return this; + } + public Builder clearCookie() { + result.hasCookie = false; + result.cookie_ = getDefaultInstance().getCookie(); + return this; + } + + // @@protoc_insertion_point(builder_scope:RemoteMessageProtocol) + } + + static { + defaultInstance = new RemoteMessageProtocol(true); + akka.remote.protocol.RemoteProtocol.internalForceInit(); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:RemoteMessageProtocol) + } + + public static final class RemoteControlProtocol extends + com.google.protobuf.GeneratedMessage { + // Use RemoteControlProtocol.newBuilder() to construct. + private RemoteControlProtocol() { + initFields(); + } + 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.protocol.RemoteProtocol.internal_static_RemoteControlProtocol_descriptor; + } + + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return akka.remote.protocol.RemoteProtocol.internal_static_RemoteControlProtocol_fieldAccessorTable; + } + + // optional string cookie = 1; + public static final int COOKIE_FIELD_NUMBER = 1; + private boolean hasCookie; + private java.lang.String cookie_ = ""; + public boolean hasCookie() { return hasCookie; } + public java.lang.String getCookie() { return cookie_; } + + // required .CommandType commandType = 2; + public static final int COMMANDTYPE_FIELD_NUMBER = 2; + private boolean hasCommandType; + private akka.remote.protocol.RemoteProtocol.CommandType commandType_; + public boolean hasCommandType() { return hasCommandType; } + public akka.remote.protocol.RemoteProtocol.CommandType getCommandType() { return commandType_; } + + private void initFields() { + commandType_ = akka.remote.protocol.RemoteProtocol.CommandType.SHUTDOWN; + } + public final boolean isInitialized() { + if (!hasCommandType) return false; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + if (hasCookie()) { + output.writeString(1, getCookie()); + } + if (hasCommandType()) { + output.writeEnum(2, getCommandType().getNumber()); + } + getUnknownFields().writeTo(output); + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasCookie()) { + size += com.google.protobuf.CodedOutputStream + .computeStringSize(1, getCookie()); + } + if (hasCommandType()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(2, getCommandType().getNumber()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSerializedSize = size; + return size; + } + + public static akka.remote.protocol.RemoteProtocol.RemoteControlProtocol parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return newBuilder().mergeFrom(data).buildParsed(); + } + public static akka.remote.protocol.RemoteProtocol.RemoteControlProtocol 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.protocol.RemoteProtocol.RemoteControlProtocol parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return newBuilder().mergeFrom(data).buildParsed(); + } + public static akka.remote.protocol.RemoteProtocol.RemoteControlProtocol parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return newBuilder().mergeFrom(data, extensionRegistry) + .buildParsed(); + } + public static akka.remote.protocol.RemoteProtocol.RemoteControlProtocol parseFrom(java.io.InputStream input) + throws java.io.IOException { + return newBuilder().mergeFrom(input).buildParsed(); + } + public static akka.remote.protocol.RemoteProtocol.RemoteControlProtocol parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return newBuilder().mergeFrom(input, extensionRegistry) + .buildParsed(); + } + public static akka.remote.protocol.RemoteProtocol.RemoteControlProtocol 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.protocol.RemoteProtocol.RemoteControlProtocol 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.protocol.RemoteProtocol.RemoteControlProtocol parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return newBuilder().mergeFrom(input).buildParsed(); + } + public static akka.remote.protocol.RemoteProtocol.RemoteControlProtocol 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.protocol.RemoteProtocol.RemoteControlProtocol prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder { + private akka.remote.protocol.RemoteProtocol.RemoteControlProtocol result; + + // Construct using akka.remote.protocol.RemoteProtocol.RemoteControlProtocol.newBuilder() + private Builder() {} + + private static Builder create() { + Builder builder = new Builder(); + builder.result = new akka.remote.protocol.RemoteProtocol.RemoteControlProtocol(); + return builder; + } + + protected akka.remote.protocol.RemoteProtocol.RemoteControlProtocol internalGetResult() { + return result; + } + + public Builder clear() { + if (result == null) { + throw new IllegalStateException( + "Cannot call clear() after build()."); + } + result = new akka.remote.protocol.RemoteProtocol.RemoteControlProtocol(); + return this; + } + + public Builder clone() { + return create().mergeFrom(result); + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return akka.remote.protocol.RemoteProtocol.RemoteControlProtocol.getDescriptor(); + } + + public akka.remote.protocol.RemoteProtocol.RemoteControlProtocol getDefaultInstanceForType() { + return akka.remote.protocol.RemoteProtocol.RemoteControlProtocol.getDefaultInstance(); + } + + public boolean isInitialized() { + return result.isInitialized(); + } + public akka.remote.protocol.RemoteProtocol.RemoteControlProtocol build() { + if (result != null && !isInitialized()) { + throw newUninitializedMessageException(result); + } + return buildPartial(); + } + + private akka.remote.protocol.RemoteProtocol.RemoteControlProtocol buildParsed() + throws com.google.protobuf.InvalidProtocolBufferException { + if (!isInitialized()) { + throw newUninitializedMessageException( + result).asInvalidProtocolBufferException(); + } + return buildPartial(); + } + + public akka.remote.protocol.RemoteProtocol.RemoteControlProtocol buildPartial() { + if (result == null) { + throw new IllegalStateException( + "build() has already been called on this Builder."); + } + akka.remote.protocol.RemoteProtocol.RemoteControlProtocol returnMe = result; + result = null; + return returnMe; + } + + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof akka.remote.protocol.RemoteProtocol.RemoteControlProtocol) { + return mergeFrom((akka.remote.protocol.RemoteProtocol.RemoteControlProtocol)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(akka.remote.protocol.RemoteProtocol.RemoteControlProtocol other) { + if (other == akka.remote.protocol.RemoteProtocol.RemoteControlProtocol.getDefaultInstance()) return this; + if (other.hasCookie()) { + setCookie(other.getCookie()); + } + if (other.hasCommandType()) { + setCommandType(other.getCommandType()); + } + this.mergeUnknownFields(other.getUnknownFields()); + return this; + } + + 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()); + return this; + default: { + if (!parseUnknownField(input, unknownFields, + extensionRegistry, tag)) { + this.setUnknownFields(unknownFields.build()); + return this; + } + break; + } + case 10: { + setCookie(input.readString()); + break; + } + case 16: { + int rawValue = input.readEnum(); + akka.remote.protocol.RemoteProtocol.CommandType value = akka.remote.protocol.RemoteProtocol.CommandType.valueOf(rawValue); + if (value == null) { + unknownFields.mergeVarintField(2, rawValue); + } else { + setCommandType(value); + } + break; + } + } + } + } + + + // optional string cookie = 1; + public boolean hasCookie() { + return result.hasCookie(); + } + public java.lang.String getCookie() { + return result.getCookie(); + } + public Builder setCookie(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + result.hasCookie = true; + result.cookie_ = value; + return this; + } + public Builder clearCookie() { + result.hasCookie = false; + result.cookie_ = getDefaultInstance().getCookie(); + return this; + } + + // required .CommandType commandType = 2; + public boolean hasCommandType() { + return result.hasCommandType(); + } + public akka.remote.protocol.RemoteProtocol.CommandType getCommandType() { + return result.getCommandType(); + } + public Builder setCommandType(akka.remote.protocol.RemoteProtocol.CommandType value) { + if (value == null) { + throw new NullPointerException(); + } + result.hasCommandType = true; + result.commandType_ = value; + return this; + } + public Builder clearCommandType() { + result.hasCommandType = false; + result.commandType_ = akka.remote.protocol.RemoteProtocol.CommandType.SHUTDOWN; + return this; + } + + // @@protoc_insertion_point(builder_scope:RemoteControlProtocol) + } + + static { + defaultInstance = new RemoteControlProtocol(true); + akka.remote.protocol.RemoteProtocol.internalForceInit(); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:RemoteControlProtocol) + } + public static final class RemoteActorRefProtocol extends com.google.protobuf.GeneratedMessage { // Use RemoteActorRefProtocol.newBuilder() to construct. @@ -3515,822 +5112,6 @@ public final class RemoteProtocol { // @@protoc_insertion_point(class_scope:TypedActorInfoProtocol) } - public static final class RemoteMessageProtocol extends - com.google.protobuf.GeneratedMessage { - // Use RemoteMessageProtocol.newBuilder() to construct. - private RemoteMessageProtocol() { - initFields(); - } - 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.protocol.RemoteProtocol.internal_static_RemoteMessageProtocol_descriptor; - } - - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable - internalGetFieldAccessorTable() { - return akka.remote.protocol.RemoteProtocol.internal_static_RemoteMessageProtocol_fieldAccessorTable; - } - - // required .UuidProtocol uuid = 1; - public static final int UUID_FIELD_NUMBER = 1; - private boolean hasUuid; - private akka.remote.protocol.RemoteProtocol.UuidProtocol uuid_; - public boolean hasUuid() { return hasUuid; } - public akka.remote.protocol.RemoteProtocol.UuidProtocol getUuid() { return uuid_; } - - // required .ActorInfoProtocol actorInfo = 2; - public static final int ACTORINFO_FIELD_NUMBER = 2; - private boolean hasActorInfo; - private akka.remote.protocol.RemoteProtocol.ActorInfoProtocol actorInfo_; - public boolean hasActorInfo() { return hasActorInfo; } - public akka.remote.protocol.RemoteProtocol.ActorInfoProtocol getActorInfo() { return actorInfo_; } - - // required bool oneWay = 3; - public static final int ONEWAY_FIELD_NUMBER = 3; - private boolean hasOneWay; - private boolean oneWay_ = false; - public boolean hasOneWay() { return hasOneWay; } - public boolean getOneWay() { return oneWay_; } - - // optional .MessageProtocol message = 4; - public static final int MESSAGE_FIELD_NUMBER = 4; - private boolean hasMessage; - private akka.remote.protocol.RemoteProtocol.MessageProtocol message_; - public boolean hasMessage() { return hasMessage; } - public akka.remote.protocol.RemoteProtocol.MessageProtocol getMessage() { return message_; } - - // optional .ExceptionProtocol exception = 5; - public static final int EXCEPTION_FIELD_NUMBER = 5; - private boolean hasException; - private akka.remote.protocol.RemoteProtocol.ExceptionProtocol exception_; - public boolean hasException() { return hasException; } - public akka.remote.protocol.RemoteProtocol.ExceptionProtocol getException() { return exception_; } - - // optional .UuidProtocol supervisorUuid = 6; - public static final int SUPERVISORUUID_FIELD_NUMBER = 6; - private boolean hasSupervisorUuid; - private akka.remote.protocol.RemoteProtocol.UuidProtocol supervisorUuid_; - public boolean hasSupervisorUuid() { return hasSupervisorUuid; } - public akka.remote.protocol.RemoteProtocol.UuidProtocol getSupervisorUuid() { return supervisorUuid_; } - - // optional .RemoteActorRefProtocol sender = 7; - public static final int SENDER_FIELD_NUMBER = 7; - private boolean hasSender; - private akka.remote.protocol.RemoteProtocol.RemoteActorRefProtocol sender_; - public boolean hasSender() { return hasSender; } - public akka.remote.protocol.RemoteProtocol.RemoteActorRefProtocol getSender() { return sender_; } - - // repeated .MetadataEntryProtocol metadata = 8; - public static final int METADATA_FIELD_NUMBER = 8; - private java.util.List metadata_ = - java.util.Collections.emptyList(); - public java.util.List getMetadataList() { - return metadata_; - } - public int getMetadataCount() { return metadata_.size(); } - public akka.remote.protocol.RemoteProtocol.MetadataEntryProtocol getMetadata(int index) { - return metadata_.get(index); - } - - // optional string cookie = 9; - public static final int COOKIE_FIELD_NUMBER = 9; - private boolean hasCookie; - private java.lang.String cookie_ = ""; - public boolean hasCookie() { return hasCookie; } - public java.lang.String getCookie() { return cookie_; } - - private void initFields() { - uuid_ = akka.remote.protocol.RemoteProtocol.UuidProtocol.getDefaultInstance(); - actorInfo_ = akka.remote.protocol.RemoteProtocol.ActorInfoProtocol.getDefaultInstance(); - message_ = akka.remote.protocol.RemoteProtocol.MessageProtocol.getDefaultInstance(); - exception_ = akka.remote.protocol.RemoteProtocol.ExceptionProtocol.getDefaultInstance(); - supervisorUuid_ = akka.remote.protocol.RemoteProtocol.UuidProtocol.getDefaultInstance(); - sender_ = akka.remote.protocol.RemoteProtocol.RemoteActorRefProtocol.getDefaultInstance(); - } - 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 (akka.remote.protocol.RemoteProtocol.MetadataEntryProtocol element : getMetadataList()) { - if (!element.isInitialized()) return false; - } - return true; - } - - public void writeTo(com.google.protobuf.CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - if (hasUuid()) { - output.writeMessage(1, getUuid()); - } - if (hasActorInfo()) { - output.writeMessage(2, getActorInfo()); - } - if (hasOneWay()) { - output.writeBool(3, getOneWay()); - } - if (hasMessage()) { - output.writeMessage(4, getMessage()); - } - if (hasException()) { - output.writeMessage(5, getException()); - } - if (hasSupervisorUuid()) { - output.writeMessage(6, getSupervisorUuid()); - } - if (hasSender()) { - output.writeMessage(7, getSender()); - } - for (akka.remote.protocol.RemoteProtocol.MetadataEntryProtocol element : getMetadataList()) { - output.writeMessage(8, element); - } - if (hasCookie()) { - output.writeString(9, getCookie()); - } - getUnknownFields().writeTo(output); - } - - private int memoizedSerializedSize = -1; - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - if (hasUuid()) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(1, getUuid()); - } - if (hasActorInfo()) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(2, getActorInfo()); - } - if (hasOneWay()) { - size += com.google.protobuf.CodedOutputStream - .computeBoolSize(3, getOneWay()); - } - if (hasMessage()) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(4, getMessage()); - } - if (hasException()) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(5, getException()); - } - if (hasSupervisorUuid()) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(6, getSupervisorUuid()); - } - if (hasSender()) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(7, getSender()); - } - for (akka.remote.protocol.RemoteProtocol.MetadataEntryProtocol element : getMetadataList()) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(8, element); - } - if (hasCookie()) { - size += com.google.protobuf.CodedOutputStream - .computeStringSize(9, getCookie()); - } - size += getUnknownFields().getSerializedSize(); - memoizedSerializedSize = size; - return size; - } - - public static akka.remote.protocol.RemoteProtocol.RemoteMessageProtocol parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); - } - public static akka.remote.protocol.RemoteProtocol.RemoteMessageProtocol 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.protocol.RemoteProtocol.RemoteMessageProtocol parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data).buildParsed(); - } - public static akka.remote.protocol.RemoteProtocol.RemoteMessageProtocol parseFrom( - byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return newBuilder().mergeFrom(data, extensionRegistry) - .buildParsed(); - } - public static akka.remote.protocol.RemoteProtocol.RemoteMessageProtocol parseFrom(java.io.InputStream input) - throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); - } - public static akka.remote.protocol.RemoteProtocol.RemoteMessageProtocol parseFrom( - java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return newBuilder().mergeFrom(input, extensionRegistry) - .buildParsed(); - } - public static akka.remote.protocol.RemoteProtocol.RemoteMessageProtocol 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.protocol.RemoteProtocol.RemoteMessageProtocol 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.protocol.RemoteProtocol.RemoteMessageProtocol parseFrom( - com.google.protobuf.CodedInputStream input) - throws java.io.IOException { - return newBuilder().mergeFrom(input).buildParsed(); - } - public static akka.remote.protocol.RemoteProtocol.RemoteMessageProtocol 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.protocol.RemoteProtocol.RemoteMessageProtocol prototype) { - return newBuilder().mergeFrom(prototype); - } - public Builder toBuilder() { return newBuilder(this); } - - public static final class Builder extends - com.google.protobuf.GeneratedMessage.Builder { - private akka.remote.protocol.RemoteProtocol.RemoteMessageProtocol result; - - // Construct using akka.remote.protocol.RemoteProtocol.RemoteMessageProtocol.newBuilder() - private Builder() {} - - private static Builder create() { - Builder builder = new Builder(); - builder.result = new akka.remote.protocol.RemoteProtocol.RemoteMessageProtocol(); - return builder; - } - - protected akka.remote.protocol.RemoteProtocol.RemoteMessageProtocol internalGetResult() { - return result; - } - - public Builder clear() { - if (result == null) { - throw new IllegalStateException( - "Cannot call clear() after build()."); - } - result = new akka.remote.protocol.RemoteProtocol.RemoteMessageProtocol(); - return this; - } - - public Builder clone() { - return create().mergeFrom(result); - } - - public com.google.protobuf.Descriptors.Descriptor - getDescriptorForType() { - return akka.remote.protocol.RemoteProtocol.RemoteMessageProtocol.getDescriptor(); - } - - public akka.remote.protocol.RemoteProtocol.RemoteMessageProtocol getDefaultInstanceForType() { - return akka.remote.protocol.RemoteProtocol.RemoteMessageProtocol.getDefaultInstance(); - } - - public boolean isInitialized() { - return result.isInitialized(); - } - public akka.remote.protocol.RemoteProtocol.RemoteMessageProtocol build() { - if (result != null && !isInitialized()) { - throw newUninitializedMessageException(result); - } - return buildPartial(); - } - - private akka.remote.protocol.RemoteProtocol.RemoteMessageProtocol buildParsed() - throws com.google.protobuf.InvalidProtocolBufferException { - if (!isInitialized()) { - throw newUninitializedMessageException( - result).asInvalidProtocolBufferException(); - } - return buildPartial(); - } - - public akka.remote.protocol.RemoteProtocol.RemoteMessageProtocol buildPartial() { - if (result == null) { - throw new IllegalStateException( - "build() has already been called on this Builder."); - } - if (result.metadata_ != java.util.Collections.EMPTY_LIST) { - result.metadata_ = - java.util.Collections.unmodifiableList(result.metadata_); - } - akka.remote.protocol.RemoteProtocol.RemoteMessageProtocol returnMe = result; - result = null; - return returnMe; - } - - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof akka.remote.protocol.RemoteProtocol.RemoteMessageProtocol) { - return mergeFrom((akka.remote.protocol.RemoteProtocol.RemoteMessageProtocol)other); - } else { - super.mergeFrom(other); - return this; - } - } - - public Builder mergeFrom(akka.remote.protocol.RemoteProtocol.RemoteMessageProtocol other) { - if (other == akka.remote.protocol.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.hasMessage()) { - mergeMessage(other.getMessage()); - } - if (other.hasException()) { - mergeException(other.getException()); - } - if (other.hasSupervisorUuid()) { - mergeSupervisorUuid(other.getSupervisorUuid()); - } - if (other.hasSender()) { - mergeSender(other.getSender()); - } - if (!other.metadata_.isEmpty()) { - if (result.metadata_.isEmpty()) { - result.metadata_ = new java.util.ArrayList(); - } - result.metadata_.addAll(other.metadata_); - } - if (other.hasCookie()) { - setCookie(other.getCookie()); - } - this.mergeUnknownFields(other.getUnknownFields()); - return this; - } - - 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()); - return this; - default: { - if (!parseUnknownField(input, unknownFields, - extensionRegistry, tag)) { - this.setUnknownFields(unknownFields.build()); - return this; - } - break; - } - case 10: { - akka.remote.protocol.RemoteProtocol.UuidProtocol.Builder subBuilder = akka.remote.protocol.RemoteProtocol.UuidProtocol.newBuilder(); - if (hasUuid()) { - subBuilder.mergeFrom(getUuid()); - } - input.readMessage(subBuilder, extensionRegistry); - setUuid(subBuilder.buildPartial()); - break; - } - case 18: { - akka.remote.protocol.RemoteProtocol.ActorInfoProtocol.Builder subBuilder = akka.remote.protocol.RemoteProtocol.ActorInfoProtocol.newBuilder(); - if (hasActorInfo()) { - subBuilder.mergeFrom(getActorInfo()); - } - input.readMessage(subBuilder, extensionRegistry); - setActorInfo(subBuilder.buildPartial()); - break; - } - case 24: { - setOneWay(input.readBool()); - break; - } - case 34: { - akka.remote.protocol.RemoteProtocol.MessageProtocol.Builder subBuilder = akka.remote.protocol.RemoteProtocol.MessageProtocol.newBuilder(); - if (hasMessage()) { - subBuilder.mergeFrom(getMessage()); - } - input.readMessage(subBuilder, extensionRegistry); - setMessage(subBuilder.buildPartial()); - break; - } - case 42: { - akka.remote.protocol.RemoteProtocol.ExceptionProtocol.Builder subBuilder = akka.remote.protocol.RemoteProtocol.ExceptionProtocol.newBuilder(); - if (hasException()) { - subBuilder.mergeFrom(getException()); - } - input.readMessage(subBuilder, extensionRegistry); - setException(subBuilder.buildPartial()); - break; - } - case 50: { - akka.remote.protocol.RemoteProtocol.UuidProtocol.Builder subBuilder = akka.remote.protocol.RemoteProtocol.UuidProtocol.newBuilder(); - if (hasSupervisorUuid()) { - subBuilder.mergeFrom(getSupervisorUuid()); - } - input.readMessage(subBuilder, extensionRegistry); - setSupervisorUuid(subBuilder.buildPartial()); - break; - } - case 58: { - akka.remote.protocol.RemoteProtocol.RemoteActorRefProtocol.Builder subBuilder = akka.remote.protocol.RemoteProtocol.RemoteActorRefProtocol.newBuilder(); - if (hasSender()) { - subBuilder.mergeFrom(getSender()); - } - input.readMessage(subBuilder, extensionRegistry); - setSender(subBuilder.buildPartial()); - break; - } - case 66: { - akka.remote.protocol.RemoteProtocol.MetadataEntryProtocol.Builder subBuilder = akka.remote.protocol.RemoteProtocol.MetadataEntryProtocol.newBuilder(); - input.readMessage(subBuilder, extensionRegistry); - addMetadata(subBuilder.buildPartial()); - break; - } - case 74: { - setCookie(input.readString()); - break; - } - } - } - } - - - // required .UuidProtocol uuid = 1; - public boolean hasUuid() { - return result.hasUuid(); - } - public akka.remote.protocol.RemoteProtocol.UuidProtocol getUuid() { - return result.getUuid(); - } - public Builder setUuid(akka.remote.protocol.RemoteProtocol.UuidProtocol value) { - if (value == null) { - throw new NullPointerException(); - } - result.hasUuid = true; - result.uuid_ = value; - return this; - } - public Builder setUuid(akka.remote.protocol.RemoteProtocol.UuidProtocol.Builder builderForValue) { - result.hasUuid = true; - result.uuid_ = builderForValue.build(); - return this; - } - public Builder mergeUuid(akka.remote.protocol.RemoteProtocol.UuidProtocol value) { - if (result.hasUuid() && - result.uuid_ != akka.remote.protocol.RemoteProtocol.UuidProtocol.getDefaultInstance()) { - result.uuid_ = - akka.remote.protocol.RemoteProtocol.UuidProtocol.newBuilder(result.uuid_).mergeFrom(value).buildPartial(); - } else { - result.uuid_ = value; - } - result.hasUuid = true; - return this; - } - public Builder clearUuid() { - result.hasUuid = false; - result.uuid_ = akka.remote.protocol.RemoteProtocol.UuidProtocol.getDefaultInstance(); - return this; - } - - // required .ActorInfoProtocol actorInfo = 2; - public boolean hasActorInfo() { - return result.hasActorInfo(); - } - public akka.remote.protocol.RemoteProtocol.ActorInfoProtocol getActorInfo() { - return result.getActorInfo(); - } - public Builder setActorInfo(akka.remote.protocol.RemoteProtocol.ActorInfoProtocol value) { - if (value == null) { - throw new NullPointerException(); - } - result.hasActorInfo = true; - result.actorInfo_ = value; - return this; - } - public Builder setActorInfo(akka.remote.protocol.RemoteProtocol.ActorInfoProtocol.Builder builderForValue) { - result.hasActorInfo = true; - result.actorInfo_ = builderForValue.build(); - return this; - } - public Builder mergeActorInfo(akka.remote.protocol.RemoteProtocol.ActorInfoProtocol value) { - if (result.hasActorInfo() && - result.actorInfo_ != akka.remote.protocol.RemoteProtocol.ActorInfoProtocol.getDefaultInstance()) { - result.actorInfo_ = - akka.remote.protocol.RemoteProtocol.ActorInfoProtocol.newBuilder(result.actorInfo_).mergeFrom(value).buildPartial(); - } else { - result.actorInfo_ = value; - } - result.hasActorInfo = true; - return this; - } - public Builder clearActorInfo() { - result.hasActorInfo = false; - result.actorInfo_ = akka.remote.protocol.RemoteProtocol.ActorInfoProtocol.getDefaultInstance(); - return this; - } - - // required bool oneWay = 3; - public boolean hasOneWay() { - return result.hasOneWay(); - } - public boolean getOneWay() { - return result.getOneWay(); - } - public Builder setOneWay(boolean value) { - result.hasOneWay = true; - result.oneWay_ = value; - return this; - } - public Builder clearOneWay() { - result.hasOneWay = false; - result.oneWay_ = false; - return this; - } - - // optional .MessageProtocol message = 4; - public boolean hasMessage() { - return result.hasMessage(); - } - public akka.remote.protocol.RemoteProtocol.MessageProtocol getMessage() { - return result.getMessage(); - } - public Builder setMessage(akka.remote.protocol.RemoteProtocol.MessageProtocol value) { - if (value == null) { - throw new NullPointerException(); - } - result.hasMessage = true; - result.message_ = value; - return this; - } - public Builder setMessage(akka.remote.protocol.RemoteProtocol.MessageProtocol.Builder builderForValue) { - result.hasMessage = true; - result.message_ = builderForValue.build(); - return this; - } - public Builder mergeMessage(akka.remote.protocol.RemoteProtocol.MessageProtocol value) { - if (result.hasMessage() && - result.message_ != akka.remote.protocol.RemoteProtocol.MessageProtocol.getDefaultInstance()) { - result.message_ = - akka.remote.protocol.RemoteProtocol.MessageProtocol.newBuilder(result.message_).mergeFrom(value).buildPartial(); - } else { - result.message_ = value; - } - result.hasMessage = true; - return this; - } - public Builder clearMessage() { - result.hasMessage = false; - result.message_ = akka.remote.protocol.RemoteProtocol.MessageProtocol.getDefaultInstance(); - return this; - } - - // optional .ExceptionProtocol exception = 5; - public boolean hasException() { - return result.hasException(); - } - public akka.remote.protocol.RemoteProtocol.ExceptionProtocol getException() { - return result.getException(); - } - public Builder setException(akka.remote.protocol.RemoteProtocol.ExceptionProtocol value) { - if (value == null) { - throw new NullPointerException(); - } - result.hasException = true; - result.exception_ = value; - return this; - } - public Builder setException(akka.remote.protocol.RemoteProtocol.ExceptionProtocol.Builder builderForValue) { - result.hasException = true; - result.exception_ = builderForValue.build(); - return this; - } - public Builder mergeException(akka.remote.protocol.RemoteProtocol.ExceptionProtocol value) { - if (result.hasException() && - result.exception_ != akka.remote.protocol.RemoteProtocol.ExceptionProtocol.getDefaultInstance()) { - result.exception_ = - akka.remote.protocol.RemoteProtocol.ExceptionProtocol.newBuilder(result.exception_).mergeFrom(value).buildPartial(); - } else { - result.exception_ = value; - } - result.hasException = true; - return this; - } - public Builder clearException() { - result.hasException = false; - result.exception_ = akka.remote.protocol.RemoteProtocol.ExceptionProtocol.getDefaultInstance(); - return this; - } - - // optional .UuidProtocol supervisorUuid = 6; - public boolean hasSupervisorUuid() { - return result.hasSupervisorUuid(); - } - public akka.remote.protocol.RemoteProtocol.UuidProtocol getSupervisorUuid() { - return result.getSupervisorUuid(); - } - public Builder setSupervisorUuid(akka.remote.protocol.RemoteProtocol.UuidProtocol value) { - if (value == null) { - throw new NullPointerException(); - } - result.hasSupervisorUuid = true; - result.supervisorUuid_ = value; - return this; - } - public Builder setSupervisorUuid(akka.remote.protocol.RemoteProtocol.UuidProtocol.Builder builderForValue) { - result.hasSupervisorUuid = true; - result.supervisorUuid_ = builderForValue.build(); - return this; - } - public Builder mergeSupervisorUuid(akka.remote.protocol.RemoteProtocol.UuidProtocol value) { - if (result.hasSupervisorUuid() && - result.supervisorUuid_ != akka.remote.protocol.RemoteProtocol.UuidProtocol.getDefaultInstance()) { - result.supervisorUuid_ = - akka.remote.protocol.RemoteProtocol.UuidProtocol.newBuilder(result.supervisorUuid_).mergeFrom(value).buildPartial(); - } else { - result.supervisorUuid_ = value; - } - result.hasSupervisorUuid = true; - return this; - } - public Builder clearSupervisorUuid() { - result.hasSupervisorUuid = false; - result.supervisorUuid_ = akka.remote.protocol.RemoteProtocol.UuidProtocol.getDefaultInstance(); - return this; - } - - // optional .RemoteActorRefProtocol sender = 7; - public boolean hasSender() { - return result.hasSender(); - } - public akka.remote.protocol.RemoteProtocol.RemoteActorRefProtocol getSender() { - return result.getSender(); - } - public Builder setSender(akka.remote.protocol.RemoteProtocol.RemoteActorRefProtocol value) { - if (value == null) { - throw new NullPointerException(); - } - result.hasSender = true; - result.sender_ = value; - return this; - } - public Builder setSender(akka.remote.protocol.RemoteProtocol.RemoteActorRefProtocol.Builder builderForValue) { - result.hasSender = true; - result.sender_ = builderForValue.build(); - return this; - } - public Builder mergeSender(akka.remote.protocol.RemoteProtocol.RemoteActorRefProtocol value) { - if (result.hasSender() && - result.sender_ != akka.remote.protocol.RemoteProtocol.RemoteActorRefProtocol.getDefaultInstance()) { - result.sender_ = - akka.remote.protocol.RemoteProtocol.RemoteActorRefProtocol.newBuilder(result.sender_).mergeFrom(value).buildPartial(); - } else { - result.sender_ = value; - } - result.hasSender = true; - return this; - } - public Builder clearSender() { - result.hasSender = false; - result.sender_ = akka.remote.protocol.RemoteProtocol.RemoteActorRefProtocol.getDefaultInstance(); - return this; - } - - // repeated .MetadataEntryProtocol metadata = 8; - public java.util.List getMetadataList() { - return java.util.Collections.unmodifiableList(result.metadata_); - } - public int getMetadataCount() { - return result.getMetadataCount(); - } - public akka.remote.protocol.RemoteProtocol.MetadataEntryProtocol getMetadata(int index) { - return result.getMetadata(index); - } - public Builder setMetadata(int index, akka.remote.protocol.RemoteProtocol.MetadataEntryProtocol value) { - if (value == null) { - throw new NullPointerException(); - } - result.metadata_.set(index, value); - return this; - } - public Builder setMetadata(int index, akka.remote.protocol.RemoteProtocol.MetadataEntryProtocol.Builder builderForValue) { - result.metadata_.set(index, builderForValue.build()); - return this; - } - public Builder addMetadata(akka.remote.protocol.RemoteProtocol.MetadataEntryProtocol value) { - if (value == null) { - throw new NullPointerException(); - } - if (result.metadata_.isEmpty()) { - result.metadata_ = new java.util.ArrayList(); - } - result.metadata_.add(value); - return this; - } - public Builder addMetadata(akka.remote.protocol.RemoteProtocol.MetadataEntryProtocol.Builder builderForValue) { - if (result.metadata_.isEmpty()) { - result.metadata_ = new java.util.ArrayList(); - } - result.metadata_.add(builderForValue.build()); - return this; - } - public Builder addAllMetadata( - java.lang.Iterable values) { - if (result.metadata_.isEmpty()) { - result.metadata_ = new java.util.ArrayList(); - } - super.addAll(values, result.metadata_); - return this; - } - public Builder clearMetadata() { - result.metadata_ = java.util.Collections.emptyList(); - return this; - } - - // optional string cookie = 9; - public boolean hasCookie() { - return result.hasCookie(); - } - public java.lang.String getCookie() { - return result.getCookie(); - } - public Builder setCookie(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - result.hasCookie = true; - result.cookie_ = value; - return this; - } - public Builder clearCookie() { - result.hasCookie = false; - result.cookie_ = getDefaultInstance().getCookie(); - return this; - } - - // @@protoc_insertion_point(builder_scope:RemoteMessageProtocol) - } - - static { - defaultInstance = new RemoteMessageProtocol(true); - akka.remote.protocol.RemoteProtocol.internalForceInit(); - defaultInstance.initFields(); - } - - // @@protoc_insertion_point(class_scope:RemoteMessageProtocol) - } - public static final class UuidProtocol extends com.google.protobuf.GeneratedMessage { // Use UuidProtocol.newBuilder() to construct. @@ -5941,6 +6722,21 @@ public final class RemoteProtocol { // @@protoc_insertion_point(class_scope:ExceptionProtocol) } + private static com.google.protobuf.Descriptors.Descriptor + internal_static_AkkaRemoteProtocol_descriptor; + private static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_AkkaRemoteProtocol_fieldAccessorTable; + private static com.google.protobuf.Descriptors.Descriptor + internal_static_RemoteMessageProtocol_descriptor; + private static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_RemoteMessageProtocol_fieldAccessorTable; + private static com.google.protobuf.Descriptors.Descriptor + internal_static_RemoteControlProtocol_descriptor; + private static + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_RemoteControlProtocol_fieldAccessorTable; private static com.google.protobuf.Descriptors.Descriptor internal_static_RemoteActorRefProtocol_descriptor; private static @@ -5976,11 +6772,6 @@ public final class RemoteProtocol { private static com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_TypedActorInfoProtocol_fieldAccessorTable; - private static com.google.protobuf.Descriptors.Descriptor - internal_static_RemoteMessageProtocol_descriptor; - private static - com.google.protobuf.GeneratedMessage.FieldAccessorTable - internal_static_RemoteMessageProtocol_fieldAccessorTable; private static com.google.protobuf.Descriptors.Descriptor internal_static_UuidProtocol_descriptor; private static @@ -6015,62 +6806,91 @@ public final class RemoteProtocol { descriptor; static { java.lang.String[] descriptorData = { - "\n\024RemoteProtocol.proto\"\204\001\n\026RemoteActorRe" + - "fProtocol\022\032\n\022classOrServiceName\030\001 \002(\t\022\026\n" + - "\016actorClassname\030\002 \002(\t\022%\n\013homeAddress\030\003 \002" + - "(\0132\020.AddressProtocol\022\017\n\007timeout\030\004 \001(\004\"_\n" + - "\033RemoteTypedActorRefProtocol\022)\n\010actorRef" + - "\030\001 \002(\0132\027.RemoteActorRefProtocol\022\025\n\rinter" + - "faceName\030\002 \002(\t\"\371\002\n\032SerializedActorRefPro" + - "tocol\022\033\n\004uuid\030\001 \002(\0132\r.UuidProtocol\022\n\n\002id" + - "\030\002 \002(\t\022\026\n\016actorClassname\030\003 \002(\t\022)\n\017origin" + - "alAddress\030\004 \002(\0132\020.AddressProtocol\022\025\n\ract", - "orInstance\030\005 \001(\014\022\033\n\023serializerClassname\030" + - "\006 \001(\t\022\017\n\007timeout\030\007 \001(\004\022\026\n\016receiveTimeout" + - "\030\010 \001(\004\022%\n\tlifeCycle\030\t \001(\0132\022.LifeCyclePro" + - "tocol\022+\n\nsupervisor\030\n \001(\0132\027.RemoteActorR" + - "efProtocol\022\024\n\014hotswapStack\030\013 \001(\014\022(\n\010mess" + - "ages\030\014 \003(\0132\026.RemoteMessageProtocol\"g\n\037Se" + - "rializedTypedActorRefProtocol\022-\n\010actorRe" + - "f\030\001 \002(\0132\033.SerializedActorRefProtocol\022\025\n\r" + - "interfaceName\030\002 \002(\t\"r\n\017MessageProtocol\0225" + - "\n\023serializationScheme\030\001 \002(\0162\030.Serializat", - "ionSchemeType\022\017\n\007message\030\002 \002(\014\022\027\n\017messag" + - "eManifest\030\003 \001(\014\"\255\001\n\021ActorInfoProtocol\022\033\n" + - "\004uuid\030\001 \002(\0132\r.UuidProtocol\022\016\n\006target\030\002 \002" + - "(\t\022\017\n\007timeout\030\003 \002(\004\022\035\n\tactorType\030\004 \002(\0162\n" + - ".ActorType\022/\n\016typedActorInfo\030\005 \001(\0132\027.Typ" + - "edActorInfoProtocol\022\n\n\002id\030\006 \001(\t\";\n\026Typed" + - "ActorInfoProtocol\022\021\n\tinterface\030\001 \002(\t\022\016\n\006" + - "method\030\002 \002(\t\"\277\002\n\025RemoteMessageProtocol\022\033" + - "\n\004uuid\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" + - "\texception\030\005 \001(\0132\022.ExceptionProtocol\022%\n\016" + - "supervisorUuid\030\006 \001(\0132\r.UuidProtocol\022\'\n\006s" + - "ender\030\007 \001(\0132\027.RemoteActorRefProtocol\022(\n\010" + - "metadata\030\010 \003(\0132\026.MetadataEntryProtocol\022\016" + - "\n\006cookie\030\t \001(\t\")\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\"6\n\021LifeCy" + - "cleProtocol\022!\n\tlifeCycle\030\001 \002(\0162\016.LifeCyc" + - "leType\"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\tclassname\030\001 \002(\t\022\017\n\007message\030\002 \002(\t*=\n\tAc" + - "torType\022\017\n\013SCALA_ACTOR\020\001\022\016\n\nJAVA_ACTOR\020\002" + - "\022\017\n\013TYPED_ACTOR\020\003*]\n\027SerializationScheme" + - "Type\022\010\n\004JAVA\020\001\022\013\n\007SBINARY\020\002\022\016\n\nSCALA_JSO" + - "N\020\003\022\r\n\tJAVA_JSON\020\004\022\014\n\010PROTOBUF\020\005*-\n\rLife" + - "CycleType\022\r\n\tPERMANENT\020\001\022\r\n\tTEMPORARY\020\002B" + - "\030\n\024akka.remote.protocolH\001" + "\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\"\277\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\022\016\n\006" + + "cookie\030\t \001(\t\"J\n\025RemoteControlProtocol\022\016\n" + + "\006cookie\030\001 \001(\t\022!\n\013commandType\030\002 \002(\0162\014.Com" + + "mandType\"\204\001\n\026RemoteActorRefProtocol\022\032\n\022c" + + "lassOrServiceName\030\001 \002(\t\022\026\n\016actorClassnam" + + "e\030\002 \002(\t\022%\n\013homeAddress\030\003 \002(\0132\020.AddressPr" + + "otocol\022\017\n\007timeout\030\004 \001(\004\"_\n\033RemoteTypedAc" + + "torRefProtocol\022)\n\010actorRef\030\001 \002(\0132\027.Remot" + + "eActorRefProtocol\022\025\n\rinterfaceName\030\002 \002(\t" + + "\"\371\002\n\032SerializedActorRefProtocol\022\033\n\004uuid\030", + "\001 \002(\0132\r.UuidProtocol\022\n\n\002id\030\002 \002(\t\022\026\n\016acto" + + "rClassname\030\003 \002(\t\022)\n\017originalAddress\030\004 \002(" + + "\0132\020.AddressProtocol\022\025\n\ractorInstance\030\005 \001" + + "(\014\022\033\n\023serializerClassname\030\006 \001(\t\022\017\n\007timeo" + + "ut\030\007 \001(\004\022\026\n\016receiveTimeout\030\010 \001(\004\022%\n\tlife" + + "Cycle\030\t \001(\0132\022.LifeCycleProtocol\022+\n\nsuper" + + "visor\030\n \001(\0132\027.RemoteActorRefProtocol\022\024\n\014" + + "hotswapStack\030\013 \001(\014\022(\n\010messages\030\014 \003(\0132\026.R" + + "emoteMessageProtocol\"g\n\037SerializedTypedA" + + "ctorRefProtocol\022-\n\010actorRef\030\001 \002(\0132\033.Seri", + "alizedActorRefProtocol\022\025\n\rinterfaceName\030" + + "\002 \002(\t\"r\n\017MessageProtocol\0225\n\023serializatio" + + "nScheme\030\001 \002(\0162\030.SerializationSchemeType\022" + + "\017\n\007message\030\002 \002(\014\022\027\n\017messageManifest\030\003 \001(" + + "\014\"\255\001\n\021ActorInfoProtocol\022\033\n\004uuid\030\001 \002(\0132\r." + + "UuidProtocol\022\016\n\006target\030\002 \002(\t\022\017\n\007timeout\030" + + "\003 \002(\004\022\035\n\tactorType\030\004 \002(\0162\n.ActorType\022/\n\016" + + "typedActorInfo\030\005 \001(\0132\027.TypedActorInfoPro" + + "tocol\022\n\n\002id\030\006 \001(\t\";\n\026TypedActorInfoProto" + + "col\022\021\n\tinterface\030\001 \002(\t\022\016\n\006method\030\002 \002(\t\")", + "\n\014UuidProtocol\022\014\n\004high\030\001 \002(\004\022\013\n\003low\030\002 \002(" + + "\004\"3\n\025MetadataEntryProtocol\022\013\n\003key\030\001 \002(\t\022" + + "\r\n\005value\030\002 \002(\014\"6\n\021LifeCycleProtocol\022!\n\tl" + + "ifeCycle\030\001 \002(\0162\016.LifeCycleType\"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*\033\n\013CommandType\022\014\n\010SHU" + + "TDOWN\020\001*=\n\tActorType\022\017\n\013SCALA_ACTOR\020\001\022\016\n" + + "\nJAVA_ACTOR\020\002\022\017\n\013TYPED_ACTOR\020\003*]\n\027Serial" + + "izationSchemeType\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\010PROTO" + + "BUF\020\005*-\n\rLifeCycleType\022\r\n\tPERMANENT\020\001\022\r\n" + + "\tTEMPORARY\020\002B\030\n\024akka.remote.protocolH\001" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { public com.google.protobuf.ExtensionRegistry assignDescriptors( com.google.protobuf.Descriptors.FileDescriptor root) { descriptor = root; - internal_static_RemoteActorRefProtocol_descriptor = + internal_static_AkkaRemoteProtocol_descriptor = getDescriptor().getMessageTypes().get(0); + internal_static_AkkaRemoteProtocol_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_AkkaRemoteProtocol_descriptor, + new java.lang.String[] { "Message", "Instruction", }, + akka.remote.protocol.RemoteProtocol.AkkaRemoteProtocol.class, + akka.remote.protocol.RemoteProtocol.AkkaRemoteProtocol.Builder.class); + internal_static_RemoteMessageProtocol_descriptor = + getDescriptor().getMessageTypes().get(1); + 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", "Cookie", }, + akka.remote.protocol.RemoteProtocol.RemoteMessageProtocol.class, + akka.remote.protocol.RemoteProtocol.RemoteMessageProtocol.Builder.class); + internal_static_RemoteControlProtocol_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_RemoteControlProtocol_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_RemoteControlProtocol_descriptor, + new java.lang.String[] { "Cookie", "CommandType", }, + akka.remote.protocol.RemoteProtocol.RemoteControlProtocol.class, + akka.remote.protocol.RemoteProtocol.RemoteControlProtocol.Builder.class); + internal_static_RemoteActorRefProtocol_descriptor = + getDescriptor().getMessageTypes().get(3); internal_static_RemoteActorRefProtocol_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_RemoteActorRefProtocol_descriptor, @@ -6078,7 +6898,7 @@ public final class RemoteProtocol { akka.remote.protocol.RemoteProtocol.RemoteActorRefProtocol.class, akka.remote.protocol.RemoteProtocol.RemoteActorRefProtocol.Builder.class); internal_static_RemoteTypedActorRefProtocol_descriptor = - getDescriptor().getMessageTypes().get(1); + getDescriptor().getMessageTypes().get(4); internal_static_RemoteTypedActorRefProtocol_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_RemoteTypedActorRefProtocol_descriptor, @@ -6086,7 +6906,7 @@ public final class RemoteProtocol { akka.remote.protocol.RemoteProtocol.RemoteTypedActorRefProtocol.class, akka.remote.protocol.RemoteProtocol.RemoteTypedActorRefProtocol.Builder.class); internal_static_SerializedActorRefProtocol_descriptor = - getDescriptor().getMessageTypes().get(2); + getDescriptor().getMessageTypes().get(5); internal_static_SerializedActorRefProtocol_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_SerializedActorRefProtocol_descriptor, @@ -6094,7 +6914,7 @@ public final class RemoteProtocol { akka.remote.protocol.RemoteProtocol.SerializedActorRefProtocol.class, akka.remote.protocol.RemoteProtocol.SerializedActorRefProtocol.Builder.class); internal_static_SerializedTypedActorRefProtocol_descriptor = - getDescriptor().getMessageTypes().get(3); + getDescriptor().getMessageTypes().get(6); internal_static_SerializedTypedActorRefProtocol_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_SerializedTypedActorRefProtocol_descriptor, @@ -6102,7 +6922,7 @@ public final class RemoteProtocol { akka.remote.protocol.RemoteProtocol.SerializedTypedActorRefProtocol.class, akka.remote.protocol.RemoteProtocol.SerializedTypedActorRefProtocol.Builder.class); internal_static_MessageProtocol_descriptor = - getDescriptor().getMessageTypes().get(4); + getDescriptor().getMessageTypes().get(7); internal_static_MessageProtocol_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_MessageProtocol_descriptor, @@ -6110,7 +6930,7 @@ public final class RemoteProtocol { akka.remote.protocol.RemoteProtocol.MessageProtocol.class, akka.remote.protocol.RemoteProtocol.MessageProtocol.Builder.class); internal_static_ActorInfoProtocol_descriptor = - getDescriptor().getMessageTypes().get(5); + getDescriptor().getMessageTypes().get(8); internal_static_ActorInfoProtocol_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_ActorInfoProtocol_descriptor, @@ -6118,23 +6938,15 @@ public final class RemoteProtocol { akka.remote.protocol.RemoteProtocol.ActorInfoProtocol.class, akka.remote.protocol.RemoteProtocol.ActorInfoProtocol.Builder.class); internal_static_TypedActorInfoProtocol_descriptor = - getDescriptor().getMessageTypes().get(6); + getDescriptor().getMessageTypes().get(9); internal_static_TypedActorInfoProtocol_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_TypedActorInfoProtocol_descriptor, new java.lang.String[] { "Interface", "Method", }, akka.remote.protocol.RemoteProtocol.TypedActorInfoProtocol.class, akka.remote.protocol.RemoteProtocol.TypedActorInfoProtocol.Builder.class); - internal_static_RemoteMessageProtocol_descriptor = - getDescriptor().getMessageTypes().get(7); - 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", "Cookie", }, - akka.remote.protocol.RemoteProtocol.RemoteMessageProtocol.class, - akka.remote.protocol.RemoteProtocol.RemoteMessageProtocol.Builder.class); internal_static_UuidProtocol_descriptor = - getDescriptor().getMessageTypes().get(8); + getDescriptor().getMessageTypes().get(10); internal_static_UuidProtocol_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_UuidProtocol_descriptor, @@ -6142,7 +6954,7 @@ public final class RemoteProtocol { akka.remote.protocol.RemoteProtocol.UuidProtocol.class, akka.remote.protocol.RemoteProtocol.UuidProtocol.Builder.class); internal_static_MetadataEntryProtocol_descriptor = - getDescriptor().getMessageTypes().get(9); + getDescriptor().getMessageTypes().get(11); internal_static_MetadataEntryProtocol_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_MetadataEntryProtocol_descriptor, @@ -6150,7 +6962,7 @@ public final class RemoteProtocol { akka.remote.protocol.RemoteProtocol.MetadataEntryProtocol.class, akka.remote.protocol.RemoteProtocol.MetadataEntryProtocol.Builder.class); internal_static_LifeCycleProtocol_descriptor = - getDescriptor().getMessageTypes().get(10); + getDescriptor().getMessageTypes().get(12); internal_static_LifeCycleProtocol_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_LifeCycleProtocol_descriptor, @@ -6158,7 +6970,7 @@ public final class RemoteProtocol { akka.remote.protocol.RemoteProtocol.LifeCycleProtocol.class, akka.remote.protocol.RemoteProtocol.LifeCycleProtocol.Builder.class); internal_static_AddressProtocol_descriptor = - getDescriptor().getMessageTypes().get(11); + getDescriptor().getMessageTypes().get(13); internal_static_AddressProtocol_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_AddressProtocol_descriptor, @@ -6166,7 +6978,7 @@ public final class RemoteProtocol { akka.remote.protocol.RemoteProtocol.AddressProtocol.class, akka.remote.protocol.RemoteProtocol.AddressProtocol.Builder.class); internal_static_ExceptionProtocol_descriptor = - getDescriptor().getMessageTypes().get(12); + getDescriptor().getMessageTypes().get(14); internal_static_ExceptionProtocol_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_ExceptionProtocol_descriptor, diff --git a/akka-remote/src/main/protocol/RemoteProtocol.proto b/akka-remote/src/main/protocol/RemoteProtocol.proto index ee8e298fc5..209b204767 100644 --- a/akka-remote/src/main/protocol/RemoteProtocol.proto +++ b/akka-remote/src/main/protocol/RemoteProtocol.proto @@ -11,6 +11,11 @@ option optimize_for = SPEED; protoc RemoteProtocol.proto --java_out ../java *******************************************/ +message AkkaRemoteProtocol { + optional RemoteMessageProtocol message = 1; + optional RemoteControlProtocol instruction = 2; +} + /** * Defines a remote message. */ @@ -26,6 +31,21 @@ message RemoteMessageProtocol { optional string cookie = 9; } +/** + * Defines some control messages for the remoting + */ +message RemoteControlProtocol { + optional string cookie = 1; + required CommandType commandType = 2; +} + +/** + * Defines the type of the RemoteControlProtocol command type + */ +enum CommandType { + SHUTDOWN = 1; +} + /** * Defines a remote ActorRef that "remembers" and uses its original Actor instance * on the original node. From f1a17704b9805e2f9227a53d9191d5829395fe42 Mon Sep 17 00:00:00 2001 From: Viktor Klang Date: Sat, 5 Mar 2011 14:55:58 +0100 Subject: [PATCH 05/15] Adding support for clean exit of remote server --- .../remote/netty/NettyRemoteSupport.scala | 67 +++++++++++++------ 1 file changed, 47 insertions(+), 20 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 db0fbe2937..6da6b56cec 100644 --- a/akka-remote/src/main/scala/akka/remote/netty/NettyRemoteSupport.scala +++ b/akka-remote/src/main/scala/akka/remote/netty/NettyRemoteSupport.scala @@ -13,10 +13,9 @@ import akka.serialization.RemoteActorSerialization._ import akka.japi.Creator import akka.config.Config._ import akka.remoteinterface._ -import akka.actor. {Index, ActorInitializationException, LocalActorRef, newUuid, ActorRegistry, Actor, RemoteActorRef, TypedActor, ActorRef, IllegalActorStateException, RemoteActorSystemMessage, uuidFrom, Uuid, Exit, LifeCycleMessage, ActorType => AkkaActorType} +import akka.actor.{EventHandler, Index, ActorInitializationException, LocalActorRef, newUuid, ActorRegistry, Actor, RemoteActorRef, TypedActor, ActorRef, IllegalActorStateException, RemoteActorSystemMessage, uuidFrom, Uuid, Exit, LifeCycleMessage, ActorType => AkkaActorType} import akka.AkkaException import akka.actor.Actor._ -import akka.actor.{EventHandler} import akka.util._ import akka.remote.{MessageSerializer, RemoteClientSettings, RemoteServerSettings} @@ -39,6 +38,20 @@ import scala.reflect.BeanProperty import java.lang.reflect.InvocationTargetException import java.util.concurrent.atomic. {AtomicReference, AtomicLong, AtomicBoolean} +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: ListenerManagement => private val remoteClients = new HashMap[Address, RemoteClient] private val remoteActors = new Index[Address, Uuid] @@ -197,7 +210,7 @@ abstract class RemoteClient private[akka] ( senderFuture: Option[CompletableFuture[T]]): Option[CompletableFuture[T]] = { if (isRunning) { if (request.getOneWay) { - currentChannel.write(request).addListener(new ChannelFutureListener { + currentChannel.write(RemoteEncoder.encode(request)).addListener(new ChannelFutureListener { def operationComplete(future: ChannelFuture) { if (future.isCancelled) { //We don't care about that right now @@ -212,7 +225,7 @@ abstract class RemoteClient private[akka] ( else new DefaultCompletableFuture[T](request.getActorInfo.getTimeout) val futureUuid = uuidFrom(request.getUuid.getHigh, request.getUuid.getLow) futures.put(futureUuid, futureResult) //Add this prematurely, remove it if write fails - currentChannel.write(request).addListener(new ChannelFutureListener { + currentChannel.write(RemoteEncoder.encode(request)).addListener(new ChannelFutureListener { def operationComplete(future: ChannelFuture) { if (future.isCancelled) { futures.remove(futureUuid) //Clean this up @@ -328,9 +341,8 @@ class ActiveRemoteClient private[akka] ( true } else { val timeLeft = RECONNECTION_TIME_WINDOW - (System.currentTimeMillis - reconnectionTimeWindowStart) - if (timeLeft > 0) { - true - } else false + + timeLeft > 0 } } @@ -363,7 +375,7 @@ class ActiveRemoteClientPipelineFactory( val timeout = new ReadTimeoutHandler(timer, RemoteClientSettings.READ_TIMEOUT.toMillis.toInt) val lenDec = new LengthFieldBasedFrameDecoder(RemoteClientSettings.MESSAGE_FRAME_SIZE, 0, 4, 0, 4) val lenPrep = new LengthFieldPrepender(4) - val protobufDec = new ProtobufDecoder(RemoteMessageProtocol.getDefaultInstance) + val protobufDec = new ProtobufDecoder(AkkaRemoteProtocol.getDefaultInstance) val protobufEnc = new ProtobufEncoder val (enc, dec) = RemoteServerSettings.COMPRESSION_SCHEME match { case "zlib" => (join(new ZlibEncoder(RemoteServerSettings.ZLIB_COMPRESSION_LEVEL)), join(new ZlibDecoder)) @@ -400,7 +412,13 @@ class ActiveRemoteClientHandler( override def messageReceived(ctx: ChannelHandlerContext, event: MessageEvent) { try { event.getMessage match { - case reply: RemoteMessageProtocol => + case arp: AkkaRemoteProtocol if arp.hasInstruction => + val rcp = arp.getInstruction + rcp.getCommandType match { + case CommandType.SHUTDOWN => spawn { client.shutdown } + } + case arp: AkkaRemoteProtocol if arp.hasMessage => + val reply = arp.getMessage val replyUuid = uuidFrom(reply.getActorInfo.getUuid.getHigh, reply.getActorInfo.getUuid.getLow) val future = futures.remove(replyUuid).asInstanceOf[CompletableFuture[Any]] @@ -423,7 +441,6 @@ class ActiveRemoteClientHandler( future.completeWithException(exception) } - case other => throw new RemoteClientException("Unknown message received in remote client handler: " + other, client.module, client.remoteAddress) } @@ -552,6 +569,14 @@ class NettyRemoteServer(serverModule: NettyRemoteServerModule, val host: String, def shutdown { try { + val shutdownSignal = { + val b = RemoteControlProtocol.newBuilder + if (RemoteClientSettings.SECURE_COOKIE.nonEmpty) + b.setCookie(RemoteClientSettings.SECURE_COOKIE.get) + b.setCommandType(CommandType.SHUTDOWN) + b.build + } + openChannels.write(RemoteEncoder.encode(shutdownSignal)).awaitUninterruptibly openChannels.disconnect openChannels.close.awaitUninterruptibly bootstrap.releaseExternalResources @@ -765,7 +790,7 @@ class RemoteServerPipelineFactory( val ssl = if(SECURE) join(new SslHandler(engine)) else join() val lenDec = new LengthFieldBasedFrameDecoder(MESSAGE_FRAME_SIZE, 0, 4, 0, 4) val lenPrep = new LengthFieldPrepender(4) - val protobufDec = new ProtobufDecoder(RemoteMessageProtocol.getDefaultInstance) + val protobufDec = new ProtobufDecoder(AkkaRemoteProtocol.getDefaultInstance) val protobufEnc = new ProtobufEncoder val (enc, dec) = COMPRESSION_SCHEME match { case "zlib" => (join(new ZlibEncoder(ZLIB_COMPRESSION_LEVEL)), join(new ZlibDecoder)) @@ -796,8 +821,8 @@ class RemoteServerHandler( val typedSessionActors = new ChannelLocal[ConcurrentHashMap[String, AnyRef]]() //Writes the specified message to the specified channel and propagates write errors to listeners - private def write(channel: Channel, message: AnyRef): Unit = { - channel.write(message).addListener( + private def write(channel: Channel, payload: AkkaRemoteProtocol): Unit = { + channel.write(payload).addListener( new ChannelFutureListener { def operationComplete(future: ChannelFuture): Unit = { if (future.isCancelled) { @@ -807,7 +832,7 @@ class RemoteServerHandler( case i: InetSocketAddress => Some(i) case _ => None } - server.notifyListeners(RemoteServerWriteFailed(message, future.getCause, server, socketAddress)) + server.notifyListeners(RemoteServerWriteFailed(payload, future.getCause, server, socketAddress)) } } }) @@ -871,7 +896,9 @@ class RemoteServerHandler( override def messageReceived(ctx: ChannelHandlerContext, event: MessageEvent) = event.getMessage match { case null => throw new IllegalActorStateException("Message in remote MessageEvent is null: " + event) - case requestProtocol: RemoteMessageProtocol => + //case remoteProtocol: AkkaRemoteProtocol if remoteProtocol.hasInstruction => RemoteServer cannot receive control messages (yet) + case remoteProtocol: AkkaRemoteProtocol if remoteProtocol.hasMessage => + val requestProtocol = remoteProtocol.getMessage if (REQUIRE_COOKIE) authenticateRemoteClient(requestProtocol, ctx) handleRemoteMessageProtocol(requestProtocol, event.getChannel) case _ => //ignore @@ -952,7 +979,7 @@ class RemoteServerHandler( // FIXME lift in the supervisor uuid management into toh createRemoteMessageProtocolBuilder method if (request.hasSupervisorUuid) messageBuilder.setSupervisorUuid(request.getSupervisorUuid) - write(channel, messageBuilder.build) + write(channel, RemoteEncoder.encode(messageBuilder.build)) } } ) @@ -988,7 +1015,7 @@ class RemoteServerHandler( None) if (request.hasSupervisorUuid) messageBuilder.setSupervisorUuid(request.getSupervisorUuid) - write(channel, messageBuilder.build) + write(channel, RemoteEncoder.encode(messageBuilder.build)) } catch { case e: Exception => EventHandler notifyListeners EventHandler.Error(e, this) @@ -1157,7 +1184,7 @@ class RemoteServerHandler( } } - private def createErrorReplyMessage(exception: Throwable, request: RemoteMessageProtocol, actorType: AkkaActorType): RemoteMessageProtocol = { + private def createErrorReplyMessage(exception: Throwable, request: RemoteMessageProtocol, actorType: AkkaActorType): AkkaRemoteProtocol = { val actorInfo = request.getActorInfo val messageBuilder = RemoteActorSerialization.createRemoteMessageProtocolBuilder( None, @@ -1172,7 +1199,7 @@ class RemoteServerHandler( actorType, None) if (request.hasSupervisorUuid) messageBuilder.setSupervisorUuid(request.getSupervisorUuid) - messageBuilder.build + RemoteEncoder.encode(messageBuilder.build) } private def authenticateRemoteClient(request: RemoteMessageProtocol, ctx: ChannelHandlerContext) = { @@ -1212,4 +1239,4 @@ class DefaultDisposableChannelGroup(name: String) extends DefaultChannelGroup(na throw new IllegalStateException("ChannelGroup already closed, cannot add new channel") } } -} +} \ No newline at end of file From 3e7289c2cedee5cedb0bbcd200567e6c9b153315 Mon Sep 17 00:00:00 2001 From: Viktor Klang Date: Sat, 5 Mar 2011 14:59:22 +0100 Subject: [PATCH 06/15] Add Future GC comment --- .../src/main/scala/akka/remote/netty/NettyRemoteSupport.scala | 1 + 1 file changed, 1 insertion(+) 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 6da6b56cec..033695839f 100644 --- a/akka-remote/src/main/scala/akka/remote/netty/NettyRemoteSupport.scala +++ b/akka-remote/src/main/scala/akka/remote/netty/NettyRemoteSupport.scala @@ -293,6 +293,7 @@ class ActiveRemoteClient private[akka] ( notifyListeners(RemoteClientError(connection.getCause, module, remoteAddress)) false } else { + //Add a task that does GCing of expired Futures timer.newTimeout(new TimerTask() { def run(timeout: Timeout) = { if(isRunning) { From f8727fc4d4c53613ed2a0afa598f1a8be7ac24a9 Mon Sep 17 00:00:00 2001 From: Viktor Klang Date: Sat, 5 Mar 2011 15:01:07 +0100 Subject: [PATCH 07/15] Removed some superfluous code --- .../src/main/scala/akka/remote/netty/NettyRemoteSupport.scala | 4 +--- 1 file changed, 1 insertion(+), 3 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 033695839f..0a45cde327 100644 --- a/akka-remote/src/main/scala/akka/remote/netty/NettyRemoteSupport.scala +++ b/akka-remote/src/main/scala/akka/remote/netty/NettyRemoteSupport.scala @@ -341,9 +341,7 @@ class ActiveRemoteClient private[akka] ( reconnectionTimeWindowStart = System.currentTimeMillis true } else { - val timeLeft = RECONNECTION_TIME_WINDOW - (System.currentTimeMillis - reconnectionTimeWindowStart) - - timeLeft > 0 + /*Time left > 0*/ (RECONNECTION_TIME_WINDOW - (System.currentTimeMillis - reconnectionTimeWindowStart)) > 0 } } From c0fcbaea01d914a19f43702bac3474cc3e863c9c Mon Sep 17 00:00:00 2001 From: Viktor Klang Date: Sat, 5 Mar 2011 15:06:36 +0100 Subject: [PATCH 08/15] Speeding up remote tests by removing superfluous Thread.sleep --- akka-remote/src/test/scala/remote/AkkaRemoteTest.scala | 1 - 1 file changed, 1 deletion(-) diff --git a/akka-remote/src/test/scala/remote/AkkaRemoteTest.scala b/akka-remote/src/test/scala/remote/AkkaRemoteTest.scala index be6234bf00..0c7421df0a 100644 --- a/akka-remote/src/test/scala/remote/AkkaRemoteTest.scala +++ b/akka-remote/src/test/scala/remote/AkkaRemoteTest.scala @@ -47,7 +47,6 @@ class AkkaRemoteTest extends override def beforeEach { remote.start(host,port) - Thread.sleep(2000) super.beforeEach } From 90470e89dd431ff4cfa195e79e1b03f99d3ef270 Mon Sep 17 00:00:00 2001 From: Viktor Klang Date: Sat, 5 Mar 2011 22:12:33 +0100 Subject: [PATCH 09/15] reverting changes to avoid breaking serialization --- akka-actor/src/main/scala/akka/AkkaException.scala | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/akka-actor/src/main/scala/akka/AkkaException.scala b/akka-actor/src/main/scala/akka/AkkaException.scala index fbeae4b105..73072b2894 100644 --- a/akka-actor/src/main/scala/akka/AkkaException.scala +++ b/akka-actor/src/main/scala/akka/AkkaException.scala @@ -23,13 +23,14 @@ import java.net.{InetAddress, UnknownHostException} import AkkaException._ val exceptionName = getClass.getName - lazy val uuid = "%s_%s".format(hostname, newUuid) + val uuid = "%s_%s".format(hostname, newUuid) - override lazy val toString = "%s\n\t[%s]\n\t%s\n\t%s".format(exceptionName, uuid, message, stackTrace) + override val toString = "%s\n\t[%s]\n\t%s\n\t%s".format(exceptionName, uuid, message, stackTrace) - lazy val stackTrace = { + val stackTrace = { val sw = new StringWriter - printStackTrace(new PrintWriter(sw)) + val pw = new PrintWriter(sw) + printStackTrace(pw) sw.toString } } From 6f05ce1da1b999a00201a98f6d4ce67d78f8d476 Mon Sep 17 00:00:00 2001 From: Viktor Klang Date: Sun, 6 Mar 2011 00:38:22 +0100 Subject: [PATCH 10/15] Adding export of the embedded uuid lib to the OSGi manifest --- project/build/AkkaProject.scala | 2 ++ 1 file changed, 2 insertions(+) diff --git a/project/build/AkkaProject.scala b/project/build/AkkaProject.scala index 3e33e4c633..acf07c5ea9 100644 --- a/project/build/AkkaProject.scala +++ b/project/build/AkkaProject.scala @@ -297,6 +297,8 @@ class AkkaParentProject(info: ProjectInfo) extends DefaultProject(info) { val junit = Dependencies.junit val scalatest = Dependencies.scalatest val multiverse_test = Dependencies.multiverse_test // StandardLatch + + override def bndExportPackage = super.bndExportPackage ++ Seq("com.eaio.*;version=3.2") } // ------------------------------------------------------------------------------------------------------------------- From f3af6bdcc7dbe3165cd92352bfe2deeab92fcf56 Mon Sep 17 00:00:00 2001 From: Viktor Klang Date: Sun, 6 Mar 2011 22:15:51 +0100 Subject: [PATCH 11/15] Tweaking AkkaException --- akka-actor/src/main/scala/akka/AkkaException.scala | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/akka-actor/src/main/scala/akka/AkkaException.scala b/akka-actor/src/main/scala/akka/AkkaException.scala index 73072b2894..5c8948c6a4 100644 --- a/akka-actor/src/main/scala/akka/AkkaException.scala +++ b/akka-actor/src/main/scala/akka/AkkaException.scala @@ -25,14 +25,11 @@ import java.net.{InetAddress, UnknownHostException} val uuid = "%s_%s".format(hostname, newUuid) - override val toString = "%s\n\t[%s]\n\t%s\n\t%s".format(exceptionName, uuid, message, stackTrace) - - val stackTrace = { + override val toString = "%s\n\t[%s]\n\t%s\n\t%s".format(exceptionName, uuid, message, { val sw = new StringWriter - val pw = new PrintWriter(sw) - printStackTrace(pw) + printStackTrace(new PrintWriter(sw)) sw.toString - } + }) } object AkkaException { From 939d4ca6cbcad97534187ddea14102aab478fe2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Bone=CC=81r?= Date: Mon, 7 Mar 2011 12:18:00 +0100 Subject: [PATCH 12/15] Changed event handler config to a list of the FQN of listeners --- .../src/main/scala/akka/actor/Actor.scala | 36 ++++++++++++------- .../ExecutorBasedEventDrivenDispatcher.scala | 2 +- .../akka/dispatch/ThreadPoolBuilder.scala | 2 +- config/akka-reference.conf | 2 +- 4 files changed, 26 insertions(+), 16 deletions(-) diff --git a/akka-actor/src/main/scala/akka/actor/Actor.scala b/akka-actor/src/main/scala/akka/actor/Actor.scala index ecfc1f2cbe..e1cced0ec0 100644 --- a/akka-actor/src/main/scala/akka/actor/Actor.scala +++ b/akka-actor/src/main/scala/akka/actor/Actor.scala @@ -7,6 +7,7 @@ package akka.actor import akka.dispatch._ import akka.config.Config._ import akka.config.Supervision._ +import akka.config.ConfigurationException import akka.util.Helpers.{narrow, narrowSilently} import akka.util.ListenerManagement import akka.AkkaException @@ -78,16 +79,16 @@ class ActorTimeoutException private[akka](message: String) extends AkkaEx * * Create, add and remove a listener: *
- * val errorHandlerEventListener = new Actor {
+ * val errorHandlerEventListener = Actor.actorOf(new Actor {
  *   self.dispatcher = EventHandler.EventHandlerDispatcher
- *     
+ *
  *   def receive = {
  *     case EventHandler.Error(cause, instance, message) => ...
- *     case EventHandler.Warning(cause, instance, message) => ...
+ *     case EventHandler.Warning(instance, message) => ...
  *     case EventHandler.Info(instance, message) => ...
  *     case EventHandler.Debug(instance, message) => ...
  *   }
- * }
+ * })
  * 
  * EventHandler.addListener(errorHandlerEventListener)
  * ...
@@ -96,7 +97,7 @@ class ActorTimeoutException        private[akka](message: String) extends AkkaEx
  *
  * Log an error event:
  * 
- * EventHandler notifyListeners EventHandler.Error(exception, this, message.toString)
+ * EventHandler.notifyListeners(EventHandler.Error(exception, this, message.toString))
  * 
* @author Jonas Bonér */ @@ -110,12 +111,12 @@ object EventHandler extends ListenerManagement { val thread: Thread = Thread.currentThread } case class Error(cause: Throwable, instance: AnyRef, message: String = "") extends Event - case class Warning(cause: Throwable, instance: AnyRef, message: String = "") extends Event + case class Warning(instance: AnyRef, message: String = "") extends Event case class Info(instance: AnyRef, message: String = "") extends Event case class Debug(instance: AnyRef, message: String = "") extends Event val error = "[ERROR] [%s] [%s] [%s] %s\n%s".intern - val warning = "[WARN] [%s] [%s] [%s] %s\n%s".intern + val warning = "[WARN] [%s] [%s] [%s] %s".intern val info = "[INFO] [%s] [%s] [%s] %s".intern val debug = "[DEBUG] [%s] [%s] [%s] %s".intern val ID = "default:error:handler".intern @@ -143,13 +144,12 @@ object EventHandler extends ListenerManagement { instance.getClass.getSimpleName, message, stackTraceFor(cause))) - case event @ Warning(cause, instance, message) => + case event @ Warning(instance, message) => println(warning.format( formattedTimestamp, event.thread.getName, instance.getClass.getSimpleName, - message, - stackTraceFor(cause))) + message)) case event @ Info(instance, message) => println(info.format( formattedTimestamp, @@ -165,9 +165,19 @@ object EventHandler extends ListenerManagement { case _ => {} } } - - if (config.getBool("akka.default-error-handler", true)) - addListener(Actor.actorOf[DefaultListener].start) // FIXME configurable in config (on/off) + + config.getList("akka.event-handlers") foreach { listenerName => + try { + val clazz = Thread.currentThread.getContextClassLoader.loadClass(listenerName).asInstanceOf[Class[_]] + addListener(Actor.actorOf(clazz.asInstanceOf[Class[_ <: Actor]]).start) + } catch { + case e: Exception => + e.printStackTrace + new ConfigurationException( + "Event Handler specified in config can't be loaded [" + listenerName + + "] due to [" + e.toString + "]") + } + } } /** diff --git a/akka-actor/src/main/scala/akka/dispatch/ExecutorBasedEventDrivenDispatcher.scala b/akka-actor/src/main/scala/akka/dispatch/ExecutorBasedEventDrivenDispatcher.scala index b312878315..2e70e8cce2 100644 --- a/akka-actor/src/main/scala/akka/dispatch/ExecutorBasedEventDrivenDispatcher.scala +++ b/akka-actor/src/main/scala/akka/dispatch/ExecutorBasedEventDrivenDispatcher.scala @@ -132,7 +132,7 @@ class ExecutorBasedEventDrivenDispatcher( executorService.get() execute mbox } catch { case e: RejectedExecutionException => - EventHandler notifyListeners EventHandler.Warning(e, this, _name) + EventHandler notifyListeners EventHandler.Warning(this, e.toString) mbox.dispatcherLock.unlock() throw e } diff --git a/akka-actor/src/main/scala/akka/dispatch/ThreadPoolBuilder.scala b/akka-actor/src/main/scala/akka/dispatch/ThreadPoolBuilder.scala index 9efd64b576..c289968ced 100644 --- a/akka-actor/src/main/scala/akka/dispatch/ThreadPoolBuilder.scala +++ b/akka-actor/src/main/scala/akka/dispatch/ThreadPoolBuilder.scala @@ -208,7 +208,7 @@ class BoundedExecutorDecorator(val executor: ExecutorService, bound: Int) extend }) } catch { case e: RejectedExecutionException => - EventHandler notifyListeners EventHandler.Warning(e, this) + EventHandler notifyListeners EventHandler.Warning(this, e.toString) semaphore.release case e: Throwable => EventHandler notifyListeners EventHandler.Error(e, this) diff --git a/config/akka-reference.conf b/config/akka-reference.conf index 6a5c5559e0..def62bab9e 100644 --- a/config/akka-reference.conf +++ b/config/akka-reference.conf @@ -12,7 +12,7 @@ akka { time-unit = "seconds" # Time unit for all timeout properties throughout the config - default-error-handler = on # register the default error handler listener which logs errors to STDOUT + event-handlers = ["akka.actor.EventHandler$DefaultListener"] # register the default event handlers (the EventHandler.DefaultListener listener logs errors to STDOUT) # These boot classes are loaded (and created) automatically when the Akka Microkernel boots up # Can be used to bootstrap your application(s) From 92fa322ec2056c66ed534b053d8208928dd37c71 Mon Sep 17 00:00:00 2001 From: Viktor Klang Date: Mon, 7 Mar 2011 13:49:33 +0100 Subject: [PATCH 13/15] Moving most of the Jersey and Jetty deps into MicroKernel (akka-modules), closing #593 --- .../scala/akka/http/DefaultAkkaLoader.scala | 25 ------- .../scala/akka/http/EmbeddedAppServer.scala | 73 ------------------- project/build/AkkaProject.scala | 23 +----- 3 files changed, 3 insertions(+), 118 deletions(-) delete mode 100644 akka-http/src/main/scala/akka/http/DefaultAkkaLoader.scala delete mode 100644 akka-http/src/main/scala/akka/http/EmbeddedAppServer.scala diff --git a/akka-http/src/main/scala/akka/http/DefaultAkkaLoader.scala b/akka-http/src/main/scala/akka/http/DefaultAkkaLoader.scala deleted file mode 100644 index 35a9918bc1..0000000000 --- a/akka-http/src/main/scala/akka/http/DefaultAkkaLoader.scala +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Copyright (C) 2009-2011 Scalable Solutions AB - */ - -package akka.http - -import akka.config.Config -import akka.util.{Bootable} -import akka.remote.BootableRemoteActorService -import akka.actor.BootableActorLoaderService -import akka.servlet.AkkaLoader - -class DefaultAkkaLoader extends AkkaLoader { - def boot(): Unit = boot(true, new EmbeddedAppServer with BootableActorLoaderService with BootableRemoteActorService) -} - - -/** - * Can be used to boot Akka - * - * java -cp ... akka.http.Main - */ -object Main extends DefaultAkkaLoader { - def main(args: Array[String]) = boot -} diff --git a/akka-http/src/main/scala/akka/http/EmbeddedAppServer.scala b/akka-http/src/main/scala/akka/http/EmbeddedAppServer.scala deleted file mode 100644 index 6ca38736f7..0000000000 --- a/akka-http/src/main/scala/akka/http/EmbeddedAppServer.scala +++ /dev/null @@ -1,73 +0,0 @@ -/** - * Copyright (C) 2009-2011 Scalable Solutions AB - */ - -package akka.http - -import javax.ws.rs.core.UriBuilder -import javax.servlet.ServletConfig -import java.io.File - -import akka.actor.BootableActorLoaderService -import akka.util.Bootable - -import org.eclipse.jetty.xml.XmlConfiguration -import org.eclipse.jetty.server.{Handler, Server} -import org.eclipse.jetty.server.handler.{HandlerList, HandlerCollection, ContextHandler} -import java.net.URL -import akka.AkkaException - -/** - * Handles the Akka Comet Support (load/unload) - */ -trait EmbeddedAppServer extends Bootable { - self: BootableActorLoaderService => - - import akka.config.Config._ - - val REST_HOSTNAME = config.getString("akka.http.hostname", "localhost") - val REST_PORT = config.getInt("akka.http.port", 9998) - - val isRestEnabled = config.getList("akka.enabled-modules").exists(_ == "http") - - protected var server: Option[Server] = None - - protected def findJettyConfigXML: Option[URL] = - Option(applicationLoader.getOrElse(this.getClass.getClassLoader).getResource("microkernel-server.xml")) orElse - HOME.map(home => new File(home + "/config/microkernel-server.xml").toURI.toURL) - - abstract override def onLoad = { - super.onLoad - if (isRestEnabled) { - - val configuration = new XmlConfiguration(findJettyConfigXML.getOrElse(error("microkernel-server.xml not found!"))) - - System.setProperty("jetty.port", REST_PORT.toString) - System.setProperty("jetty.host", REST_HOSTNAME) - - HOME.foreach( home => System.setProperty("jetty.home", home + "/deploy/root") ) - - server = Option(configuration.configure.asInstanceOf[Server]) map { s => //Set the correct classloader to our contexts - applicationLoader foreach { loader => - //We need to provide the correct classloader to the servlets - def setClassLoader(handlers: Seq[Handler]): Unit = { - handlers foreach { - case c: ContextHandler => c.setClassLoader(loader) - case c: HandlerCollection => setClassLoader(c.getHandlers) - case _ => - } - } - setClassLoader(s.getHandlers) - } - //Start the server - s.start() - s - } - } - } - - abstract override def onUnload = { - super.onUnload - server foreach { _.stop() } - } -} diff --git a/project/build/AkkaProject.scala b/project/build/AkkaProject.scala index acf07c5ea9..3e1aefef2d 100644 --- a/project/build/AkkaProject.scala +++ b/project/build/AkkaProject.scala @@ -135,11 +135,7 @@ class AkkaParentProject(info: ProjectInfo) extends DefaultProject(info) { lazy val javax_servlet_30 = "org.glassfish" % "javax.servlet" % JAVAX_SERVLET_VERSION % "provided" //CDDL v1 - lazy val jetty = "org.eclipse.jetty" % "jetty-server" % JETTY_VERSION % "compile" //Eclipse license - lazy val jetty_util = "org.eclipse.jetty" % "jetty-util" % JETTY_VERSION % "compile" //Eclipse license - lazy val jetty_xml = "org.eclipse.jetty" % "jetty-xml" % JETTY_VERSION % "compile" //Eclipse license - lazy val jetty_servlet = "org.eclipse.jetty" % "jetty-servlet" % JETTY_VERSION % "compile" //Eclipse license - + lazy val jetty = "org.eclipse.jetty" % "jetty-server" % JETTY_VERSION % "provided" //Eclipse license lazy val guicey = "org.guiceyfruit" % "guice-all" % "2.0" % "compile" //ApacheV2 lazy val h2_lzf = "voldemort.store.compress" % "h2-lzf" % "1.0" % "compile" //ApacheV2 @@ -147,10 +143,7 @@ class AkkaParentProject(info: ProjectInfo) extends DefaultProject(info) { lazy val jackson = "org.codehaus.jackson" % "jackson-mapper-asl" % JACKSON_VERSION % "compile" //ApacheV2 lazy val jackson_core = "org.codehaus.jackson" % "jackson-core-asl" % JACKSON_VERSION % "compile" //ApacheV2 - lazy val jersey = "com.sun.jersey" % "jersey-core" % JERSEY_VERSION % "compile" //CDDL v1 - lazy val jersey_json = "com.sun.jersey" % "jersey-json" % JERSEY_VERSION % "compile" //CDDL v1 - lazy val jersey_server = "com.sun.jersey" % "jersey-server" % JERSEY_VERSION % "compile" //CDDL v1 - lazy val jersey_contrib = "com.sun.jersey.contribs" % "jersey-scala" % JERSEY_VERSION % "compile" //CDDL v1 + lazy val jersey_server = "com.sun.jersey" % "jersey-server" % JERSEY_VERSION % "provided" //CDDL v1 lazy val jsr250 = "javax.annotation" % "jsr250-api" % "1.0" % "compile" //CDDL v1 @@ -168,8 +161,6 @@ class AkkaParentProject(info: ProjectInfo) extends DefaultProject(info) { lazy val sjson = "net.debasishg" % "sjson_2.8.1" % "0.9.1" % "compile" //ApacheV2 lazy val sjson_test = "net.debasishg" % "sjson_2.8.1" % "0.9.1" % "test" //ApacheV2 - lazy val stax_api = "javax.xml.stream" % "stax-api" % "1.0-2" % "compile" //ApacheV2 - // Test lazy val commons_coll = "commons-collections" % "commons-collections" % "3.2.1" % "test" //ApacheV2 @@ -358,16 +349,8 @@ class AkkaParentProject(info: ProjectInfo) extends DefaultProject(info) { val jsr250 = Dependencies.jsr250 val javax_servlet30 = Dependencies.javax_servlet_30 val jetty = Dependencies.jetty - val jetty_util = Dependencies.jetty_util - val jetty_xml = Dependencies.jetty_xml - val jetty_servlet = Dependencies.jetty_servlet - val jackson_core = Dependencies.jackson_core - val jersey = Dependencies.jersey - val jersey_contrib = Dependencies.jersey_contrib - val jersey_json = Dependencies.jersey_json - val jersey_server = Dependencies.jersey_server + val jersey = Dependencies.jersey_server val jsr311 = Dependencies.jsr311 - val stax_api = Dependencies.stax_api // testing val junit = Dependencies.junit From 48949f214482a1fb4457edbfc8da03a2e5624720 Mon Sep 17 00:00:00 2001 From: Viktor Klang Date: Mon, 7 Mar 2011 14:09:31 +0100 Subject: [PATCH 14/15] Removing non-needed jersey module configuration --- project/build/AkkaProject.scala | 1 - 1 file changed, 1 deletion(-) diff --git a/project/build/AkkaProject.scala b/project/build/AkkaProject.scala index 3e1aefef2d..90443f4049 100644 --- a/project/build/AkkaProject.scala +++ b/project/build/AkkaProject.scala @@ -98,7 +98,6 @@ class AkkaParentProject(info: ProjectInfo) extends DefaultProject(info) { lazy val guiceyFruitModuleConfig = ModuleConfiguration("org.guiceyfruit", GuiceyFruitRepo) lazy val glassfishModuleConfig = ModuleConfiguration("org.glassfish", GlassfishRepo) lazy val jbossModuleConfig = ModuleConfiguration("org.jboss", JBossRepo) - lazy val jerseyContrModuleConfig = ModuleConfiguration("com.sun.jersey.contribs", JavaNetRepo) lazy val jerseyModuleConfig = ModuleConfiguration("com.sun.jersey", JavaNetRepo) lazy val multiverseModuleConfig = ModuleConfiguration("org.multiverse", CodehausRepo) lazy val nettyModuleConfig = ModuleConfiguration("org.jboss.netty", JBossRepo) From 4901ad3b6df0d2f4d3d4e57a5ef610ccda99c393 Mon Sep 17 00:00:00 2001 From: Viktor Klang Date: Mon, 7 Mar 2011 21:54:00 +0100 Subject: [PATCH 15/15] Fixing #655: Stopping all actors connected to remote server on shutdown --- .../remoteinterface/RemoteInterface.scala | 28 ++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/akka-actor/src/main/scala/akka/remoteinterface/RemoteInterface.scala b/akka-actor/src/main/scala/akka/remoteinterface/RemoteInterface.scala index 4e78446396..ed0122dd61 100644 --- a/akka-actor/src/main/scala/akka/remoteinterface/RemoteInterface.scala +++ b/akka-actor/src/main/scala/akka/remoteinterface/RemoteInterface.scala @@ -216,7 +216,33 @@ abstract class RemoteSupport extends ListenerManagement with RemoteServerModule private[akka] val typedActorsFactories = new ConcurrentHashMap[String, () => AnyRef] def clear { - List(actors,actorsByUuid,actorsFactories,typedActors,typedActorsByUuid,typedActorsFactories) foreach (_.clear) + def clearActorMap(map: ConcurrentHashMap[String, ActorRef]) { + val i = map.values.iterator + while (i.hasNext) { + i.next match { + case ref: LocalActorRef => try { ref.stop } catch { case e: Exception => } + case _ => + } + } + map.clear + } + + def clearTypedActorMap(map: ConcurrentHashMap[String, AnyRef]) { + ReflectiveAccess.TypedActorModule.typedActorObjectInstance foreach { + case typedActor => + val i = map.values.iterator + //FIXME Only stop local TypedActor? + while (i.hasNext) { try { typedActor.stop(i.next) } catch { case e: Exception => } } + } + map.clear + } + + clearActorMap(actors) + clearActorMap(actorsByUuid) + clearTypedActorMap(typedActors) + clearTypedActorMap(typedActorsByUuid) + actorsFactories.clear + typedActorsFactories.clear } }