fixed deprecation warnings in akka-core

This commit is contained in:
Jonas Bonér 2010-03-29 09:33:32 +02:00
parent 75e887c7e6
commit 8c67eeb139
9 changed files with 17 additions and 17 deletions

View file

@ -28,7 +28,7 @@ trait BootableActorLoaderService extends Bootable with Logging {
log.error("Could not find a deploy directory at [%s]", DEPLOY)
System.exit(-1)
}
val toDeploy = for (f <- DEPLOY_DIR.listFiles().toArray.toList.asInstanceOf[List[File]]) yield f.toURL
val toDeploy = for (f <- DEPLOY_DIR.listFiles().toArray.toList.asInstanceOf[List[File]]) yield f.toURI.toURL
log.info("Deploying applications from [%s]: [%s]", DEPLOY, toDeploy.toArray.toList)
new URLClassLoader(toDeploy.toArray, getClass.getClassLoader)
} else getClass.getClassLoader)

View file

@ -89,8 +89,8 @@ sealed class Supervisor private[akka] (handler: FaultHandlingStrategy, trapExcep
// Cheating, should really go through the dispatcher rather than direct access to a CHM
def getInstance[T](clazz: Class[T]): List[T] = actors.get(clazz.getName).asInstanceOf[List[T]]
def getComponentInterfaces: List[Class[_]] = List.flatten(
actors.values.toArray.toList.asInstanceOf[List[List[AnyRef]]]).map(_.getClass)
def getComponentInterfaces: List[Class[_]] =
actors.values.toArray.toList.asInstanceOf[List[List[AnyRef]]].flatten.map(_.getClass)
def isDefined(clazz: Class[_]): Boolean = actors.containsKey(clazz.getName)

View file

@ -13,7 +13,7 @@ object ConfiguratorRepository extends Logging {
private val configuration = new HashSet[Configurator]
def registerConfigurator(conf: Configurator) = synchronized {
configuration + conf
configuration += conf
}
def getConfigurators: List[Configurator] = synchronized {

View file

@ -166,7 +166,7 @@ abstract class BasicClusterActor extends ClusterActor {
case DeregisterLocalNode(s) => {
log debug ("DeregisterLocalNode: %s", s)
local = Node(local.endpoints - s)
local = Node(local.endpoints.filterNot(_ == s))
broadcast(Papers(local.endpoints))
}
}
@ -201,12 +201,12 @@ abstract class BasicClusterActor extends ClusterActor {
* Applies the given PartialFunction to all known RemoteAddresses
*/
def lookup[T](handleRemoteAddress: PartialFunction[RemoteAddress, T]): Option[T] =
remotes.values.toList.flatMap(_.endpoints).find(handleRemoteAddress isDefinedAt _).map(handleRemoteAddress)
remotes.valuesIterator.toList.flatMap(_.endpoints).find(handleRemoteAddress isDefinedAt _).map(handleRemoteAddress)
/**
* Applies the given function to all remote addresses known
*/
def foreach(f: (RemoteAddress) => Unit): Unit = remotes.values.toList.flatMap(_.endpoints).foreach(f)
def foreach(f: (RemoteAddress) => Unit): Unit = remotes.valuesIterator.toList.flatMap(_.endpoints).foreach(f)
/**
* Registers a local endpoint

View file

@ -127,7 +127,7 @@ object RemoteClient extends Logging {
if (remoteClients.contains(hash)) {
val client = remoteClients(hash)
client.shutdown
remoteClients - hash
remoteClients -= hash
}
}
@ -140,13 +140,13 @@ object RemoteClient extends Logging {
}
private[akka] def register(hostname: String, port: Int, uuid: String) = synchronized {
actorsFor(RemoteServer.Address(hostname, port)) + uuid
actorsFor(RemoteServer.Address(hostname, port)) += uuid
}
// TODO: add RemoteClient.unregister for ActiveObject, but first need a @shutdown callback
private[akka] def unregister(hostname: String, port: Int, uuid: String) = synchronized {
val set = actorsFor(RemoteServer.Address(hostname, port))
set - uuid
set -= uuid
if (set.isEmpty) shutdownClientFor(new InetSocketAddress(hostname, port))
}
@ -267,7 +267,7 @@ class RemoteClientPipelineFactory(name: String,
/**
* @author <a href="http://jonasboner.com">Jonas Bon&#233;r</a>
*/
@ChannelPipelineCoverage(value = "all")
@ChannelHandler.Sharable
class RemoteClientHandler(val name: String,
val futures: ConcurrentMap[Long, CompletableFuture],
val supervisors: ConcurrentMap[String, Actor],

View file

@ -244,7 +244,7 @@ class RemoteServerPipelineFactory(
/**
* @author <a href="http://jonasboner.com">Jonas Bon&#233;r</a>
*/
@ChannelPipelineCoverage(value = "all")
@ChannelHandler.Sharable
class RemoteServerHandler(
val name: String,
val openChannels: ChannelGroup,

View file

@ -208,7 +208,7 @@ object Transaction extends TransactionManagement with Logging {
def commit = synchronized {
log.trace("Committing transaction %s", toString)
atomic0 {
persistentStateMap.values.foreach(_.commit)
persistentStateMap.valuesIterator.foreach(_.commit)
}
status = TransactionStatus.Completed
}

View file

@ -152,7 +152,7 @@ class TransactionalRef[T] extends Transactional {
def elements: Iterator[T] = {
ensureIsInTransaction
if (isEmpty) Iterator.empty else Iterator.fromValues(ref.get)
if (isEmpty) Iterator.empty else Iterator(ref.get)
}
def toList: List[T] = {
@ -227,7 +227,7 @@ class TransactionalMap[K, V] extends Transactional with scala.collection.mutable
def iterator = ref.get.get.iterator
override def elements: Iterator[(K, V)] = ref.get.get.elements
override def elements: Iterator[(K, V)] = ref.get.get.iterator
override def contains(key: K): Boolean = ref.get.get.contains(key)
@ -253,7 +253,7 @@ object TransactionalVector {
*
* @author <a href="http://jonasboner.com">Jonas Bon&#233;r</a>
*/
class TransactionalVector[T] extends Transactional with RandomAccessSeq[T] {
class TransactionalVector[T] extends Transactional with IndexedSeq[T] {
val uuid = UUID.newUuid.toString
private[this] val ref = TransactionalRef[Vector[T]]

View file

@ -44,7 +44,7 @@ import Vector._
*/
@serializable
class Vector[+T] private (val length: Int, shift: Int, root: Array[AnyRef], tail: Array[AnyRef])
extends RandomAccessSeq[T] with PersistentDataStructure { outer =>
extends IndexedSeq[T] with PersistentDataStructure { outer =>
private val tailOff = length - tail.length
/*