aa.application.Fibonacci
Class FibActor

java.lang.Object
  extended byaa.core.Actor
      extended byaa.application.Fibonacci.FibActor
All Implemented Interfaces:
java.io.Serializable

public class FibActor
extends Actor

This class represents the fibonacci example actor.

Author:
xinghuizhao
See Also:
Serialized Form

Field Summary
(package private)  ActorName client
          The first response we have received from a child fib actor.
(package private)  java.lang.String meth
           
(package private)  int numResponses
           
(package private)  int partialResponse
           
 
Fields inherited from class aa.core.Actor
m_athread
 
Constructor Summary
FibActor()
          Creates a new instance of FibActor
FibActor(ActorName p_anClient, java.lang.String p_strMeth)
           
 
Method Summary
 void fib(java.lang.Integer p_intVal, ActorName p_anClient, java.lang.String p_strMeth)
          This method is called by a client to request a fib computation.
 void result(java.lang.Integer p_intVal)
          This method is called from another child actor to pass a partial result.
 
Methods inherited from class aa.core.Actor
become, become, become, become, become, become, become, become, become, become, become, becomeActor, call, call, call, call, call, call, call, call, call, call, call, callMessage, create, create, create, create, create, create, create, create, create, create, create, createActor, createRemote, createRemote, createRemote, createRemote, createRemote, createRemote, createRemote, createRemote, createRemote, createRemote, createRemote, createRemoteActor, destroy, echo, getActorName, getDefaultDirectoryManager, getDefaultDirectoryManager, getLastErrorMessage, migrate, print, printLastErrorMessage, println, send, send, send, send, send, send, send, send, send, send, send, sendMessage, setErrorMessage, uninit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

numResponses

int numResponses

partialResponse

int partialResponse

client

ActorName client
The first response we have received from a child fib actor. We save this value until we receive the second response, and send our clint the sum of both values


meth

java.lang.String meth
Constructor Detail

FibActor

public FibActor()
Creates a new instance of FibActor


FibActor

public FibActor(ActorName p_anClient,
                java.lang.String p_strMeth)
Method Detail

fib

public void fib(java.lang.Integer p_intVal,
                ActorName p_anClient,
                java.lang.String p_strMeth)
This method is called by a client to request a fib computation. p_intVal : fibonacci number should be computed. p_anClient : ActorName of the client waiting for a response. p_strMeth : name of the method to be invoked on the client.


result

public void result(java.lang.Integer p_intVal)
This method is called from another child actor to pass a partial result. We wait until we have two such results, add them, and return the result to client.