org.objectweb.proactive.p2p.service
Class P2PAcquaintanceManager

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

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_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.
 BooleanMutableWrapper contains(P2PService service)
          Returns true if this collection contains the specified element.
 java.util.Vector<P2PService> getAcquaintanceList()
           
 P2PService getActiveGroup()
           
 void initActivity(Body body)
          Initializes the activity of the active object.
 P2PService randomPeer()
           
 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.

randomPeer

public P2PService randomPeer()
Returns:
a random acquaintance reference.

getAcquaintanceList

public java.util.Vector<P2PService> getAcquaintanceList()
Returns:
the list of current acquaintances.


Copyright 2001-2007 INRIA All Rights Reserved.