diff options
Diffstat (limited to 'test/disabled/presentation/akka/src')
6 files changed, 30 insertions, 30 deletions
diff --git a/test/disabled/presentation/akka/src/akka/actor/Actor.scala b/test/disabled/presentation/akka/src/akka/actor/Actor.scala index b955c4c38b..b9bc51b635 100644 --- a/test/disabled/presentation/akka/src/akka/actor/Actor.scala +++ b/test/disabled/presentation/akka/src/akka/actor/Actor.scala @@ -135,7 +135,7 @@ object Actor extends ListenerManagement { * val actor = actorOf[MyActor].start() * </pre> */ - def actorOf[T <: Actor: Manifest]: ActorRef = actorOf(manifest[T].erasure.asInstanceOf[Class[_ <: Actor]]) + def actorOf[T <: Actor: ClassTag]: ActorRef = actorOf(classTag[T].erasure.asInstanceOf[Class[_ <: Actor]]) /** Creates an ActorRef out of the Actor of the specified Class. * <pre> @@ -481,7 +481,7 @@ private[actor] class AnyOptionAsTypedOption(anyOption: Option[Any]) { /** Convenience helper to cast the given Option of Any to an Option of the given type. Will swallow a possible * ClassCastException and return None in that case. */ - def asSilently[T: Manifest]: Option[T] = narrowSilently[T](anyOption) + def asSilently[T: ClassTag]: Option[T] = narrowSilently[T](anyOption) } /** Marker interface for proxyable actors (such as typed actor). diff --git a/test/disabled/presentation/akka/src/akka/actor/ActorRef.scala b/test/disabled/presentation/akka/src/akka/actor/ActorRef.scala index ff67c9468e..da0b63006a 100644 --- a/test/disabled/presentation/akka/src/akka/actor/ActorRef.scala +++ b/test/disabled/presentation/akka/src/akka/actor/ActorRef.scala @@ -1406,28 +1406,28 @@ trait ScalaActorRef extends ActorRefShared { ref: ActorRef => /** * Atomically create (from actor class) and start an actor. */ - def spawn[T <: Actor: Manifest]: ActorRef = - spawn(manifest[T].erasure.asInstanceOf[Class[_ <: Actor]]) + def spawn[T <: Actor: ClassTag]: ActorRef = + spawn(classTag[T].erasure.asInstanceOf[Class[_ <: Actor]]) /** * Atomically create (from actor class), start and make an actor remote. */ - def spawnRemote[T <: Actor: Manifest](hostname: String, port: Int, timeout: Long): ActorRef = { + def spawnRemote[T <: Actor: ClassTag](hostname: String, port: Int, timeout: Long): ActorRef = { ensureRemotingEnabled - spawnRemote(manifest[T].erasure.asInstanceOf[Class[_ <: Actor]], hostname, port, timeout) + spawnRemote(classTag[T].erasure.asInstanceOf[Class[_ <: Actor]], hostname, port, timeout) } /** * Atomically create (from actor class), start and link an actor. */ - def spawnLink[T <: Actor: Manifest]: ActorRef = - spawnLink(manifest[T].erasure.asInstanceOf[Class[_ <: Actor]]) + def spawnLink[T <: Actor: ClassTag]: ActorRef = + spawnLink(classTag[T].erasure.asInstanceOf[Class[_ <: Actor]]) /** * Atomically create (from actor class), start, link and make an actor remote. */ - def spawnLinkRemote[T <: Actor: Manifest](hostname: String, port: Int, timeout: Long): ActorRef = { + def spawnLinkRemote[T <: Actor: ClassTag](hostname: String, port: Int, timeout: Long): ActorRef = { ensureRemotingEnabled - spawnLinkRemote(manifest[T].erasure.asInstanceOf[Class[_ <: Actor]], hostname, port, timeout) + spawnLinkRemote(classTag[T].erasure.asInstanceOf[Class[_ <: Actor]], hostname, port, timeout) } } diff --git a/test/disabled/presentation/akka/src/akka/actor/ActorRegistry.scala b/test/disabled/presentation/akka/src/akka/actor/ActorRegistry.scala index df335dc8b4..5d649fcd36 100644 --- a/test/disabled/presentation/akka/src/akka/actor/ActorRegistry.scala +++ b/test/disabled/presentation/akka/src/akka/actor/ActorRegistry.scala @@ -5,7 +5,7 @@ package akka.actor import scala.collection.mutable.{ ListBuffer, Map } -import scala.reflect.Manifest +import scala.reflect.ArrayTag import java.util.concurrent.{ ConcurrentSkipListSet, ConcurrentHashMap } import java.util.{ Set => JSet } @@ -74,10 +74,10 @@ final class ActorRegistry private[actor] () extends ListenerManagement { } /** - * Finds all actors that are subtypes of the class passed in as the Manifest argument and supporting passed message. + * Finds all actors that are subtypes of the class passed in as the ClassTag argument and supporting passed message. */ - def actorsFor[T <: Actor](message: Any)(implicit manifest: Manifest[T]): Array[ActorRef] = - filter(a => manifest.erasure.isAssignableFrom(a.actor.getClass) && a.isDefinedAt(message)) + def actorsFor[T <: Actor](message: Any)(implicit classTag: ClassTag[T]): Array[ActorRef] = + filter(a => classTag.erasure.isAssignableFrom(a.actor.getClass) && a.isDefinedAt(message)) /** * Finds all actors that satisfy a predicate. @@ -93,16 +93,16 @@ final class ActorRegistry private[actor] () extends ListenerManagement { } /** - * Finds all actors that are subtypes of the class passed in as the Manifest argument. + * Finds all actors that are subtypes of the class passed in as the ClassTag argument. */ - def actorsFor[T <: Actor](implicit manifest: Manifest[T]): Array[ActorRef] = - actorsFor[T](manifest.erasure.asInstanceOf[Class[T]]) + def actorsFor[T <: Actor](implicit classTag: ClassTag[T]): Array[ActorRef] = + actorsFor[T](classTag.erasure.asInstanceOf[Class[T]]) /** * Finds any actor that matches T. Very expensive, traverses ALL alive actors. */ - def actorFor[T <: Actor](implicit manifest: Manifest[T]): Option[ActorRef] = - find({ case a: ActorRef if manifest.erasure.isAssignableFrom(a.actor.getClass) => a }) + def actorFor[T <: Actor](implicit classTag: ClassTag[T]): Option[ActorRef] = + find({ case a: ActorRef if classTag.erasure.isAssignableFrom(a.actor.getClass) => a }) /** * Finds all actors of type or sub-type specified by the class passed in as the Class argument. @@ -166,21 +166,21 @@ final class ActorRegistry private[actor] () extends ListenerManagement { } /** - * Finds all typed actors that are subtypes of the class passed in as the Manifest argument. + * Finds all typed actors that are subtypes of the class passed in as the ClassTag argument. */ - def typedActorsFor[T <: AnyRef](implicit manifest: Manifest[T]): Array[AnyRef] = { + def typedActorsFor[T <: AnyRef](implicit classTag: ClassTag[T]): Array[AnyRef] = { TypedActorModule.ensureEnabled - typedActorsFor[T](manifest.erasure.asInstanceOf[Class[T]]) + typedActorsFor[T](classTag.erasure.asInstanceOf[Class[T]]) } /** * Finds any typed actor that matches T. */ - def typedActorFor[T <: AnyRef](implicit manifest: Manifest[T]): Option[AnyRef] = { + def typedActorFor[T <: AnyRef](implicit classTag: ClassTag[T]): Option[AnyRef] = { TypedActorModule.ensureEnabled def predicate(proxy: AnyRef): Boolean = { val actorRef = TypedActorModule.typedActorObjectInstance.get.actorFor(proxy) - actorRef.isDefined && manifest.erasure.isAssignableFrom(actorRef.get.actor.getClass) + actorRef.isDefined && classTag.erasure.isAssignableFrom(actorRef.get.actor.getClass) } findTypedActor({ case a: Some[AnyRef] if predicate(a.get) => a }) } @@ -279,7 +279,7 @@ final class ActorRegistry private[actor] () extends ListenerManagement { * * @author Viktor Klang */ -class Index[K <: AnyRef, V <: AnyRef: Manifest] { +class Index[K <: AnyRef, V <: AnyRef: ArrayTag] { private val Naught = Array[V]() //Nil for Arrays private val container = new ConcurrentHashMap[K, JSet[V]] private val emptySet = new ConcurrentSkipListSet[V] diff --git a/test/disabled/presentation/akka/src/akka/event/EventHandler.scala b/test/disabled/presentation/akka/src/akka/event/EventHandler.scala index f3176b7c21..af2fee6c47 100644 --- a/test/disabled/presentation/akka/src/akka/event/EventHandler.scala +++ b/test/disabled/presentation/akka/src/akka/event/EventHandler.scala @@ -115,8 +115,8 @@ object EventHandler extends ListenerManagement { notifyListeners(event) } - def notify[T <: Event: ClassManifest](event: => T) { - if (level >= levelFor(classManifest[T].erasure.asInstanceOf[Class[_ <: Event]])) notifyListeners(event) + def notify[T <: Event: ClassTag](event: => T) { + if (level >= levelFor(classTag[T].erasure.asInstanceOf[Class[_ <: Event]])) notifyListeners(event) } def error(cause: Throwable, instance: AnyRef, message: => String) { diff --git a/test/disabled/presentation/akka/src/akka/remoteinterface/RemoteInterface.scala b/test/disabled/presentation/akka/src/akka/remoteinterface/RemoteInterface.scala index 0c5da82294..5219c49dcb 100644 --- a/test/disabled/presentation/akka/src/akka/remoteinterface/RemoteInterface.scala +++ b/test/disabled/presentation/akka/src/akka/remoteinterface/RemoteInterface.scala @@ -206,8 +206,8 @@ abstract class RemoteSupport extends ListenerManagement with RemoteServerModule * </pre> */ @deprecated("Will be removed after 1.1", "1.1") - def actorOf[T <: Actor: Manifest](host: String, port: Int): ActorRef = - clientManagedActorOf(() => createActorFromClass(manifest.erasure), host, port) + def actorOf[T <: Actor: ClassTag](host: String, port: Int): ActorRef = + clientManagedActorOf(() => createActorFromClass(classTag[T].erasure), host, port) protected def createActorFromClass(clazz: Class[_]): Actor = { import ReflectiveAccess.{ createInstance, noParams, noArgs } diff --git a/test/disabled/presentation/akka/src/akka/util/Helpers.scala b/test/disabled/presentation/akka/src/akka/util/Helpers.scala index 48477426c9..0ff45408d0 100644 --- a/test/disabled/presentation/akka/src/akka/util/Helpers.scala +++ b/test/disabled/presentation/akka/src/akka/util/Helpers.scala @@ -37,7 +37,7 @@ object Helpers { * Convenience helper to cast the given Option of Any to an Option of the given type. Will swallow a possible * ClassCastException and return None in that case. */ - def narrowSilently[T: Manifest](o: Option[Any]): Option[T] = + def narrowSilently[T: ClassTag](o: Option[Any]): Option[T] = try { narrow(o) } catch { |