Added comment about broken TypedActor remoting behavior

This commit is contained in:
Jonas Bonér 2011-03-31 15:55:30 +02:00
parent 804812b635
commit cdbde3f661
2 changed files with 16 additions and 5 deletions

View file

@ -17,7 +17,7 @@ import java.util.concurrent.ConcurrentHashMap
import java.io.{PrintWriter, PrintStream} import java.io.{PrintWriter, PrintStream}
trait RemoteModule { trait RemoteModule {
val UUID_PREFIX = "uuid:" val UUID_PREFIX = "uuid:".intern
def optimizeLocalScoped_?(): Boolean //Apply optimizations for remote operations in local scope def optimizeLocalScoped_?(): Boolean //Apply optimizations for remote operations in local scope
protected[akka] def notifyListeners(message: => Any): Unit protected[akka] def notifyListeners(message: => Any): Unit
@ -84,7 +84,6 @@ case class RemoteClientWriteFailed(
@BeanProperty client: RemoteClientModule, @BeanProperty client: RemoteClientModule,
@BeanProperty remoteAddress: InetSocketAddress) extends RemoteClientLifeCycleEvent @BeanProperty remoteAddress: InetSocketAddress) extends RemoteClientLifeCycleEvent
/** /**
* Life-cycle events for RemoteServer. * Life-cycle events for RemoteServer.
*/ */
@ -120,7 +119,12 @@ class RemoteClientException private[akka] (
val remoteAddress: InetSocketAddress) extends AkkaException(message) val remoteAddress: InetSocketAddress) extends AkkaException(message)
/** /**
* Returned when a remote exception sent over the wire cannot be loaded and instantiated * Thrown when the remote server actor dispatching fails for some reason.
*/
class RemoteServerException private[akka] (message: String) extends AkkaException(message)
/**
* Thrown when a remote exception sent over the wire cannot be loaded and instantiated
*/ */
case class CannotInstantiateRemoteExceptionDueToRemoteProtocolParsingErrorException private[akka] (cause: Throwable, originalClassName: String, originalMessage: String) case class CannotInstantiateRemoteExceptionDueToRemoteProtocolParsingErrorException private[akka] (cause: Throwable, originalClassName: String, originalMessage: String)
extends AkkaException("\nParsingError[%s]\nOriginalException[%s]\nOriginalMessage[%s]" extends AkkaException("\nParsingError[%s]\nOriginalException[%s]\nOriginalMessage[%s]"

View file

@ -1049,7 +1049,7 @@ class RemoteServerHandler(
throw firstException throw firstException
targetMethod targetMethod
} }
try { try {
val messageReceiver = resolveMethod(typedActor.getClass, ownerTypeHint, typedActorInfo.getMethod, argClasses) val messageReceiver = resolveMethod(typedActor.getClass, ownerTypeHint, typedActorInfo.getMethod, argClasses)
@ -1230,7 +1230,14 @@ class RemoteServerHandler(
server.findTypedActorByIdOrUuid(actorInfo.getId, parseUuid(uuid).toString) match { server.findTypedActorByIdOrUuid(actorInfo.getId, parseUuid(uuid).toString) match {
case null => // the actor has not been registered globally. See if we have it in the session case null => // the actor has not been registered globally. See if we have it in the session
createTypedSessionActor(actorInfo, channel) match { createTypedSessionActor(actorInfo, channel) match {
case null => createClientManagedTypedActor(actorInfo) //Maybe client managed actor? case null =>
// FIXME this is broken, if a user tries to get a server-managed typed actor and that is not registered then a client-managed typed actor is created, but just throwing an exception here causes client-managed typed actors to fail
/* val e = new RemoteServerException("Can't load remote Typed Actor for [" + actorInfo.getId + "]")
EventHandler.error(e, this, e.getMessage)
server.notifyListeners(RemoteServerError(e, server))
throw e
*/ createClientManagedTypedActor(actorInfo) // client-managed actor
case sessionActor => sessionActor case sessionActor => sessionActor
} }
case typedActor => typedActor case typedActor => typedActor