Moved ActiveObjectConfiguration to ActiveObject.scala file

This commit is contained in:
Jonas Bonér 2010-04-21 11:23:30 +02:00
parent 559689d082
commit 35787895e9
2 changed files with 38 additions and 40 deletions

View file

@ -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.
*

View file

@ -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
}
}