diff --git a/akka-actor/src/main/scala/actor/Actor.scala b/akka-actor/src/main/scala/actor/Actor.scala
index d3e7699403..872997c760 100644
--- a/akka-actor/src/main/scala/actor/Actor.scala
+++ b/akka-actor/src/main/scala/actor/Actor.scala
@@ -410,14 +410,14 @@ trait Actor extends Logging {
*
* Is called when an Actor is started by invoking 'actor.start'.
*/
- def init {}
+ def preStart {}
/**
* User overridable callback.
*
* Is called when 'actor.stop' is invoked.
*/
- def shutdown {}
+ def postStop {}
/**
* User overridable callback.
@@ -433,13 +433,6 @@ trait Actor extends Logging {
*/
def postRestart(reason: Throwable) {}
- /**
- * User overridable callback.
- *
- * Is called during initialization. Can be used to initialize transactional state. Will be invoked within a transaction.
- */
- def initTransactionalState {}
-
/**
* Is the actor able to handle the message passed in as arguments?
*/
diff --git a/akka-actor/src/main/scala/actor/ActorRef.scala b/akka-actor/src/main/scala/actor/ActorRef.scala
index 4d422e7c57..3472ec4696 100644
--- a/akka-actor/src/main/scala/actor/ActorRef.scala
+++ b/akka-actor/src/main/scala/actor/ActorRef.scala
@@ -817,7 +817,7 @@ class LocalActorRef private[akka](
_transactionFactory = None
_isRunning = false
_isShutDown = true
- actor.shutdown
+ actor.postStop
ActorRegistry.unregister(this)
if (isRemotingEnabled) {
if(remoteAddress.isDefined)
@@ -1123,8 +1123,7 @@ class LocalActorRef private[akka](
failedActor.preRestart(reason)
nullOutActorRefReferencesFor(failedActor)
val freshActor = newActor
- freshActor.init
- freshActor.initTransactionalState
+ freshActor.preStart
actorInstance.set(freshActor)
if (failedActor.isInstanceOf[Proxyable])
failedActor.asInstanceOf[Proxyable].swapProxiedActor(freshActor)
@@ -1292,8 +1291,7 @@ class LocalActorRef private[akka](
}
private def initializeActorInstance = {
- actor.init // run actor init and initTransactionalState callbacks
- actor.initTransactionalState
+ actor.preStart // run actor preStart
Actor.log.trace("[%s] has started", toString)
ActorRegistry.register(this)
if (id == "N/A") id = actorClass.getName // if no name set, then use default name (class name)
diff --git a/akka-actor/src/main/scala/actor/Supervisor.scala b/akka-actor/src/main/scala/actor/Supervisor.scala
index 1af351a33d..f575cda299 100644
--- a/akka-actor/src/main/scala/actor/Supervisor.scala
+++ b/akka-actor/src/main/scala/actor/Supervisor.scala
@@ -187,7 +187,7 @@ final class SupervisorActor private[akka] (
trapExit = trapExceptions
faultHandler = Some(handler)
- override def shutdown(): Unit = shutdownLinkedActors
+ override def postStop(): Unit = shutdownLinkedActors
def receive = {
// FIXME add a way to respond to MaximumNumberOfRestartsWithinTimeRangeReached in declaratively configured Supervisor
diff --git a/akka-actor/src/test/scala/actor/actor/Bench.scala b/akka-actor/src/test/scala/actor/actor/Bench.scala
index 8e3a44f3a0..ded90edad5 100644
--- a/akka-actor/src/test/scala/actor/actor/Bench.scala
+++ b/akka-actor/src/test/scala/actor/actor/Bench.scala
@@ -78,7 +78,7 @@ object Chameneos {
var sumMeetings = 0
var numFaded = 0
- override def init = {
+ override def preStart = {
for (i <- 0 until numChameneos) actorOf(new Chameneo(self, colours(i % 3), i))
}
diff --git a/akka-actor/src/test/scala/actor/supervisor/RestartStrategySpec.scala b/akka-actor/src/test/scala/actor/supervisor/RestartStrategySpec.scala
index 5023c756e1..234a0bd25d 100644
--- a/akka-actor/src/test/scala/actor/supervisor/RestartStrategySpec.scala
+++ b/akka-actor/src/test/scala/actor/supervisor/RestartStrategySpec.scala
@@ -42,7 +42,7 @@ class RestartStrategySpec extends JUnitSuite {
restartLatch.open
}
- override def shutdown = {
+ override def postStop = {
if (restartLatch.isOpen) {
secondRestartLatch.open
}
diff --git a/akka-actor/src/test/scala/dispatch/HawtDispatcherEchoServer.scala b/akka-actor/src/test/scala/dispatch/HawtDispatcherEchoServer.scala
index 97f2e0df9d..8d4c8dedc1 100644
--- a/akka-actor/src/test/scala/dispatch/HawtDispatcherEchoServer.scala
+++ b/akka-actor/src/test/scala/dispatch/HawtDispatcherEchoServer.scala
@@ -53,7 +53,7 @@ object HawtDispatcherEchoServer {
var accept_source:DispatchSource = _
var sessions = ListBuffer[ActorRef]()
- override def init = {
+ override def preStart = {
channel = ServerSocketChannel.open();
channel.socket().bind(new InetSocketAddress(port));
channel.configureBlocking(false);
@@ -122,7 +122,7 @@ object HawtDispatcherEchoServer {
var writeCounter = 0L
var closed = false
- override def init = {
+ override def preStart = {
if(useReactorPattern) {
// Then we will be using the reactor pattern for handling IO:
@@ -154,7 +154,7 @@ object HawtDispatcherEchoServer {
println("Accepted connection from: "+remote_address);
}
- override def shutdown = {
+ override def postStop = {
closed = true
read_source.release
write_source.release
diff --git a/akka-actor/src/test/scala/dispatch/ThreadBasedDispatcherSpec.scala b/akka-actor/src/test/scala/dispatch/ThreadBasedDispatcherSpec.scala
index 44cd9aade3..7ecef80e39 100644
--- a/akka-actor/src/test/scala/dispatch/ThreadBasedDispatcherSpec.scala
+++ b/akka-actor/src/test/scala/dispatch/ThreadBasedDispatcherSpec.scala
@@ -85,7 +85,7 @@ class ThreadBasedDispatcherSpec extends JUnitSuite {
}
assert(handleLatch.await(5, TimeUnit.SECONDS))
assert(!threadingIssueDetected.get)
- dispatcher.shutdown
+ dispatcher.postStop
}
}
*/
diff --git a/akka-amqp/src/main/scala/se/scalablesolutions/akka/amqp/ConsumerActor.scala b/akka-amqp/src/main/scala/se/scalablesolutions/akka/amqp/ConsumerActor.scala
index d3f0acd1cf..0ca9046093 100644
--- a/akka-amqp/src/main/scala/se/scalablesolutions/akka/amqp/ConsumerActor.scala
+++ b/akka-amqp/src/main/scala/se/scalablesolutions/akka/amqp/ConsumerActor.scala
@@ -108,10 +108,10 @@ private[amqp] class ConsumerActor(consumerParameters: ConsumerParameters)
super.preRestart(reason)
}
- override def shutdown = {
+ override def postStop = {
listenerTag.foreach(tag => channel.foreach(_.basicCancel(tag)))
self.shutdownLinkedActors
- super.shutdown
+ super.postStop
}
override def toString =
diff --git a/akka-amqp/src/main/scala/se/scalablesolutions/akka/amqp/ExampleSession.scala b/akka-amqp/src/main/scala/se/scalablesolutions/akka/amqp/ExampleSession.scala
index f45553520d..ecb3029444 100644
--- a/akka-amqp/src/main/scala/se/scalablesolutions/akka/amqp/ExampleSession.scala
+++ b/akka-amqp/src/main/scala/se/scalablesolutions/akka/amqp/ExampleSession.scala
@@ -46,7 +46,7 @@ object ExampleSession {
printTopic("Happy hAkking :-)")
- // shutdown everything the amqp tree except the main AMQP supervisor
+ // postStop everything the amqp tree except the main AMQP supervisor
// all connections/consumers/producers will be stopped
AMQP.shutdownAll
diff --git a/akka-amqp/src/main/scala/se/scalablesolutions/akka/amqp/FaultTolerantChannelActor.scala b/akka-amqp/src/main/scala/se/scalablesolutions/akka/amqp/FaultTolerantChannelActor.scala
index 5ecae4c6d3..4d642df554 100644
--- a/akka-amqp/src/main/scala/se/scalablesolutions/akka/amqp/FaultTolerantChannelActor.scala
+++ b/akka-amqp/src/main/scala/se/scalablesolutions/akka/amqp/FaultTolerantChannelActor.scala
@@ -103,5 +103,5 @@ abstract private[amqp] class FaultTolerantChannelActor(
closeChannel
}
- override def shutdown = closeChannel
+ override def postStop = closeChannel
}
diff --git a/akka-amqp/src/main/scala/se/scalablesolutions/akka/amqp/FaultTolerantConnectionActor.scala b/akka-amqp/src/main/scala/se/scalablesolutions/akka/amqp/FaultTolerantConnectionActor.scala
index 1e50a985be..0fd3f715b5 100644
--- a/akka-amqp/src/main/scala/se/scalablesolutions/akka/amqp/FaultTolerantConnectionActor.scala
+++ b/akka-amqp/src/main/scala/se/scalablesolutions/akka/amqp/FaultTolerantConnectionActor.scala
@@ -104,9 +104,9 @@ private[amqp] class FaultTolerantConnectionActor(connectionParameters: Connectio
connectionCallback.foreach(cb => if (cb.isRunning) cb ! message)
}
- override def shutdown = {
+ override def postStop = {
reconnectionTimer.cancel
- // make sure shutdown is called on all linked actors so they can do channel cleanup before connection is killed
+ // make sure postStop is called on all linked actors so they can do channel cleanup before connection is killed
self.shutdownLinkedActors
disconnect
}
diff --git a/akka-amqp/src/main/scala/se/scalablesolutions/akka/amqp/rpc/RpcClientActor.scala b/akka-amqp/src/main/scala/se/scalablesolutions/akka/amqp/rpc/RpcClientActor.scala
index 5c717cb8bb..10596e393f 100644
--- a/akka-amqp/src/main/scala/se/scalablesolutions/akka/amqp/rpc/RpcClientActor.scala
+++ b/akka-amqp/src/main/scala/se/scalablesolutions/akka/amqp/rpc/RpcClientActor.scala
@@ -40,9 +40,9 @@ class RpcClientActor[I,O](
}
- override def shutdown = {
+ override def postStop = {
rpcClient.foreach(rpc => rpc.close)
- super.shutdown
+ super.postStop
}
override def toString = "AMQP.RpcClient[exchange=" +exchangeName + ", routingKey=" + routingKey+ "]"
diff --git a/akka-camel/src/main/scala/Producer.scala b/akka-camel/src/main/scala/Producer.scala
index 8764b91b4c..0be07e9737 100644
--- a/akka-camel/src/main/scala/Producer.scala
+++ b/akka-camel/src/main/scala/Producer.scala
@@ -54,10 +54,10 @@ trait ProducerSupport { this: Actor =>
def headersToCopy: Set[String] = headersToCopyDefault
/**
- * Default implementation of Actor.shutdown for freeing resources needed
+ * Default implementation of Actor.postStop for freeing resources needed
* to actually send messages to endpointUri.
*/
- override def shutdown {
+ override def postStop {
processor.stop
}
diff --git a/akka-http/src/main/scala/AkkaClusterBroadcastFilter.scala b/akka-http/src/main/scala/AkkaClusterBroadcastFilter.scala
index 775c8b554d..7ea963872f 100644
--- a/akka-http/src/main/scala/AkkaClusterBroadcastFilter.scala
+++ b/akka-http/src/main/scala/AkkaClusterBroadcastFilter.scala
@@ -24,6 +24,11 @@ class AkkaClusterBroadcastFilter extends Actor with ClusterBroadcastFilter {
@BeanProperty var clusterName = ""
@BeanProperty var broadcaster : Broadcaster = null
+ def init() {
+ //Since this class is instantiated by Atmosphere, we need to make sure it's started
+ self.start
+ }
+
/**
* Stops the actor
*/
@@ -48,7 +53,4 @@ class AkkaClusterBroadcastFilter extends Actor with ClusterBroadcastFilter {
case b @ ClusterCometBroadcast(c, _) if (c == clusterName) && (broadcaster ne null) => broadcaster broadcast b
case _ =>
}
-
- //Since this class is instantiated by Atmosphere, we need to make sure it's started
- self.start
}
diff --git a/akka-http/src/main/scala/Initializer.scala b/akka-http/src/main/scala/Initializer.scala
index da95a39b77..c1cd8bfc87 100644
--- a/akka-http/src/main/scala/Initializer.scala
+++ b/akka-http/src/main/scala/Initializer.scala
@@ -13,7 +13,7 @@ import se.scalablesolutions.akka.util.{Logging, Bootable}
import javax.servlet.{ServletContextListener, ServletContextEvent}
/**
- * This class can be added to web.xml mappings as a listener to start and shutdown Akka.
+ * This class can be added to web.xml mappings as a listener to start and postStop Akka.
*
*
* ...
diff --git a/akka-jta/src/main/scala/AtomikosTransactionService.scala b/akka-jta/src/main/scala/AtomikosTransactionService.scala
index 305ddb6ace..4acbb1a013 100644
--- a/akka-jta/src/main/scala/AtomikosTransactionService.scala
+++ b/akka-jta/src/main/scala/AtomikosTransactionService.scala
@@ -36,6 +36,6 @@ class AtomikosTransactionService extends TransactionService with TransactionProt
"Could not create a new Atomikos J2EE Transaction Manager, due to: " + e.toString)
}
)))
- // TODO: gracefully shutdown of the TM
- //txService.shutdown(false)
+ // TODO: gracefully postStop of the TM
+ //txService.postStop(false)
}
diff --git a/akka-kernel/src/main/scala/Kernel.scala b/akka-kernel/src/main/scala/Kernel.scala
index 6489a60680..646ca34bcc 100644
--- a/akka-kernel/src/main/scala/Kernel.scala
+++ b/akka-kernel/src/main/scala/Kernel.scala
@@ -15,7 +15,7 @@ object Main {
}
/**
- * The Akka Kernel, is used to start And shutdown Akka in standalone/kernel mode.
+ * The Akka Kernel, is used to start And postStop Akka in standalone/kernel mode.
*
* @author Jonas Bonér
*/
diff --git a/akka-persistence/akka-persistence-redis/src/main/scala/RedisStorageBackend.scala b/akka-persistence/akka-persistence-redis/src/main/scala/RedisStorageBackend.scala
index 61595ec21f..9fd3142019 100644
--- a/akka-persistence/akka-persistence-redis/src/main/scala/RedisStorageBackend.scala
+++ b/akka-persistence/akka-persistence-redis/src/main/scala/RedisStorageBackend.scala
@@ -302,13 +302,23 @@ private [akka] object RedisStorageBackend extends
// add item to sorted set identified by name
def zadd(name: String, zscore: String, item: Array[Byte]): Boolean = withErrorHandling {
db.zadd(name, zscore, byteArrayToString(item))
- .map { case 1 => true }.getOrElse(false)
+ .map { e =>
+ e match {
+ case 1 => true
+ case _ => false
+ }
+ }.getOrElse(false)
}
// remove item from sorted set identified by name
def zrem(name: String, item: Array[Byte]): Boolean = withErrorHandling {
db.zrem(name, byteArrayToString(item))
- .map { case 1 => true }.getOrElse(false)
+ .map { e =>
+ e match {
+ case 1 => true
+ case _ => false
+ }
+ }.getOrElse(false)
}
// cardinality of the set identified by name
@@ -349,6 +359,7 @@ private [akka] object RedisStorageBackend extends
case e: java.lang.NullPointerException =>
throw new StorageException("Could not connect to Redis server")
case e =>
+ e.printStackTrace
throw new StorageException("Error in Redis: " + e.getMessage)
}
}
diff --git a/akka-remote/src/main/java/se/scalablesolutions/akka/remote/protocol/RemoteProtocol.java b/akka-remote/src/main/java/se/scalablesolutions/akka/remote/protocol/RemoteProtocol.java
index b8a4c04c33..61d79c7a3f 100644
--- a/akka-remote/src/main/java/se/scalablesolutions/akka/remote/protocol/RemoteProtocol.java
+++ b/akka-remote/src/main/java/se/scalablesolutions/akka/remote/protocol/RemoteProtocol.java
@@ -2827,6 +2827,18 @@ public final class RemoteProtocol {
public boolean hasSender() { return hasSender; }
public se.scalablesolutions.akka.remote.protocol.RemoteProtocol.RemoteActorRefProtocol getSender() { return sender_; }
+ // repeated .MetadataEntryProtocol metadata = 7;
+ public static final int METADATA_FIELD_NUMBER = 7;
+ private java.util.List metadata_ =
+ java.util.Collections.emptyList();
+ public java.util.List getMetadataList() {
+ return metadata_;
+ }
+ public int getMetadataCount() { return metadata_.size(); }
+ public se.scalablesolutions.akka.remote.protocol.RemoteProtocol.MetadataEntryProtocol getMetadata(int index) {
+ return metadata_.get(index);
+ }
+
private void initFields() {
message_ = se.scalablesolutions.akka.remote.protocol.RemoteProtocol.MessageProtocol.getDefaultInstance();
actorInfo_ = se.scalablesolutions.akka.remote.protocol.RemoteProtocol.ActorInfoProtocol.getDefaultInstance();
@@ -2842,6 +2854,9 @@ public final class RemoteProtocol {
if (hasSender()) {
if (!getSender().isInitialized()) return false;
}
+ for (se.scalablesolutions.akka.remote.protocol.RemoteProtocol.MetadataEntryProtocol element : getMetadataList()) {
+ if (!element.isInitialized()) return false;
+ }
return true;
}
@@ -2866,6 +2881,9 @@ public final class RemoteProtocol {
if (hasSender()) {
output.writeMessage(6, getSender());
}
+ for (se.scalablesolutions.akka.remote.protocol.RemoteProtocol.MetadataEntryProtocol element : getMetadataList()) {
+ output.writeMessage(7, element);
+ }
getUnknownFields().writeTo(output);
}
@@ -2899,6 +2917,10 @@ public final class RemoteProtocol {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(6, getSender());
}
+ for (se.scalablesolutions.akka.remote.protocol.RemoteProtocol.MetadataEntryProtocol element : getMetadataList()) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(7, element);
+ }
size += getUnknownFields().getSerializedSize();
memoizedSerializedSize = size;
return size;
@@ -3041,6 +3063,10 @@ public final class RemoteProtocol {
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_);
+ }
se.scalablesolutions.akka.remote.protocol.RemoteProtocol.RemoteRequestProtocol returnMe = result;
result = null;
return returnMe;
@@ -3075,6 +3101,12 @@ public final class RemoteProtocol {
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_);
+ }
this.mergeUnknownFields(other.getUnknownFields());
return this;
}
@@ -3139,6 +3171,12 @@ public final class RemoteProtocol {
setSender(subBuilder.buildPartial());
break;
}
+ case 58: {
+ se.scalablesolutions.akka.remote.protocol.RemoteProtocol.MetadataEntryProtocol.Builder subBuilder = se.scalablesolutions.akka.remote.protocol.RemoteProtocol.MetadataEntryProtocol.newBuilder();
+ input.readMessage(subBuilder, extensionRegistry);
+ addMetadata(subBuilder.buildPartial());
+ break;
+ }
}
}
}
@@ -3312,6 +3350,57 @@ public final class RemoteProtocol {
return this;
}
+ // repeated .MetadataEntryProtocol metadata = 7;
+ public java.util.List getMetadataList() {
+ return java.util.Collections.unmodifiableList(result.metadata_);
+ }
+ public int getMetadataCount() {
+ return result.getMetadataCount();
+ }
+ public se.scalablesolutions.akka.remote.protocol.RemoteProtocol.MetadataEntryProtocol getMetadata(int index) {
+ return result.getMetadata(index);
+ }
+ public Builder setMetadata(int index, se.scalablesolutions.akka.remote.protocol.RemoteProtocol.MetadataEntryProtocol value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ result.metadata_.set(index, value);
+ return this;
+ }
+ public Builder setMetadata(int index, se.scalablesolutions.akka.remote.protocol.RemoteProtocol.MetadataEntryProtocol.Builder builderForValue) {
+ result.metadata_.set(index, builderForValue.build());
+ return this;
+ }
+ public Builder addMetadata(se.scalablesolutions.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(se.scalablesolutions.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 extends se.scalablesolutions.akka.remote.protocol.RemoteProtocol.MetadataEntryProtocol> 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;
+ }
+
// @@protoc_insertion_point(builder_scope:RemoteRequestProtocol)
}
@@ -3393,6 +3482,18 @@ public final class RemoteProtocol {
public boolean hasIsSuccessful() { return hasIsSuccessful; }
public boolean getIsSuccessful() { return isSuccessful_; }
+ // repeated .MetadataEntryProtocol metadata = 7;
+ public static final int METADATA_FIELD_NUMBER = 7;
+ private java.util.List metadata_ =
+ java.util.Collections.emptyList();
+ public java.util.List getMetadataList() {
+ return metadata_;
+ }
+ public int getMetadataCount() { return metadata_.size(); }
+ public se.scalablesolutions.akka.remote.protocol.RemoteProtocol.MetadataEntryProtocol getMetadata(int index) {
+ return metadata_.get(index);
+ }
+
private void initFields() {
message_ = se.scalablesolutions.akka.remote.protocol.RemoteProtocol.MessageProtocol.getDefaultInstance();
exception_ = se.scalablesolutions.akka.remote.protocol.RemoteProtocol.ExceptionProtocol.getDefaultInstance();
@@ -3407,6 +3508,9 @@ public final class RemoteProtocol {
if (hasException()) {
if (!getException().isInitialized()) return false;
}
+ for (se.scalablesolutions.akka.remote.protocol.RemoteProtocol.MetadataEntryProtocol element : getMetadataList()) {
+ if (!element.isInitialized()) return false;
+ }
return true;
}
@@ -3431,6 +3535,9 @@ public final class RemoteProtocol {
if (hasIsSuccessful()) {
output.writeBool(6, getIsSuccessful());
}
+ for (se.scalablesolutions.akka.remote.protocol.RemoteProtocol.MetadataEntryProtocol element : getMetadataList()) {
+ output.writeMessage(7, element);
+ }
getUnknownFields().writeTo(output);
}
@@ -3464,6 +3571,10 @@ public final class RemoteProtocol {
size += com.google.protobuf.CodedOutputStream
.computeBoolSize(6, getIsSuccessful());
}
+ for (se.scalablesolutions.akka.remote.protocol.RemoteProtocol.MetadataEntryProtocol element : getMetadataList()) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(7, element);
+ }
size += getUnknownFields().getSerializedSize();
memoizedSerializedSize = size;
return size;
@@ -3606,6 +3717,10 @@ public final class RemoteProtocol {
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_);
+ }
se.scalablesolutions.akka.remote.protocol.RemoteProtocol.RemoteReplyProtocol returnMe = result;
result = null;
return returnMe;
@@ -3640,6 +3755,12 @@ public final class RemoteProtocol {
if (other.hasIsSuccessful()) {
setIsSuccessful(other.getIsSuccessful());
}
+ if (!other.metadata_.isEmpty()) {
+ if (result.metadata_.isEmpty()) {
+ result.metadata_ = new java.util.ArrayList();
+ }
+ result.metadata_.addAll(other.metadata_);
+ }
this.mergeUnknownFields(other.getUnknownFields());
return this;
}
@@ -3699,6 +3820,12 @@ public final class RemoteProtocol {
setIsSuccessful(input.readBool());
break;
}
+ case 58: {
+ se.scalablesolutions.akka.remote.protocol.RemoteProtocol.MetadataEntryProtocol.Builder subBuilder = se.scalablesolutions.akka.remote.protocol.RemoteProtocol.MetadataEntryProtocol.newBuilder();
+ input.readMessage(subBuilder, extensionRegistry);
+ addMetadata(subBuilder.buildPartial());
+ break;
+ }
}
}
}
@@ -3853,6 +3980,57 @@ public final class RemoteProtocol {
return this;
}
+ // repeated .MetadataEntryProtocol metadata = 7;
+ public java.util.List getMetadataList() {
+ return java.util.Collections.unmodifiableList(result.metadata_);
+ }
+ public int getMetadataCount() {
+ return result.getMetadataCount();
+ }
+ public se.scalablesolutions.akka.remote.protocol.RemoteProtocol.MetadataEntryProtocol getMetadata(int index) {
+ return result.getMetadata(index);
+ }
+ public Builder setMetadata(int index, se.scalablesolutions.akka.remote.protocol.RemoteProtocol.MetadataEntryProtocol value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ result.metadata_.set(index, value);
+ return this;
+ }
+ public Builder setMetadata(int index, se.scalablesolutions.akka.remote.protocol.RemoteProtocol.MetadataEntryProtocol.Builder builderForValue) {
+ result.metadata_.set(index, builderForValue.build());
+ return this;
+ }
+ public Builder addMetadata(se.scalablesolutions.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(se.scalablesolutions.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 extends se.scalablesolutions.akka.remote.protocol.RemoteProtocol.MetadataEntryProtocol> 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;
+ }
+
// @@protoc_insertion_point(builder_scope:RemoteReplyProtocol)
}
@@ -3865,6 +4043,662 @@ public final class RemoteProtocol {
// @@protoc_insertion_point(class_scope:RemoteReplyProtocol)
}
+ public static final class UuidProtocol extends
+ com.google.protobuf.GeneratedMessage {
+ // Use UuidProtocol.newBuilder() to construct.
+ private UuidProtocol() {
+ initFields();
+ }
+ private UuidProtocol(boolean noInit) {}
+
+ private static final UuidProtocol defaultInstance;
+ public static UuidProtocol getDefaultInstance() {
+ return defaultInstance;
+ }
+
+ public UuidProtocol getDefaultInstanceForType() {
+ return defaultInstance;
+ }
+
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return se.scalablesolutions.akka.remote.protocol.RemoteProtocol.internal_static_UuidProtocol_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return se.scalablesolutions.akka.remote.protocol.RemoteProtocol.internal_static_UuidProtocol_fieldAccessorTable;
+ }
+
+ // required uint64 high = 1;
+ public static final int HIGH_FIELD_NUMBER = 1;
+ private boolean hasHigh;
+ private long high_ = 0L;
+ public boolean hasHigh() { return hasHigh; }
+ public long getHigh() { return high_; }
+
+ // required uint64 low = 2;
+ public static final int LOW_FIELD_NUMBER = 2;
+ private boolean hasLow;
+ private long low_ = 0L;
+ public boolean hasLow() { return hasLow; }
+ public long getLow() { return low_; }
+
+ private void initFields() {
+ }
+ public final boolean isInitialized() {
+ if (!hasHigh) return false;
+ if (!hasLow) return false;
+ return true;
+ }
+
+ public void writeTo(com.google.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ getSerializedSize();
+ if (hasHigh()) {
+ output.writeUInt64(1, getHigh());
+ }
+ if (hasLow()) {
+ output.writeUInt64(2, getLow());
+ }
+ getUnknownFields().writeTo(output);
+ }
+
+ private int memoizedSerializedSize = -1;
+ public int getSerializedSize() {
+ int size = memoizedSerializedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (hasHigh()) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeUInt64Size(1, getHigh());
+ }
+ if (hasLow()) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeUInt64Size(2, getLow());
+ }
+ size += getUnknownFields().getSerializedSize();
+ memoizedSerializedSize = size;
+ return size;
+ }
+
+ public static se.scalablesolutions.akka.remote.protocol.RemoteProtocol.UuidProtocol parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return newBuilder().mergeFrom(data).buildParsed();
+ }
+ public static se.scalablesolutions.akka.remote.protocol.RemoteProtocol.UuidProtocol parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return newBuilder().mergeFrom(data, extensionRegistry)
+ .buildParsed();
+ }
+ public static se.scalablesolutions.akka.remote.protocol.RemoteProtocol.UuidProtocol parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return newBuilder().mergeFrom(data).buildParsed();
+ }
+ public static se.scalablesolutions.akka.remote.protocol.RemoteProtocol.UuidProtocol parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return newBuilder().mergeFrom(data, extensionRegistry)
+ .buildParsed();
+ }
+ public static se.scalablesolutions.akka.remote.protocol.RemoteProtocol.UuidProtocol parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return newBuilder().mergeFrom(input).buildParsed();
+ }
+ public static se.scalablesolutions.akka.remote.protocol.RemoteProtocol.UuidProtocol parseFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return newBuilder().mergeFrom(input, extensionRegistry)
+ .buildParsed();
+ }
+ public static se.scalablesolutions.akka.remote.protocol.RemoteProtocol.UuidProtocol parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ Builder builder = newBuilder();
+ if (builder.mergeDelimitedFrom(input)) {
+ return builder.buildParsed();
+ } else {
+ return null;
+ }
+ }
+ public static se.scalablesolutions.akka.remote.protocol.RemoteProtocol.UuidProtocol 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 se.scalablesolutions.akka.remote.protocol.RemoteProtocol.UuidProtocol parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return newBuilder().mergeFrom(input).buildParsed();
+ }
+ public static se.scalablesolutions.akka.remote.protocol.RemoteProtocol.UuidProtocol 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(se.scalablesolutions.akka.remote.protocol.RemoteProtocol.UuidProtocol prototype) {
+ return newBuilder().mergeFrom(prototype);
+ }
+ public Builder toBuilder() { return newBuilder(this); }
+
+ public static final class Builder extends
+ com.google.protobuf.GeneratedMessage.Builder {
+ private se.scalablesolutions.akka.remote.protocol.RemoteProtocol.UuidProtocol result;
+
+ // Construct using se.scalablesolutions.akka.remote.protocol.RemoteProtocol.UuidProtocol.newBuilder()
+ private Builder() {}
+
+ private static Builder create() {
+ Builder builder = new Builder();
+ builder.result = new se.scalablesolutions.akka.remote.protocol.RemoteProtocol.UuidProtocol();
+ return builder;
+ }
+
+ protected se.scalablesolutions.akka.remote.protocol.RemoteProtocol.UuidProtocol internalGetResult() {
+ return result;
+ }
+
+ public Builder clear() {
+ if (result == null) {
+ throw new IllegalStateException(
+ "Cannot call clear() after build().");
+ }
+ result = new se.scalablesolutions.akka.remote.protocol.RemoteProtocol.UuidProtocol();
+ return this;
+ }
+
+ public Builder clone() {
+ return create().mergeFrom(result);
+ }
+
+ public com.google.protobuf.Descriptors.Descriptor
+ getDescriptorForType() {
+ return se.scalablesolutions.akka.remote.protocol.RemoteProtocol.UuidProtocol.getDescriptor();
+ }
+
+ public se.scalablesolutions.akka.remote.protocol.RemoteProtocol.UuidProtocol getDefaultInstanceForType() {
+ return se.scalablesolutions.akka.remote.protocol.RemoteProtocol.UuidProtocol.getDefaultInstance();
+ }
+
+ public boolean isInitialized() {
+ return result.isInitialized();
+ }
+ public se.scalablesolutions.akka.remote.protocol.RemoteProtocol.UuidProtocol build() {
+ if (result != null && !isInitialized()) {
+ throw newUninitializedMessageException(result);
+ }
+ return buildPartial();
+ }
+
+ private se.scalablesolutions.akka.remote.protocol.RemoteProtocol.UuidProtocol buildParsed()
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ if (!isInitialized()) {
+ throw newUninitializedMessageException(
+ result).asInvalidProtocolBufferException();
+ }
+ return buildPartial();
+ }
+
+ public se.scalablesolutions.akka.remote.protocol.RemoteProtocol.UuidProtocol buildPartial() {
+ if (result == null) {
+ throw new IllegalStateException(
+ "build() has already been called on this Builder.");
+ }
+ se.scalablesolutions.akka.remote.protocol.RemoteProtocol.UuidProtocol returnMe = result;
+ result = null;
+ return returnMe;
+ }
+
+ public Builder mergeFrom(com.google.protobuf.Message other) {
+ if (other instanceof se.scalablesolutions.akka.remote.protocol.RemoteProtocol.UuidProtocol) {
+ return mergeFrom((se.scalablesolutions.akka.remote.protocol.RemoteProtocol.UuidProtocol)other);
+ } else {
+ super.mergeFrom(other);
+ return this;
+ }
+ }
+
+ public Builder mergeFrom(se.scalablesolutions.akka.remote.protocol.RemoteProtocol.UuidProtocol other) {
+ if (other == se.scalablesolutions.akka.remote.protocol.RemoteProtocol.UuidProtocol.getDefaultInstance()) return this;
+ if (other.hasHigh()) {
+ setHigh(other.getHigh());
+ }
+ if (other.hasLow()) {
+ setLow(other.getLow());
+ }
+ 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 8: {
+ setHigh(input.readUInt64());
+ break;
+ }
+ case 16: {
+ setLow(input.readUInt64());
+ break;
+ }
+ }
+ }
+ }
+
+
+ // required uint64 high = 1;
+ public boolean hasHigh() {
+ return result.hasHigh();
+ }
+ public long getHigh() {
+ return result.getHigh();
+ }
+ public Builder setHigh(long value) {
+ result.hasHigh = true;
+ result.high_ = value;
+ return this;
+ }
+ public Builder clearHigh() {
+ result.hasHigh = false;
+ result.high_ = 0L;
+ return this;
+ }
+
+ // required uint64 low = 2;
+ public boolean hasLow() {
+ return result.hasLow();
+ }
+ public long getLow() {
+ return result.getLow();
+ }
+ public Builder setLow(long value) {
+ result.hasLow = true;
+ result.low_ = value;
+ return this;
+ }
+ public Builder clearLow() {
+ result.hasLow = false;
+ result.low_ = 0L;
+ return this;
+ }
+
+ // @@protoc_insertion_point(builder_scope:UuidProtocol)
+ }
+
+ static {
+ defaultInstance = new UuidProtocol(true);
+ se.scalablesolutions.akka.remote.protocol.RemoteProtocol.internalForceInit();
+ defaultInstance.initFields();
+ }
+
+ // @@protoc_insertion_point(class_scope:UuidProtocol)
+ }
+
+ public static final class MetadataEntryProtocol extends
+ com.google.protobuf.GeneratedMessage {
+ // Use MetadataEntryProtocol.newBuilder() to construct.
+ private MetadataEntryProtocol() {
+ initFields();
+ }
+ private MetadataEntryProtocol(boolean noInit) {}
+
+ private static final MetadataEntryProtocol defaultInstance;
+ public static MetadataEntryProtocol getDefaultInstance() {
+ return defaultInstance;
+ }
+
+ public MetadataEntryProtocol getDefaultInstanceForType() {
+ return defaultInstance;
+ }
+
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return se.scalablesolutions.akka.remote.protocol.RemoteProtocol.internal_static_MetadataEntryProtocol_descriptor;
+ }
+
+ protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return se.scalablesolutions.akka.remote.protocol.RemoteProtocol.internal_static_MetadataEntryProtocol_fieldAccessorTable;
+ }
+
+ // required string key = 1;
+ public static final int KEY_FIELD_NUMBER = 1;
+ private boolean hasKey;
+ private java.lang.String key_ = "";
+ public boolean hasKey() { return hasKey; }
+ public java.lang.String getKey() { return key_; }
+
+ // required bytes value = 2;
+ public static final int VALUE_FIELD_NUMBER = 2;
+ private boolean hasValue;
+ private com.google.protobuf.ByteString value_ = com.google.protobuf.ByteString.EMPTY;
+ public boolean hasValue() { return hasValue; }
+ public com.google.protobuf.ByteString getValue() { return value_; }
+
+ private void initFields() {
+ }
+ public final boolean isInitialized() {
+ if (!hasKey) return false;
+ if (!hasValue) return false;
+ return true;
+ }
+
+ public void writeTo(com.google.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ getSerializedSize();
+ if (hasKey()) {
+ output.writeString(1, getKey());
+ }
+ if (hasValue()) {
+ output.writeBytes(2, getValue());
+ }
+ getUnknownFields().writeTo(output);
+ }
+
+ private int memoizedSerializedSize = -1;
+ public int getSerializedSize() {
+ int size = memoizedSerializedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (hasKey()) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeStringSize(1, getKey());
+ }
+ if (hasValue()) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeBytesSize(2, getValue());
+ }
+ size += getUnknownFields().getSerializedSize();
+ memoizedSerializedSize = size;
+ return size;
+ }
+
+ public static se.scalablesolutions.akka.remote.protocol.RemoteProtocol.MetadataEntryProtocol parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return newBuilder().mergeFrom(data).buildParsed();
+ }
+ public static se.scalablesolutions.akka.remote.protocol.RemoteProtocol.MetadataEntryProtocol parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return newBuilder().mergeFrom(data, extensionRegistry)
+ .buildParsed();
+ }
+ public static se.scalablesolutions.akka.remote.protocol.RemoteProtocol.MetadataEntryProtocol parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return newBuilder().mergeFrom(data).buildParsed();
+ }
+ public static se.scalablesolutions.akka.remote.protocol.RemoteProtocol.MetadataEntryProtocol parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return newBuilder().mergeFrom(data, extensionRegistry)
+ .buildParsed();
+ }
+ public static se.scalablesolutions.akka.remote.protocol.RemoteProtocol.MetadataEntryProtocol parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return newBuilder().mergeFrom(input).buildParsed();
+ }
+ public static se.scalablesolutions.akka.remote.protocol.RemoteProtocol.MetadataEntryProtocol parseFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return newBuilder().mergeFrom(input, extensionRegistry)
+ .buildParsed();
+ }
+ public static se.scalablesolutions.akka.remote.protocol.RemoteProtocol.MetadataEntryProtocol parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ Builder builder = newBuilder();
+ if (builder.mergeDelimitedFrom(input)) {
+ return builder.buildParsed();
+ } else {
+ return null;
+ }
+ }
+ public static se.scalablesolutions.akka.remote.protocol.RemoteProtocol.MetadataEntryProtocol 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 se.scalablesolutions.akka.remote.protocol.RemoteProtocol.MetadataEntryProtocol parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return newBuilder().mergeFrom(input).buildParsed();
+ }
+ public static se.scalablesolutions.akka.remote.protocol.RemoteProtocol.MetadataEntryProtocol 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(se.scalablesolutions.akka.remote.protocol.RemoteProtocol.MetadataEntryProtocol prototype) {
+ return newBuilder().mergeFrom(prototype);
+ }
+ public Builder toBuilder() { return newBuilder(this); }
+
+ public static final class Builder extends
+ com.google.protobuf.GeneratedMessage.Builder {
+ private se.scalablesolutions.akka.remote.protocol.RemoteProtocol.MetadataEntryProtocol result;
+
+ // Construct using se.scalablesolutions.akka.remote.protocol.RemoteProtocol.MetadataEntryProtocol.newBuilder()
+ private Builder() {}
+
+ private static Builder create() {
+ Builder builder = new Builder();
+ builder.result = new se.scalablesolutions.akka.remote.protocol.RemoteProtocol.MetadataEntryProtocol();
+ return builder;
+ }
+
+ protected se.scalablesolutions.akka.remote.protocol.RemoteProtocol.MetadataEntryProtocol internalGetResult() {
+ return result;
+ }
+
+ public Builder clear() {
+ if (result == null) {
+ throw new IllegalStateException(
+ "Cannot call clear() after build().");
+ }
+ result = new se.scalablesolutions.akka.remote.protocol.RemoteProtocol.MetadataEntryProtocol();
+ return this;
+ }
+
+ public Builder clone() {
+ return create().mergeFrom(result);
+ }
+
+ public com.google.protobuf.Descriptors.Descriptor
+ getDescriptorForType() {
+ return se.scalablesolutions.akka.remote.protocol.RemoteProtocol.MetadataEntryProtocol.getDescriptor();
+ }
+
+ public se.scalablesolutions.akka.remote.protocol.RemoteProtocol.MetadataEntryProtocol getDefaultInstanceForType() {
+ return se.scalablesolutions.akka.remote.protocol.RemoteProtocol.MetadataEntryProtocol.getDefaultInstance();
+ }
+
+ public boolean isInitialized() {
+ return result.isInitialized();
+ }
+ public se.scalablesolutions.akka.remote.protocol.RemoteProtocol.MetadataEntryProtocol build() {
+ if (result != null && !isInitialized()) {
+ throw newUninitializedMessageException(result);
+ }
+ return buildPartial();
+ }
+
+ private se.scalablesolutions.akka.remote.protocol.RemoteProtocol.MetadataEntryProtocol buildParsed()
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ if (!isInitialized()) {
+ throw newUninitializedMessageException(
+ result).asInvalidProtocolBufferException();
+ }
+ return buildPartial();
+ }
+
+ public se.scalablesolutions.akka.remote.protocol.RemoteProtocol.MetadataEntryProtocol buildPartial() {
+ if (result == null) {
+ throw new IllegalStateException(
+ "build() has already been called on this Builder.");
+ }
+ se.scalablesolutions.akka.remote.protocol.RemoteProtocol.MetadataEntryProtocol returnMe = result;
+ result = null;
+ return returnMe;
+ }
+
+ public Builder mergeFrom(com.google.protobuf.Message other) {
+ if (other instanceof se.scalablesolutions.akka.remote.protocol.RemoteProtocol.MetadataEntryProtocol) {
+ return mergeFrom((se.scalablesolutions.akka.remote.protocol.RemoteProtocol.MetadataEntryProtocol)other);
+ } else {
+ super.mergeFrom(other);
+ return this;
+ }
+ }
+
+ public Builder mergeFrom(se.scalablesolutions.akka.remote.protocol.RemoteProtocol.MetadataEntryProtocol other) {
+ if (other == se.scalablesolutions.akka.remote.protocol.RemoteProtocol.MetadataEntryProtocol.getDefaultInstance()) return this;
+ if (other.hasKey()) {
+ setKey(other.getKey());
+ }
+ if (other.hasValue()) {
+ setValue(other.getValue());
+ }
+ 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: {
+ setKey(input.readString());
+ break;
+ }
+ case 18: {
+ setValue(input.readBytes());
+ break;
+ }
+ }
+ }
+ }
+
+
+ // required string key = 1;
+ public boolean hasKey() {
+ return result.hasKey();
+ }
+ public java.lang.String getKey() {
+ return result.getKey();
+ }
+ public Builder setKey(java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ result.hasKey = true;
+ result.key_ = value;
+ return this;
+ }
+ public Builder clearKey() {
+ result.hasKey = false;
+ result.key_ = getDefaultInstance().getKey();
+ return this;
+ }
+
+ // required bytes value = 2;
+ public boolean hasValue() {
+ return result.hasValue();
+ }
+ public com.google.protobuf.ByteString getValue() {
+ return result.getValue();
+ }
+ public Builder setValue(com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ result.hasValue = true;
+ result.value_ = value;
+ return this;
+ }
+ public Builder clearValue() {
+ result.hasValue = false;
+ result.value_ = getDefaultInstance().getValue();
+ return this;
+ }
+
+ // @@protoc_insertion_point(builder_scope:MetadataEntryProtocol)
+ }
+
+ static {
+ defaultInstance = new MetadataEntryProtocol(true);
+ se.scalablesolutions.akka.remote.protocol.RemoteProtocol.internalForceInit();
+ defaultInstance.initFields();
+ }
+
+ // @@protoc_insertion_point(class_scope:MetadataEntryProtocol)
+ }
+
public static final class LifeCycleProtocol extends
com.google.protobuf.GeneratedMessage {
// Use LifeCycleProtocol.newBuilder() to construct.
@@ -4854,6 +5688,16 @@ public final class RemoteProtocol {
private static
com.google.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_RemoteReplyProtocol_fieldAccessorTable;
+ private static com.google.protobuf.Descriptors.Descriptor
+ internal_static_UuidProtocol_descriptor;
+ private static
+ com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internal_static_UuidProtocol_fieldAccessorTable;
+ private static com.google.protobuf.Descriptors.Descriptor
+ internal_static_MetadataEntryProtocol_descriptor;
+ private static
+ com.google.protobuf.GeneratedMessage.FieldAccessorTable
+ internal_static_MetadataEntryProtocol_fieldAccessorTable;
private static com.google.protobuf.Descriptors.Descriptor
internal_static_LifeCycleProtocol_descriptor;
private static
@@ -4899,26 +5743,31 @@ public final class RemoteProtocol {
"torType\030\004 \002(\0162\n.ActorType\022/\n\016typedActorI" +
"nfo\030\005 \001(\0132\027.TypedActorInfoProtocol\";\n\026Ty",
"pedActorInfoProtocol\022\021\n\tinterface\030\001 \002(\t\022" +
- "\016\n\006method\030\002 \002(\t\"\300\001\n\025RemoteRequestProtoco" +
+ "\016\n\006method\030\002 \002(\t\"\352\001\n\025RemoteRequestProtoco" +
"l\022\n\n\002id\030\001 \002(\004\022!\n\007message\030\002 \002(\0132\020.Message" +
"Protocol\022%\n\tactorInfo\030\003 \002(\0132\022.ActorInfoP" +
"rotocol\022\020\n\010isOneWay\030\004 \002(\010\022\026\n\016supervisorU" +
"uid\030\005 \001(\t\022\'\n\006sender\030\006 \001(\0132\027.RemoteActorR" +
- "efProtocol\"\252\001\n\023RemoteReplyProtocol\022\n\n\002id" +
- "\030\001 \002(\004\022!\n\007message\030\002 \001(\0132\020.MessageProtoco" +
- "l\022%\n\texception\030\003 \001(\0132\022.ExceptionProtocol" +
- "\022\026\n\016supervisorUuid\030\004 \001(\t\022\017\n\007isActor\030\005 \002(",
- "\010\022\024\n\014isSuccessful\030\006 \002(\010\"6\n\021LifeCycleProt" +
- "ocol\022!\n\tlifeCycle\030\001 \002(\0162\016.LifeCycleType\"" +
- "1\n\017AddressProtocol\022\020\n\010hostname\030\001 \002(\t\022\014\n\004" +
- "port\030\002 \002(\r\"7\n\021ExceptionProtocol\022\021\n\tclass" +
- "name\030\001 \002(\t\022\017\n\007message\030\002 \002(\t*=\n\tActorType" +
- "\022\017\n\013SCALA_ACTOR\020\001\022\016\n\nJAVA_ACTOR\020\002\022\017\n\013TYP" +
- "ED_ACTOR\020\003*]\n\027SerializationSchemeType\022\010\n" +
- "\004JAVA\020\001\022\013\n\007SBINARY\020\002\022\016\n\nSCALA_JSON\020\003\022\r\n\t" +
- "JAVA_JSON\020\004\022\014\n\010PROTOBUF\020\005*-\n\rLifeCycleTy" +
- "pe\022\r\n\tPERMANENT\020\001\022\r\n\tTEMPORARY\020\002B-\n)se.s",
- "calablesolutions.akka.remote.protocolH\001"
+ "efProtocol\022(\n\010metadata\030\007 \003(\0132\026.MetadataE" +
+ "ntryProtocol\"\324\001\n\023RemoteReplyProtocol\022\n\n\002" +
+ "id\030\001 \002(\004\022!\n\007message\030\002 \001(\0132\020.MessageProto" +
+ "col\022%\n\texception\030\003 \001(\0132\022.ExceptionProtoc",
+ "ol\022\026\n\016supervisorUuid\030\004 \001(\t\022\017\n\007isActor\030\005 " +
+ "\002(\010\022\024\n\014isSuccessful\030\006 \002(\010\022(\n\010metadata\030\007 " +
+ "\003(\0132\026.MetadataEntryProtocol\")\n\014UuidProto" +
+ "col\022\014\n\004high\030\001 \002(\004\022\013\n\003low\030\002 \002(\004\"3\n\025Metada" +
+ "taEntryProtocol\022\013\n\003key\030\001 \002(\t\022\r\n\005value\030\002 " +
+ "\002(\014\"6\n\021LifeCycleProtocol\022!\n\tlifeCycle\030\001 " +
+ "\002(\0162\016.LifeCycleType\"1\n\017AddressProtocol\022\020" +
+ "\n\010hostname\030\001 \002(\t\022\014\n\004port\030\002 \002(\r\"7\n\021Except" +
+ "ionProtocol\022\021\n\tclassname\030\001 \002(\t\022\017\n\007messag" +
+ "e\030\002 \002(\t*=\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-\n)se.scalablesolutions.akk" +
+ "a.remote.protocolH\001"
};
com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() {
@@ -4970,7 +5819,7 @@ public final class RemoteProtocol {
internal_static_RemoteRequestProtocol_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_RemoteRequestProtocol_descriptor,
- new java.lang.String[] { "Id", "Message", "ActorInfo", "IsOneWay", "SupervisorUuid", "Sender", },
+ new java.lang.String[] { "Id", "Message", "ActorInfo", "IsOneWay", "SupervisorUuid", "Sender", "Metadata", },
se.scalablesolutions.akka.remote.protocol.RemoteProtocol.RemoteRequestProtocol.class,
se.scalablesolutions.akka.remote.protocol.RemoteProtocol.RemoteRequestProtocol.Builder.class);
internal_static_RemoteReplyProtocol_descriptor =
@@ -4978,11 +5827,27 @@ public final class RemoteProtocol {
internal_static_RemoteReplyProtocol_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_RemoteReplyProtocol_descriptor,
- new java.lang.String[] { "Id", "Message", "Exception", "SupervisorUuid", "IsActor", "IsSuccessful", },
+ new java.lang.String[] { "Id", "Message", "Exception", "SupervisorUuid", "IsActor", "IsSuccessful", "Metadata", },
se.scalablesolutions.akka.remote.protocol.RemoteProtocol.RemoteReplyProtocol.class,
se.scalablesolutions.akka.remote.protocol.RemoteProtocol.RemoteReplyProtocol.Builder.class);
- internal_static_LifeCycleProtocol_descriptor =
+ internal_static_UuidProtocol_descriptor =
getDescriptor().getMessageTypes().get(7);
+ internal_static_UuidProtocol_fieldAccessorTable = new
+ com.google.protobuf.GeneratedMessage.FieldAccessorTable(
+ internal_static_UuidProtocol_descriptor,
+ new java.lang.String[] { "High", "Low", },
+ se.scalablesolutions.akka.remote.protocol.RemoteProtocol.UuidProtocol.class,
+ se.scalablesolutions.akka.remote.protocol.RemoteProtocol.UuidProtocol.Builder.class);
+ internal_static_MetadataEntryProtocol_descriptor =
+ getDescriptor().getMessageTypes().get(8);
+ internal_static_MetadataEntryProtocol_fieldAccessorTable = new
+ com.google.protobuf.GeneratedMessage.FieldAccessorTable(
+ internal_static_MetadataEntryProtocol_descriptor,
+ new java.lang.String[] { "Key", "Value", },
+ se.scalablesolutions.akka.remote.protocol.RemoteProtocol.MetadataEntryProtocol.class,
+ se.scalablesolutions.akka.remote.protocol.RemoteProtocol.MetadataEntryProtocol.Builder.class);
+ internal_static_LifeCycleProtocol_descriptor =
+ getDescriptor().getMessageTypes().get(9);
internal_static_LifeCycleProtocol_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_LifeCycleProtocol_descriptor,
@@ -4990,7 +5855,7 @@ public final class RemoteProtocol {
se.scalablesolutions.akka.remote.protocol.RemoteProtocol.LifeCycleProtocol.class,
se.scalablesolutions.akka.remote.protocol.RemoteProtocol.LifeCycleProtocol.Builder.class);
internal_static_AddressProtocol_descriptor =
- getDescriptor().getMessageTypes().get(8);
+ getDescriptor().getMessageTypes().get(10);
internal_static_AddressProtocol_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_AddressProtocol_descriptor,
@@ -4998,7 +5863,7 @@ public final class RemoteProtocol {
se.scalablesolutions.akka.remote.protocol.RemoteProtocol.AddressProtocol.class,
se.scalablesolutions.akka.remote.protocol.RemoteProtocol.AddressProtocol.Builder.class);
internal_static_ExceptionProtocol_descriptor =
- getDescriptor().getMessageTypes().get(9);
+ getDescriptor().getMessageTypes().get(11);
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 871365278c..203b505d68 100644
--- a/akka-remote/src/main/protocol/RemoteProtocol.proto
+++ b/akka-remote/src/main/protocol/RemoteProtocol.proto
@@ -81,6 +81,7 @@ message RemoteRequestProtocol {
required bool isOneWay = 4;
optional string supervisorUuid = 5;
optional RemoteActorRefProtocol sender = 6;
+ repeated MetadataEntryProtocol metadata = 7;
}
/**
@@ -93,6 +94,23 @@ message RemoteReplyProtocol {
optional string supervisorUuid = 4;
required bool isActor = 5;
required bool isSuccessful = 6;
+ repeated MetadataEntryProtocol metadata = 7;
+}
+
+/**
+ * Defines a UUID.
+ */
+message UuidProtocol {
+ required uint64 high = 1;
+ required uint64 low = 2;
+}
+
+/**
+ * Defines a meta data entry.
+ */
+message MetadataEntryProtocol {
+ required string key = 1;
+ required bytes value = 2;
}
/**
diff --git a/akka-remote/src/main/scala/remote/Cluster.scala b/akka-remote/src/main/scala/remote/Cluster.scala
index 88807f3ba1..6e1e99f0b2 100644
--- a/akka-remote/src/main/scala/remote/Cluster.scala
+++ b/akka-remote/src/main/scala/remote/Cluster.scala
@@ -86,11 +86,11 @@ abstract class BasicClusterActor extends ClusterActor with Logging {
@volatile private var local: Node = Node(Nil)
@volatile private var remotes: Map[ADDR_T, Node] = Map()
- override def init = {
+ override def preStart = {
remotes = new HashMap[ADDR_T, Node]
}
- override def shutdown = {
+ override def postStop = {
remotes = Map()
}
diff --git a/akka-remote/src/main/scala/remote/JGroupsClusterActor.scala b/akka-remote/src/main/scala/remote/JGroupsClusterActor.scala
index 54ef3807d4..07cbf4d65b 100644
--- a/akka-remote/src/main/scala/remote/JGroupsClusterActor.scala
+++ b/akka-remote/src/main/scala/remote/JGroupsClusterActor.scala
@@ -54,8 +54,8 @@ class JGroupsClusterActor extends BasicClusterActor {
protected def toAllNodes(msg : Array[Byte]): Unit =
for (c <- channel) c.send(new JG_MSG(null, null, msg))
- override def shutdown = {
- super.shutdown
+ override def postStop = {
+ super.postStop
log info ("Shutting down %s", toString)
isActive = false
channel.foreach(Util shutdown _)
diff --git a/akka-remote/src/main/scala/remote/RemoteClient.scala b/akka-remote/src/main/scala/remote/RemoteClient.scala
index 52585a491c..97e2f3070f 100644
--- a/akka-remote/src/main/scala/remote/RemoteClient.scala
+++ b/akka-remote/src/main/scala/remote/RemoteClient.scala
@@ -205,7 +205,7 @@ class RemoteClient private[akka] (
extends Logging with ListenerManagement {
val name = "RemoteClient@" + hostname + "::" + port
- //FIXME Should these be clear:ed on shutdown?
+ //FIXME Should these be clear:ed on postStop?
private val futures = new ConcurrentHashMap[Long, CompletableFuture[_]]
private val supervisors = new ConcurrentHashMap[String, ActorRef]
diff --git a/akka-remote/src/main/scala/remote/RemoteServer.scala b/akka-remote/src/main/scala/remote/RemoteServer.scala
index b6fd275188..4bcd4861ff 100644
--- a/akka-remote/src/main/scala/remote/RemoteServer.scala
+++ b/akka-remote/src/main/scala/remote/RemoteServer.scala
@@ -423,7 +423,7 @@ class RemoteServerHandler(
applicationLoader.foreach(MessageSerializer.setClassLoader(_))
/**
- * ChannelOpen overridden to store open channels for a clean shutdown of a RemoteServer.
+ * ChannelOpen overridden to store open channels for a clean postStop of a RemoteServer.
* If a channel is closed before, it is automatically removed from the open channels group.
*/
override def channelOpen(ctx: ChannelHandlerContext, event: ChannelStateEvent) = openChannels.add(ctx.getChannel)
diff --git a/akka-remote/src/test/java/se/scalablesolutions/akka/remote/protocol/RemoteProtocol.java b/akka-remote/src/test/java/se/scalablesolutions/akka/remote/protocol/RemoteProtocol.java
index 0ab1a0aa10..3c8a60aecc 100644
--- a/akka-remote/src/test/java/se/scalablesolutions/akka/remote/protocol/RemoteProtocol.java
+++ b/akka-remote/src/test/java/se/scalablesolutions/akka/remote/protocol/RemoteProtocol.java
@@ -3920,7 +3920,7 @@ public final class RemoteProtocol {
public boolean hasInit() { return hasInit; }
public java.lang.String getInit() { return init_; }
- // optional string shutdown = 5;
+ // optional string postStop = 5;
public static final int SHUTDOWN_FIELD_NUMBER = 5;
private boolean hasShutdown;
private java.lang.String shutdown_ = "";
@@ -4295,7 +4295,7 @@ public final class RemoteProtocol {
return this;
}
- // optional string shutdown = 5;
+ // optional string postStop = 5;
public boolean hasShutdown() {
return result.hasShutdown();
}
diff --git a/akka-remote/src/test/scala/remote/ServerInitiatedRemoteActorSpec.scala b/akka-remote/src/test/scala/remote/ServerInitiatedRemoteActorSpec.scala
index 7a2676d040..59f122c656 100644
--- a/akka-remote/src/test/scala/remote/ServerInitiatedRemoteActorSpec.scala
+++ b/akka-remote/src/test/scala/remote/ServerInitiatedRemoteActorSpec.scala
@@ -67,7 +67,7 @@ class ServerInitiatedRemoteActorSpec extends JUnitSuite {
Thread.sleep(1000)
}
- // make sure the servers shutdown cleanly after the test has finished
+ // make sure the servers postStop cleanly after the test has finished
@After
def finished {
try {
diff --git a/akka-remote/src/test/scala/serialization/ProtobufActorMessageSerializationSpec.scala b/akka-remote/src/test/scala/serialization/ProtobufActorMessageSerializationSpec.scala
index 011c656f8d..e05e4b0394 100644
--- a/akka-remote/src/test/scala/serialization/ProtobufActorMessageSerializationSpec.scala
+++ b/akka-remote/src/test/scala/serialization/ProtobufActorMessageSerializationSpec.scala
@@ -47,7 +47,7 @@ class ProtobufActorMessageSerializationSpec extends JUnitSuite {
Thread.sleep(1000)
}
- // make sure the servers shutdown cleanly after the test has finished
+ // make sure the servers postStop cleanly after the test has finished
@After
def finished() {
server.shutdown
diff --git a/akka-samples/akka-sample-chat/src/main/scala/ChatServer.scala b/akka-samples/akka-sample-chat/src/main/scala/ChatServer.scala
index e3fd76a344..6f70d8071a 100644
--- a/akka-samples/akka-sample-chat/src/main/scala/ChatServer.scala
+++ b/akka-samples/akka-sample-chat/src/main/scala/ChatServer.scala
@@ -185,7 +185,7 @@ trait ChatServer extends Actor {
protected def sessionManagement: Receive
protected def shutdownSessions(): Unit
- override def shutdown = {
+ override def postStop = {
log.info("Chat server is shutting down...")
shutdownSessions
self.unlink(storage)
@@ -205,7 +205,7 @@ class ChatService extends
SessionManagement with
ChatManagement with
RedisChatStorageFactory {
- override def init = {
+ override def preStart = {
RemoteNode.start("localhost", 9999)
RemoteNode.register("chat:service", self)
}
diff --git a/akka-spring/src/test/java/se/scalablesolutions/akka/spring/Pojo.java b/akka-spring/src/test/java/se/scalablesolutions/akka/spring/Pojo.java
index 24c0fea352..6046f2bb5d 100644
--- a/akka-spring/src/test/java/se/scalablesolutions/akka/spring/Pojo.java
+++ b/akka-spring/src/test/java/se/scalablesolutions/akka/spring/Pojo.java
@@ -14,7 +14,7 @@ public class Pojo extends TypedActor implements PojoInf, ApplicationContextAware
private String stringFromRef;
private boolean gotApplicationContext = false;
- private boolean initInvoked = false;
+ private boolean preStartInvoked = false;
public boolean gotApplicationContext() {
return gotApplicationContext;
@@ -41,11 +41,11 @@ public class Pojo extends TypedActor implements PojoInf, ApplicationContextAware
}
@Override
- public void init() {
- initInvoked = true;
+ public void preStart() {
+ preStartInvoked = true;
}
- public boolean isInitInvoked() {
- return initInvoked;
+ public boolean isPreStartInvoked() {
+ return preStartInvoked;
}
}
diff --git a/akka-spring/src/test/java/se/scalablesolutions/akka/spring/PojoInf.java b/akka-spring/src/test/java/se/scalablesolutions/akka/spring/PojoInf.java
index 9ebf80e89b..0a313ceb18 100644
--- a/akka-spring/src/test/java/se/scalablesolutions/akka/spring/PojoInf.java
+++ b/akka-spring/src/test/java/se/scalablesolutions/akka/spring/PojoInf.java
@@ -8,6 +8,6 @@ public interface PojoInf {
public String getStringFromVal();
public String getStringFromRef();
public boolean gotApplicationContext();
- public boolean isInitInvoked();
+ public boolean isPreStartInvoked();
}
diff --git a/akka-spring/src/test/java/se/scalablesolutions/akka/spring/SampleBean.java b/akka-spring/src/test/java/se/scalablesolutions/akka/spring/SampleBean.java
index f9d3381436..29e80d1c65 100644
--- a/akka-spring/src/test/java/se/scalablesolutions/akka/spring/SampleBean.java
+++ b/akka-spring/src/test/java/se/scalablesolutions/akka/spring/SampleBean.java
@@ -19,7 +19,7 @@ public class SampleBean extends TypedActor implements SampleBeanIntf {
}
@Override
- public void shutdown() {
+ public void postStop() {
down = true;
}
}
diff --git a/akka-spring/src/test/java/se/scalablesolutions/akka/spring/foo/StatefulPojo.java b/akka-spring/src/test/java/se/scalablesolutions/akka/spring/foo/StatefulPojo.java
index 3b4e05453b..ce85267edc 100644
--- a/akka-spring/src/test/java/se/scalablesolutions/akka/spring/foo/StatefulPojo.java
+++ b/akka-spring/src/test/java/se/scalablesolutions/akka/spring/foo/StatefulPojo.java
@@ -5,6 +5,7 @@ import se.scalablesolutions.akka.stm.TransactionalMap;
import se.scalablesolutions.akka.stm.TransactionalVector;
import se.scalablesolutions.akka.stm.Ref;
import se.scalablesolutions.akka.actor.*;
+import se.scalablesolutions.akka.stm.local.Atomic;
public class StatefulPojo extends TypedActor {
private TransactionalMap mapState;
@@ -13,12 +14,16 @@ public class StatefulPojo extends TypedActor {
private boolean isInitialized = false;
@Override
- public void initTransactionalState() {
- if (!isInitialized) {
- mapState = new TransactionalMap();
- vectorState = new TransactionalVector();
- refState = new Ref();
- isInitialized = true;
+ public void preStart() {
+ if(!isInitialized) {
+ isInitialized = new Atomic() {
+ public Boolean atomically() {
+ mapState = new TransactionalMap();
+ vectorState = new TransactionalVector();
+ refState = new Ref();
+ return true;
+ }
+ }.execute();
}
}
diff --git a/akka-spring/src/test/scala/ActorFactoryBeanTest.scala b/akka-spring/src/test/scala/ActorFactoryBeanTest.scala
index 13c6203929..0bd373a408 100644
--- a/akka-spring/src/test/scala/ActorFactoryBeanTest.scala
+++ b/akka-spring/src/test/scala/ActorFactoryBeanTest.scala
@@ -68,7 +68,7 @@ class ActorFactoryBeanTest extends Spec with ShouldMatchers with BeforeAndAfterA
it("should create an application context and verify dependency injection for typed") {
var ctx = new ClassPathXmlApplicationContext("appContext.xml");
val ta = ctx.getBean("typedActor").asInstanceOf[PojoInf];
- assert(ta.isInitInvoked)
+ assert(ta.isPreStartInvoked)
assert(ta.getStringFromVal === "akka rocks")
assert(ta.getStringFromRef === "spring rocks")
assert(ta.gotApplicationContext)
diff --git a/akka-typed-actor/src/main/scala/actor/TypedActor.scala b/akka-typed-actor/src/main/scala/actor/TypedActor.scala
index e60b11c3d6..c3457cb43b 100644
--- a/akka-typed-actor/src/main/scala/actor/TypedActor.scala
+++ b/akka-typed-actor/src/main/scala/actor/TypedActor.scala
@@ -40,12 +40,12 @@ import java.lang.reflect.{Method, Field, InvocationHandler, Proxy => JProxy}
* }
*
* @Override
- * public void init() {
+ * public void preStart() {
* ... // optional initialization on start
* }
*
* @Override
- * public void shutdown() {
+ * public void postStop() {
* ... // optional cleanup on stop
* }
*
@@ -78,11 +78,11 @@ import java.lang.reflect.{Method, Field, InvocationHandler, Proxy => JProxy}
*
* def square(x: Int): Future[Integer] = future(x * x)
*
- * override def init = {
+ * override def preStart = {
* ... // optional initialization on start
* }
*
- * override def shutdown = {
+ * override def postStop = {
* ... // optional cleanup on stop
* }
*
@@ -542,11 +542,7 @@ object TypedActor extends Logging {
val typedActor =
if (instance.isInstanceOf[TypedActor]) instance.asInstanceOf[TypedActor]
else throw new IllegalArgumentException("Actor [" + targetClass.getName + "] is not a sub class of 'TypedActor'")
- typedActor.init
- import se.scalablesolutions.akka.stm.local.atomic
- atomic {
- typedActor.initTransactionalState
- }
+ typedActor.preStart
typedActor
}
@@ -764,4 +760,4 @@ private[akka] sealed case class AspectInit(
/**
* Marker interface for server manager typed actors.
*/
-private[akka] sealed trait ServerManagedTypedActor extends TypedActor
\ No newline at end of file
+private[akka] sealed trait ServerManagedTypedActor extends TypedActor
diff --git a/akka-typed-actor/src/test/java/se/scalablesolutions/akka/actor/NestedTransactionalTypedActorImpl.java b/akka-typed-actor/src/test/java/se/scalablesolutions/akka/actor/NestedTransactionalTypedActorImpl.java
index 1b95517c22..cb002b0a9e 100644
--- a/akka-typed-actor/src/test/java/se/scalablesolutions/akka/actor/NestedTransactionalTypedActorImpl.java
+++ b/akka-typed-actor/src/test/java/se/scalablesolutions/akka/actor/NestedTransactionalTypedActorImpl.java
@@ -10,7 +10,7 @@ public class NestedTransactionalTypedActorImpl extends TypedTransactor implement
private boolean isInitialized = false;
@Override
- public void init() {
+ public void preStart() {
if (!isInitialized) {
mapState = new TransactionalMap();
vectorState = new TransactionalVector();
diff --git a/akka-typed-actor/src/test/java/se/scalablesolutions/akka/actor/SamplePojoImpl.java b/akka-typed-actor/src/test/java/se/scalablesolutions/akka/actor/SamplePojoImpl.java
index 12985c72ce..1e567014d9 100644
--- a/akka-typed-actor/src/test/java/se/scalablesolutions/akka/actor/SamplePojoImpl.java
+++ b/akka-typed-actor/src/test/java/se/scalablesolutions/akka/actor/SamplePojoImpl.java
@@ -38,7 +38,7 @@ public class SamplePojoImpl extends TypedActor implements SamplePojo {
}
@Override
- public void shutdown() {
+ public void postStop() {
_down = true;
latch.countDown();
}
diff --git a/akka-typed-actor/src/test/java/se/scalablesolutions/akka/actor/TransactionalTypedActorImpl.java b/akka-typed-actor/src/test/java/se/scalablesolutions/akka/actor/TransactionalTypedActorImpl.java
index 9b32f5d329..45bda4a675 100644
--- a/akka-typed-actor/src/test/java/se/scalablesolutions/akka/actor/TransactionalTypedActorImpl.java
+++ b/akka-typed-actor/src/test/java/se/scalablesolutions/akka/actor/TransactionalTypedActorImpl.java
@@ -2,6 +2,8 @@ package se.scalablesolutions.akka.actor;
import se.scalablesolutions.akka.actor.*;
import se.scalablesolutions.akka.stm.*;
+import se.scalablesolutions.akka.stm.local.*;
+import se.scalablesolutions.akka.stm.local.Atomic;
public class TransactionalTypedActorImpl extends TypedTransactor implements TransactionalTypedActor {
private TransactionalMap mapState;
@@ -10,12 +12,16 @@ public class TransactionalTypedActorImpl extends TypedTransactor implements Tran
private boolean isInitialized = false;
@Override
- public void initTransactionalState() {
+ public void preStart() {
if (!isInitialized) {
- mapState = new TransactionalMap();
- vectorState = new TransactionalVector();
- refState = new Ref();
- isInitialized = true;
+ isInitialized = new Atomic() {
+ public Boolean atomically() {
+ mapState = new TransactionalMap();
+ vectorState = new TransactionalVector();
+ refState = new Ref();
+ return true;
+ }
+ }.execute();
}
}
diff --git a/akka-typed-actor/src/test/scala/actor/typed-actor/TypedActorLifecycleSpec.scala b/akka-typed-actor/src/test/scala/actor/typed-actor/TypedActorLifecycleSpec.scala
index 10fc40493b..9a21af06da 100644
--- a/akka-typed-actor/src/test/scala/actor/typed-actor/TypedActorLifecycleSpec.scala
+++ b/akka-typed-actor/src/test/scala/actor/typed-actor/TypedActorLifecycleSpec.scala
@@ -95,7 +95,7 @@ class TypedActorLifecycleSpec extends Spec with ShouldMatchers with BeforeAndAft
}
/*
- it("should shutdown non-supervised, annotated typed actor on TypedActor.stop") {
+ it("should postStop non-supervised, annotated typed actor on TypedActor.stop") {
val obj = TypedActor.newInstance(classOf[SamplePojoAnnotated])
assert(AspectInitRegistry.initFor(obj) ne null)
assert("hello akka" === obj.greet("akka"))
@@ -112,7 +112,7 @@ class TypedActorLifecycleSpec extends Spec with ShouldMatchers with BeforeAndAft
}
}
- it("should shutdown non-supervised, annotated typed actor on ActorRegistry.shutdownAll") {
+ it("should postStop non-supervised, annotated typed actor on ActorRegistry.shutdownAll") {
val obj = TypedActor.newInstance(classOf[SamplePojoAnnotated])
assert(AspectInitRegistry.initFor(obj) ne null)
assert("hello akka" === obj.greet("akka"))
@@ -147,7 +147,7 @@ class TypedActorLifecycleSpec extends Spec with ShouldMatchers with BeforeAndAft
}
}
- it("should shutdown supervised, annotated typed actor on failure") {
+ it("should postStop supervised, annotated typed actor on failure") {
val obj = conf2.getInstance[SamplePojoAnnotated](classOf[SamplePojoAnnotated])
val cdl = obj.newCountdownLatch(1)
assert(AspectInitRegistry.initFor(obj) ne null)
diff --git a/embedded-repo/com/redis/redisclient/2.8.0-2.0/redisclient-2.8.0-2.0.pom b/embedded-repo/com/redis/redisclient/2.8.0-2.0/redisclient-2.8.0-2.0.pom
new file mode 100644
index 0000000000..12558da1c4
--- /dev/null
+++ b/embedded-repo/com/redis/redisclient/2.8.0-2.0/redisclient-2.8.0-2.0.pom
@@ -0,0 +1,8 @@
+
+
+ 4.0.0
+ com.redis
+ redisclient
+ 2.8.0-2.0
+ jar
+
\ No newline at end of file
diff --git a/embedded-repo/org/scala-tools/time/2.8.0-0.2-SNAPSHOT/time-2.8.0-0.2-SNAPSHOT.pom b/embedded-repo/org/scala-tools/time/2.8.0-0.2-SNAPSHOT/time-2.8.0-0.2-SNAPSHOT.pom
new file mode 100644
index 0000000000..fc1cf3406e
--- /dev/null
+++ b/embedded-repo/org/scala-tools/time/2.8.0-0.2-SNAPSHOT/time-2.8.0-0.2-SNAPSHOT.pom
@@ -0,0 +1,8 @@
+
+
+ 4.0.0
+ org.scala-tools
+ time
+ 2.8.0-0.2-SNAPSHOT
+ jar
+
\ No newline at end of file
diff --git a/project/build/AkkaProject.scala b/project/build/AkkaProject.scala
index 0676d9587e..656cf783c9 100644
--- a/project/build/AkkaProject.scala
+++ b/project/build/AkkaProject.scala
@@ -49,9 +49,8 @@ class AkkaParentProject(info: ProjectInfo) extends DefaultProject(info) {
lazy val JavaNetRepo = MavenRepository("java.net Repo", "http://download.java.net/maven/2")
lazy val SonatypeSnapshotRepo = MavenRepository("Sonatype OSS Repo", "http://oss.sonatype.org/content/repositories/releases")
lazy val SunJDMKRepo = MavenRepository("Sun JDMK Repo", "http://wp5.e-taxonomy.eu/cdmlib/mavenrepo")
- lazy val CasbahRepoSnapshots = MavenRepository("Casbah Snapshot Repo", "http://repo.bumnetworks.com/snapshots/")
- lazy val CasbahRepoReleases = MavenRepository("Casbah Snapshot Repo", "http://repo.bumnetworks.com/releases/")
lazy val ZookeeperRepo = MavenRepository("Zookeeper Repo", "http://lilycms.org/maven/maven2/deploy/")
+ lazy val CasbahRepoReleases = MavenRepository("Casbah Release Repo", "http://repo.bumnetworks.com/releases")
}
// -------------------------------------------------------------------------------------------------------------------
@@ -78,7 +77,6 @@ class AkkaParentProject(info: ProjectInfo) extends DefaultProject(info) {
lazy val scalaTestModuleConfig = ModuleConfiguration("org.scalatest", ScalaToolsSnapshots)
lazy val logbackModuleConfig = ModuleConfiguration("ch.qos.logback",sbt.DefaultMavenRepository)
lazy val atomikosModuleConfig = ModuleConfiguration("com.atomikos",sbt.DefaultMavenRepository)
- lazy val casbahSnapshot = ModuleConfiguration("com.novus",CasbahRepoSnapshots)
lazy val casbahRelease = ModuleConfiguration("com.novus",CasbahRepoReleases)
lazy val zookeeperRelease = ModuleConfiguration("org.apache.hadoop.zookeeper",ZookeeperRepo)
lazy val embeddedRepo = EmbeddedRepo // This is the only exception, because the embedded repo is fast!
@@ -494,7 +492,7 @@ class AkkaParentProject(info: ProjectInfo) extends DefaultProject(info) {
val commons_codec = Dependencies.commons_codec
val redis = Dependencies.redis
- // override def testOptions = TestFilter((name: String) => name.endsWith("Test")) :: Nil
+ override def testOptions = TestFilter((name: String) => name.endsWith("Test")) :: Nil
}
// -------------------------------------------------------------------------------------------------------------------
@@ -505,7 +503,7 @@ class AkkaParentProject(info: ProjectInfo) extends DefaultProject(info) {
val mongo = Dependencies.mongo
val casbah = Dependencies.casbah
- // override def testOptions = TestFilter((name: String) => name.endsWith("Test")) :: Nil
+ override def testOptions = TestFilter((name: String) => name.endsWith("Test")) :: Nil
}
// -------------------------------------------------------------------------------------------------------------------