Rewrite of remote protocol to use the new ActorRef protocol
This commit is contained in:
parent
17fc19b4e7
commit
fb3ae7ed2b
18 changed files with 435 additions and 582 deletions
|
|
@ -121,15 +121,15 @@ object Publish {
|
||||||
def forConsumer(actor: ActorRef): Option[Publish] =
|
def forConsumer(actor: ActorRef): Option[Publish] =
|
||||||
forConsumeAnnotated(actor) orElse forConsumerType(actor)
|
forConsumeAnnotated(actor) orElse forConsumerType(actor)
|
||||||
|
|
||||||
private def forConsumeAnnotated(actorId: ActorRef): Option[Publish] = {
|
private def forConsumeAnnotated(actorRef: ActorRef): Option[Publish] = {
|
||||||
val annotation = actorId.actorClass.getAnnotation(classOf[consume])
|
val annotation = actorRef.actorClass.getAnnotation(classOf[consume])
|
||||||
if (annotation eq null) None
|
if (annotation eq null) None
|
||||||
else if (actorId.remoteAddress.isDefined) None // do not publish proxies
|
else if (actorRef.remoteAddress.isDefined) None // do not publish proxies
|
||||||
else Some(Publish(annotation.value, actorId.id, false))
|
else Some(Publish(annotation.value, actorRef.id, false))
|
||||||
}
|
}
|
||||||
|
|
||||||
private def forConsumerType(actorId: ActorRef): Option[Publish] =
|
private def forConsumerType(actorRef: ActorRef): Option[Publish] =
|
||||||
if (!actorId.actor.isInstanceOf[Consumer]) None
|
if (!actorRef.actor.isInstanceOf[Consumer]) None
|
||||||
else if (actorId.remoteAddress.isDefined) None
|
else if (actorRef.remoteAddress.isDefined) None
|
||||||
else Some(Publish(actorId.actor.asInstanceOf[Consumer].endpointUri, actorId.uuid, true))
|
else Some(Publish(actorRef.actor.asInstanceOf[Consumer].endpointUri, actorRef.uuid, true))
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,8 @@
|
||||||
package se.scalablesolutions.akka.actor
|
package se.scalablesolutions.akka.actor
|
||||||
|
|
||||||
import se.scalablesolutions.akka.config.FaultHandlingStrategy
|
import se.scalablesolutions.akka.config.FaultHandlingStrategy
|
||||||
import se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteRequest
|
import se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteRequestProtocol
|
||||||
import se.scalablesolutions.akka.remote.{RemoteProtocolBuilder, RemoteClient, RemoteRequestIdFactory}
|
import se.scalablesolutions.akka.remote.{RemoteProtocolBuilder, RemoteClient, RemoteRequestProtocolIdFactory}
|
||||||
import se.scalablesolutions.akka.dispatch.{MessageDispatcher, Future}
|
import se.scalablesolutions.akka.dispatch.{MessageDispatcher, Future}
|
||||||
import se.scalablesolutions.akka.config.ScalaConfig._
|
import se.scalablesolutions.akka.config.ScalaConfig._
|
||||||
import se.scalablesolutions.akka.serialization.Serializer
|
import se.scalablesolutions.akka.serialization.Serializer
|
||||||
|
|
@ -284,9 +284,9 @@ object ActiveObject {
|
||||||
actor.initialize(target, proxy)
|
actor.initialize(target, proxy)
|
||||||
actor.timeout = timeout
|
actor.timeout = timeout
|
||||||
if (remoteAddress.isDefined) actor.makeRemote(remoteAddress.get)
|
if (remoteAddress.isDefined) actor.makeRemote(remoteAddress.get)
|
||||||
val actorId = new ActorRef(() => actor)
|
val actorRef = new ActorRef(() => actor)
|
||||||
AspectInitRegistry.register(proxy, AspectInit(target, actorId, remoteAddress, timeout))
|
AspectInitRegistry.register(proxy, AspectInit(target, actorRef, remoteAddress, timeout))
|
||||||
actorId.start
|
actorRef.start
|
||||||
proxy.asInstanceOf[T]
|
proxy.asInstanceOf[T]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -295,9 +295,9 @@ object ActiveObject {
|
||||||
actor.initialize(target.getClass, target)
|
actor.initialize(target.getClass, target)
|
||||||
actor.timeout = timeout
|
actor.timeout = timeout
|
||||||
if (remoteAddress.isDefined) actor.makeRemote(remoteAddress.get)
|
if (remoteAddress.isDefined) actor.makeRemote(remoteAddress.get)
|
||||||
val actorId = new ActorRef(() => actor)
|
val actorRef = new ActorRef(() => actor)
|
||||||
AspectInitRegistry.register(proxy, AspectInit(intf, actorId, remoteAddress, timeout))
|
AspectInitRegistry.register(proxy, AspectInit(intf, actorRef, remoteAddress, timeout))
|
||||||
actorId.start
|
actorRef.start
|
||||||
proxy.asInstanceOf[T]
|
proxy.asInstanceOf[T]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -388,10 +388,10 @@ private[akka] object AspectInitRegistry {
|
||||||
|
|
||||||
private[akka] sealed case class AspectInit(
|
private[akka] sealed case class AspectInit(
|
||||||
val target: Class[_],
|
val target: Class[_],
|
||||||
val actorId: ActorRef,
|
val actorRef: ActorRef,
|
||||||
val remoteAddress: Option[InetSocketAddress],
|
val remoteAddress: Option[InetSocketAddress],
|
||||||
val timeout: Long) {
|
val timeout: Long) {
|
||||||
def this(target: Class[_], actorId: ActorRef, timeout: Long) = this(target, actorId, None, timeout)
|
def this(target: Class[_], actorRef: ActorRef, timeout: Long) = this(target, actorRef, None, timeout)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -405,7 +405,7 @@ private[akka] sealed case class AspectInit(
|
||||||
private[akka] sealed class ActiveObjectAspect {
|
private[akka] sealed class ActiveObjectAspect {
|
||||||
@volatile private var isInitialized = false
|
@volatile private var isInitialized = false
|
||||||
private var target: Class[_] = _
|
private var target: Class[_] = _
|
||||||
private var actorId: ActorRef = _
|
private var actorRef: ActorRef = _
|
||||||
private var remoteAddress: Option[InetSocketAddress] = _
|
private var remoteAddress: Option[InetSocketAddress] = _
|
||||||
private var timeout: Long = _
|
private var timeout: Long = _
|
||||||
|
|
||||||
|
|
@ -414,7 +414,7 @@ private[akka] sealed class ActiveObjectAspect {
|
||||||
if (!isInitialized) {
|
if (!isInitialized) {
|
||||||
val init = AspectInitRegistry.initFor(joinPoint.getThis)
|
val init = AspectInitRegistry.initFor(joinPoint.getThis)
|
||||||
target = init.target
|
target = init.target
|
||||||
actorId = init.actorId
|
actorRef = init.actorRef
|
||||||
remoteAddress = init.remoteAddress
|
remoteAddress = init.remoteAddress
|
||||||
timeout = init.timeout
|
timeout = init.timeout
|
||||||
isInitialized = true
|
isInitialized = true
|
||||||
|
|
@ -430,10 +430,10 @@ private[akka] sealed class ActiveObjectAspect {
|
||||||
private def localDispatch(joinPoint: JoinPoint): AnyRef = {
|
private def localDispatch(joinPoint: JoinPoint): AnyRef = {
|
||||||
val rtti = joinPoint.getRtti.asInstanceOf[MethodRtti]
|
val rtti = joinPoint.getRtti.asInstanceOf[MethodRtti]
|
||||||
if (isOneWay(rtti)) {
|
if (isOneWay(rtti)) {
|
||||||
(actorId ! Invocation(joinPoint, true, true) ).asInstanceOf[AnyRef]
|
(actorRef ! Invocation(joinPoint, true, true) ).asInstanceOf[AnyRef]
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
val result = actorId !! (Invocation(joinPoint, false, isVoid(rtti)), timeout)
|
val result = actorRef !! (Invocation(joinPoint, false, isVoid(rtti)), timeout)
|
||||||
if (result.isDefined) result.get
|
if (result.isDefined) result.get
|
||||||
else throw new IllegalStateException("No result defined for invocation [" + joinPoint + "]")
|
else throw new IllegalStateException("No result defined for invocation [" + joinPoint + "]")
|
||||||
}
|
}
|
||||||
|
|
@ -443,17 +443,17 @@ private[akka] sealed class ActiveObjectAspect {
|
||||||
val rtti = joinPoint.getRtti.asInstanceOf[MethodRtti]
|
val rtti = joinPoint.getRtti.asInstanceOf[MethodRtti]
|
||||||
val oneWay_? = isOneWay(rtti) || isVoid(rtti)
|
val oneWay_? = isOneWay(rtti) || isVoid(rtti)
|
||||||
val (message: Array[AnyRef], isEscaped) = escapeArguments(rtti.getParameterValues)
|
val (message: Array[AnyRef], isEscaped) = escapeArguments(rtti.getParameterValues)
|
||||||
val requestBuilder = RemoteRequest.newBuilder
|
val requestBuilder = RemoteRequestProtocol.newBuilder
|
||||||
.setId(RemoteRequestIdFactory.nextId)
|
.setId(RemoteRequestProtocolIdFactory.nextId)
|
||||||
.setMethod(rtti.getMethod.getName)
|
.setMethod(rtti.getMethod.getName)
|
||||||
.setTarget(target.getName)
|
.setTarget(target.getName)
|
||||||
.setUuid(actorId.uuid)
|
.setUuid(actorRef.uuid)
|
||||||
.setTimeout(timeout)
|
.setTimeout(timeout)
|
||||||
.setIsActor(false)
|
.setIsActor(false)
|
||||||
.setIsOneWay(oneWay_?)
|
.setIsOneWay(oneWay_?)
|
||||||
.setIsEscaped(false)
|
.setIsEscaped(false)
|
||||||
RemoteProtocolBuilder.setMessage(message, requestBuilder)
|
RemoteProtocolBuilder.setMessage(message, requestBuilder)
|
||||||
val id = actorId.actor.registerSupervisorAsRemoteActor
|
val id = actorRef.actor.registerSupervisorAsRemoteActor
|
||||||
if (id.isDefined) requestBuilder.setSupervisorUuid(id.get)
|
if (id.isDefined) requestBuilder.setSupervisorUuid(id.get)
|
||||||
val remoteMessage = requestBuilder.build
|
val remoteMessage = requestBuilder.build
|
||||||
val future = RemoteClient.clientFor(remoteAddress.get).send(remoteMessage, None)
|
val future = RemoteClient.clientFor(remoteAddress.get).send(remoteMessage, None)
|
||||||
|
|
|
||||||
|
|
@ -11,12 +11,10 @@ import se.scalablesolutions.akka.config.ScalaConfig._
|
||||||
import se.scalablesolutions.akka.stm.Transaction.Global._
|
import se.scalablesolutions.akka.stm.Transaction.Global._
|
||||||
import se.scalablesolutions.akka.stm.TransactionManagement._
|
import se.scalablesolutions.akka.stm.TransactionManagement._
|
||||||
import se.scalablesolutions.akka.stm.TransactionManagement
|
import se.scalablesolutions.akka.stm.TransactionManagement
|
||||||
import se.scalablesolutions.akka.remote.protobuf.RemoteProtocol
|
|
||||||
import se.scalablesolutions.akka.remote.{RemoteNode, RemoteServer, RemoteClient,
|
|
||||||
RemoteActorProxy, RemoteProtocolBuilder,
|
|
||||||
RemoteRequestIdFactory}
|
|
||||||
import se.scalablesolutions.akka.serialization.Serializer
|
import se.scalablesolutions.akka.serialization.Serializer
|
||||||
import se.scalablesolutions.akka.util.{HashCode, Logging, UUID}
|
import se.scalablesolutions.akka.util.{HashCode, Logging, UUID}
|
||||||
|
import se.scalablesolutions.akka.remote.protobuf.RemoteProtocol
|
||||||
|
import se.scalablesolutions.akka.remote.{RemoteNode, RemoteServer, RemoteClient, RemoteActorProxy, RemoteProtocolBuilder, RemoteRequestProtocolIdFactory}
|
||||||
|
|
||||||
import org.multiverse.api.ThreadLocalTransaction._
|
import org.multiverse.api.ThreadLocalTransaction._
|
||||||
import org.multiverse.commitbarriers.CountDownCommitBarrier
|
import org.multiverse.commitbarriers.CountDownCommitBarrier
|
||||||
|
|
@ -250,31 +248,32 @@ object Actor extends Logging {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The ActorID object can be used to create ActorID instances out of its binary
|
* The ActorRef object can be used to create ActorRef instances out of its binary
|
||||||
* protobuf based representation.
|
* protobuf based representation.
|
||||||
* <pre>
|
* <pre>
|
||||||
* val actorRef = ActorID.fromBinary(bytes)
|
* val actorRef = ActorRef.fromBinary(bytes)
|
||||||
* actorRef ! message // send message to remote actor through its reference
|
* actorRef ! message // send message to remote actor through its reference
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author <a href="http://jonasboner.com">Jonas Bonér</a>
|
* @author <a href="http://jonasboner.com">Jonas Bonér</a>
|
||||||
*/
|
*/
|
||||||
object ActorID {
|
object ActorRef {
|
||||||
def fromBinary(bytes: Array[Byte]): ActorID = {
|
def fromBinary(bytes: Array[Byte]): ActorRef =
|
||||||
val actorRefProto = RemoteProtocol.ActorRef.newBuilder.mergeFrom(bytes).build
|
fromProtocol(RemoteProtocol.ActorRefProtocol.newBuilder.mergeFrom(bytes).build)
|
||||||
|
|
||||||
|
def fromProtocol(protocol: RemoteProtocol.ActorRefProtocol): ActorRef =
|
||||||
RemoteActorProxy(
|
RemoteActorProxy(
|
||||||
actorRefProto.getUuid,
|
protocol.getUuid,
|
||||||
actorRefProto.getActorClassName,
|
protocol.getActorClassName,
|
||||||
actorRefProto.getSourceHostname,
|
protocol.getSourceHostname,
|
||||||
actorRefProto.getSourcePort,
|
protocol.getSourcePort,
|
||||||
actorRefProto.getTimeout)
|
protocol.getTimeout)
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ActorID is an immutable and serializable handle to an Actor.
|
* ActorRef is an immutable and serializable handle to an Actor.
|
||||||
* <p/>
|
* <p/>
|
||||||
* Create an ActorID for an Actor by using the factory method on the Actor object.
|
* Create an ActorRef for an Actor by using the factory method on the Actor object.
|
||||||
* <p/>
|
* <p/>
|
||||||
* Here is an example on how to create an actor with a default constructor.
|
* Here is an example on how to create an actor with a default constructor.
|
||||||
* <pre>
|
* <pre>
|
||||||
|
|
@ -297,6 +296,7 @@ object ActorID {
|
||||||
*
|
*
|
||||||
* @author <a href="http://jonasboner.com">Jonas Bonér</a>
|
* @author <a href="http://jonasboner.com">Jonas Bonér</a>
|
||||||
*/
|
*/
|
||||||
|
final class ActorRef private[akka] () {
|
||||||
private[akka] var actorFactory: Either[Option[Class[_ <: Actor]], Option[() => Actor]] = Left(None)
|
private[akka] var actorFactory: Either[Option[Class[_ <: Actor]], Option[() => Actor]] = Left(None)
|
||||||
|
|
||||||
private[akka] lazy val actor: Actor = {
|
private[akka] lazy val actor: Actor = {
|
||||||
|
|
@ -329,20 +329,29 @@ object ActorID {
|
||||||
actorFactory = Right(Some(factory))
|
actorFactory = Right(Some(factory))
|
||||||
}
|
}
|
||||||
|
|
||||||
def toBinary: Array[Byte] = {
|
def toProtocol: RemoteProtocol.ActorRefProtocol = {
|
||||||
|
val (host, port) = actor._replyToAddress.map(address =>
|
||||||
|
(address.getHostName, address.getPort))
|
||||||
|
.getOrElse((Actor.HOSTNAME, Actor.PORT))
|
||||||
|
|
||||||
if (!actor._registeredInRemoteNodeDuringSerialization) {
|
if (!actor._registeredInRemoteNodeDuringSerialization) {
|
||||||
RemoteNode.register(uuid, this)
|
Actor.log.debug("Register serialized Actor [%s] as remote @ [%s:%s]", actorClass.getName, host, port)
|
||||||
|
if (RemoteServer.serverFor(host, port).isEmpty) (new RemoteServer).start(host, port)
|
||||||
|
RemoteServer.actorsFor(RemoteServer.Address(host, port)).actors.put(uuid, this)
|
||||||
actor._registeredInRemoteNodeDuringSerialization = true
|
actor._registeredInRemoteNodeDuringSerialization = true
|
||||||
}
|
}
|
||||||
RemoteProtocol.ActorRef.newBuilder
|
|
||||||
|
RemoteProtocol.ActorRefProtocol.newBuilder
|
||||||
.setUuid(uuid)
|
.setUuid(uuid)
|
||||||
.setActorClassName(actorClass.getName)
|
.setActorClassName(actorClass.getName)
|
||||||
.setSourceHostname(RemoteServer.HOSTNAME)
|
.setSourceHostname(host)
|
||||||
.setSourcePort(RemoteServer.PORT)
|
.setSourcePort(port)
|
||||||
.setTimeout(timeout)
|
.setTimeout(timeout)
|
||||||
.build.toByteArray
|
.build
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def toBinary: Array[Byte] = toProtocol.toByteArray
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the class for the Actor instance that is managed by the ActorRef.
|
* Returns the class for the Actor instance that is managed by the ActorRef.
|
||||||
*/
|
*/
|
||||||
|
|
@ -450,7 +459,7 @@ object ActorID {
|
||||||
* If you are sending messages using <code>!!</code> then you <b>have to</b> use <code>reply(..)</code>
|
* If you are sending messages using <code>!!</code> then you <b>have to</b> use <code>reply(..)</code>
|
||||||
* to send a reply message to the original sender. If not then the sender will block until the timeout expires.
|
* to send a reply message to the original sender. If not then the sender will block until the timeout expires.
|
||||||
*/
|
*/
|
||||||
def !: Option[T] = !
|
def !(implicit sender: Option[ActorRef] = None): Option[T] = !
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sends a message asynchronously returns a future holding the eventual reply message.
|
* Sends a message asynchronously returns a future holding the eventual reply message.
|
||||||
|
|
@ -478,7 +487,7 @@ object ActorID {
|
||||||
if (actor.isKilled) throw new ActorKilledException("Actor [" + toString + "] has been killed, can't respond to messages")
|
if (actor.isKilled) throw new ActorKilledException("Actor [" + toString + "] has been killed, can't respond to messages")
|
||||||
if (actor.isRunning) {
|
if (actor.isRunning) {
|
||||||
sender.get.actor.replyTo match {
|
sender.get.actor.replyTo match {
|
||||||
case Some(Left(actorID)) => actor.postMessageToMailbox(message, Some(actorID))
|
case Some(Left(actorRef)) => actor.postMessageToMailbox(message, Some(actorRef))
|
||||||
case Some(Right(future)) => actor.postMessageToMailboxAndCreateFutureResultWithTimeout(message, actor.timeout, Some(future))
|
case Some(Right(future)) => actor.postMessageToMailboxAndCreateFutureResultWithTimeout(message, actor.timeout, Some(future))
|
||||||
case _ => throw new IllegalStateException("Can't forward message when initial sender is not an actor")
|
case _ => throw new IllegalStateException("Can't forward message when initial sender is not an actor")
|
||||||
}
|
}
|
||||||
|
|
@ -599,7 +608,7 @@ trait Actor extends TransactionManagement with Logging {
|
||||||
@volatile private[this] var _isSuspended = true
|
@volatile private[this] var _isSuspended = true
|
||||||
@volatile private[this] var _isShutDown = false
|
@volatile private[this] var _isShutDown = false
|
||||||
@volatile private[akka] var _isKilled = false
|
@volatile private[akka] var _isKilled = false
|
||||||
@volatile private[akka] var _registeredInRemoteNodeDuringSerialization = true
|
@volatile private[akka] var _registeredInRemoteNodeDuringSerialization = false
|
||||||
private var _hotswap: Option[PartialFunction[Any, Unit]] = None
|
private var _hotswap: Option[PartialFunction[Any, Unit]] = None
|
||||||
private[akka] var _remoteAddress: Option[InetSocketAddress] = None
|
private[akka] var _remoteAddress: Option[InetSocketAddress] = None
|
||||||
private[akka] var _linkedActors: Option[HashSet[ActorRef]] = None
|
private[akka] var _linkedActors: Option[HashSet[ActorRef]] = None
|
||||||
|
|
@ -904,7 +913,8 @@ trait Actor extends TransactionManagement with Logging {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the contact address for this actor. This is used for replying to messages sent asynchronously when no reply channel exists.
|
* Set the contact address for this actor. This is used for replying to messages sent
|
||||||
|
* asynchronously when no reply channel exists.
|
||||||
*/
|
*/
|
||||||
def setReplyToAddress(hostname: String, port: Int): Unit = setReplyToAddress(new InetSocketAddress(hostname, port))
|
def setReplyToAddress(hostname: String, port: Int): Unit = setReplyToAddress(new InetSocketAddress(hostname, port))
|
||||||
|
|
||||||
|
|
@ -934,12 +944,12 @@ trait Actor extends TransactionManagement with Logging {
|
||||||
* <p/>
|
* <p/>
|
||||||
* To be invoked from within the actor itself.
|
* To be invoked from within the actor itself.
|
||||||
*/
|
*/
|
||||||
protected[this] def link(actorId: ActorRef) = {
|
protected[this] def link(actorRef: ActorRef) = {
|
||||||
if (actorId.supervisor.isDefined) throw new IllegalStateException(
|
if (actorRef.supervisor.isDefined) throw new IllegalStateException(
|
||||||
"Actor can only have one supervisor [" + actorId + "], e.g. link(actor) fails")
|
"Actor can only have one supervisor [" + actorRef + "], e.g. link(actor) fails")
|
||||||
getLinkedActors.add(actorId)
|
getLinkedActors.add(actorRef)
|
||||||
actorId.supervisor = Some(self)
|
actorRef.supervisor = Some(self)
|
||||||
Actor.log.debug("Linking actor [%s] to actor [%s]", actorId, this)
|
Actor.log.debug("Linking actor [%s] to actor [%s]", actorRef, this)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -947,12 +957,12 @@ trait Actor extends TransactionManagement with Logging {
|
||||||
* <p/>
|
* <p/>
|
||||||
* To be invoked from within the actor itself.
|
* To be invoked from within the actor itself.
|
||||||
*/
|
*/
|
||||||
protected[this] def unlink(actorId: ActorRef) = {
|
protected[this] def unlink(actorRef: ActorRef) = {
|
||||||
if (!getLinkedActors.contains(actorId)) throw new IllegalStateException(
|
if (!getLinkedActors.contains(actorRef)) throw new IllegalStateException(
|
||||||
"Actor [" + actorId + "] is not a linked actor, can't unlink")
|
"Actor [" + actorRef + "] is not a linked actor, can't unlink")
|
||||||
getLinkedActors.remove(actorId)
|
getLinkedActors.remove(actorRef)
|
||||||
actorId.supervisor = None
|
actorRef.supervisor = None
|
||||||
Actor.log.debug("Unlinking actor [%s] from actor [%s]", actorId, this)
|
Actor.log.debug("Unlinking actor [%s] from actor [%s]", actorRef, this)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -960,11 +970,11 @@ trait Actor extends TransactionManagement with Logging {
|
||||||
* <p/>
|
* <p/>
|
||||||
* To be invoked from within the actor itself.
|
* To be invoked from within the actor itself.
|
||||||
*/
|
*/
|
||||||
protected[this] def startLink(actorId: ActorRef) = {
|
protected[this] def startLink(actorRef: ActorRef) = {
|
||||||
try {
|
try {
|
||||||
actorId.start
|
actorRef.start
|
||||||
} finally {
|
} finally {
|
||||||
link(actorId)
|
link(actorRef)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -973,12 +983,12 @@ trait Actor extends TransactionManagement with Logging {
|
||||||
* <p/>
|
* <p/>
|
||||||
* To be invoked from within the actor itself.
|
* To be invoked from within the actor itself.
|
||||||
*/
|
*/
|
||||||
protected[this] def startLinkRemote(actorId: ActorRef, hostname: String, port: Int) = {
|
protected[this] def startLinkRemote(actorRef: ActorRef, hostname: String, port: Int) = {
|
||||||
try {
|
try {
|
||||||
actorId.makeRemote(hostname, port)
|
actorRef.makeRemote(hostname, port)
|
||||||
actorId.start
|
actorRef.start
|
||||||
} finally {
|
} finally {
|
||||||
link(actorId)
|
link(actorRef)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -988,9 +998,9 @@ trait Actor extends TransactionManagement with Logging {
|
||||||
* To be invoked from within the actor itself.
|
* To be invoked from within the actor itself.
|
||||||
*/
|
*/
|
||||||
protected[this] def spawn[T <: Actor : Manifest]: ActorRef = {
|
protected[this] def spawn[T <: Actor : Manifest]: ActorRef = {
|
||||||
val actorId = spawnButDoNotStart[T]
|
val actorRef = spawnButDoNotStart[T]
|
||||||
actorId.start
|
actorRef.start
|
||||||
actorId
|
actorRef
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -1062,15 +1072,15 @@ trait Actor extends TransactionManagement with Logging {
|
||||||
new ActorRef(() => actor)
|
new ActorRef(() => actor)
|
||||||
}
|
}
|
||||||
|
|
||||||
protected[akka] def postMessageToMailbox(message: Any, sender: Option[ActorRef]): Unit = {
|
protected[akka] def postMessageToMailbox(message: Any, senderOption: Option[ActorRef]): Unit = {
|
||||||
joinTransaction(message)
|
joinTransaction(message)
|
||||||
|
|
||||||
if (_remoteAddress.isDefined) {
|
if (_remoteAddress.isDefined) {
|
||||||
val requestBuilder = RemoteProtocol.RemoteRequest.newBuilder
|
val requestBuilder = RemoteProtocol.RemoteRequestProtocol.newBuilder
|
||||||
.setId(RemoteRequestIdFactory.nextId)
|
.setId(RemoteRequestProtocolIdFactory.nextId)
|
||||||
.setTarget(this.getClass.getName)
|
.setTarget(this.getClass.getName)
|
||||||
.setTimeout(this.timeout)
|
.setTimeout(this.timeout)
|
||||||
.setUuid(this.id)
|
.setUuid(this.uuid)
|
||||||
.setIsActor(true)
|
.setIsActor(true)
|
||||||
.setIsOneWay(true)
|
.setIsOneWay(true)
|
||||||
.setIsEscaped(false)
|
.setIsEscaped(false)
|
||||||
|
|
@ -1078,30 +1088,12 @@ trait Actor extends TransactionManagement with Logging {
|
||||||
val id = registerSupervisorAsRemoteActor
|
val id = registerSupervisorAsRemoteActor
|
||||||
if (id.isDefined) requestBuilder.setSupervisorUuid(id.get)
|
if (id.isDefined) requestBuilder.setSupervisorUuid(id.get)
|
||||||
|
|
||||||
// set the source fields used to reply back to the original sender
|
senderOption.foreach(sender => requestBuilder.setSender(sender.toProtocol))
|
||||||
// (i.e. not the remote proxy actor)
|
|
||||||
if (sender.isDefined) {
|
|
||||||
val s = sender.get.actor
|
|
||||||
requestBuilder.setSourceTarget(s.getClass.getName)
|
|
||||||
requestBuilder.setSourceUuid(s.uuid)
|
|
||||||
|
|
||||||
val (host, port) = s._replyToAddress.map(a => (a.getHostName, a.getPort)).getOrElse((Actor.HOSTNAME, Actor.PORT))
|
|
||||||
|
|
||||||
Actor.log.debug("Setting sending actor as %s @ %s:%s", s.getClass.getName, host, port)
|
|
||||||
|
|
||||||
requestBuilder.setSourceHostname(host)
|
|
||||||
requestBuilder.setSourcePort(port)
|
|
||||||
|
|
||||||
if (RemoteServer.serverFor(host, port).isEmpty) {
|
|
||||||
val server = new RemoteServer
|
|
||||||
server.start(host, port)
|
|
||||||
}
|
|
||||||
RemoteServer.actorsFor(RemoteServer.Address(host, port)).actors.put(sender.get.id, sender.get)
|
|
||||||
}
|
|
||||||
RemoteProtocolBuilder.setMessage(message, requestBuilder)
|
RemoteProtocolBuilder.setMessage(message, requestBuilder)
|
||||||
RemoteClient.clientFor(_remoteAddress.get).send[Any](requestBuilder.build, None)
|
RemoteClient.clientFor(_remoteAddress.get).send[Any](requestBuilder.build, None)
|
||||||
} else {
|
} else {
|
||||||
val invocation = new MessageInvocation(self, message, sender.map(Left(_)), transactionSet.get)
|
val invocation = new MessageInvocation(self, message, senderOption.map(Left(_)), transactionSet.get)
|
||||||
if (messageDispatcher.usesActorMailbox) {
|
if (messageDispatcher.usesActorMailbox) {
|
||||||
_mailbox.add(invocation)
|
_mailbox.add(invocation)
|
||||||
if (_isSuspended) invocation.send
|
if (_isSuspended) invocation.send
|
||||||
|
|
@ -1117,17 +1109,21 @@ trait Actor extends TransactionManagement with Logging {
|
||||||
joinTransaction(message)
|
joinTransaction(message)
|
||||||
|
|
||||||
if (_remoteAddress.isDefined) {
|
if (_remoteAddress.isDefined) {
|
||||||
val requestBuilder = RemoteProtocol.RemoteRequest.newBuilder
|
val requestBuilder = RemoteProtocol.RemoteRequestProtocol.newBuilder
|
||||||
.setId(RemoteRequestIdFactory.nextId)
|
.setId(RemoteRequestProtocolIdFactory.nextId)
|
||||||
.setTarget(this.getClass.getName)
|
.setTarget(this.getClass.getName)
|
||||||
.setTimeout(this.timeout)
|
.setTimeout(this.timeout)
|
||||||
.setUuid(this.id)
|
.setUuid(this.uuid)
|
||||||
.setIsActor(true)
|
.setIsActor(true)
|
||||||
.setIsOneWay(false)
|
.setIsOneWay(false)
|
||||||
.setIsEscaped(false)
|
.setIsEscaped(false)
|
||||||
|
|
||||||
|
//senderOption.foreach(sender => requestBuilder.setSender(sender.toProtocol))
|
||||||
RemoteProtocolBuilder.setMessage(message, requestBuilder)
|
RemoteProtocolBuilder.setMessage(message, requestBuilder)
|
||||||
|
|
||||||
val id = registerSupervisorAsRemoteActor
|
val id = registerSupervisorAsRemoteActor
|
||||||
if (id.isDefined) requestBuilder.setSupervisorUuid(id.get)
|
if (id.isDefined) requestBuilder.setSupervisorUuid(id.get)
|
||||||
|
|
||||||
val future = RemoteClient.clientFor(_remoteAddress.get).send(requestBuilder.build, senderFuture)
|
val future = RemoteClient.clientFor(_remoteAddress.get).send(requestBuilder.build, senderFuture)
|
||||||
if (future.isDefined) future.get
|
if (future.isDefined) future.get
|
||||||
else throw new IllegalStateException("Expected a future from remote call to actor " + toString)
|
else throw new IllegalStateException("Expected a future from remote call to actor " + toString)
|
||||||
|
|
@ -1136,10 +1132,7 @@ trait Actor extends TransactionManagement with Logging {
|
||||||
else new DefaultCompletableFuture[T](timeout)
|
else new DefaultCompletableFuture[T](timeout)
|
||||||
val invocation = new MessageInvocation(
|
val invocation = new MessageInvocation(
|
||||||
self, message, Some(Right(future.asInstanceOf[CompletableFuture[Any]])), transactionSet.get)
|
self, message, Some(Right(future.asInstanceOf[CompletableFuture[Any]])), transactionSet.get)
|
||||||
|
if (messageDispatcher.usesActorMailbox) _mailbox.add(invocation)
|
||||||
if (messageDispatcher.usesActorMailbox)
|
|
||||||
_mailbox.add(invocation)
|
|
||||||
|
|
||||||
invocation.send
|
invocation.send
|
||||||
future
|
future
|
||||||
}
|
}
|
||||||
|
|
@ -1273,8 +1266,8 @@ trait Actor extends TransactionManagement with Logging {
|
||||||
|
|
||||||
private[this] def restartLinkedActors(reason: Throwable) = {
|
private[this] def restartLinkedActors(reason: Throwable) = {
|
||||||
getLinkedActors.toArray.toList.asInstanceOf[List[ActorRef]].foreach {
|
getLinkedActors.toArray.toList.asInstanceOf[List[ActorRef]].foreach {
|
||||||
actorId =>
|
actorRef =>
|
||||||
val actor = actorId.actor
|
val actor = actorRef.actor
|
||||||
if (actor.lifeCycle.isEmpty) actor.lifeCycle = Some(LifeCycle(Permanent))
|
if (actor.lifeCycle.isEmpty) actor.lifeCycle = Some(LifeCycle(Permanent))
|
||||||
actor.lifeCycle.get match {
|
actor.lifeCycle.get match {
|
||||||
case LifeCycle(scope, _) => {
|
case LifeCycle(scope, _) => {
|
||||||
|
|
@ -1284,7 +1277,7 @@ trait Actor extends TransactionManagement with Logging {
|
||||||
case Temporary =>
|
case Temporary =>
|
||||||
Actor.log.info("Actor [%s] configured as TEMPORARY and will not be restarted.", actor.id)
|
Actor.log.info("Actor [%s] configured as TEMPORARY and will not be restarted.", actor.id)
|
||||||
actor.stop
|
actor.stop
|
||||||
getLinkedActors.remove(actorId) // remove the temporary actor
|
getLinkedActors.remove(actorRef) // remove the temporary actor
|
||||||
// if last temporary actor is gone, then unlink me from supervisor
|
// if last temporary actor is gone, then unlink me from supervisor
|
||||||
if (getLinkedActors.isEmpty) {
|
if (getLinkedActors.isEmpty) {
|
||||||
Actor.log.info("All linked actors have died permanently (they were all configured as TEMPORARY)" +
|
Actor.log.info("All linked actors have died permanently (they were all configured as TEMPORARY)" +
|
||||||
|
|
@ -1370,7 +1363,7 @@ object DispatcherType {
|
||||||
*
|
*
|
||||||
* @author <a href="http://jonasboner.com">Jonas Bonér</a>
|
* @author <a href="http://jonasboner.com">Jonas Bonér</a>
|
||||||
*/
|
*/
|
||||||
class ActorMessageInvoker private[akka] (val actorId: ActorRef) extends MessageInvoker {
|
class ActorMessageInvoker private[akka] (val actorRef: ActorRef) extends MessageInvoker {
|
||||||
def invoke(handle: MessageInvocation) = actorId.actor.invoke(handle)
|
def invoke(handle: MessageInvocation) = actorRef.actor.invoke(handle)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -57,9 +57,9 @@ object ActorRegistry extends Logging {
|
||||||
val all = new ListBuffer[ActorRef]
|
val all = new ListBuffer[ActorRef]
|
||||||
val elements = actorsByUUID.elements
|
val elements = actorsByUUID.elements
|
||||||
while (elements.hasMoreElements) {
|
while (elements.hasMoreElements) {
|
||||||
val actorId = elements.nextElement
|
val actorRef = elements.nextElement
|
||||||
if (manifest.erasure.isAssignableFrom(actorId.actor.getClass)) {
|
if (manifest.erasure.isAssignableFrom(actorRef.actor.getClass)) {
|
||||||
all += actorId
|
all += actorRef
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
all.toList
|
all.toList
|
||||||
|
|
@ -92,24 +92,24 @@ object ActorRegistry extends Logging {
|
||||||
/**
|
/**
|
||||||
* Registers an actor in the ActorRegistry.
|
* Registers an actor in the ActorRegistry.
|
||||||
*/
|
*/
|
||||||
def register(actorId: ActorRef) = {
|
def register(actorRef: ActorRef) = {
|
||||||
// UUID
|
// UUID
|
||||||
actorsByUUID.put(actorId.uuid, actorId)
|
actorsByUUID.put(actorRef.uuid, actorRef)
|
||||||
|
|
||||||
// ID
|
// ID
|
||||||
val id = actorId.id
|
val id = actorRef.id
|
||||||
if (id eq null) throw new IllegalStateException("Actor.id is null " + actorId)
|
if (id eq null) throw new IllegalStateException("Actor.id is null " + actorRef)
|
||||||
if (actorsById.containsKey(id)) actorsById.put(id, actorId :: actorsById.get(id))
|
if (actorsById.containsKey(id)) actorsById.put(id, actorRef :: actorsById.get(id))
|
||||||
else actorsById.put(id, actorId :: Nil)
|
else actorsById.put(id, actorRef :: Nil)
|
||||||
|
|
||||||
// Class name
|
// Class name
|
||||||
val className = actorId.actor.getClass.getName
|
val className = actorRef.actor.getClass.getName
|
||||||
if (actorsByClassName.containsKey(className)) {
|
if (actorsByClassName.containsKey(className)) {
|
||||||
actorsByClassName.put(className, actorId :: actorsByClassName.get(className))
|
actorsByClassName.put(className, actorRef :: actorsByClassName.get(className))
|
||||||
} else actorsByClassName.put(className, actorId :: Nil)
|
} else actorsByClassName.put(className, actorRef :: Nil)
|
||||||
|
|
||||||
// notify listeners
|
// notify listeners
|
||||||
foreachListener(_ ! ActorRegistered(actorId))
|
foreachListener(_ ! ActorRegistered(actorRef))
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -58,9 +58,9 @@ object Scheduler extends Actor {
|
||||||
|
|
||||||
def restart = service = Executors.newSingleThreadScheduledExecutor(SchedulerThreadFactory)
|
def restart = service = Executors.newSingleThreadScheduledExecutor(SchedulerThreadFactory)
|
||||||
|
|
||||||
def stopSupervising(actorId: ActorRef) = {
|
def stopSupervising(actorRef: ActorRef) = {
|
||||||
unlink(actorId)
|
unlink(actorRef)
|
||||||
schedulers.remove(actorId)
|
schedulers.remove(actorRef)
|
||||||
}
|
}
|
||||||
|
|
||||||
override def shutdown = {
|
override def shutdown = {
|
||||||
|
|
|
||||||
|
|
@ -103,9 +103,9 @@ sealed class Supervisor private[akka] (handler: FaultHandlingStrategy, trapExcep
|
||||||
|
|
||||||
override def stop = synchronized {
|
override def stop = synchronized {
|
||||||
super[Actor].stop
|
super[Actor].stop
|
||||||
getLinkedActors.toArray.toList.asInstanceOf[List[ActorRef]].foreach { actorId =>
|
getLinkedActors.toArray.toList.asInstanceOf[List[ActorRef]].foreach { actorRef =>
|
||||||
actorId.stop
|
actorRef.stop
|
||||||
log.info("Shutting actor down: %s", actorId)
|
log.info("Shutting actor down: %s", actorRef)
|
||||||
}
|
}
|
||||||
log.info("Stopping supervisor: %s", this)
|
log.info("Stopping supervisor: %s", this)
|
||||||
}
|
}
|
||||||
|
|
@ -119,19 +119,19 @@ sealed class Supervisor private[akka] (handler: FaultHandlingStrategy, trapExcep
|
||||||
case SupervisorConfig(_, servers) =>
|
case SupervisorConfig(_, servers) =>
|
||||||
servers.map(server =>
|
servers.map(server =>
|
||||||
server match {
|
server match {
|
||||||
case Supervise(actorId, lifeCycle, remoteAddress) =>
|
case Supervise(actorRef, lifeCycle, remoteAddress) =>
|
||||||
val className = actorId.actor.getClass.getName
|
val className = actorRef.actor.getClass.getName
|
||||||
val currentActors = {
|
val currentActors = {
|
||||||
val list = actors.get(className)
|
val list = actors.get(className)
|
||||||
if (list eq null) List[ActorRef]()
|
if (list eq null) List[ActorRef]()
|
||||||
else list
|
else list
|
||||||
}
|
}
|
||||||
actors.put(className, actorId :: currentActors)
|
actors.put(className, actorRef :: currentActors)
|
||||||
actorId.actor.lifeCycle = Some(lifeCycle)
|
actorRef.actor.lifeCycle = Some(lifeCycle)
|
||||||
startLink(actorId)
|
startLink(actorRef)
|
||||||
remoteAddress.foreach(address => RemoteServer.actorsFor(
|
remoteAddress.foreach(address => RemoteServer.actorsFor(
|
||||||
RemoteServer.Address(address.hostname, address.port))
|
RemoteServer.Address(address.hostname, address.port))
|
||||||
.actors.put(actorId.id, actorId))
|
.actors.put(actorRef.id, actorRef))
|
||||||
|
|
||||||
case supervisorConfig @ SupervisorConfig(_, _) => // recursive supervisor configuration
|
case supervisorConfig @ SupervisorConfig(_, _) => // recursive supervisor configuration
|
||||||
val supervisor = {
|
val supervisor = {
|
||||||
|
|
|
||||||
|
|
@ -25,13 +25,13 @@ object ScalaConfig {
|
||||||
|
|
||||||
case class SupervisorConfig(restartStrategy: RestartStrategy, worker: List[Server]) extends Server
|
case class SupervisorConfig(restartStrategy: RestartStrategy, worker: List[Server]) extends Server
|
||||||
|
|
||||||
class Supervise(val actorId: ActorRef, val lifeCycle: LifeCycle, _remoteAddress: RemoteAddress) extends Server {
|
class Supervise(val actorRef: ActorRef, val lifeCycle: LifeCycle, _remoteAddress: RemoteAddress) extends Server {
|
||||||
val remoteAddress: Option[RemoteAddress] = if (_remoteAddress eq null) None else Some(_remoteAddress)
|
val remoteAddress: Option[RemoteAddress] = if (_remoteAddress eq null) None else Some(_remoteAddress)
|
||||||
}
|
}
|
||||||
object Supervise {
|
object Supervise {
|
||||||
def apply(actorId: ActorRef, lifeCycle: LifeCycle, remoteAddress: RemoteAddress) = new Supervise(actorId, lifeCycle, remoteAddress)
|
def apply(actorRef: ActorRef, lifeCycle: LifeCycle, remoteAddress: RemoteAddress) = new Supervise(actorRef, lifeCycle, remoteAddress)
|
||||||
def apply(actorId: ActorRef, lifeCycle: LifeCycle) = new Supervise(actorId, lifeCycle, null)
|
def apply(actorRef: ActorRef, lifeCycle: LifeCycle) = new Supervise(actorRef, lifeCycle, null)
|
||||||
def unapply(supervise: Supervise) = Some((supervise.actorId, supervise.lifeCycle, supervise.remoteAddress))
|
def unapply(supervise: Supervise) = Some((supervise.actorRef, supervise.lifeCycle, supervise.remoteAddress))
|
||||||
}
|
}
|
||||||
|
|
||||||
case class RestartStrategy(
|
case class RestartStrategy(
|
||||||
|
|
@ -227,8 +227,8 @@ object JavaConfig {
|
||||||
intf, target, lifeCycle.transform, timeout, transactionRequired, dispatcher,
|
intf, target, lifeCycle.transform, timeout, transactionRequired, dispatcher,
|
||||||
if (remoteAddress ne null) se.scalablesolutions.akka.config.ScalaConfig.RemoteAddress(remoteAddress.hostname, remoteAddress.port) else null)
|
if (remoteAddress ne null) se.scalablesolutions.akka.config.ScalaConfig.RemoteAddress(remoteAddress.hostname, remoteAddress.port) else null)
|
||||||
|
|
||||||
def newSupervised(actorId: ActorRef) =
|
def newSupervised(actorRef: ActorRef) =
|
||||||
se.scalablesolutions.akka.config.ScalaConfig.Supervise(actorId, lifeCycle.transform)
|
se.scalablesolutions.akka.config.ScalaConfig.Supervise(actorRef, lifeCycle.transform)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -18,14 +18,14 @@ abstract class AbstractReactorBasedEventDrivenDispatcher(val name: String) exten
|
||||||
|
|
||||||
def dispatch(invocation: MessageInvocation) = queue.append(invocation)
|
def dispatch(invocation: MessageInvocation) = queue.append(invocation)
|
||||||
|
|
||||||
override def register(actorId: ActorRef) = synchronized {
|
override def register(actorRef: ActorRef) = synchronized {
|
||||||
messageInvokers.put(actorId, new ActorMessageInvoker(actorId))
|
messageInvokers.put(actorRef, new ActorMessageInvoker(actorRef))
|
||||||
super.register(actorId)
|
super.register(actorRef)
|
||||||
}
|
}
|
||||||
|
|
||||||
override def unregister(actorId: ActorRef) = synchronized {
|
override def unregister(actorRef: ActorRef) = synchronized {
|
||||||
messageInvokers.remove(actorId)
|
messageInvokers.remove(actorRef)
|
||||||
super.unregister(actorId)
|
super.unregister(actorRef)
|
||||||
}
|
}
|
||||||
|
|
||||||
def shutdown = if (active) {
|
def shutdown = if (active) {
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ import se.scalablesolutions.akka.actor.{Actor, ActorRef}
|
||||||
class ExecutorBasedEventDrivenWorkStealingDispatcher(_name: String) extends MessageDispatcher with ThreadPoolBuilder {
|
class ExecutorBasedEventDrivenWorkStealingDispatcher(_name: String) extends MessageDispatcher with ThreadPoolBuilder {
|
||||||
@volatile private var active: Boolean = false
|
@volatile private var active: Boolean = false
|
||||||
|
|
||||||
implicit def actorId2actor(actorId: ActorRef): Actor = actorId.actor
|
implicit def actorRef2actor(actorRef: ActorRef): Actor = actorRef.actor
|
||||||
|
|
||||||
/** Type of the actors registered in this dispatcher. */
|
/** Type of the actors registered in this dispatcher. */
|
||||||
private var actorType:Option[Class[_]] = None
|
private var actorType:Option[Class[_]] = None
|
||||||
|
|
@ -193,15 +193,15 @@ class ExecutorBasedEventDrivenWorkStealingDispatcher(_name: String) extends Mess
|
||||||
|
|
||||||
private[akka] def init = withNewThreadPoolWithLinkedBlockingQueueWithUnboundedCapacity.buildThreadPool
|
private[akka] def init = withNewThreadPoolWithLinkedBlockingQueueWithUnboundedCapacity.buildThreadPool
|
||||||
|
|
||||||
override def register(actorId: ActorRef) = {
|
override def register(actorRef: ActorRef) = {
|
||||||
verifyActorsAreOfSameType(actorId)
|
verifyActorsAreOfSameType(actorRef)
|
||||||
pooledActors.add(actorId)
|
pooledActors.add(actorRef)
|
||||||
super.register(actorId)
|
super.register(actorRef)
|
||||||
}
|
}
|
||||||
|
|
||||||
override def unregister(actorId: ActorRef) = {
|
override def unregister(actorRef: ActorRef) = {
|
||||||
pooledActors.remove(actorId)
|
pooledActors.remove(actorRef)
|
||||||
super.unregister(actorId)
|
super.unregister(actorRef)
|
||||||
}
|
}
|
||||||
|
|
||||||
def usesActorMailbox = true
|
def usesActorMailbox = true
|
||||||
|
|
|
||||||
|
|
@ -60,9 +60,9 @@ trait MessageDispatcher extends Logging {
|
||||||
def dispatch(invocation: MessageInvocation)
|
def dispatch(invocation: MessageInvocation)
|
||||||
def start
|
def start
|
||||||
def shutdown
|
def shutdown
|
||||||
def register(actorId: ActorRef) = references.put(actorId.uuid, actorId)
|
def register(actorRef: ActorRef) = references.put(actorRef.uuid, actorRef)
|
||||||
def unregister(actorId: ActorRef) = {
|
def unregister(actorRef: ActorRef) = {
|
||||||
references.remove(actorId.uuid)
|
references.remove(actorRef.uuid)
|
||||||
if (canBeShutDown)
|
if (canBeShutDown)
|
||||||
shutdown // shut down in the dispatcher's references is zero
|
shutdown // shut down in the dispatcher's references is zero
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
package se.scalablesolutions.akka.remote
|
package se.scalablesolutions.akka.remote
|
||||||
|
|
||||||
import se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.{RemoteRequest, RemoteReply}
|
import se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.{RemoteRequestProtocol, RemoteReplyProtocol}
|
||||||
import se.scalablesolutions.akka.actor.{Exit, Actor, ActorRef}
|
import se.scalablesolutions.akka.actor.{Exit, Actor, ActorRef}
|
||||||
import se.scalablesolutions.akka.dispatch.{DefaultCompletableFuture, CompletableFuture}
|
import se.scalablesolutions.akka.dispatch.{DefaultCompletableFuture, CompletableFuture}
|
||||||
import se.scalablesolutions.akka.util.{UUID, Logging}
|
import se.scalablesolutions.akka.util.{UUID, Logging}
|
||||||
|
|
@ -31,7 +31,7 @@ import scala.collection.mutable.{HashSet, HashMap}
|
||||||
*
|
*
|
||||||
* @author <a href="http://jonasboner.com">Jonas Bonér</a>
|
* @author <a href="http://jonasboner.com">Jonas Bonér</a>
|
||||||
*/
|
*/
|
||||||
object RemoteRequestIdFactory {
|
object RemoteRequestProtocolIdFactory {
|
||||||
private val nodeId = UUID.newUuid
|
private val nodeId = UUID.newUuid
|
||||||
private val id = new AtomicLong
|
private val id = new AtomicLong
|
||||||
|
|
||||||
|
|
@ -64,23 +64,15 @@ private[akka] class RemoteActorProxy private (
|
||||||
val remoteClient = RemoteClient.clientFor(hostname, port)
|
val remoteClient = RemoteClient.clientFor(hostname, port)
|
||||||
|
|
||||||
override def postMessageToMailbox(message: Any, senderOption: Option[ActorRef]): Unit = {
|
override def postMessageToMailbox(message: Any, senderOption: Option[ActorRef]): Unit = {
|
||||||
val requestBuilder = RemoteRequest.newBuilder
|
val requestBuilder = RemoteRequestProtocol.newBuilder
|
||||||
.setId(RemoteRequestIdFactory.nextId)
|
.setId(RemoteRequestProtocolIdFactory.nextId)
|
||||||
.setTarget(className)
|
.setTarget(className)
|
||||||
.setTimeout(timeOut)
|
.setTimeout(timeOut)
|
||||||
.setUuid(uuid)
|
.setUuid(uuid)
|
||||||
.setIsActor(true)
|
.setIsActor(true)
|
||||||
.setIsOneWay(true)
|
.setIsOneWay(true)
|
||||||
.setIsEscaped(false)
|
.setIsEscaped(false)
|
||||||
if (senderOption.isDefined) {
|
senderOption.foreach(sender => requestBuilder.setSender(sender.toProtocol))
|
||||||
val sender = senderOption.get.actor
|
|
||||||
requestBuilder.setSourceTarget(sender.getClass.getName)
|
|
||||||
requestBuilder.setSourceUuid(sender.uuid)
|
|
||||||
val (host, port) = sender._replyToAddress.map(address =>
|
|
||||||
(address.getHostName, address.getPort)).getOrElse((Actor.HOSTNAME, Actor.PORT))
|
|
||||||
requestBuilder.setSourceHostname(host)
|
|
||||||
requestBuilder.setSourcePort(port)
|
|
||||||
}
|
|
||||||
RemoteProtocolBuilder.setMessage(message, requestBuilder)
|
RemoteProtocolBuilder.setMessage(message, requestBuilder)
|
||||||
remoteClient.send[Any](requestBuilder.build, None)
|
remoteClient.send[Any](requestBuilder.build, None)
|
||||||
}
|
}
|
||||||
|
|
@ -89,14 +81,15 @@ private[akka] class RemoteActorProxy private (
|
||||||
message: Any,
|
message: Any,
|
||||||
timeout: Long,
|
timeout: Long,
|
||||||
senderFuture: Option[CompletableFuture[T]]): CompletableFuture[T] = {
|
senderFuture: Option[CompletableFuture[T]]): CompletableFuture[T] = {
|
||||||
val requestBuilder = RemoteRequest.newBuilder
|
val requestBuilder = RemoteRequestProtocol.newBuilder
|
||||||
.setId(RemoteRequestIdFactory.nextId)
|
.setId(RemoteRequestProtocolIdFactory.nextId)
|
||||||
.setTarget(className)
|
.setTarget(className)
|
||||||
.setTimeout(timeout)
|
.setTimeout(timeout)
|
||||||
.setUuid(uuid)
|
.setUuid(uuid)
|
||||||
.setIsActor(true)
|
.setIsActor(true)
|
||||||
.setIsOneWay(false)
|
.setIsOneWay(false)
|
||||||
.setIsEscaped(false)
|
.setIsEscaped(false)
|
||||||
|
//senderOption.foreach(sender => requestBuilder.setSender(sender.toProtocol))
|
||||||
RemoteProtocolBuilder.setMessage(message, requestBuilder)
|
RemoteProtocolBuilder.setMessage(message, requestBuilder)
|
||||||
val future = remoteClient.send(requestBuilder.build, senderFuture)
|
val future = remoteClient.send(requestBuilder.build, senderFuture)
|
||||||
if (future.isDefined) future.get
|
if (future.isDefined) future.get
|
||||||
|
|
@ -121,14 +114,14 @@ object RemoteClient extends Logging {
|
||||||
def actorFor(className: String, hostname: String, port: Int): ActorRef =
|
def actorFor(className: String, hostname: String, port: Int): ActorRef =
|
||||||
actorFor(className, className, 5000L, hostname, port)
|
actorFor(className, className, 5000L, hostname, port)
|
||||||
|
|
||||||
def actorFor(actorId: String, className: String, hostname: String, port: Int): ActorRef =
|
def actorFor(actorRef: String, className: String, hostname: String, port: Int): ActorRef =
|
||||||
actorFor(actorId, className, 5000L, hostname, port)
|
actorFor(actorRef, className, 5000L, hostname, port)
|
||||||
|
|
||||||
def actorFor(className: String, timeout: Long, hostname: String, port: Int): ActorRef =
|
def actorFor(className: String, timeout: Long, hostname: String, port: Int): ActorRef =
|
||||||
actorFor(className, className, timeout, hostname, port)
|
actorFor(className, className, timeout, hostname, port)
|
||||||
|
|
||||||
def actorFor(actorId: String, className: String, timeout: Long, hostname: String, port: Int): ActorRef =
|
def actorFor(actorRef: String, className: String, timeout: Long, hostname: String, port: Int): ActorRef =
|
||||||
RemoteActorProxy(actorId, className, hostname, port, timeout)
|
RemoteActorProxy(actorRef, className, hostname, port, timeout)
|
||||||
|
|
||||||
def clientFor(hostname: String, port: Int): RemoteClient = clientFor(new InetSocketAddress(hostname, port))
|
def clientFor(hostname: String, port: Int): RemoteClient = clientFor(new InetSocketAddress(hostname, port))
|
||||||
|
|
||||||
|
|
@ -237,7 +230,7 @@ class RemoteClient(val hostname: String, val port: Int) extends Logging {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
def send[T](request: RemoteRequest, senderFuture: Option[CompletableFuture[T]]): Option[CompletableFuture[T]] = if (isRunning) {
|
def send[T](request: RemoteRequestProtocol, senderFuture: Option[CompletableFuture[T]]): Option[CompletableFuture[T]] = if (isRunning) {
|
||||||
if (request.getIsOneWay) {
|
if (request.getIsOneWay) {
|
||||||
connection.getChannel.write(request)
|
connection.getChannel.write(request)
|
||||||
None
|
None
|
||||||
|
|
@ -256,17 +249,17 @@ class RemoteClient(val hostname: String, val port: Int) extends Logging {
|
||||||
throw exception
|
throw exception
|
||||||
}
|
}
|
||||||
|
|
||||||
def registerSupervisorForActor(actorId: ActorRef) =
|
def registerSupervisorForActor(actorRef: ActorRef) =
|
||||||
if (!actorId.supervisor.isDefined) throw new IllegalStateException("Can't register supervisor for " + actorId + " since it is not under supervision")
|
if (!actorRef.supervisor.isDefined) throw new IllegalStateException("Can't register supervisor for " + actorRef + " since it is not under supervision")
|
||||||
else supervisors.putIfAbsent(actorId.supervisor.get.uuid, actorId)
|
else supervisors.putIfAbsent(actorRef.supervisor.get.uuid, actorRef)
|
||||||
|
|
||||||
def deregisterSupervisorForActor(actorId: ActorRef) =
|
def deregisterSupervisorForActor(actorRef: ActorRef) =
|
||||||
if (!actorId.supervisor.isDefined) throw new IllegalStateException("Can't unregister supervisor for " + actorId + " since it is not under supervision")
|
if (!actorRef.supervisor.isDefined) throw new IllegalStateException("Can't unregister supervisor for " + actorRef + " since it is not under supervision")
|
||||||
else supervisors.remove(actorId.supervisor.get.uuid)
|
else supervisors.remove(actorRef.supervisor.get.uuid)
|
||||||
|
|
||||||
def registerListener(actorId: ActorRef) = listeners.add(actorId)
|
def registerListener(actorRef: ActorRef) = listeners.add(actorRef)
|
||||||
|
|
||||||
def deregisterListener(actorId: ActorRef) = listeners.remove(actorId)
|
def deregisterListener(actorRef: ActorRef) = listeners.remove(actorRef)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -283,7 +276,7 @@ class RemoteClientPipelineFactory(name: String,
|
||||||
val timeout = new ReadTimeoutHandler(timer, RemoteClient.READ_TIMEOUT)
|
val timeout = new ReadTimeoutHandler(timer, RemoteClient.READ_TIMEOUT)
|
||||||
val lenDec = new LengthFieldBasedFrameDecoder(1048576, 0, 4, 0, 4)
|
val lenDec = new LengthFieldBasedFrameDecoder(1048576, 0, 4, 0, 4)
|
||||||
val lenPrep = new LengthFieldPrepender(4)
|
val lenPrep = new LengthFieldPrepender(4)
|
||||||
val protobufDec = new ProtobufDecoder(RemoteReply.getDefaultInstance)
|
val protobufDec = new ProtobufDecoder(RemoteReplyProtocol.getDefaultInstance)
|
||||||
val protobufEnc = new ProtobufEncoder
|
val protobufEnc = new ProtobufEncoder
|
||||||
val zipCodec = RemoteServer.COMPRESSION_SCHEME match {
|
val zipCodec = RemoteServer.COMPRESSION_SCHEME match {
|
||||||
case "zlib" => Some(Codec(new ZlibEncoder(RemoteServer.ZLIB_COMPRESSION_LEVEL), new ZlibDecoder))
|
case "zlib" => Some(Codec(new ZlibEncoder(RemoteServer.ZLIB_COMPRESSION_LEVEL), new ZlibDecoder))
|
||||||
|
|
@ -323,9 +316,9 @@ class RemoteClientHandler(val name: String,
|
||||||
override def messageReceived(ctx: ChannelHandlerContext, event: MessageEvent) {
|
override def messageReceived(ctx: ChannelHandlerContext, event: MessageEvent) {
|
||||||
try {
|
try {
|
||||||
val result = event.getMessage
|
val result = event.getMessage
|
||||||
if (result.isInstanceOf[RemoteReply]) {
|
if (result.isInstanceOf[RemoteReplyProtocol]) {
|
||||||
val reply = result.asInstanceOf[RemoteReply]
|
val reply = result.asInstanceOf[RemoteReplyProtocol]
|
||||||
log.debug("Remote client received RemoteReply[\n%s]", reply.toString)
|
log.debug("Remote client received RemoteReplyProtocol[\n%s]", reply.toString)
|
||||||
val future = futures.get(reply.getId).asInstanceOf[CompletableFuture[Any]]
|
val future = futures.get(reply.getId).asInstanceOf[CompletableFuture[Any]]
|
||||||
if (reply.getIsSuccessful) {
|
if (reply.getIsSuccessful) {
|
||||||
val message = RemoteProtocolBuilder.getMessage(reply)
|
val message = RemoteProtocolBuilder.getMessage(reply)
|
||||||
|
|
@ -388,7 +381,7 @@ class RemoteClientHandler(val name: String,
|
||||||
event.getChannel.close
|
event.getChannel.close
|
||||||
}
|
}
|
||||||
|
|
||||||
private def parseException(reply: RemoteReply) = {
|
private def parseException(reply: RemoteReplyProtocol) = {
|
||||||
val exception = reply.getException
|
val exception = reply.getException
|
||||||
val exceptionType = Class.forName(exception.substring(0, exception.indexOf('$')))
|
val exceptionType = Class.forName(exception.substring(0, exception.indexOf('$')))
|
||||||
val exceptionMessage = exception.substring(exception.indexOf('$') + 1, exception.length)
|
val exceptionMessage = exception.substring(exception.indexOf('$') + 1, exception.length)
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ package se.scalablesolutions.akka.remote
|
||||||
|
|
||||||
import se.scalablesolutions.akka.serialization.Serializable.SBinary
|
import se.scalablesolutions.akka.serialization.Serializable.SBinary
|
||||||
import se.scalablesolutions.akka.serialization.{Serializer, Serializable, SerializationProtocol}
|
import se.scalablesolutions.akka.serialization.{Serializer, Serializable, SerializationProtocol}
|
||||||
import se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.{RemoteRequest, RemoteReply}
|
import se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.{RemoteRequestProtocol, RemoteReplyProtocol}
|
||||||
|
|
||||||
import com.google.protobuf.{Message, ByteString}
|
import com.google.protobuf.{Message, ByteString}
|
||||||
|
|
||||||
|
|
@ -23,7 +23,7 @@ object RemoteProtocolBuilder {
|
||||||
SERIALIZER_SCALA_JSON.classLoader = Some(cl)
|
SERIALIZER_SCALA_JSON.classLoader = Some(cl)
|
||||||
}
|
}
|
||||||
|
|
||||||
def getMessage(request: RemoteRequest): Any = {
|
def getMessage(request: RemoteRequestProtocol): Any = {
|
||||||
request.getProtocol match {
|
request.getProtocol match {
|
||||||
case SerializationProtocol.JAVA =>
|
case SerializationProtocol.JAVA =>
|
||||||
unbox(SERIALIZER_JAVA.in(request.getMessage.toByteArray, None))
|
unbox(SERIALIZER_JAVA.in(request.getMessage.toByteArray, None))
|
||||||
|
|
@ -42,7 +42,7 @@ object RemoteProtocolBuilder {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
def getMessage(reply: RemoteReply): Any = {
|
def getMessage(reply: RemoteReplyProtocol): Any = {
|
||||||
reply.getProtocol match {
|
reply.getProtocol match {
|
||||||
case SerializationProtocol.JAVA =>
|
case SerializationProtocol.JAVA =>
|
||||||
unbox(SERIALIZER_JAVA.in(reply.getMessage.toByteArray, None))
|
unbox(SERIALIZER_JAVA.in(reply.getMessage.toByteArray, None))
|
||||||
|
|
@ -61,7 +61,7 @@ object RemoteProtocolBuilder {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
def setMessage(message: Any, builder: RemoteRequest.Builder) = {
|
def setMessage(message: Any, builder: RemoteRequestProtocol.Builder) = {
|
||||||
if (message.isInstanceOf[Serializable.SBinary[_]]) {
|
if (message.isInstanceOf[Serializable.SBinary[_]]) {
|
||||||
val serializable = message.asInstanceOf[Serializable.SBinary[_ <: Any]]
|
val serializable = message.asInstanceOf[Serializable.SBinary[_ <: Any]]
|
||||||
builder.setProtocol(SerializationProtocol.SBINARY)
|
builder.setProtocol(SerializationProtocol.SBINARY)
|
||||||
|
|
@ -89,7 +89,7 @@ object RemoteProtocolBuilder {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
def setMessage(message: Any, builder: RemoteReply.Builder) = {
|
def setMessage(message: Any, builder: RemoteReplyProtocol.Builder) = {
|
||||||
if (message.isInstanceOf[Serializable.SBinary[_]]) {
|
if (message.isInstanceOf[Serializable.SBinary[_]]) {
|
||||||
val serializable = message.asInstanceOf[Serializable.SBinary[_ <: Any]]
|
val serializable = message.asInstanceOf[Serializable.SBinary[_ <: Any]]
|
||||||
builder.setProtocol(SerializationProtocol.SBINARY)
|
builder.setProtocol(SerializationProtocol.SBINARY)
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ import java.util.{Map => JMap}
|
||||||
|
|
||||||
import se.scalablesolutions.akka.actor._
|
import se.scalablesolutions.akka.actor._
|
||||||
import se.scalablesolutions.akka.util._
|
import se.scalablesolutions.akka.util._
|
||||||
import se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.{RemoteReply, RemoteRequest}
|
import se.scalablesolutions.akka.remote.protobuf.RemoteProtocol._
|
||||||
import se.scalablesolutions.akka.config.Config.config
|
import se.scalablesolutions.akka.config.Config.config
|
||||||
|
|
||||||
import org.jboss.netty.bootstrap.ServerBootstrap
|
import org.jboss.netty.bootstrap.ServerBootstrap
|
||||||
|
|
@ -199,37 +199,54 @@ class RemoteServer extends Logging {
|
||||||
/**
|
/**
|
||||||
* Register Remote Actor by the Actor's 'id' field.
|
* Register Remote Actor by the Actor's 'id' field.
|
||||||
*/
|
*/
|
||||||
def register(actor: ActorRef) = synchronized {
|
def register(actorRef: ActorRef) = synchronized {
|
||||||
if (_isRunning) {
|
if (_isRunning) {
|
||||||
log.info("Registering server side remote actor [%s] with id [%s]", actor.actorClass.getName, actor.id)
|
log.info("Registering server side remote actor [%s] with id [%s]", actorRef.actorClass.getName, actorRef.id)
|
||||||
RemoteServer.actorsFor(RemoteServer.Address(hostname, port)).actors.put(actor.id, actor)
|
RemoteServer.actorsFor(RemoteServer.Address(hostname, port)).actors.put(actorRef.id, actorRef)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Register Remote Actor by a specific 'id' passed as argument.
|
* Register Remote Actor by a specific 'id' passed as argument.
|
||||||
|
* <p/>
|
||||||
|
* NOTE: If you use this method to register your remote actor then you must unregister the actor by this ID yourself.
|
||||||
*/
|
*/
|
||||||
def register(id: String, actor: ActorRef) = synchronized {
|
def register(id: String, actorRef: ActorRef) = synchronized {
|
||||||
if (_isRunning) {
|
if (_isRunning) {
|
||||||
log.info("Registering server side remote actor [%s] with id [%s]", actor.actorClass.getName, id)
|
log.info("Registering server side remote actor [%s] with id [%s]", actorRef.actorClass.getName, id)
|
||||||
RemoteServer.actorsFor(RemoteServer.Address(hostname, port)).actors.put(id, actor)
|
RemoteServer.actorsFor(RemoteServer.Address(hostname, port)).actors.put(id, actorRef)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Unregister Remote Actor.
|
* Unregister Remote Actor that is registered using its 'id' field (not custom ID).
|
||||||
*/
|
*/
|
||||||
def unregister(actor: ActorID) = synchronized {
|
def unregister(actorRef: ActorRef) = synchronized {
|
||||||
if (_isRunning) {
|
if (_isRunning) {
|
||||||
log.info("Unregistering server side remote actor [%s] with id [%s]", actor.actorClass.getName, actor.id)
|
log.info("Unregistering server side remote actor [%s] with id [%s]", actorRef.actorClass.getName, actorRef.id)
|
||||||
val server = RemoteServer.actorsFor(RemoteServer.Address(hostname, port))
|
val server = RemoteServer.actorsFor(RemoteServer.Address(hostname, port))
|
||||||
server.actors.put(actor.id, actor)
|
server.actors.remove(actorRef.id)
|
||||||
if (actor.actor._registeredInRemoteNodeDuringSerialization) server.actors.remove(actor.uuid)
|
if (actorRef.actor._registeredInRemoteNodeDuringSerialization) server.actors.remove(actorRef.uuid)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Unregister Remote Actor by specific 'id'.
|
||||||
|
* <p/>
|
||||||
|
* NOTE: You need to call this method if you have registered an actor by a custom ID.
|
||||||
|
*/
|
||||||
|
def unregister(id: String) = synchronized {
|
||||||
|
if (_isRunning) {
|
||||||
|
log.info("Unregistering server side remote actor with id [%s]", id)
|
||||||
|
val server = RemoteServer.actorsFor(RemoteServer.Address(hostname, port))
|
||||||
|
val actorRef = server.actors.get(id)
|
||||||
|
server.actors.remove(id)
|
||||||
|
if (actorRef.actor._registeredInRemoteNodeDuringSerialization) server.actors.remove(actorRef.uuid)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
case class Codec(encoder : ChannelHandler, decoder : ChannelHandler)
|
case class Codec(encoder: ChannelHandler, decoder: ChannelHandler)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author <a href="http://jonasboner.com">Jonas Bonér</a>
|
* @author <a href="http://jonasboner.com">Jonas Bonér</a>
|
||||||
|
|
@ -245,7 +262,7 @@ class RemoteServerPipelineFactory(
|
||||||
def getPipeline: ChannelPipeline = {
|
def getPipeline: ChannelPipeline = {
|
||||||
val lenDec = new LengthFieldBasedFrameDecoder(1048576, 0, 4, 0, 4)
|
val lenDec = new LengthFieldBasedFrameDecoder(1048576, 0, 4, 0, 4)
|
||||||
val lenPrep = new LengthFieldPrepender(4)
|
val lenPrep = new LengthFieldPrepender(4)
|
||||||
val protobufDec = new ProtobufDecoder(RemoteRequest.getDefaultInstance)
|
val protobufDec = new ProtobufDecoder(RemoteRequestProtocol.getDefaultInstance)
|
||||||
val protobufEnc = new ProtobufEncoder
|
val protobufEnc = new ProtobufEncoder
|
||||||
val zipCodec = RemoteServer.COMPRESSION_SCHEME match {
|
val zipCodec = RemoteServer.COMPRESSION_SCHEME match {
|
||||||
case "zlib" => Some(Codec(new ZlibEncoder(RemoteServer.ZLIB_COMPRESSION_LEVEL), new ZlibDecoder))
|
case "zlib" => Some(Codec(new ZlibEncoder(RemoteServer.ZLIB_COMPRESSION_LEVEL), new ZlibDecoder))
|
||||||
|
|
@ -295,50 +312,37 @@ class RemoteServerHandler(
|
||||||
override def messageReceived(ctx: ChannelHandlerContext, event: MessageEvent) = {
|
override def messageReceived(ctx: ChannelHandlerContext, event: MessageEvent) = {
|
||||||
val message = event.getMessage
|
val message = event.getMessage
|
||||||
if (message eq null) throw new IllegalStateException("Message in remote MessageEvent is null: " + event)
|
if (message eq null) throw new IllegalStateException("Message in remote MessageEvent is null: " + event)
|
||||||
if (message.isInstanceOf[RemoteRequest]) {
|
if (message.isInstanceOf[RemoteRequestProtocol]) {
|
||||||
handleRemoteRequest(message.asInstanceOf[RemoteRequest], event.getChannel)
|
handleRemoteRequestProtocol(message.asInstanceOf[RemoteRequestProtocol], event.getChannel)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override def exceptionCaught(ctx: ChannelHandlerContext, event: ExceptionEvent) = {
|
override def exceptionCaught(ctx: ChannelHandlerContext, event: ExceptionEvent) = {
|
||||||
|
event.getCause.printStackTrace
|
||||||
log.error(event.getCause, "Unexpected exception from remote downstream")
|
log.error(event.getCause, "Unexpected exception from remote downstream")
|
||||||
event.getChannel.close
|
event.getChannel.close
|
||||||
}
|
}
|
||||||
|
|
||||||
private def handleRemoteRequest(request: RemoteRequest, channel: Channel) = {
|
private def handleRemoteRequestProtocol(request: RemoteRequestProtocol, channel: Channel) = {
|
||||||
log.debug("Received RemoteRequest[\n%s]", request.toString)
|
log.debug("Received RemoteRequestProtocol[\n%s]", request.toString)
|
||||||
if (request.getIsActor) dispatchToActor(request, channel)
|
if (request.getIsActor) dispatchToActor(request, channel)
|
||||||
else dispatchToActiveObject(request, channel)
|
else dispatchToActiveObject(request, channel)
|
||||||
}
|
}
|
||||||
|
|
||||||
private def dispatchToActor(request: RemoteRequest, channel: Channel) = {
|
private def dispatchToActor(request: RemoteRequestProtocol, channel: Channel) = {
|
||||||
log.debug("Dispatching to remote actor [%s]", request.getTarget)
|
log.debug("Dispatching to remote actor [%s:%s]", request.getTarget, request.getUuid)
|
||||||
val actorId = createActor(request.getTarget, request.getUuid, request.getTimeout)
|
val actorRef = createActor(request.getTarget, request.getUuid, request.getTimeout)
|
||||||
actorId.start
|
actorRef.start
|
||||||
|
|
||||||
val message = RemoteProtocolBuilder.getMessage(request)
|
val message = RemoteProtocolBuilder.getMessage(request)
|
||||||
if (request.getIsOneWay) {
|
if (request.getIsOneWay) {
|
||||||
if (request.hasSourceHostname && request.hasSourcePort) {
|
val sender = request.getSender
|
||||||
// re-create the sending actor
|
if (sender ne null) actorRef.!(message)(Some(ActorRef.fromProtocol(sender)))
|
||||||
val targetClass = if (request.hasSourceTarget) request.getSourceTarget
|
|
||||||
else request.getTarget
|
|
||||||
|
|
||||||
val remoteActorId = createActor(targetClass, request.getSourceUuid, request.getTimeout)
|
|
||||||
if (!remoteActorId.isRunning) {
|
|
||||||
remoteActorId.makeRemote(request.getSourceHostname, request.getSourcePort)
|
|
||||||
remoteActorId.start
|
|
||||||
}
|
|
||||||
actorId.!(message)(Some(remoteActorId))
|
|
||||||
} else {
|
|
||||||
// couldn't find a way to reply, send the message without a source/sender
|
|
||||||
actorId ! message
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
val resultOrNone = actorId !! message
|
val resultOrNone = actorRef !! message
|
||||||
val result: AnyRef = if (resultOrNone.isDefined) resultOrNone.get else null
|
val result: AnyRef = if (resultOrNone.isDefined) resultOrNone.get else null
|
||||||
log.debug("Returning result from actor invocation [%s]", result)
|
log.debug("Returning result from actor invocation [%s]", result)
|
||||||
val replyBuilder = RemoteReply.newBuilder
|
val replyBuilder = RemoteReplyProtocol.newBuilder
|
||||||
.setId(request.getId)
|
.setId(request.getId)
|
||||||
.setIsSuccessful(true)
|
.setIsSuccessful(true)
|
||||||
.setIsActor(true)
|
.setIsActor(true)
|
||||||
|
|
@ -349,7 +353,7 @@ class RemoteServerHandler(
|
||||||
} catch {
|
} catch {
|
||||||
case e: Throwable =>
|
case e: Throwable =>
|
||||||
log.error(e, "Could not invoke remote actor [%s]", request.getTarget)
|
log.error(e, "Could not invoke remote actor [%s]", request.getTarget)
|
||||||
val replyBuilder = RemoteReply.newBuilder
|
val replyBuilder = RemoteReplyProtocol.newBuilder
|
||||||
.setId(request.getId)
|
.setId(request.getId)
|
||||||
.setException(e.getClass.getName + "$" + e.getMessage)
|
.setException(e.getClass.getName + "$" + e.getMessage)
|
||||||
.setIsSuccessful(false)
|
.setIsSuccessful(false)
|
||||||
|
|
@ -361,7 +365,7 @@ class RemoteServerHandler(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private def dispatchToActiveObject(request: RemoteRequest, channel: Channel) = {
|
private def dispatchToActiveObject(request: RemoteRequestProtocol, channel: Channel) = {
|
||||||
log.debug("Dispatching to remote active object [%s :: %s]", request.getMethod, request.getTarget)
|
log.debug("Dispatching to remote active object [%s :: %s]", request.getMethod, request.getTarget)
|
||||||
val activeObject = createActiveObject(request.getTarget, request.getTimeout)
|
val activeObject = createActiveObject(request.getTarget, request.getTimeout)
|
||||||
|
|
||||||
|
|
@ -377,7 +381,7 @@ class RemoteServerHandler(
|
||||||
else {
|
else {
|
||||||
val result = messageReceiver.invoke(activeObject, unescapedArgs: _*)
|
val result = messageReceiver.invoke(activeObject, unescapedArgs: _*)
|
||||||
log.debug("Returning result from remote active object invocation [%s]", result)
|
log.debug("Returning result from remote active object invocation [%s]", result)
|
||||||
val replyBuilder = RemoteReply.newBuilder
|
val replyBuilder = RemoteReplyProtocol.newBuilder
|
||||||
.setId(request.getId)
|
.setId(request.getId)
|
||||||
.setIsSuccessful(true)
|
.setIsSuccessful(true)
|
||||||
.setIsActor(false)
|
.setIsActor(false)
|
||||||
|
|
@ -389,7 +393,7 @@ class RemoteServerHandler(
|
||||||
} catch {
|
} catch {
|
||||||
case e: InvocationTargetException =>
|
case e: InvocationTargetException =>
|
||||||
log.error(e.getCause, "Could not invoke remote active object [%s :: %s]", request.getMethod, request.getTarget)
|
log.error(e.getCause, "Could not invoke remote active object [%s :: %s]", request.getMethod, request.getTarget)
|
||||||
val replyBuilder = RemoteReply.newBuilder
|
val replyBuilder = RemoteReplyProtocol.newBuilder
|
||||||
.setId(request.getId)
|
.setId(request.getId)
|
||||||
.setException(e.getCause.getClass.getName + "$" + e.getCause.getMessage)
|
.setException(e.getCause.getClass.getName + "$" + e.getCause.getMessage)
|
||||||
.setIsSuccessful(false)
|
.setIsSuccessful(false)
|
||||||
|
|
@ -399,7 +403,7 @@ class RemoteServerHandler(
|
||||||
channel.write(replyMessage)
|
channel.write(replyMessage)
|
||||||
case e: Throwable =>
|
case e: Throwable =>
|
||||||
log.error(e.getCause, "Could not invoke remote active object [%s :: %s]", request.getMethod, request.getTarget)
|
log.error(e.getCause, "Could not invoke remote active object [%s :: %s]", request.getMethod, request.getTarget)
|
||||||
val replyBuilder = RemoteReply.newBuilder
|
val replyBuilder = RemoteReplyProtocol.newBuilder
|
||||||
.setId(request.getId)
|
.setId(request.getId)
|
||||||
.setException(e.getClass.getName + "$" + e.getMessage)
|
.setException(e.getClass.getName + "$" + e.getMessage)
|
||||||
.setIsSuccessful(false)
|
.setIsSuccessful(false)
|
||||||
|
|
@ -454,8 +458,9 @@ class RemoteServerHandler(
|
||||||
* Does not start the actor.
|
* Does not start the actor.
|
||||||
*/
|
*/
|
||||||
private def createActor(name: String, uuid: String, timeout: Long): ActorRef = {
|
private def createActor(name: String, uuid: String, timeout: Long): ActorRef = {
|
||||||
val actorIdOrNull = actors.get(uuid)
|
val actorRefOrNull = actors.get(uuid)
|
||||||
if (actorIdOrNull eq null) {
|
println("----------- ACTOR " + actorRefOrNull + " " + uuid)
|
||||||
|
if (actorRefOrNull eq null) {
|
||||||
try {
|
try {
|
||||||
log.info("Creating a new remote actor [%s:%s]", name, uuid)
|
log.info("Creating a new remote actor [%s:%s]", name, uuid)
|
||||||
val clazz = if (applicationLoader.isDefined) applicationLoader.get.loadClass(name)
|
val clazz = if (applicationLoader.isDefined) applicationLoader.get.loadClass(name)
|
||||||
|
|
@ -464,14 +469,14 @@ class RemoteServerHandler(
|
||||||
newInstance._uuid = uuid
|
newInstance._uuid = uuid
|
||||||
newInstance.timeout = timeout
|
newInstance.timeout = timeout
|
||||||
newInstance._remoteAddress = None
|
newInstance._remoteAddress = None
|
||||||
val actorId = new ActorRef(() => newInstance)
|
val actorRef = new ActorRef(() => newInstance)
|
||||||
actors.put(uuid, actorId)
|
actors.put(uuid, actorRef)
|
||||||
actorId
|
actorRef
|
||||||
} catch {
|
} catch {
|
||||||
case e =>
|
case e =>
|
||||||
log.error(e, "Could not create remote actor instance")
|
log.error(e, "Could not create remote actor instance")
|
||||||
throw e
|
throw e
|
||||||
}
|
}
|
||||||
} else actorIdOrNull
|
} else actorRefOrNull
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ object FutureSpec {
|
||||||
class FutureSpec extends JUnitSuite {
|
class FutureSpec extends JUnitSuite {
|
||||||
import FutureSpec._
|
import FutureSpec._
|
||||||
|
|
||||||
@Test def shouldActorReplyResultThroughExplicitFuture = {
|
@Test def shouldActorReplyResultThroughExplicitFuture {
|
||||||
val actor = newActor[TestActor]
|
val actor = newActor[TestActor]
|
||||||
actor.start
|
actor.start
|
||||||
val future = actor !!! "Hello"
|
val future = actor !!! "Hello"
|
||||||
|
|
@ -30,7 +30,7 @@ class FutureSpec extends JUnitSuite {
|
||||||
actor.stop
|
actor.stop
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test def shouldActorReplyExceptionThroughExplicitFuture = {
|
@Test def shouldActorReplyExceptionThroughExplicitFuture {
|
||||||
val actor = newActor[TestActor]
|
val actor = newActor[TestActor]
|
||||||
actor.start
|
actor.start
|
||||||
val future = actor !!! "Failure"
|
val future = actor !!! "Failure"
|
||||||
|
|
|
||||||
|
|
@ -1,36 +0,0 @@
|
||||||
package se.scalablesolutions.akka.actor
|
|
||||||
|
|
||||||
import org.scalatest.junit.JUnitSuite
|
|
||||||
import org.junit.Test
|
|
||||||
import Actor._
|
|
||||||
|
|
||||||
class MemoryFootprintSpec extends JUnitSuite {
|
|
||||||
class Mem extends Actor {
|
|
||||||
def receive = {
|
|
||||||
case _ => {}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
val NR_OF_ACTORS = 100000
|
|
||||||
val MAX_MEMORY_FOOTPRINT_PER_ACTOR = 700
|
|
||||||
|
|
||||||
@Test
|
|
||||||
def actorsShouldHaveLessMemoryFootprintThan700Bytes = {
|
|
||||||
println("============== MEMORY FOOTPRINT TEST ==============")
|
|
||||||
// warm up
|
|
||||||
(1 until 10000).foreach(i => new Mem)
|
|
||||||
|
|
||||||
// Actors are put in AspectRegistry when created so they won't be GCd here
|
|
||||||
|
|
||||||
val totalMem = Runtime.getRuntime.totalMemory - Runtime.getRuntime.freeMemory
|
|
||||||
println("Memory before " + totalMem)
|
|
||||||
(1 until NR_OF_ACTORS).foreach(i => new Mem)
|
|
||||||
|
|
||||||
val newTotalMem = Runtime.getRuntime.totalMemory - Runtime.getRuntime.freeMemory
|
|
||||||
println("Memory aftor " + newTotalMem)
|
|
||||||
val memPerActor = (newTotalMem - totalMem) / NR_OF_ACTORS
|
|
||||||
|
|
||||||
println("Memory footprint per actor is : " + memPerActor)
|
|
||||||
assert(memPerActor < MAX_MEMORY_FOOTPRINT_PER_ACTOR) // memory per actor should be less than 630 bytes
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -105,7 +105,7 @@ class ServerInitiatedRemoteActorSpec extends JUnitSuite {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
def shouldSendRemoteReply = {
|
def shouldSendRemoteReplyProtocol = {
|
||||||
implicit val timeout = 500000000L
|
implicit val timeout = 500000000L
|
||||||
val actor = RemoteClient.actorFor(
|
val actor = RemoteClient.actorFor(
|
||||||
"se.scalablesolutions.akka.actor.ServerInitiatedRemoteActorSpec$RemoteActorSpecActorBidirectional",
|
"se.scalablesolutions.akka.actor.ServerInitiatedRemoteActorSpec$RemoteActorSpecActorBidirectional",
|
||||||
|
|
|
||||||
|
|
@ -7,28 +7,28 @@ public final class RemoteProtocol {
|
||||||
public static void registerAllExtensions(
|
public static void registerAllExtensions(
|
||||||
com.google.protobuf.ExtensionRegistry registry) {
|
com.google.protobuf.ExtensionRegistry registry) {
|
||||||
}
|
}
|
||||||
public static final class ActorRef extends
|
public static final class ActorRefProtocol extends
|
||||||
com.google.protobuf.GeneratedMessage {
|
com.google.protobuf.GeneratedMessage {
|
||||||
// Use ActorRef.newBuilder() to construct.
|
// Use ActorRefProtocol.newBuilder() to construct.
|
||||||
private ActorRef() {}
|
private ActorRefProtocol() {}
|
||||||
|
|
||||||
private static final ActorRef defaultInstance = new ActorRef();
|
private static final ActorRefProtocol defaultInstance = new ActorRefProtocol();
|
||||||
public static ActorRef getDefaultInstance() {
|
public static ActorRefProtocol getDefaultInstance() {
|
||||||
return defaultInstance;
|
return defaultInstance;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ActorRef getDefaultInstanceForType() {
|
public ActorRefProtocol getDefaultInstanceForType() {
|
||||||
return defaultInstance;
|
return defaultInstance;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final com.google.protobuf.Descriptors.Descriptor
|
public static final com.google.protobuf.Descriptors.Descriptor
|
||||||
getDescriptor() {
|
getDescriptor() {
|
||||||
return se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.internal_static_se_scalablesolutions_akka_remote_protobuf_ActorRef_descriptor;
|
return se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.internal_static_se_scalablesolutions_akka_remote_protobuf_ActorRefProtocol_descriptor;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
|
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
|
||||||
internalGetFieldAccessorTable() {
|
internalGetFieldAccessorTable() {
|
||||||
return se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.internal_static_se_scalablesolutions_akka_remote_protobuf_ActorRef_fieldAccessorTable;
|
return se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.internal_static_se_scalablesolutions_akka_remote_protobuf_ActorRefProtocol_fieldAccessorTable;
|
||||||
}
|
}
|
||||||
|
|
||||||
// required string uuid = 1;
|
// required string uuid = 1;
|
||||||
|
|
@ -126,57 +126,57 @@ public final class RemoteProtocol {
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRef parseFrom(
|
public static se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRefProtocol parseFrom(
|
||||||
com.google.protobuf.ByteString data)
|
com.google.protobuf.ByteString data)
|
||||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||||
return newBuilder().mergeFrom(data).buildParsed();
|
return newBuilder().mergeFrom(data).buildParsed();
|
||||||
}
|
}
|
||||||
public static se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRef parseFrom(
|
public static se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRefProtocol parseFrom(
|
||||||
com.google.protobuf.ByteString data,
|
com.google.protobuf.ByteString data,
|
||||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||||
return newBuilder().mergeFrom(data, extensionRegistry)
|
return newBuilder().mergeFrom(data, extensionRegistry)
|
||||||
.buildParsed();
|
.buildParsed();
|
||||||
}
|
}
|
||||||
public static se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRef parseFrom(byte[] data)
|
public static se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRefProtocol parseFrom(byte[] data)
|
||||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||||
return newBuilder().mergeFrom(data).buildParsed();
|
return newBuilder().mergeFrom(data).buildParsed();
|
||||||
}
|
}
|
||||||
public static se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRef parseFrom(
|
public static se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRefProtocol parseFrom(
|
||||||
byte[] data,
|
byte[] data,
|
||||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||||
return newBuilder().mergeFrom(data, extensionRegistry)
|
return newBuilder().mergeFrom(data, extensionRegistry)
|
||||||
.buildParsed();
|
.buildParsed();
|
||||||
}
|
}
|
||||||
public static se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRef parseFrom(java.io.InputStream input)
|
public static se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRefProtocol parseFrom(java.io.InputStream input)
|
||||||
throws java.io.IOException {
|
throws java.io.IOException {
|
||||||
return newBuilder().mergeFrom(input).buildParsed();
|
return newBuilder().mergeFrom(input).buildParsed();
|
||||||
}
|
}
|
||||||
public static se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRef parseFrom(
|
public static se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRefProtocol parseFrom(
|
||||||
java.io.InputStream input,
|
java.io.InputStream input,
|
||||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||||
throws java.io.IOException {
|
throws java.io.IOException {
|
||||||
return newBuilder().mergeFrom(input, extensionRegistry)
|
return newBuilder().mergeFrom(input, extensionRegistry)
|
||||||
.buildParsed();
|
.buildParsed();
|
||||||
}
|
}
|
||||||
public static se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRef parseDelimitedFrom(java.io.InputStream input)
|
public static se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRefProtocol parseDelimitedFrom(java.io.InputStream input)
|
||||||
throws java.io.IOException {
|
throws java.io.IOException {
|
||||||
return newBuilder().mergeDelimitedFrom(input).buildParsed();
|
return newBuilder().mergeDelimitedFrom(input).buildParsed();
|
||||||
}
|
}
|
||||||
public static se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRef parseDelimitedFrom(
|
public static se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRefProtocol parseDelimitedFrom(
|
||||||
java.io.InputStream input,
|
java.io.InputStream input,
|
||||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||||
throws java.io.IOException {
|
throws java.io.IOException {
|
||||||
return newBuilder().mergeDelimitedFrom(input, extensionRegistry)
|
return newBuilder().mergeDelimitedFrom(input, extensionRegistry)
|
||||||
.buildParsed();
|
.buildParsed();
|
||||||
}
|
}
|
||||||
public static se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRef parseFrom(
|
public static se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRefProtocol parseFrom(
|
||||||
com.google.protobuf.CodedInputStream input)
|
com.google.protobuf.CodedInputStream input)
|
||||||
throws java.io.IOException {
|
throws java.io.IOException {
|
||||||
return newBuilder().mergeFrom(input).buildParsed();
|
return newBuilder().mergeFrom(input).buildParsed();
|
||||||
}
|
}
|
||||||
public static se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRef parseFrom(
|
public static se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRefProtocol parseFrom(
|
||||||
com.google.protobuf.CodedInputStream input,
|
com.google.protobuf.CodedInputStream input,
|
||||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||||
throws java.io.IOException {
|
throws java.io.IOException {
|
||||||
|
|
@ -186,25 +186,25 @@ public final class RemoteProtocol {
|
||||||
|
|
||||||
public static Builder newBuilder() { return Builder.create(); }
|
public static Builder newBuilder() { return Builder.create(); }
|
||||||
public Builder newBuilderForType() { return newBuilder(); }
|
public Builder newBuilderForType() { return newBuilder(); }
|
||||||
public static Builder newBuilder(se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRef prototype) {
|
public static Builder newBuilder(se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRefProtocol prototype) {
|
||||||
return newBuilder().mergeFrom(prototype);
|
return newBuilder().mergeFrom(prototype);
|
||||||
}
|
}
|
||||||
public Builder toBuilder() { return newBuilder(this); }
|
public Builder toBuilder() { return newBuilder(this); }
|
||||||
|
|
||||||
public static final class Builder extends
|
public static final class Builder extends
|
||||||
com.google.protobuf.GeneratedMessage.Builder<Builder> {
|
com.google.protobuf.GeneratedMessage.Builder<Builder> {
|
||||||
private se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRef result;
|
private se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRefProtocol result;
|
||||||
|
|
||||||
// Construct using se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRef.newBuilder()
|
// Construct using se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRefProtocol.newBuilder()
|
||||||
private Builder() {}
|
private Builder() {}
|
||||||
|
|
||||||
private static Builder create() {
|
private static Builder create() {
|
||||||
Builder builder = new Builder();
|
Builder builder = new Builder();
|
||||||
builder.result = new se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRef();
|
builder.result = new se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRefProtocol();
|
||||||
return builder;
|
return builder;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRef internalGetResult() {
|
protected se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRefProtocol internalGetResult() {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -213,7 +213,7 @@ public final class RemoteProtocol {
|
||||||
throw new IllegalStateException(
|
throw new IllegalStateException(
|
||||||
"Cannot call clear() after build().");
|
"Cannot call clear() after build().");
|
||||||
}
|
}
|
||||||
result = new se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRef();
|
result = new se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRefProtocol();
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -223,24 +223,24 @@ public final class RemoteProtocol {
|
||||||
|
|
||||||
public com.google.protobuf.Descriptors.Descriptor
|
public com.google.protobuf.Descriptors.Descriptor
|
||||||
getDescriptorForType() {
|
getDescriptorForType() {
|
||||||
return se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRef.getDescriptor();
|
return se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRefProtocol.getDescriptor();
|
||||||
}
|
}
|
||||||
|
|
||||||
public se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRef getDefaultInstanceForType() {
|
public se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRefProtocol getDefaultInstanceForType() {
|
||||||
return se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRef.getDefaultInstance();
|
return se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRefProtocol.getDefaultInstance();
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isInitialized() {
|
public boolean isInitialized() {
|
||||||
return result.isInitialized();
|
return result.isInitialized();
|
||||||
}
|
}
|
||||||
public se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRef build() {
|
public se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRefProtocol build() {
|
||||||
if (result != null && !isInitialized()) {
|
if (result != null && !isInitialized()) {
|
||||||
throw newUninitializedMessageException(result);
|
throw newUninitializedMessageException(result);
|
||||||
}
|
}
|
||||||
return buildPartial();
|
return buildPartial();
|
||||||
}
|
}
|
||||||
|
|
||||||
private se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRef buildParsed()
|
private se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRefProtocol buildParsed()
|
||||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||||
if (!isInitialized()) {
|
if (!isInitialized()) {
|
||||||
throw newUninitializedMessageException(
|
throw newUninitializedMessageException(
|
||||||
|
|
@ -249,27 +249,27 @@ public final class RemoteProtocol {
|
||||||
return buildPartial();
|
return buildPartial();
|
||||||
}
|
}
|
||||||
|
|
||||||
public se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRef buildPartial() {
|
public se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRefProtocol buildPartial() {
|
||||||
if (result == null) {
|
if (result == null) {
|
||||||
throw new IllegalStateException(
|
throw new IllegalStateException(
|
||||||
"build() has already been called on this Builder.");
|
"build() has already been called on this Builder.");
|
||||||
}
|
}
|
||||||
se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRef returnMe = result;
|
se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRefProtocol returnMe = result;
|
||||||
result = null;
|
result = null;
|
||||||
return returnMe;
|
return returnMe;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Builder mergeFrom(com.google.protobuf.Message other) {
|
public Builder mergeFrom(com.google.protobuf.Message other) {
|
||||||
if (other instanceof se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRef) {
|
if (other instanceof se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRefProtocol) {
|
||||||
return mergeFrom((se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRef)other);
|
return mergeFrom((se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRefProtocol)other);
|
||||||
} else {
|
} else {
|
||||||
super.mergeFrom(other);
|
super.mergeFrom(other);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Builder mergeFrom(se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRef other) {
|
public Builder mergeFrom(se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRefProtocol other) {
|
||||||
if (other == se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRef.getDefaultInstance()) return this;
|
if (other == se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRefProtocol.getDefaultInstance()) return this;
|
||||||
if (other.hasUuid()) {
|
if (other.hasUuid()) {
|
||||||
setUuid(other.getUuid());
|
setUuid(other.getUuid());
|
||||||
}
|
}
|
||||||
|
|
@ -444,28 +444,28 @@ public final class RemoteProtocol {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final class RemoteRequest extends
|
public static final class RemoteRequestProtocol extends
|
||||||
com.google.protobuf.GeneratedMessage {
|
com.google.protobuf.GeneratedMessage {
|
||||||
// Use RemoteRequest.newBuilder() to construct.
|
// Use RemoteRequestProtocol.newBuilder() to construct.
|
||||||
private RemoteRequest() {}
|
private RemoteRequestProtocol() {}
|
||||||
|
|
||||||
private static final RemoteRequest defaultInstance = new RemoteRequest();
|
private static final RemoteRequestProtocol defaultInstance = new RemoteRequestProtocol();
|
||||||
public static RemoteRequest getDefaultInstance() {
|
public static RemoteRequestProtocol getDefaultInstance() {
|
||||||
return defaultInstance;
|
return defaultInstance;
|
||||||
}
|
}
|
||||||
|
|
||||||
public RemoteRequest getDefaultInstanceForType() {
|
public RemoteRequestProtocol getDefaultInstanceForType() {
|
||||||
return defaultInstance;
|
return defaultInstance;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final com.google.protobuf.Descriptors.Descriptor
|
public static final com.google.protobuf.Descriptors.Descriptor
|
||||||
getDescriptor() {
|
getDescriptor() {
|
||||||
return se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.internal_static_se_scalablesolutions_akka_remote_protobuf_RemoteRequest_descriptor;
|
return se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.internal_static_se_scalablesolutions_akka_remote_protobuf_RemoteRequestProtocol_descriptor;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
|
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
|
||||||
internalGetFieldAccessorTable() {
|
internalGetFieldAccessorTable() {
|
||||||
return se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.internal_static_se_scalablesolutions_akka_remote_protobuf_RemoteRequest_fieldAccessorTable;
|
return se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.internal_static_se_scalablesolutions_akka_remote_protobuf_RemoteRequestProtocol_fieldAccessorTable;
|
||||||
}
|
}
|
||||||
|
|
||||||
// required uint64 id = 1;
|
// required uint64 id = 1;
|
||||||
|
|
@ -552,33 +552,12 @@ public final class RemoteProtocol {
|
||||||
public boolean hasIsEscaped() { return hasIsEscaped; }
|
public boolean hasIsEscaped() { return hasIsEscaped; }
|
||||||
public boolean getIsEscaped() { return isEscaped_; }
|
public boolean getIsEscaped() { return isEscaped_; }
|
||||||
|
|
||||||
// optional string sourceHostname = 13;
|
// optional .se.scalablesolutions.akka.remote.protobuf.ActorRefProtocol sender = 13;
|
||||||
public static final int SOURCEHOSTNAME_FIELD_NUMBER = 13;
|
public static final int SENDER_FIELD_NUMBER = 13;
|
||||||
private boolean hasSourceHostname;
|
private boolean hasSender;
|
||||||
private java.lang.String sourceHostname_ = "";
|
private se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRefProtocol sender_ = se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRefProtocol.getDefaultInstance();
|
||||||
public boolean hasSourceHostname() { return hasSourceHostname; }
|
public boolean hasSender() { return hasSender; }
|
||||||
public java.lang.String getSourceHostname() { return sourceHostname_; }
|
public se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRefProtocol getSender() { return sender_; }
|
||||||
|
|
||||||
// optional uint32 sourcePort = 14;
|
|
||||||
public static final int SOURCEPORT_FIELD_NUMBER = 14;
|
|
||||||
private boolean hasSourcePort;
|
|
||||||
private int sourcePort_ = 0;
|
|
||||||
public boolean hasSourcePort() { return hasSourcePort; }
|
|
||||||
public int getSourcePort() { return sourcePort_; }
|
|
||||||
|
|
||||||
// optional string sourceTarget = 15;
|
|
||||||
public static final int SOURCETARGET_FIELD_NUMBER = 15;
|
|
||||||
private boolean hasSourceTarget;
|
|
||||||
private java.lang.String sourceTarget_ = "";
|
|
||||||
public boolean hasSourceTarget() { return hasSourceTarget; }
|
|
||||||
public java.lang.String getSourceTarget() { return sourceTarget_; }
|
|
||||||
|
|
||||||
// optional string sourceUuid = 16;
|
|
||||||
public static final int SOURCEUUID_FIELD_NUMBER = 16;
|
|
||||||
private boolean hasSourceUuid;
|
|
||||||
private java.lang.String sourceUuid_ = "";
|
|
||||||
public boolean hasSourceUuid() { return hasSourceUuid; }
|
|
||||||
public java.lang.String getSourceUuid() { return sourceUuid_; }
|
|
||||||
|
|
||||||
public final boolean isInitialized() {
|
public final boolean isInitialized() {
|
||||||
if (!hasId) return false;
|
if (!hasId) return false;
|
||||||
|
|
@ -590,6 +569,9 @@ public final class RemoteProtocol {
|
||||||
if (!hasIsActor) return false;
|
if (!hasIsActor) return false;
|
||||||
if (!hasIsOneWay) return false;
|
if (!hasIsOneWay) return false;
|
||||||
if (!hasIsEscaped) return false;
|
if (!hasIsEscaped) return false;
|
||||||
|
if (hasSender()) {
|
||||||
|
if (!getSender().isInitialized()) return false;
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -631,17 +613,8 @@ public final class RemoteProtocol {
|
||||||
if (hasIsEscaped()) {
|
if (hasIsEscaped()) {
|
||||||
output.writeBool(12, getIsEscaped());
|
output.writeBool(12, getIsEscaped());
|
||||||
}
|
}
|
||||||
if (hasSourceHostname()) {
|
if (hasSender()) {
|
||||||
output.writeString(13, getSourceHostname());
|
output.writeMessage(13, getSender());
|
||||||
}
|
|
||||||
if (hasSourcePort()) {
|
|
||||||
output.writeUInt32(14, getSourcePort());
|
|
||||||
}
|
|
||||||
if (hasSourceTarget()) {
|
|
||||||
output.writeString(15, getSourceTarget());
|
|
||||||
}
|
|
||||||
if (hasSourceUuid()) {
|
|
||||||
output.writeString(16, getSourceUuid());
|
|
||||||
}
|
}
|
||||||
getUnknownFields().writeTo(output);
|
getUnknownFields().writeTo(output);
|
||||||
}
|
}
|
||||||
|
|
@ -700,78 +673,66 @@ public final class RemoteProtocol {
|
||||||
size += com.google.protobuf.CodedOutputStream
|
size += com.google.protobuf.CodedOutputStream
|
||||||
.computeBoolSize(12, getIsEscaped());
|
.computeBoolSize(12, getIsEscaped());
|
||||||
}
|
}
|
||||||
if (hasSourceHostname()) {
|
if (hasSender()) {
|
||||||
size += com.google.protobuf.CodedOutputStream
|
size += com.google.protobuf.CodedOutputStream
|
||||||
.computeStringSize(13, getSourceHostname());
|
.computeMessageSize(13, getSender());
|
||||||
}
|
|
||||||
if (hasSourcePort()) {
|
|
||||||
size += com.google.protobuf.CodedOutputStream
|
|
||||||
.computeUInt32Size(14, getSourcePort());
|
|
||||||
}
|
|
||||||
if (hasSourceTarget()) {
|
|
||||||
size += com.google.protobuf.CodedOutputStream
|
|
||||||
.computeStringSize(15, getSourceTarget());
|
|
||||||
}
|
|
||||||
if (hasSourceUuid()) {
|
|
||||||
size += com.google.protobuf.CodedOutputStream
|
|
||||||
.computeStringSize(16, getSourceUuid());
|
|
||||||
}
|
}
|
||||||
size += getUnknownFields().getSerializedSize();
|
size += getUnknownFields().getSerializedSize();
|
||||||
memoizedSerializedSize = size;
|
memoizedSerializedSize = size;
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteRequest parseFrom(
|
public static se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteRequestProtocol parseFrom(
|
||||||
com.google.protobuf.ByteString data)
|
com.google.protobuf.ByteString data)
|
||||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||||
return newBuilder().mergeFrom(data).buildParsed();
|
return newBuilder().mergeFrom(data).buildParsed();
|
||||||
}
|
}
|
||||||
public static se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteRequest parseFrom(
|
public static se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteRequestProtocol parseFrom(
|
||||||
com.google.protobuf.ByteString data,
|
com.google.protobuf.ByteString data,
|
||||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||||
return newBuilder().mergeFrom(data, extensionRegistry)
|
return newBuilder().mergeFrom(data, extensionRegistry)
|
||||||
.buildParsed();
|
.buildParsed();
|
||||||
}
|
}
|
||||||
public static se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteRequest parseFrom(byte[] data)
|
public static se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteRequestProtocol parseFrom(byte[] data)
|
||||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||||
return newBuilder().mergeFrom(data).buildParsed();
|
return newBuilder().mergeFrom(data).buildParsed();
|
||||||
}
|
}
|
||||||
public static se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteRequest parseFrom(
|
public static se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteRequestProtocol parseFrom(
|
||||||
byte[] data,
|
byte[] data,
|
||||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||||
return newBuilder().mergeFrom(data, extensionRegistry)
|
return newBuilder().mergeFrom(data, extensionRegistry)
|
||||||
.buildParsed();
|
.buildParsed();
|
||||||
}
|
}
|
||||||
public static se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteRequest parseFrom(java.io.InputStream input)
|
public static se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteRequestProtocol parseFrom(java.io.InputStream input)
|
||||||
throws java.io.IOException {
|
throws java.io.IOException {
|
||||||
return newBuilder().mergeFrom(input).buildParsed();
|
return newBuilder().mergeFrom(input).buildParsed();
|
||||||
}
|
}
|
||||||
public static se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteRequest parseFrom(
|
public static se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteRequestProtocol parseFrom(
|
||||||
java.io.InputStream input,
|
java.io.InputStream input,
|
||||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||||
throws java.io.IOException {
|
throws java.io.IOException {
|
||||||
return newBuilder().mergeFrom(input, extensionRegistry)
|
return newBuilder().mergeFrom(input, extensionRegistry)
|
||||||
.buildParsed();
|
.buildParsed();
|
||||||
}
|
}
|
||||||
public static se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteRequest parseDelimitedFrom(java.io.InputStream input)
|
public static se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteRequestProtocol parseDelimitedFrom(java.io.InputStream input)
|
||||||
throws java.io.IOException {
|
throws java.io.IOException {
|
||||||
return newBuilder().mergeDelimitedFrom(input).buildParsed();
|
return newBuilder().mergeDelimitedFrom(input).buildParsed();
|
||||||
}
|
}
|
||||||
public static se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteRequest parseDelimitedFrom(
|
public static se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteRequestProtocol parseDelimitedFrom(
|
||||||
java.io.InputStream input,
|
java.io.InputStream input,
|
||||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||||
throws java.io.IOException {
|
throws java.io.IOException {
|
||||||
return newBuilder().mergeDelimitedFrom(input, extensionRegistry)
|
return newBuilder().mergeDelimitedFrom(input, extensionRegistry)
|
||||||
.buildParsed();
|
.buildParsed();
|
||||||
}
|
}
|
||||||
public static se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteRequest parseFrom(
|
public static se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteRequestProtocol parseFrom(
|
||||||
com.google.protobuf.CodedInputStream input)
|
com.google.protobuf.CodedInputStream input)
|
||||||
throws java.io.IOException {
|
throws java.io.IOException {
|
||||||
return newBuilder().mergeFrom(input).buildParsed();
|
return newBuilder().mergeFrom(input).buildParsed();
|
||||||
}
|
}
|
||||||
public static se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteRequest parseFrom(
|
public static se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteRequestProtocol parseFrom(
|
||||||
com.google.protobuf.CodedInputStream input,
|
com.google.protobuf.CodedInputStream input,
|
||||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||||
throws java.io.IOException {
|
throws java.io.IOException {
|
||||||
|
|
@ -781,25 +742,25 @@ public final class RemoteProtocol {
|
||||||
|
|
||||||
public static Builder newBuilder() { return Builder.create(); }
|
public static Builder newBuilder() { return Builder.create(); }
|
||||||
public Builder newBuilderForType() { return newBuilder(); }
|
public Builder newBuilderForType() { return newBuilder(); }
|
||||||
public static Builder newBuilder(se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteRequest prototype) {
|
public static Builder newBuilder(se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteRequestProtocol prototype) {
|
||||||
return newBuilder().mergeFrom(prototype);
|
return newBuilder().mergeFrom(prototype);
|
||||||
}
|
}
|
||||||
public Builder toBuilder() { return newBuilder(this); }
|
public Builder toBuilder() { return newBuilder(this); }
|
||||||
|
|
||||||
public static final class Builder extends
|
public static final class Builder extends
|
||||||
com.google.protobuf.GeneratedMessage.Builder<Builder> {
|
com.google.protobuf.GeneratedMessage.Builder<Builder> {
|
||||||
private se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteRequest result;
|
private se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteRequestProtocol result;
|
||||||
|
|
||||||
// Construct using se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteRequest.newBuilder()
|
// Construct using se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteRequestProtocol.newBuilder()
|
||||||
private Builder() {}
|
private Builder() {}
|
||||||
|
|
||||||
private static Builder create() {
|
private static Builder create() {
|
||||||
Builder builder = new Builder();
|
Builder builder = new Builder();
|
||||||
builder.result = new se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteRequest();
|
builder.result = new se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteRequestProtocol();
|
||||||
return builder;
|
return builder;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteRequest internalGetResult() {
|
protected se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteRequestProtocol internalGetResult() {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -808,7 +769,7 @@ public final class RemoteProtocol {
|
||||||
throw new IllegalStateException(
|
throw new IllegalStateException(
|
||||||
"Cannot call clear() after build().");
|
"Cannot call clear() after build().");
|
||||||
}
|
}
|
||||||
result = new se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteRequest();
|
result = new se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteRequestProtocol();
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -818,24 +779,24 @@ public final class RemoteProtocol {
|
||||||
|
|
||||||
public com.google.protobuf.Descriptors.Descriptor
|
public com.google.protobuf.Descriptors.Descriptor
|
||||||
getDescriptorForType() {
|
getDescriptorForType() {
|
||||||
return se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteRequest.getDescriptor();
|
return se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteRequestProtocol.getDescriptor();
|
||||||
}
|
}
|
||||||
|
|
||||||
public se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteRequest getDefaultInstanceForType() {
|
public se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteRequestProtocol getDefaultInstanceForType() {
|
||||||
return se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteRequest.getDefaultInstance();
|
return se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteRequestProtocol.getDefaultInstance();
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isInitialized() {
|
public boolean isInitialized() {
|
||||||
return result.isInitialized();
|
return result.isInitialized();
|
||||||
}
|
}
|
||||||
public se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteRequest build() {
|
public se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteRequestProtocol build() {
|
||||||
if (result != null && !isInitialized()) {
|
if (result != null && !isInitialized()) {
|
||||||
throw newUninitializedMessageException(result);
|
throw newUninitializedMessageException(result);
|
||||||
}
|
}
|
||||||
return buildPartial();
|
return buildPartial();
|
||||||
}
|
}
|
||||||
|
|
||||||
private se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteRequest buildParsed()
|
private se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteRequestProtocol buildParsed()
|
||||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||||
if (!isInitialized()) {
|
if (!isInitialized()) {
|
||||||
throw newUninitializedMessageException(
|
throw newUninitializedMessageException(
|
||||||
|
|
@ -844,27 +805,27 @@ public final class RemoteProtocol {
|
||||||
return buildPartial();
|
return buildPartial();
|
||||||
}
|
}
|
||||||
|
|
||||||
public se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteRequest buildPartial() {
|
public se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteRequestProtocol buildPartial() {
|
||||||
if (result == null) {
|
if (result == null) {
|
||||||
throw new IllegalStateException(
|
throw new IllegalStateException(
|
||||||
"build() has already been called on this Builder.");
|
"build() has already been called on this Builder.");
|
||||||
}
|
}
|
||||||
se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteRequest returnMe = result;
|
se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteRequestProtocol returnMe = result;
|
||||||
result = null;
|
result = null;
|
||||||
return returnMe;
|
return returnMe;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Builder mergeFrom(com.google.protobuf.Message other) {
|
public Builder mergeFrom(com.google.protobuf.Message other) {
|
||||||
if (other instanceof se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteRequest) {
|
if (other instanceof se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteRequestProtocol) {
|
||||||
return mergeFrom((se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteRequest)other);
|
return mergeFrom((se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteRequestProtocol)other);
|
||||||
} else {
|
} else {
|
||||||
super.mergeFrom(other);
|
super.mergeFrom(other);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Builder mergeFrom(se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteRequest other) {
|
public Builder mergeFrom(se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteRequestProtocol other) {
|
||||||
if (other == se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteRequest.getDefaultInstance()) return this;
|
if (other == se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteRequestProtocol.getDefaultInstance()) return this;
|
||||||
if (other.hasId()) {
|
if (other.hasId()) {
|
||||||
setId(other.getId());
|
setId(other.getId());
|
||||||
}
|
}
|
||||||
|
|
@ -901,17 +862,8 @@ public final class RemoteProtocol {
|
||||||
if (other.hasIsEscaped()) {
|
if (other.hasIsEscaped()) {
|
||||||
setIsEscaped(other.getIsEscaped());
|
setIsEscaped(other.getIsEscaped());
|
||||||
}
|
}
|
||||||
if (other.hasSourceHostname()) {
|
if (other.hasSender()) {
|
||||||
setSourceHostname(other.getSourceHostname());
|
mergeSender(other.getSender());
|
||||||
}
|
|
||||||
if (other.hasSourcePort()) {
|
|
||||||
setSourcePort(other.getSourcePort());
|
|
||||||
}
|
|
||||||
if (other.hasSourceTarget()) {
|
|
||||||
setSourceTarget(other.getSourceTarget());
|
|
||||||
}
|
|
||||||
if (other.hasSourceUuid()) {
|
|
||||||
setSourceUuid(other.getSourceUuid());
|
|
||||||
}
|
}
|
||||||
this.mergeUnknownFields(other.getUnknownFields());
|
this.mergeUnknownFields(other.getUnknownFields());
|
||||||
return this;
|
return this;
|
||||||
|
|
@ -987,19 +939,12 @@ public final class RemoteProtocol {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 106: {
|
case 106: {
|
||||||
setSourceHostname(input.readString());
|
se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRefProtocol.Builder subBuilder = se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRefProtocol.newBuilder();
|
||||||
break;
|
if (hasSender()) {
|
||||||
}
|
subBuilder.mergeFrom(getSender());
|
||||||
case 112: {
|
}
|
||||||
setSourcePort(input.readUInt32());
|
input.readMessage(subBuilder, extensionRegistry);
|
||||||
break;
|
setSender(subBuilder.buildPartial());
|
||||||
}
|
|
||||||
case 122: {
|
|
||||||
setSourceTarget(input.readString());
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 130: {
|
|
||||||
setSourceUuid(input.readString());
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1241,84 +1186,40 @@ public final class RemoteProtocol {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
// optional string sourceHostname = 13;
|
// optional .se.scalablesolutions.akka.remote.protobuf.ActorRefProtocol sender = 13;
|
||||||
public boolean hasSourceHostname() {
|
public boolean hasSender() {
|
||||||
return result.hasSourceHostname();
|
return result.hasSender();
|
||||||
}
|
}
|
||||||
public java.lang.String getSourceHostname() {
|
public se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRefProtocol getSender() {
|
||||||
return result.getSourceHostname();
|
return result.getSender();
|
||||||
}
|
}
|
||||||
public Builder setSourceHostname(java.lang.String value) {
|
public Builder setSender(se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRefProtocol value) {
|
||||||
if (value == null) {
|
if (value == null) {
|
||||||
throw new NullPointerException();
|
throw new NullPointerException();
|
||||||
}
|
}
|
||||||
result.hasSourceHostname = true;
|
result.hasSender = true;
|
||||||
result.sourceHostname_ = value;
|
result.sender_ = value;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
public Builder clearSourceHostname() {
|
public Builder setSender(se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRefProtocol.Builder builderForValue) {
|
||||||
result.hasSourceHostname = false;
|
result.hasSender = true;
|
||||||
result.sourceHostname_ = getDefaultInstance().getSourceHostname();
|
result.sender_ = builderForValue.build();
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
public Builder mergeSender(se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRefProtocol value) {
|
||||||
// optional uint32 sourcePort = 14;
|
if (result.hasSender() &&
|
||||||
public boolean hasSourcePort() {
|
result.sender_ != se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRefProtocol.getDefaultInstance()) {
|
||||||
return result.hasSourcePort();
|
result.sender_ =
|
||||||
}
|
se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRefProtocol.newBuilder(result.sender_).mergeFrom(value).buildPartial();
|
||||||
public int getSourcePort() {
|
} else {
|
||||||
return result.getSourcePort();
|
result.sender_ = value;
|
||||||
}
|
}
|
||||||
public Builder setSourcePort(int value) {
|
result.hasSender = true;
|
||||||
result.hasSourcePort = true;
|
|
||||||
result.sourcePort_ = value;
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
public Builder clearSourcePort() {
|
public Builder clearSender() {
|
||||||
result.hasSourcePort = false;
|
result.hasSender = false;
|
||||||
result.sourcePort_ = 0;
|
result.sender_ = se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRefProtocol.getDefaultInstance();
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
// optional string sourceTarget = 15;
|
|
||||||
public boolean hasSourceTarget() {
|
|
||||||
return result.hasSourceTarget();
|
|
||||||
}
|
|
||||||
public java.lang.String getSourceTarget() {
|
|
||||||
return result.getSourceTarget();
|
|
||||||
}
|
|
||||||
public Builder setSourceTarget(java.lang.String value) {
|
|
||||||
if (value == null) {
|
|
||||||
throw new NullPointerException();
|
|
||||||
}
|
|
||||||
result.hasSourceTarget = true;
|
|
||||||
result.sourceTarget_ = value;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public Builder clearSourceTarget() {
|
|
||||||
result.hasSourceTarget = false;
|
|
||||||
result.sourceTarget_ = getDefaultInstance().getSourceTarget();
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
// optional string sourceUuid = 16;
|
|
||||||
public boolean hasSourceUuid() {
|
|
||||||
return result.hasSourceUuid();
|
|
||||||
}
|
|
||||||
public java.lang.String getSourceUuid() {
|
|
||||||
return result.getSourceUuid();
|
|
||||||
}
|
|
||||||
public Builder setSourceUuid(java.lang.String value) {
|
|
||||||
if (value == null) {
|
|
||||||
throw new NullPointerException();
|
|
||||||
}
|
|
||||||
result.hasSourceUuid = true;
|
|
||||||
result.sourceUuid_ = value;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public Builder clearSourceUuid() {
|
|
||||||
result.hasSourceUuid = false;
|
|
||||||
result.sourceUuid_ = getDefaultInstance().getSourceUuid();
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1332,28 +1233,28 @@ public final class RemoteProtocol {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final class RemoteReply extends
|
public static final class RemoteReplyProtocol extends
|
||||||
com.google.protobuf.GeneratedMessage {
|
com.google.protobuf.GeneratedMessage {
|
||||||
// Use RemoteReply.newBuilder() to construct.
|
// Use RemoteReplyProtocol.newBuilder() to construct.
|
||||||
private RemoteReply() {}
|
private RemoteReplyProtocol() {}
|
||||||
|
|
||||||
private static final RemoteReply defaultInstance = new RemoteReply();
|
private static final RemoteReplyProtocol defaultInstance = new RemoteReplyProtocol();
|
||||||
public static RemoteReply getDefaultInstance() {
|
public static RemoteReplyProtocol getDefaultInstance() {
|
||||||
return defaultInstance;
|
return defaultInstance;
|
||||||
}
|
}
|
||||||
|
|
||||||
public RemoteReply getDefaultInstanceForType() {
|
public RemoteReplyProtocol getDefaultInstanceForType() {
|
||||||
return defaultInstance;
|
return defaultInstance;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final com.google.protobuf.Descriptors.Descriptor
|
public static final com.google.protobuf.Descriptors.Descriptor
|
||||||
getDescriptor() {
|
getDescriptor() {
|
||||||
return se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.internal_static_se_scalablesolutions_akka_remote_protobuf_RemoteReply_descriptor;
|
return se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.internal_static_se_scalablesolutions_akka_remote_protobuf_RemoteReplyProtocol_descriptor;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
|
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
|
||||||
internalGetFieldAccessorTable() {
|
internalGetFieldAccessorTable() {
|
||||||
return se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.internal_static_se_scalablesolutions_akka_remote_protobuf_RemoteReply_fieldAccessorTable;
|
return se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.internal_static_se_scalablesolutions_akka_remote_protobuf_RemoteReplyProtocol_fieldAccessorTable;
|
||||||
}
|
}
|
||||||
|
|
||||||
// required uint64 id = 1;
|
// required uint64 id = 1;
|
||||||
|
|
@ -1491,57 +1392,57 @@ public final class RemoteProtocol {
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteReply parseFrom(
|
public static se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteReplyProtocol parseFrom(
|
||||||
com.google.protobuf.ByteString data)
|
com.google.protobuf.ByteString data)
|
||||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||||
return newBuilder().mergeFrom(data).buildParsed();
|
return newBuilder().mergeFrom(data).buildParsed();
|
||||||
}
|
}
|
||||||
public static se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteReply parseFrom(
|
public static se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteReplyProtocol parseFrom(
|
||||||
com.google.protobuf.ByteString data,
|
com.google.protobuf.ByteString data,
|
||||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||||
return newBuilder().mergeFrom(data, extensionRegistry)
|
return newBuilder().mergeFrom(data, extensionRegistry)
|
||||||
.buildParsed();
|
.buildParsed();
|
||||||
}
|
}
|
||||||
public static se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteReply parseFrom(byte[] data)
|
public static se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteReplyProtocol parseFrom(byte[] data)
|
||||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||||
return newBuilder().mergeFrom(data).buildParsed();
|
return newBuilder().mergeFrom(data).buildParsed();
|
||||||
}
|
}
|
||||||
public static se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteReply parseFrom(
|
public static se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteReplyProtocol parseFrom(
|
||||||
byte[] data,
|
byte[] data,
|
||||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||||
return newBuilder().mergeFrom(data, extensionRegistry)
|
return newBuilder().mergeFrom(data, extensionRegistry)
|
||||||
.buildParsed();
|
.buildParsed();
|
||||||
}
|
}
|
||||||
public static se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteReply parseFrom(java.io.InputStream input)
|
public static se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteReplyProtocol parseFrom(java.io.InputStream input)
|
||||||
throws java.io.IOException {
|
throws java.io.IOException {
|
||||||
return newBuilder().mergeFrom(input).buildParsed();
|
return newBuilder().mergeFrom(input).buildParsed();
|
||||||
}
|
}
|
||||||
public static se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteReply parseFrom(
|
public static se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteReplyProtocol parseFrom(
|
||||||
java.io.InputStream input,
|
java.io.InputStream input,
|
||||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||||
throws java.io.IOException {
|
throws java.io.IOException {
|
||||||
return newBuilder().mergeFrom(input, extensionRegistry)
|
return newBuilder().mergeFrom(input, extensionRegistry)
|
||||||
.buildParsed();
|
.buildParsed();
|
||||||
}
|
}
|
||||||
public static se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteReply parseDelimitedFrom(java.io.InputStream input)
|
public static se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteReplyProtocol parseDelimitedFrom(java.io.InputStream input)
|
||||||
throws java.io.IOException {
|
throws java.io.IOException {
|
||||||
return newBuilder().mergeDelimitedFrom(input).buildParsed();
|
return newBuilder().mergeDelimitedFrom(input).buildParsed();
|
||||||
}
|
}
|
||||||
public static se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteReply parseDelimitedFrom(
|
public static se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteReplyProtocol parseDelimitedFrom(
|
||||||
java.io.InputStream input,
|
java.io.InputStream input,
|
||||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||||
throws java.io.IOException {
|
throws java.io.IOException {
|
||||||
return newBuilder().mergeDelimitedFrom(input, extensionRegistry)
|
return newBuilder().mergeDelimitedFrom(input, extensionRegistry)
|
||||||
.buildParsed();
|
.buildParsed();
|
||||||
}
|
}
|
||||||
public static se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteReply parseFrom(
|
public static se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteReplyProtocol parseFrom(
|
||||||
com.google.protobuf.CodedInputStream input)
|
com.google.protobuf.CodedInputStream input)
|
||||||
throws java.io.IOException {
|
throws java.io.IOException {
|
||||||
return newBuilder().mergeFrom(input).buildParsed();
|
return newBuilder().mergeFrom(input).buildParsed();
|
||||||
}
|
}
|
||||||
public static se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteReply parseFrom(
|
public static se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteReplyProtocol parseFrom(
|
||||||
com.google.protobuf.CodedInputStream input,
|
com.google.protobuf.CodedInputStream input,
|
||||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||||
throws java.io.IOException {
|
throws java.io.IOException {
|
||||||
|
|
@ -1551,25 +1452,25 @@ public final class RemoteProtocol {
|
||||||
|
|
||||||
public static Builder newBuilder() { return Builder.create(); }
|
public static Builder newBuilder() { return Builder.create(); }
|
||||||
public Builder newBuilderForType() { return newBuilder(); }
|
public Builder newBuilderForType() { return newBuilder(); }
|
||||||
public static Builder newBuilder(se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteReply prototype) {
|
public static Builder newBuilder(se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteReplyProtocol prototype) {
|
||||||
return newBuilder().mergeFrom(prototype);
|
return newBuilder().mergeFrom(prototype);
|
||||||
}
|
}
|
||||||
public Builder toBuilder() { return newBuilder(this); }
|
public Builder toBuilder() { return newBuilder(this); }
|
||||||
|
|
||||||
public static final class Builder extends
|
public static final class Builder extends
|
||||||
com.google.protobuf.GeneratedMessage.Builder<Builder> {
|
com.google.protobuf.GeneratedMessage.Builder<Builder> {
|
||||||
private se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteReply result;
|
private se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteReplyProtocol result;
|
||||||
|
|
||||||
// Construct using se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteReply.newBuilder()
|
// Construct using se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteReplyProtocol.newBuilder()
|
||||||
private Builder() {}
|
private Builder() {}
|
||||||
|
|
||||||
private static Builder create() {
|
private static Builder create() {
|
||||||
Builder builder = new Builder();
|
Builder builder = new Builder();
|
||||||
builder.result = new se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteReply();
|
builder.result = new se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteReplyProtocol();
|
||||||
return builder;
|
return builder;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteReply internalGetResult() {
|
protected se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteReplyProtocol internalGetResult() {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1578,7 +1479,7 @@ public final class RemoteProtocol {
|
||||||
throw new IllegalStateException(
|
throw new IllegalStateException(
|
||||||
"Cannot call clear() after build().");
|
"Cannot call clear() after build().");
|
||||||
}
|
}
|
||||||
result = new se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteReply();
|
result = new se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteReplyProtocol();
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1588,24 +1489,24 @@ public final class RemoteProtocol {
|
||||||
|
|
||||||
public com.google.protobuf.Descriptors.Descriptor
|
public com.google.protobuf.Descriptors.Descriptor
|
||||||
getDescriptorForType() {
|
getDescriptorForType() {
|
||||||
return se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteReply.getDescriptor();
|
return se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteReplyProtocol.getDescriptor();
|
||||||
}
|
}
|
||||||
|
|
||||||
public se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteReply getDefaultInstanceForType() {
|
public se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteReplyProtocol getDefaultInstanceForType() {
|
||||||
return se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteReply.getDefaultInstance();
|
return se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteReplyProtocol.getDefaultInstance();
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isInitialized() {
|
public boolean isInitialized() {
|
||||||
return result.isInitialized();
|
return result.isInitialized();
|
||||||
}
|
}
|
||||||
public se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteReply build() {
|
public se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteReplyProtocol build() {
|
||||||
if (result != null && !isInitialized()) {
|
if (result != null && !isInitialized()) {
|
||||||
throw newUninitializedMessageException(result);
|
throw newUninitializedMessageException(result);
|
||||||
}
|
}
|
||||||
return buildPartial();
|
return buildPartial();
|
||||||
}
|
}
|
||||||
|
|
||||||
private se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteReply buildParsed()
|
private se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteReplyProtocol buildParsed()
|
||||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||||
if (!isInitialized()) {
|
if (!isInitialized()) {
|
||||||
throw newUninitializedMessageException(
|
throw newUninitializedMessageException(
|
||||||
|
|
@ -1614,27 +1515,27 @@ public final class RemoteProtocol {
|
||||||
return buildPartial();
|
return buildPartial();
|
||||||
}
|
}
|
||||||
|
|
||||||
public se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteReply buildPartial() {
|
public se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteReplyProtocol buildPartial() {
|
||||||
if (result == null) {
|
if (result == null) {
|
||||||
throw new IllegalStateException(
|
throw new IllegalStateException(
|
||||||
"build() has already been called on this Builder.");
|
"build() has already been called on this Builder.");
|
||||||
}
|
}
|
||||||
se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteReply returnMe = result;
|
se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteReplyProtocol returnMe = result;
|
||||||
result = null;
|
result = null;
|
||||||
return returnMe;
|
return returnMe;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Builder mergeFrom(com.google.protobuf.Message other) {
|
public Builder mergeFrom(com.google.protobuf.Message other) {
|
||||||
if (other instanceof se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteReply) {
|
if (other instanceof se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteReplyProtocol) {
|
||||||
return mergeFrom((se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteReply)other);
|
return mergeFrom((se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteReplyProtocol)other);
|
||||||
} else {
|
} else {
|
||||||
super.mergeFrom(other);
|
super.mergeFrom(other);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Builder mergeFrom(se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteReply other) {
|
public Builder mergeFrom(se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteReplyProtocol other) {
|
||||||
if (other == se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteReply.getDefaultInstance()) return this;
|
if (other == se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteReplyProtocol.getDefaultInstance()) return this;
|
||||||
if (other.hasId()) {
|
if (other.hasId()) {
|
||||||
setId(other.getId());
|
setId(other.getId());
|
||||||
}
|
}
|
||||||
|
|
@ -1888,20 +1789,20 @@ public final class RemoteProtocol {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static com.google.protobuf.Descriptors.Descriptor
|
private static com.google.protobuf.Descriptors.Descriptor
|
||||||
internal_static_se_scalablesolutions_akka_remote_protobuf_ActorRef_descriptor;
|
internal_static_se_scalablesolutions_akka_remote_protobuf_ActorRefProtocol_descriptor;
|
||||||
private static
|
private static
|
||||||
com.google.protobuf.GeneratedMessage.FieldAccessorTable
|
com.google.protobuf.GeneratedMessage.FieldAccessorTable
|
||||||
internal_static_se_scalablesolutions_akka_remote_protobuf_ActorRef_fieldAccessorTable;
|
internal_static_se_scalablesolutions_akka_remote_protobuf_ActorRefProtocol_fieldAccessorTable;
|
||||||
private static com.google.protobuf.Descriptors.Descriptor
|
private static com.google.protobuf.Descriptors.Descriptor
|
||||||
internal_static_se_scalablesolutions_akka_remote_protobuf_RemoteRequest_descriptor;
|
internal_static_se_scalablesolutions_akka_remote_protobuf_RemoteRequestProtocol_descriptor;
|
||||||
private static
|
private static
|
||||||
com.google.protobuf.GeneratedMessage.FieldAccessorTable
|
com.google.protobuf.GeneratedMessage.FieldAccessorTable
|
||||||
internal_static_se_scalablesolutions_akka_remote_protobuf_RemoteRequest_fieldAccessorTable;
|
internal_static_se_scalablesolutions_akka_remote_protobuf_RemoteRequestProtocol_fieldAccessorTable;
|
||||||
private static com.google.protobuf.Descriptors.Descriptor
|
private static com.google.protobuf.Descriptors.Descriptor
|
||||||
internal_static_se_scalablesolutions_akka_remote_protobuf_RemoteReply_descriptor;
|
internal_static_se_scalablesolutions_akka_remote_protobuf_RemoteReplyProtocol_descriptor;
|
||||||
private static
|
private static
|
||||||
com.google.protobuf.GeneratedMessage.FieldAccessorTable
|
com.google.protobuf.GeneratedMessage.FieldAccessorTable
|
||||||
internal_static_se_scalablesolutions_akka_remote_protobuf_RemoteReply_fieldAccessorTable;
|
internal_static_se_scalablesolutions_akka_remote_protobuf_RemoteReplyProtocol_fieldAccessorTable;
|
||||||
|
|
||||||
public static com.google.protobuf.Descriptors.FileDescriptor
|
public static com.google.protobuf.Descriptors.FileDescriptor
|
||||||
getDescriptor() {
|
getDescriptor() {
|
||||||
|
|
@ -1913,52 +1814,52 @@ public final class RemoteProtocol {
|
||||||
java.lang.String[] descriptorData = {
|
java.lang.String[] descriptorData = {
|
||||||
"\n>se/scalablesolutions/akka/remote/proto" +
|
"\n>se/scalablesolutions/akka/remote/proto" +
|
||||||
"buf/RemoteProtocol.proto\022)se.scalablesol" +
|
"buf/RemoteProtocol.proto\022)se.scalablesol" +
|
||||||
"utions.akka.remote.protobuf\"m\n\010ActorRef\022" +
|
"utions.akka.remote.protobuf\"u\n\020ActorRefP" +
|
||||||
"\014\n\004uuid\030\001 \002(\t\022\026\n\016actorClassName\030\002 \002(\t\022\026\n" +
|
"rotocol\022\014\n\004uuid\030\001 \002(\t\022\026\n\016actorClassName\030" +
|
||||||
"\016sourceHostname\030\003 \002(\t\022\022\n\nsourcePort\030\004 \002(" +
|
"\002 \002(\t\022\026\n\016sourceHostname\030\003 \002(\t\022\022\n\nsourceP" +
|
||||||
"\r\022\017\n\007timeout\030\005 \002(\004\"\272\002\n\rRemoteRequest\022\n\n\002" +
|
"ort\030\004 \002(\r\022\017\n\007timeout\030\005 \002(\004\"\271\002\n\025RemoteReq" +
|
||||||
"id\030\001 \002(\004\022\020\n\010protocol\030\002 \002(\r\022\017\n\007message\030\003 " +
|
"uestProtocol\022\n\n\002id\030\001 \002(\004\022\020\n\010protocol\030\002 \002" +
|
||||||
"\002(\014\022\027\n\017messageManifest\030\004 \001(\014\022\016\n\006method\030\005" +
|
"(\r\022\017\n\007message\030\003 \002(\014\022\027\n\017messageManifest\030\004" +
|
||||||
" \001(\t\022\016\n\006target\030\006 \002(\t\022\014\n\004uuid\030\007 \002(\t\022\017\n\007ti" +
|
" \001(\014\022\016\n\006method\030\005 \001(\t\022\016\n\006target\030\006 \002(\t\022\014\n\004" +
|
||||||
"meout\030\010 \002(\004\022\026\n\016supervisorUuid\030\t \001(\t\022\017\n\007i",
|
"uuid\030\007 \002(\t\022\017\n\007timeout\030\010 \002(\004\022\026\n\016superviso",
|
||||||
"sActor\030\n \002(\010\022\020\n\010isOneWay\030\013 \002(\010\022\021\n\tisEsca" +
|
"rUuid\030\t \001(\t\022\017\n\007isActor\030\n \002(\010\022\020\n\010isOneWay" +
|
||||||
"ped\030\014 \002(\010\022\026\n\016sourceHostname\030\r \001(\t\022\022\n\nsou" +
|
"\030\013 \002(\010\022\021\n\tisEscaped\030\014 \002(\010\022K\n\006sender\030\r \001(" +
|
||||||
"rcePort\030\016 \001(\r\022\024\n\014sourceTarget\030\017 \001(\t\022\022\n\ns" +
|
"\0132;.se.scalablesolutions.akka.remote.pro" +
|
||||||
"ourceUuid\030\020 \001(\t\"\247\001\n\013RemoteReply\022\n\n\002id\030\001 " +
|
"tobuf.ActorRefProtocol\"\257\001\n\023RemoteReplyPr" +
|
||||||
"\002(\004\022\020\n\010protocol\030\002 \001(\r\022\017\n\007message\030\003 \001(\014\022\027" +
|
"otocol\022\n\n\002id\030\001 \002(\004\022\020\n\010protocol\030\002 \001(\r\022\017\n\007" +
|
||||||
"\n\017messageManifest\030\004 \001(\014\022\021\n\texception\030\005 \001" +
|
"message\030\003 \001(\014\022\027\n\017messageManifest\030\004 \001(\014\022\021" +
|
||||||
"(\t\022\026\n\016supervisorUuid\030\006 \001(\t\022\017\n\007isActor\030\007 " +
|
"\n\texception\030\005 \001(\t\022\026\n\016supervisorUuid\030\006 \001(" +
|
||||||
"\002(\010\022\024\n\014isSuccessful\030\010 \002(\010"
|
"\t\022\017\n\007isActor\030\007 \002(\010\022\024\n\014isSuccessful\030\010 \002(\010"
|
||||||
};
|
};
|
||||||
com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
|
com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
|
||||||
new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() {
|
new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() {
|
||||||
public com.google.protobuf.ExtensionRegistry assignDescriptors(
|
public com.google.protobuf.ExtensionRegistry assignDescriptors(
|
||||||
com.google.protobuf.Descriptors.FileDescriptor root) {
|
com.google.protobuf.Descriptors.FileDescriptor root) {
|
||||||
descriptor = root;
|
descriptor = root;
|
||||||
internal_static_se_scalablesolutions_akka_remote_protobuf_ActorRef_descriptor =
|
internal_static_se_scalablesolutions_akka_remote_protobuf_ActorRefProtocol_descriptor =
|
||||||
getDescriptor().getMessageTypes().get(0);
|
getDescriptor().getMessageTypes().get(0);
|
||||||
internal_static_se_scalablesolutions_akka_remote_protobuf_ActorRef_fieldAccessorTable = new
|
internal_static_se_scalablesolutions_akka_remote_protobuf_ActorRefProtocol_fieldAccessorTable = new
|
||||||
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
|
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
|
||||||
internal_static_se_scalablesolutions_akka_remote_protobuf_ActorRef_descriptor,
|
internal_static_se_scalablesolutions_akka_remote_protobuf_ActorRefProtocol_descriptor,
|
||||||
new java.lang.String[] { "Uuid", "ActorClassName", "SourceHostname", "SourcePort", "Timeout", },
|
new java.lang.String[] { "Uuid", "ActorClassName", "SourceHostname", "SourcePort", "Timeout", },
|
||||||
se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRef.class,
|
se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRefProtocol.class,
|
||||||
se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRef.Builder.class);
|
se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.ActorRefProtocol.Builder.class);
|
||||||
internal_static_se_scalablesolutions_akka_remote_protobuf_RemoteRequest_descriptor =
|
internal_static_se_scalablesolutions_akka_remote_protobuf_RemoteRequestProtocol_descriptor =
|
||||||
getDescriptor().getMessageTypes().get(1);
|
getDescriptor().getMessageTypes().get(1);
|
||||||
internal_static_se_scalablesolutions_akka_remote_protobuf_RemoteRequest_fieldAccessorTable = new
|
internal_static_se_scalablesolutions_akka_remote_protobuf_RemoteRequestProtocol_fieldAccessorTable = new
|
||||||
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
|
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
|
||||||
internal_static_se_scalablesolutions_akka_remote_protobuf_RemoteRequest_descriptor,
|
internal_static_se_scalablesolutions_akka_remote_protobuf_RemoteRequestProtocol_descriptor,
|
||||||
new java.lang.String[] { "Id", "Protocol", "Message", "MessageManifest", "Method", "Target", "Uuid", "Timeout", "SupervisorUuid", "IsActor", "IsOneWay", "IsEscaped", "SourceHostname", "SourcePort", "SourceTarget", "SourceUuid", },
|
new java.lang.String[] { "Id", "Protocol", "Message", "MessageManifest", "Method", "Target", "Uuid", "Timeout", "SupervisorUuid", "IsActor", "IsOneWay", "IsEscaped", "Sender", },
|
||||||
se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteRequest.class,
|
se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteRequestProtocol.class,
|
||||||
se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteRequest.Builder.class);
|
se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteRequestProtocol.Builder.class);
|
||||||
internal_static_se_scalablesolutions_akka_remote_protobuf_RemoteReply_descriptor =
|
internal_static_se_scalablesolutions_akka_remote_protobuf_RemoteReplyProtocol_descriptor =
|
||||||
getDescriptor().getMessageTypes().get(2);
|
getDescriptor().getMessageTypes().get(2);
|
||||||
internal_static_se_scalablesolutions_akka_remote_protobuf_RemoteReply_fieldAccessorTable = new
|
internal_static_se_scalablesolutions_akka_remote_protobuf_RemoteReplyProtocol_fieldAccessorTable = new
|
||||||
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
|
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
|
||||||
internal_static_se_scalablesolutions_akka_remote_protobuf_RemoteReply_descriptor,
|
internal_static_se_scalablesolutions_akka_remote_protobuf_RemoteReplyProtocol_descriptor,
|
||||||
new java.lang.String[] { "Id", "Protocol", "Message", "MessageManifest", "Exception", "SupervisorUuid", "IsActor", "IsSuccessful", },
|
new java.lang.String[] { "Id", "Protocol", "Message", "MessageManifest", "Exception", "SupervisorUuid", "IsActor", "IsSuccessful", },
|
||||||
se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteReply.class,
|
se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteReplyProtocol.class,
|
||||||
se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteReply.Builder.class);
|
se.scalablesolutions.akka.remote.protobuf.RemoteProtocol.RemoteReplyProtocol.Builder.class);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ package se.scalablesolutions.akka.remote.protobuf;
|
||||||
protoc se/scalablesolutions/akka/remote/protobuf/RemoteProtocol.proto --java_out .
|
protoc se/scalablesolutions/akka/remote/protobuf/RemoteProtocol.proto --java_out .
|
||||||
*/
|
*/
|
||||||
|
|
||||||
message ActorRef {
|
message ActorRefProtocol {
|
||||||
required string uuid = 1;
|
required string uuid = 1;
|
||||||
required string actorClassName = 2;
|
required string actorClassName = 2;
|
||||||
required string sourceHostname = 3;
|
required string sourceHostname = 3;
|
||||||
|
|
@ -18,7 +18,7 @@ message ActorRef {
|
||||||
required uint64 timeout = 5;
|
required uint64 timeout = 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
message RemoteRequest {
|
message RemoteRequestProtocol {
|
||||||
required uint64 id = 1;
|
required uint64 id = 1;
|
||||||
required uint32 protocol = 2;
|
required uint32 protocol = 2;
|
||||||
required bytes message = 3;
|
required bytes message = 3;
|
||||||
|
|
@ -31,13 +31,10 @@ message RemoteRequest {
|
||||||
required bool isActor = 10;
|
required bool isActor = 10;
|
||||||
required bool isOneWay = 11;
|
required bool isOneWay = 11;
|
||||||
required bool isEscaped = 12;
|
required bool isEscaped = 12;
|
||||||
optional string sourceHostname = 13;
|
optional ActorRefProtocol sender = 13;
|
||||||
optional uint32 sourcePort = 14;
|
|
||||||
optional string sourceTarget = 15;
|
|
||||||
optional string sourceUuid = 16;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
message RemoteReply {
|
message RemoteReplyProtocol {
|
||||||
required uint64 id = 1;
|
required uint64 id = 1;
|
||||||
optional uint32 protocol = 2;
|
optional uint32 protocol = 2;
|
||||||
optional bytes message = 3;
|
optional bytes message = 3;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue