diff options
author | Philipp Haller <hallerp@gmail.com> | 2010-04-29 22:15:18 +0000 |
---|---|---|
committer | Philipp Haller <hallerp@gmail.com> | 2010-04-29 22:15:18 +0000 |
commit | d43999e5d07e8223c9aa8fe344b83cdd42c5e7a7 (patch) | |
tree | 6052a1a5eef85c64c86b77f05abc37bd0aef27d1 | |
parent | 18cdaae4b61b481ca9b3be48995ea45d1e2aab53 (diff) | |
download | scala-d43999e5d07e8223c9aa8fe344b83cdd42c5e7a7.tar.gz scala-d43999e5d07e8223c9aa8fe344b83cdd42c5e7a7.tar.bz2 scala-d43999e5d07e8223c9aa8fe344b83cdd42c5e7a7.zip |
Deprecated two members of RemoteActor which cle...
Deprecated two members of RemoteActor which clearly should not be in the
public API. Removed unnecessary casts. Some more complete doc comments.
No review.
-rw-r--r-- | src/actors/scala/actors/Channel.scala | 9 | ||||
-rw-r--r-- | src/actors/scala/actors/OutputChannel.scala | 4 | ||||
-rw-r--r-- | src/actors/scala/actors/remote/Proxy.scala | 2 | ||||
-rw-r--r-- | src/actors/scala/actors/remote/RemoteActor.scala | 16 |
4 files changed, 20 insertions, 11 deletions
diff --git a/src/actors/scala/actors/Channel.scala b/src/actors/scala/actors/Channel.scala index bf5d9261db..ae1e3029d1 100644 --- a/src/actors/scala/actors/Channel.scala +++ b/src/actors/scala/actors/Channel.scala @@ -58,8 +58,7 @@ class Channel[Msg](val receiver: Actor) extends InputChannel[Msg] with OutputCha def receive[R](f: PartialFunction[Msg, R]): R = { val C = this.asInstanceOf[Channel[Any]] - val recvActor = receiver.asInstanceOf[Actor] - recvActor.receive { + receiver.receive { case C ! msg if (f.isDefinedAt(msg.asInstanceOf[Msg])) => f(msg.asInstanceOf[Msg]) } } @@ -70,8 +69,7 @@ class Channel[Msg](val receiver: Actor) extends InputChannel[Msg] with OutputCha def receiveWithin[R](msec: Long)(f: PartialFunction[Any, R]): R = { val C = this.asInstanceOf[Channel[Any]] - val recvActor = receiver.asInstanceOf[Actor] - recvActor.receiveWithin(msec) { + receiver.receiveWithin(msec) { case C ! msg if (f.isDefinedAt(msg)) => f(msg) case TIMEOUT => f(TIMEOUT) } @@ -86,8 +84,7 @@ class Channel[Msg](val receiver: Actor) extends InputChannel[Msg] with OutputCha def reactWithin(msec: Long)(f: PartialFunction[Any, Unit]): Nothing = { val C = this.asInstanceOf[Channel[Any]] - val recvActor = receiver.asInstanceOf[Actor] - recvActor.reactWithin(msec) { + receiver.reactWithin(msec) { case C ! msg if (f.isDefinedAt(msg)) => f(msg) case TIMEOUT => f(TIMEOUT) } diff --git a/src/actors/scala/actors/OutputChannel.scala b/src/actors/scala/actors/OutputChannel.scala index 5f99f57ecf..291117bf71 100644 --- a/src/actors/scala/actors/OutputChannel.scala +++ b/src/actors/scala/actors/OutputChannel.scala @@ -22,6 +22,8 @@ trait OutputChannel[-Msg] { /** * Sends <code>msg</code> to this $actor (asynchronous). + * + * @param msg the message to send */ def !(msg: Msg): Unit @@ -36,6 +38,8 @@ trait OutputChannel[-Msg] { /** * Forwards <code>msg</code> to this $actor (asynchronous). + * + * @param msg the message to forward */ def forward(msg: Msg): Unit diff --git a/src/actors/scala/actors/remote/Proxy.scala b/src/actors/scala/actors/remote/Proxy.scala index ac5951ed85..3607e6e62d 100644 --- a/src/actors/scala/actors/remote/Proxy.scala +++ b/src/actors/scala/actors/remote/Proxy.scala @@ -42,7 +42,7 @@ private[remote] class Proxy(node: Node, name: Symbol, @transient var kernel: Net } private def setupKernel() { - kernel = RemoteActor.someKernel + kernel = RemoteActor.someNetKernel kernel.registerProxy(node, name, this) } diff --git a/src/actors/scala/actors/remote/RemoteActor.scala b/src/actors/scala/actors/remote/RemoteActor.scala index 78361ec0fb..4e544665c0 100644 --- a/src/actors/scala/actors/remote/RemoteActor.scala +++ b/src/actors/scala/actors/remote/RemoteActor.scala @@ -57,10 +57,10 @@ object RemoteActor { * <code>port</code>. */ def alive(port: Int): Unit = synchronized { - createKernelOnPort(port) + createNetKernelOnPort(port) } - def createKernelOnPort(port: Int): NetKernel = { + private def createNetKernelOnPort(port: Int): NetKernel = { val serv = TcpService(port, cl) val kern = serv.kernel val s = Actor.self @@ -82,6 +82,10 @@ object RemoteActor { kern } + @deprecated("this member is going to be removed in a future release") + def createKernelOnPort(port: Int): NetKernel = + createNetKernelOnPort(port) + /** * Registers <code>a</code> under <code>name</code> on this * node. @@ -102,7 +106,7 @@ object RemoteActor { case None => // establish remotely accessible // return path (sender) - createKernelOnPort(TcpService.generatePort) + createNetKernelOnPort(TcpService.generatePort) case Some(k) => k } @@ -115,8 +119,12 @@ object RemoteActor { selfKernel.getOrCreateProxy(node, sym) } - def someKernel: NetKernel = + private[remote] def someNetKernel: NetKernel = kernels.valuesIterator.next + + @deprecated("this member is going to be removed in a future release") + def someKernel: NetKernel = + someNetKernel } |