org.objectweb.proactive.core.descriptor.services
Class P2PLookupService

java.lang.Object
  extended byorg.objectweb.proactive.core.descriptor.services.P2PLookupService
All Implemented Interfaces:
java.io.Serializable, UniversalService

public class P2PLookupService
extends java.lang.Object
implements UniversalService

This class represents a service to acquire ProActiveRuntime(JVMs) with the ProActive P2P infrastructure This service can be defined and used transparently when using XML Deployment descriptor

Since:
ProActive 2.0.1
Version:
1.0, 2004/09/20
Author:
ProActive Team
See Also:
Serialized Form

Field Summary
protected  int lookupFrequence
           
protected  int MAX
           
protected  int nodeCount
           
protected  int nodeNumber
           
protected  java.util.Vector peersList
           
protected static java.lang.String serviceName
           
protected  org.objectweb.proactive.p2p.core.service.P2PService serviceP2P
           
protected  long timeout
           
protected  int TTL
           
 
Constructor Summary
P2PLookupService()
           
 
Method Summary
 int getLookupFrequence()
           
 int getMAX()
           
 int getNodeNumber()
           
 java.lang.String getServiceName()
          Returns the name of the service.
 long getTimeout()
           
 int getTTL()
           
 void setLookupFrequence(int lookupFrequence)
          Sets the period of lookup.
 void setMAX(int max)
          Sets the Maximum number of nodes.
 void setNodeNumber(int nodeNumber)
          Sets the number of nodes to be acquired with this P2P service
 void setNodeNumberToMAX()
          Sets the number of nodes to be acquired to 10000(Max Value) This method is usefull to acquire an undefined number of nodes.
 void setPeerList(java.lang.String[] peerList)
           
 void setTimeout(long timeout)
           
 void setTTL(int ttl)
           
 ProActiveRuntime[] startService()
          Starts this Service
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serviceName

protected static java.lang.String serviceName

MAX

protected int MAX

nodeNumber

protected int nodeNumber

nodeCount

protected int nodeCount

timeout

protected long timeout

lookupFrequence

protected int lookupFrequence

TTL

protected int TTL

serviceP2P

protected org.objectweb.proactive.p2p.core.service.P2PService serviceP2P

peersList

protected java.util.Vector peersList
Constructor Detail

P2PLookupService

public P2PLookupService()
Method Detail

startService

public ProActiveRuntime[] startService()
                                throws ProActiveException
Description copied from interface: UniversalService
Starts this Service

Specified by:
startService in interface UniversalService
Returns:
an array of ProActiveRuntime
Throws:
ProActiveException
See Also:
UniversalService.startService()

getNodeNumber

public int getNodeNumber()
Returns:
Returns the nodeNumber.

setNodeNumber

public void setNodeNumber(int nodeNumber)
Sets the number of nodes to be acquired with this P2P service

Parameters:
nodeNumber - The nodeNumber to set.

setNodeNumberToMAX

public void setNodeNumberToMAX()
Sets the number of nodes to be acquired to 10000(Max Value) This method is usefull to acquire an undefined number of nodes. Indeed the number of nodes expected is never reached, the operation will be done again after lookupFrequence ms and if the timout has not expired


getTimeout

public long getTimeout()
Returns:
Returns the timeout.

setTimeout

public void setTimeout(long timeout)
Parameters:
timeout - The timeout to set.

getLookupFrequence

public int getLookupFrequence()
Returns:
Returns the lookupFrequence.

setLookupFrequence

public void setLookupFrequence(int lookupFrequence)
Sets the period of lookup. It means that every lookupFrequence(in ms) a P2P lookup will occur

Parameters:
lookupFrequence - The lookupFrequence to set.

getTTL

public int getTTL()
Returns:
Returns the TTL.

setTTL

public void setTTL(int ttl)
Parameters:
ttl - The TTL to set.

setPeerList

public void setPeerList(java.lang.String[] peerList)

getMAX

public int getMAX()
Returns:
the value of MAX attributes

setMAX

public void setMAX(int max)
Sets the Maximum number of nodes. Once this max number is reached the service provide access to acuired ProActiveRuntimes

Parameters:
max -

getServiceName

public java.lang.String getServiceName()
Description copied from interface: UniversalService
Returns the name of the service. The name is static, it means that it is the same name for all instances of a sefvice's class

Specified by:
getServiceName in interface UniversalService
Returns:
the static name of the service
See Also:
UniversalService.getServiceName()


Copyright ? October 2004 INRIA All Rights Reserved.