Removing InetSocketAddress as much as possible from the remoting, switching to RemoteAddress for an easier way forward with different transports. Also removing quite a few allocations internally in the remoting as a side-efect of this.

This commit is contained in:
Viktor Klang 2011-11-10 17:39:04 +01:00
parent 0800511ac9
commit ba9281e267
12 changed files with 122 additions and 146 deletions

View file

@ -10,6 +10,7 @@ import scala.annotation.tailrec
import java.util.concurrent.atomic.{ AtomicReference, AtomicInteger }
import java.net.InetSocketAddress
import akka.remote.RemoteAddress
/**
* An Iterable that also contains a version.
@ -71,12 +72,12 @@ trait ConnectionManager {
/**
* Creates a new connection (ActorRef) if it didn't exist. Atomically.
*/
def putIfAbsent(address: InetSocketAddress, newConnectionFactory: () ActorRef): ActorRef
def putIfAbsent(address: RemoteAddress, newConnectionFactory: () ActorRef): ActorRef
/**
* Fails over connections from one address to another.
*/
def failOver(from: InetSocketAddress, to: InetSocketAddress)
def failOver(from: RemoteAddress, to: RemoteAddress)
}
/**
@ -120,9 +121,9 @@ class LocalConnectionManager(initialConnections: Iterable[ActorRef]) extends Con
}
}
def failOver(from: InetSocketAddress, to: InetSocketAddress) {} // do nothing here
def failOver(from: RemoteAddress, to: RemoteAddress) {} // do nothing here
def putIfAbsent(address: InetSocketAddress, newConnectionFactory: () ActorRef): ActorRef = {
def putIfAbsent(address: RemoteAddress, newConnectionFactory: () ActorRef): ActorRef = {
throw new UnsupportedOperationException("Not supported")
}
}