org.objectweb.proactive.p2p.api.worker
Class Worker

java.lang.Object
  extended byorg.objectweb.proactive.p2p.api.worker.Worker
All Implemented Interfaces:
Active, InitActive, java.io.Serializable

public class Worker
extends java.lang.Object
implements java.io.Serializable, InitActive

Author:
Alexandre di Costanzo
See Also:
Serialized Form

Field Summary
protected static org.apache.log4j.Logger logger
           
 
Constructor Summary
Worker()
           
Worker(Worker mother)
           
 
Method Summary
 void createDaughter(java.lang.Object[][] params)
           
 Result execute(java.lang.Object[] params)
           
 Result executeDaughter(java.lang.Object[] params)
           
 Worker getBrothers()
           
 Worker getDaughters()
           
 java.util.Vector getInfos()
           
 Worker getMother()
           
 int getPeers(int n)
           
 Problem getProblem()
           
 int haveNewInfo()
           
 void initActivity(Body body)
          Initializes the activity of the active object.
 java.lang.Object lastInfo()
           
 void receiveInfo(java.lang.Object info)
           
 void receiveInfoForAll(java.lang.Object info, boolean fromMother)
           
 void relaxPeers()
           
 void sendInfoToAll(java.lang.Object info)
           
 void sendInfoToBrother(java.lang.Object info)
           
 void sendInfoToMother(java.lang.Object info)
           
 void setBrothers(Worker brothers)
           
 void setProblem(Problem problem)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static org.apache.log4j.Logger logger
Constructor Detail

Worker

public Worker()

Worker

public Worker(Worker mother)
Method Detail

execute

public Result execute(java.lang.Object[] params)

getPeers

public int getPeers(int n)
             throws ProActiveException
Throws:
ProActiveException

relaxPeers

public void relaxPeers()

createDaughter

public void createDaughter(java.lang.Object[][] params)
                    throws ProActiveException
Parameters:
params - [][0] = Woker mother ; [][1]=Problem
Throws:
ProActiveException

executeDaughter

public Result executeDaughter(java.lang.Object[] params)
Parameters:
params -
Returns:
Returns result

sendInfoToAll

public void sendInfoToAll(java.lang.Object info)

sendInfoToBrother

public void sendInfoToBrother(java.lang.Object info)

sendInfoToMother

public void sendInfoToMother(java.lang.Object info)

receiveInfo

public void receiveInfo(java.lang.Object info)

receiveInfoForAll

public void receiveInfoForAll(java.lang.Object info,
                              boolean fromMother)

getMother

public Worker getMother()

getDaughters

public Worker getDaughters()

getBrothers

public Worker getBrothers()

getInfos

public java.util.Vector getInfos()
Returns:
Returns the infos.

lastInfo

public java.lang.Object lastInfo()
                          throws java.util.NoSuchElementException
Throws:
java.util.NoSuchElementException

haveNewInfo

public int haveNewInfo()

getProblem

public Problem getProblem()
Returns:
Returns the problem.

setBrothers

public void setBrothers(Worker brothers)

initActivity

public void initActivity(Body body)
Description copied from interface: InitActive
Initializes the activity of the active object.

Specified by:
initActivity in interface InitActive
Parameters:
body - the body of the active object being initialized
See Also:
InitActive.initActivity(org.objectweb.proactive.Body)

setProblem

public void setProblem(Problem problem)
Parameters:
problem - The problem to set.


Copyright ? April 2005 INRIA All Rights Reserved.