fix review comments

This commit is contained in:
Roland 2011-12-30 00:12:49 +01:00
parent 6571f34d91
commit 023f4eb0ec
4 changed files with 11 additions and 3 deletions

View file

@ -59,7 +59,7 @@ sealed trait ActorPath extends Comparable[ActorPath] with Serializable {
/**
* Recursively create a descendants path by appending all child names.
*/
def /(child: Iterable[String]): ActorPath = (this /: child)(_ / _)
def /(child: Iterable[String]): ActorPath = (this /: child)((path, elem) if (elem.isEmpty) path else path / elem)
/**
* ''Java API'': Recursively create a descendants path by appending all child names.

View file

@ -478,7 +478,7 @@ class LocalActorRefProvider(
} else ref.getChild(path.iterator) match {
case Nobody
log.debug("look-up of path sequence '{}' failed", path)
new EmptyLocalActorRef(eventStream, dispatcher, ref.path / path.filterNot(_.isEmpty))
new EmptyLocalActorRef(eventStream, dispatcher, ref.path / path)
case x x
}

View file

@ -179,6 +179,14 @@ case object FromConfig extends RouterConfig {
throw new ConfigurationException("router " + ref + " needs external configuration from file (e.g. application.conf)")
}
/**
* Java API: Router configuration which has no default, i.e. external configuration is required.
*/
case class FromConfig() extends RouterConfig {
def createRoute(props: Props, actorContext: ActorContext, ref: RoutedActorRef): Route =
throw new ConfigurationException("router " + ref + " needs external configuration from file (e.g. application.conf)")
}
object RoundRobinRouter {
def apply(routees: Iterable[ActorRef]) = new RoundRobinRouter(routees = routees map (_.path.toString))
}

View file

@ -71,7 +71,7 @@ abstract class RemoteClient private[akka] (
/**
* Sends the message across the wire
*/
def send(request: RemoteMessageProtocol): Unit = {
private def send(request: RemoteMessageProtocol): Unit = {
try {
val payload = remoteSupport.createMessageSendEnvelope(request)
currentChannel.write(payload).addListener(