org.objectweb.proactive.p2p.service
Class P2PAcquaintanceManager

java.lang.Object
  extended byorg.objectweb.proactive.p2p.service.P2PAcquaintanceManager
All Implemented Interfaces:
Active, InitActive, P2PConstants, ProActiveInternalObject, RunActive, java.io.Serializable

public class P2PAcquaintanceManager
extends java.lang.Object
implements InitActive, RunActive, java.io.Serializable, P2PConstants, ProActiveInternalObject

Updating the group of exportAcquaintances of the P2P service.

Author:
Alexandre di Costanzo
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org.objectweb.proactive.p2p.service.util.P2PConstants
HIDE_P2PNODE_MONITORING, MAX_NODE, P2P_NODE_NAME, PROPERPY_XML_PATH, PROPERTY_ACQUISITION, PROPERTY_EXPLORING_MSG, PROPERTY_LOAD_BAL, PROPERTY_LOOKUP_FREQ, PROPERTY_MSG_MEMORY, PROPERTY_MULTI_PROC_NODES, PROPERTY_NO_SHARING, PROPERTY_NOA, PROPERTY_NODES_ACQUISITION_T0, PROPERTY_PORT, PROPERTY_TTL, PROPERTY_TTU, SHARED_NODE_NAME, VN_NAME
 
Constructor Summary
P2PAcquaintanceManager()
          The empty constructor for activating.
P2PAcquaintanceManager(P2PService localService)
          Construct a new P2PAcquaintanceManager.
 
Method Summary
 void add(P2PService peer)
          Add a peer in the group of acquaintancesActived.
 void chooseNneighborsAndSendTheBalanceRequest(int n, P2PService sender, double ranking)
           
 void chooseNneighborsAndStealTheirWork(int n, double ranking, java.lang.String myNodeAddress)
           
 BooleanMutableWrapper contains(P2PService service)
          Returns true if this collection contains the specified element.
 P2PService getActiveGroup()
           
 void initActivity(Body body)
          Initializes the activity of the active object.
 void remove(P2PService peer)
           
 void runActivity(Body body)
          Runs the activity of the active object.
 IntMutableWrapper size()
          Returns the number of elements in this group.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

P2PAcquaintanceManager

public P2PAcquaintanceManager()
The empty constructor for activating.


P2PAcquaintanceManager

public P2PAcquaintanceManager(P2PService localService)
Construct a new P2PAcquaintanceManager.

Parameters:
localService - a reference to the local P2P service.
Method Detail

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)

runActivity

public void runActivity(Body body)
Description copied from interface: RunActive
Runs the activity of the active object.

Specified by:
runActivity in interface RunActive
Parameters:
body - the body of the active object being started
See Also:
RunActive.runActivity(org.objectweb.proactive.Body)

getActiveGroup

public P2PService getActiveGroup()
Returns:
An active object to make group method call.

add

public void add(P2PService peer)
Add a peer in the group of acquaintancesActived.

Parameters:
peer - the peer to add.

remove

public void remove(P2PService peer)

size

public IntMutableWrapper size()
Returns the number of elements in this group.

Returns:
the number of elements in this group.

contains

public BooleanMutableWrapper contains(P2PService service)
Returns true if this collection contains the specified element. More formally, returns true if and only if this collection contains at least one element e such that (o==null ? e==null : o.equals(e)).

Parameters:
service - element whose presence in this collection is to be tested.
Returns:
true if this collection contains the specified element.

chooseNneighborsAndSendTheBalanceRequest

public void chooseNneighborsAndSendTheBalanceRequest(int n,
                                                     P2PService sender,
                                                     double ranking)
Parameters:
n - number of neighbors which receive the balance request
sender - who sends the request
ranking - the ranking of the caller

chooseNneighborsAndStealTheirWork

public void chooseNneighborsAndStealTheirWork(int n,
                                              double ranking,
                                              java.lang.String myNodeAddress)
Parameters:
n - number of neighbors which receive the balance request
ranking - who sends the request
myNodeAddress - the ranking of the caller


Copyright 2001-2005 INRIA All Rights Reserved.