fixed deprecation warnings in akka-core
This commit is contained in:
parent
75e887c7e6
commit
8c67eeb139
9 changed files with 17 additions and 17 deletions
|
|
@ -28,7 +28,7 @@ trait BootableActorLoaderService extends Bootable with Logging {
|
||||||
log.error("Could not find a deploy directory at [%s]", DEPLOY)
|
log.error("Could not find a deploy directory at [%s]", DEPLOY)
|
||||||
System.exit(-1)
|
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)
|
log.info("Deploying applications from [%s]: [%s]", DEPLOY, toDeploy.toArray.toList)
|
||||||
new URLClassLoader(toDeploy.toArray, getClass.getClassLoader)
|
new URLClassLoader(toDeploy.toArray, getClass.getClassLoader)
|
||||||
} else getClass.getClassLoader)
|
} else getClass.getClassLoader)
|
||||||
|
|
|
||||||
|
|
@ -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
|
// 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 getInstance[T](clazz: Class[T]): List[T] = actors.get(clazz.getName).asInstanceOf[List[T]]
|
||||||
|
|
||||||
def getComponentInterfaces: List[Class[_]] = List.flatten(
|
def getComponentInterfaces: List[Class[_]] =
|
||||||
actors.values.toArray.toList.asInstanceOf[List[List[AnyRef]]]).map(_.getClass)
|
actors.values.toArray.toList.asInstanceOf[List[List[AnyRef]]].flatten.map(_.getClass)
|
||||||
|
|
||||||
def isDefined(clazz: Class[_]): Boolean = actors.containsKey(clazz.getName)
|
def isDefined(clazz: Class[_]): Boolean = actors.containsKey(clazz.getName)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ object ConfiguratorRepository extends Logging {
|
||||||
private val configuration = new HashSet[Configurator]
|
private val configuration = new HashSet[Configurator]
|
||||||
|
|
||||||
def registerConfigurator(conf: Configurator) = synchronized {
|
def registerConfigurator(conf: Configurator) = synchronized {
|
||||||
configuration + conf
|
configuration += conf
|
||||||
}
|
}
|
||||||
|
|
||||||
def getConfigurators: List[Configurator] = synchronized {
|
def getConfigurators: List[Configurator] = synchronized {
|
||||||
|
|
|
||||||
|
|
@ -166,7 +166,7 @@ abstract class BasicClusterActor extends ClusterActor {
|
||||||
|
|
||||||
case DeregisterLocalNode(s) => {
|
case DeregisterLocalNode(s) => {
|
||||||
log debug ("DeregisterLocalNode: %s", s)
|
log debug ("DeregisterLocalNode: %s", s)
|
||||||
local = Node(local.endpoints - s)
|
local = Node(local.endpoints.filterNot(_ == s))
|
||||||
broadcast(Papers(local.endpoints))
|
broadcast(Papers(local.endpoints))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -201,12 +201,12 @@ abstract class BasicClusterActor extends ClusterActor {
|
||||||
* Applies the given PartialFunction to all known RemoteAddresses
|
* Applies the given PartialFunction to all known RemoteAddresses
|
||||||
*/
|
*/
|
||||||
def lookup[T](handleRemoteAddress: PartialFunction[RemoteAddress, T]): Option[T] =
|
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
|
* 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
|
* Registers a local endpoint
|
||||||
|
|
|
||||||
|
|
@ -127,7 +127,7 @@ object RemoteClient extends Logging {
|
||||||
if (remoteClients.contains(hash)) {
|
if (remoteClients.contains(hash)) {
|
||||||
val client = remoteClients(hash)
|
val client = remoteClients(hash)
|
||||||
client.shutdown
|
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 {
|
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
|
// TODO: add RemoteClient.unregister for ActiveObject, but first need a @shutdown callback
|
||||||
private[akka] def unregister(hostname: String, port: Int, uuid: String) = synchronized {
|
private[akka] def unregister(hostname: String, port: Int, uuid: String) = synchronized {
|
||||||
val set = actorsFor(RemoteServer.Address(hostname, port))
|
val set = actorsFor(RemoteServer.Address(hostname, port))
|
||||||
set - uuid
|
set -= uuid
|
||||||
if (set.isEmpty) shutdownClientFor(new InetSocketAddress(hostname, port))
|
if (set.isEmpty) shutdownClientFor(new InetSocketAddress(hostname, port))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -267,7 +267,7 @@ class RemoteClientPipelineFactory(name: String,
|
||||||
/**
|
/**
|
||||||
* @author <a href="http://jonasboner.com">Jonas Bonér</a>
|
* @author <a href="http://jonasboner.com">Jonas Bonér</a>
|
||||||
*/
|
*/
|
||||||
@ChannelPipelineCoverage(value = "all")
|
@ChannelHandler.Sharable
|
||||||
class RemoteClientHandler(val name: String,
|
class RemoteClientHandler(val name: String,
|
||||||
val futures: ConcurrentMap[Long, CompletableFuture],
|
val futures: ConcurrentMap[Long, CompletableFuture],
|
||||||
val supervisors: ConcurrentMap[String, Actor],
|
val supervisors: ConcurrentMap[String, Actor],
|
||||||
|
|
|
||||||
|
|
@ -244,7 +244,7 @@ class RemoteServerPipelineFactory(
|
||||||
/**
|
/**
|
||||||
* @author <a href="http://jonasboner.com">Jonas Bonér</a>
|
* @author <a href="http://jonasboner.com">Jonas Bonér</a>
|
||||||
*/
|
*/
|
||||||
@ChannelPipelineCoverage(value = "all")
|
@ChannelHandler.Sharable
|
||||||
class RemoteServerHandler(
|
class RemoteServerHandler(
|
||||||
val name: String,
|
val name: String,
|
||||||
val openChannels: ChannelGroup,
|
val openChannels: ChannelGroup,
|
||||||
|
|
|
||||||
|
|
@ -208,7 +208,7 @@ object Transaction extends TransactionManagement with Logging {
|
||||||
def commit = synchronized {
|
def commit = synchronized {
|
||||||
log.trace("Committing transaction %s", toString)
|
log.trace("Committing transaction %s", toString)
|
||||||
atomic0 {
|
atomic0 {
|
||||||
persistentStateMap.values.foreach(_.commit)
|
persistentStateMap.valuesIterator.foreach(_.commit)
|
||||||
}
|
}
|
||||||
status = TransactionStatus.Completed
|
status = TransactionStatus.Completed
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -152,7 +152,7 @@ class TransactionalRef[T] extends Transactional {
|
||||||
|
|
||||||
def elements: Iterator[T] = {
|
def elements: Iterator[T] = {
|
||||||
ensureIsInTransaction
|
ensureIsInTransaction
|
||||||
if (isEmpty) Iterator.empty else Iterator.fromValues(ref.get)
|
if (isEmpty) Iterator.empty else Iterator(ref.get)
|
||||||
}
|
}
|
||||||
|
|
||||||
def toList: List[T] = {
|
def toList: List[T] = {
|
||||||
|
|
@ -227,7 +227,7 @@ class TransactionalMap[K, V] extends Transactional with scala.collection.mutable
|
||||||
|
|
||||||
def iterator = ref.get.get.iterator
|
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)
|
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ér</a>
|
* @author <a href="http://jonasboner.com">Jonas Bonér</a>
|
||||||
*/
|
*/
|
||||||
class TransactionalVector[T] extends Transactional with RandomAccessSeq[T] {
|
class TransactionalVector[T] extends Transactional with IndexedSeq[T] {
|
||||||
val uuid = UUID.newUuid.toString
|
val uuid = UUID.newUuid.toString
|
||||||
|
|
||||||
private[this] val ref = TransactionalRef[Vector[T]]
|
private[this] val ref = TransactionalRef[Vector[T]]
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ import Vector._
|
||||||
*/
|
*/
|
||||||
@serializable
|
@serializable
|
||||||
class Vector[+T] private (val length: Int, shift: Int, root: Array[AnyRef], tail: Array[AnyRef])
|
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
|
private val tailOff = length - tail.length
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue