Permalink
Browse files

parameterized all spawn/start/link methods + enhanced maintanance scr…

…ipts
  • Loading branch information...
1 parent d48afd0 commit bc7b9ddb854a5d7b088d819add09a5914e217fc0 jboner committed Aug 21, 2009
Showing with 32 additions and 17 deletions.
  1. +8 −8 kernel/src/main/scala/actor/Actor.scala
  2. +21 −9 scripts/convert_tabs_to_spaces.sh
  3. +3 −0 scripts/dos_to_unix.sh
@@ -358,8 +358,8 @@ trait Actor extends Logging with TransactionManagement {
* <p/>
* To be invoked from within the actor itself.
*/
- protected[this] def spawn(actorClass: Class[_]): Actor = {
- val actor = actorClass.newInstance.asInstanceOf[Actor]
+ protected[this] def spawn[T <: Actor](actorClass: Class[T]): T = {
+ val actor = actorClass.newInstance.asInstanceOf[T]
actor.dispatcher = dispatcher
actor.mailbox = mailbox
actor.start
@@ -371,8 +371,8 @@ trait Actor extends Logging with TransactionManagement {
* <p/>
* To be invoked from within the actor itself.
*/
- protected[this] def spawnRemote(actorClass: Class[_]): Actor = {
- val actor = actorClass.newInstance.asInstanceOf[Actor]
+ protected[this] def spawnRemote[T <: Actor](actorClass: Class[T]): T = {
+ val actor = actorClass.newInstance.asInstanceOf[T]
actor.makeRemote(RemoteServer.HOSTNAME, RemoteServer.PORT)
actor.dispatcher = dispatcher
actor.mailbox = mailbox
@@ -385,8 +385,8 @@ trait Actor extends Logging with TransactionManagement {
* <p/>
* To be invoked from within the actor itself.
*/
- protected[this] def spawnLink(actorClass: Class[_]): Actor = {
- val actor = spawn(actorClass)
+ protected[this] def spawnLink[T <: Actor](actorClass: Class[T]): T = {
+ val actor = spawn[T](actorClass)
link(actor)
actor
}
@@ -396,8 +396,8 @@ trait Actor extends Logging with TransactionManagement {
* <p/>
* To be invoked from within the actor itself.
*/
- protected[this] def spawnLinkRemote(actorClass: Class[_]): Actor = {
- val actor = spawn(actorClass)
+ protected[this] def spawnLinkRemote[T <: Actor](actorClass: Class[T]): T = {
+ val actor = spawn[T](actorClass)
actor.makeRemote(RemoteServer.HOSTNAME, RemoteServer.PORT)
link(actor)
actor
@@ -1,11 +1,23 @@
#!/bin/sh
-echo "converting all tabs to 2 spaces"
-find . -type f -name '*.html' -exec sed -i 's/[\t]/ /' {} \;
-
-#find . -name "*.html" |while read line
-#do
-# expand -i $line > $line.new
-# mv -f $line.new $line
-#done
-
+find . -name "*.java" |while read line
+do
+ expand $line > $line.new
+ mv -f $line.new $line
+done
+find . -name "*.scala" |while read line
+do
+ expand $line > $line.new
+ mv -f $line.new $line
+done
+find . -name "*.html" |while read line
+do
+ expand $line > $line.new
+ mv -f $line.new $line
+done
+find . -name "*.xml" |while read line
+do
+ expand $line > $line.new
+ mv -f $line.new $line
+done
+echo "converted all tabs to 2 spaces"
exit 0
@@ -1,2 +1,5 @@
#!/bin/sh
find . -name *.scala -exec dos2unix {} \;
+find . -name *.java -exec dos2unix {} \;
+find . -name *.html -exec dos2unix {} \;
+find . -name *.xml -exec dos2unix {} \;

0 comments on commit bc7b9dd

Please sign in to comment.