org.objectweb.proactive.ext.migration
Class MigrationStrategyImpl

java.lang.Object
  extended by org.objectweb.proactive.ext.migration.MigrationStrategyImpl
All Implemented Interfaces:
java.io.Serializable, MigrationStrategy

public class MigrationStrategyImpl
extends java.lang.Object
implements java.io.Serializable, MigrationStrategy

MigrationStrategyImpl contains destination. It allows us to program an Agent to follow an itinary so that it can perform automaticly some method upon arrival on a site. An migrationStrategy is instanciated by the user.

See Also:
Serialized Form

Constructor Summary
MigrationStrategyImpl()
          Creates an empty MigrationStrategyImpl
MigrationStrategyImpl(java.lang.String filename)
          Creates an itinary using a text-file.
 
Method Summary
 void add(Destination r)
          Adds a Destination to an itinary
 void add(java.lang.String nodeURL, java.lang.String method)
           
 void addNext(Destination r)
          Adds a Destination for the next migration
 void addNext(java.lang.String nodeURL, java.lang.String method)
           
 void decrease()
           
 Destination getCurrentDestination()
          Returns the current Destination.
 Destination getNextExcept(java.lang.String s)
          Returns the next destination in the migrationStrategy which is not s
 Destination next()
          Returns the next destination on the list and increase index by one.
 void remove(Destination d)
           
 void remove(java.lang.String nodeURL, java.lang.String method)
           
 void reset()
           
 int size()
           
 java.util.Vector<java.lang.String> toVector()
          Return a java.util.Vector made of strings representing the destinations
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MigrationStrategyImpl

public MigrationStrategyImpl()
Creates an empty MigrationStrategyImpl


MigrationStrategyImpl

public MigrationStrategyImpl(java.lang.String filename)
Creates an itinary using a text-file. Should implement verification of the existence of the methods to avoid problems at run-time.

Method Detail

add

public void add(Destination r)
Adds a Destination to an itinary

Specified by:
add in interface MigrationStrategy

add

public void add(java.lang.String nodeURL,
                java.lang.String method)
Specified by:
add in interface MigrationStrategy

addNext

public void addNext(Destination r)
Adds a Destination for the next migration

Specified by:
addNext in interface MigrationStrategy

addNext

public void addNext(java.lang.String nodeURL,
                    java.lang.String method)
Specified by:
addNext in interface MigrationStrategy

remove

public void remove(java.lang.String nodeURL,
                   java.lang.String method)
Specified by:
remove in interface MigrationStrategy

remove

public void remove(Destination d)
Specified by:
remove in interface MigrationStrategy

next

public Destination next()
Returns the next destination on the list and increase index by one. If there is no more destination, then return null

Specified by:
next in interface MigrationStrategy

getCurrentDestination

public Destination getCurrentDestination()
Returns the current Destination. Returns null if nothing is available


getNextExcept

public Destination getNextExcept(java.lang.String s)
Returns the next destination in the migrationStrategy which is not s


size

public int size()

decrease

public void decrease()

reset

public void reset()
Specified by:
reset in interface MigrationStrategy

toVector

public java.util.Vector<java.lang.String> toVector()
Return a java.util.Vector made of strings representing the destinations



Copyright 2001-2007 INRIA All Rights Reserved.