From 35787895e98ac2e75dd2cfd2c02e9f43dba8ce51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Bon=C3=A9r?= Date: Wed, 21 Apr 2010 11:23:30 +0200 Subject: [PATCH] Moved ActiveObjectConfiguration to ActiveObject.scala file --- .../src/main/scala/actor/ActiveObject.scala | 39 ++++++++++++++++++- .../actor/ActiveObjectConfiguration.scala | 39 ------------------- 2 files changed, 38 insertions(+), 40 deletions(-) delete mode 100644 akka-core/src/main/scala/actor/ActiveObjectConfiguration.scala diff --git a/akka-core/src/main/scala/actor/ActiveObject.scala b/akka-core/src/main/scala/actor/ActiveObject.scala index 2446472e0e..9dbe1c939d 100644 --- a/akka-core/src/main/scala/actor/ActiveObject.scala +++ b/akka-core/src/main/scala/actor/ActiveObject.scala @@ -4,7 +4,7 @@ package se.scalablesolutions.akka.actor -import _root_.se.scalablesolutions.akka.config.FaultHandlingStrategy +import se.scalablesolutions.akka.config.FaultHandlingStrategy import se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteRequest import se.scalablesolutions.akka.remote.{RemoteProtocolBuilder, RemoteClient, RemoteRequestIdFactory} import se.scalablesolutions.akka.dispatch.{MessageDispatcher, Future} @@ -29,6 +29,43 @@ object Annotations { val inittransactionalstate = classOf[inittransactionalstate] } +/** + * TODO: document + * FIXDOC: document ActiveObjectConfiguration + */ +final class ActiveObjectConfiguration { + private[akka] var _timeout: Long = Actor.TIMEOUT + private[akka] var _restartCallbacks: Option[RestartCallbacks] = None + private[akka] var _transactionRequired = false + private[akka] var _host: Option[InetSocketAddress] = None + private[akka] var _messageDispatcher: Option[MessageDispatcher] = None + + def timeout(timeout: Long) : ActiveObjectConfiguration = { + _timeout = timeout + this + } + + def restartCallbacks(pre: String, post: String) : ActiveObjectConfiguration = { + _restartCallbacks = Some(new RestartCallbacks(pre, post)) + this + } + + def makeTransactionRequired() : ActiveObjectConfiguration = { + _transactionRequired = true; + this + } + + def makeRemote(hostname: String, port: Int) : ActiveObjectConfiguration = { + _host = Some(new InetSocketAddress(hostname, port)) + this + } + + def dispatcher(messageDispatcher: MessageDispatcher) : ActiveObjectConfiguration = { + _messageDispatcher = Some(messageDispatcher) + this + } +} + /** * Factory class for creating Active Objects out of plain POJOs and/or POJOs with interfaces. * diff --git a/akka-core/src/main/scala/actor/ActiveObjectConfiguration.scala b/akka-core/src/main/scala/actor/ActiveObjectConfiguration.scala deleted file mode 100644 index 8390d2bdbb..0000000000 --- a/akka-core/src/main/scala/actor/ActiveObjectConfiguration.scala +++ /dev/null @@ -1,39 +0,0 @@ -package se.scalablesolutions.akka.actor - -import _root_.java.net.InetSocketAddress -import _root_.se.scalablesolutions.akka.config.ScalaConfig.RestartCallbacks -import _root_.se.scalablesolutions.akka.dispatch.MessageDispatcher - - -final class ActiveObjectConfiguration { - private[akka] var _timeout: Long = Actor.TIMEOUT - private[akka] var _restartCallbacks: Option[RestartCallbacks] = None - private[akka] var _transactionRequired = false - private[akka] var _host: Option[InetSocketAddress] = None - private[akka] var _messageDispatcher: Option[MessageDispatcher] = None - - def timeout(timeout: Long) : ActiveObjectConfiguration = { - _timeout = timeout - this - } - - def restartCallbacks(pre: String, post: String) : ActiveObjectConfiguration = { - _restartCallbacks = Some(new RestartCallbacks(pre, post)) - this - } - - def makeTransactionRequired() : ActiveObjectConfiguration = { - _transactionRequired = true; - this - } - - def makeRemote(hostname: String, port: Int) : ActiveObjectConfiguration = { - _host = Some(new InetSocketAddress(hostname, port)) - this - } - - def dispatcher(messageDispatcher: MessageDispatcher) : ActiveObjectConfiguration = { - _messageDispatcher = Some(messageDispatcher) - this - } -} \ No newline at end of file