org.objectweb.proactive.p2p.service.node
Class P2PNodeManager

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

public class P2PNodeManager
extends java.lang.Object
implements java.io.Serializable, InitActive, RunActive, EndActive, P2PConstants

Author:
Alexandre di Costanzo Created on Jan 12, 2005
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org.objectweb.proactive.p2p.service.util.P2PConstants
MAX_NODE, P2P_NODE_NAME, PROPERPY_XML_PATH, PROPERTY_ACQUISITION, PROPERTY_BOOKING_MAX, PROPERTY_BOOKING_NODES, PROPERTY_EXPLORING_MSG, PROPERTY_LOOKUP_FREQ, PROPERTY_MSG_MEMORY, PROPERTY_MULTI_PROC_NODES, PROPERTY_NOA, PROPERTY_NODES_ACQUISITION_T0, PROPERTY_PORT, PROPERTY_TTL, PROPERTY_TTU, SHARED_NODE_NAME, VN_NAME
 
Constructor Summary
P2PNodeManager()
          Empty constructor for new active.
P2PNodeManager(P2PService localService)
          Construct a new P2PNodeManager.
 
Method Summary
 P2PNode askingNode()
          Asking a shared node.
 void endActivity(Body body)
          Finalized the active object after the activity has been stopped.
 void initActivity(Body body)
          Initializes the activity of the active object.
 void leaveNode(Node nodeToFree, java.lang.String vnName)
          Leave the specified node.
 void noMoreNodeNeeded(Node givenNode)
          Free a booked node.
 void runActivity(Body body)
          Runs the activity of the active object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

P2PNodeManager

public P2PNodeManager()
Empty constructor for new active.


P2PNodeManager

public P2PNodeManager(P2PService localService)
Construct a new P2PNodeManager.

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

askingNode

public P2PNode askingNode()
Asking a shared node.

Returns:
a P2PNode which contains a node or null if no shared nodes are available.

leaveNode

public void leaveNode(Node nodeToFree,
                      java.lang.String vnName)
Leave the specified node. The node is killed and new one is created and ready for sharing.

Parameters:
nodeToFree - the node to kill.
vnName - Virtual node name to unregister or null.

noMoreNodeNeeded

public void noMoreNodeNeeded(Node givenNode)
Free a booked node.

Parameters:
givenNode - node given and not used.

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)

endActivity

public void endActivity(Body body)
Description copied from interface: EndActive
Finalized the active object after the activity has been stopped.

Specified by:
endActivity in interface EndActive
Parameters:
body - the body of the active object being finalized.
See Also:
EndActive.endActivity(org.objectweb.proactive.Body)


Copyright ? April 2005 INRIA All Rights Reserved.