org.ourgrid.mygrid.scheduler.test
Class FakeGump

java.lang.Object
  extended by org.ourgrid.mygrid.scheduler.test.FakeGump
All Implemented Interfaces:
java.rmi.Remote, Gump

public class FakeGump
extends java.lang.Object
implements Gump

Fake object.


Field Summary
protected  int disposeOfCount
           
protected  int expectedDisposeOf
           
protected  int expectedLostGuM
           
protected  int expectedNoMoreGuMs
           
protected  int expectedWannaGuMs
           
protected  int lostGuMCount
           
protected  int noMoreGuMsCount
           
protected  int wannaGuMsCount
           
 
Constructor Summary
FakeGump()
           
 
Method Summary
 void disposeGum(long requestID, GumID gumID)
          Informs the provider that a given grid machine is not needed anymore.
 void finishRequestGums(long requestID)
          Informs the provider that it must stop providing grid machines for the consumer who made a given request.
 ObjectID getObjectID()
          Returns the identification object related to this GridMachineProvider.
 void lostGum(long requestId, GumID gumID)
           
 void pauseRequestGums(long requestID)
          Suspends a request for gums.
 void requestGums(RequestSpec requestSpec)
          Requests grid machines according to the specification contained in a RequestSpec.
 void resumeRequestGums(long requestID)
          Resumes a request for gums.
 void setExpectedDisposeOf(int expectedDisposeOf)
           
 void setExpectedLostGuM(int expectedLostGuM)
           
 void setExpectedNMoreGuMs(int expectedNoMoreGuMs)
           
 void setExpectedWannaGuMs(int expectedWannaGuMs)
           
 void unwantedGum(long requestID, GumID gumID)
          Informs the provider that a given grid machine is not needed anymore.
 void verify()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

expectedWannaGuMs

protected int expectedWannaGuMs

expectedNoMoreGuMs

protected int expectedNoMoreGuMs

expectedDisposeOf

protected int expectedDisposeOf

expectedLostGuM

protected int expectedLostGuM

wannaGuMsCount

protected int wannaGuMsCount

noMoreGuMsCount

protected int noMoreGuMsCount

disposeOfCount

protected int disposeOfCount

lostGuMCount

protected int lostGuMCount
Constructor Detail

FakeGump

public FakeGump()
Method Detail

setExpectedWannaGuMs

public void setExpectedWannaGuMs(int expectedWannaGuMs)

setExpectedNMoreGuMs

public void setExpectedNMoreGuMs(int expectedNoMoreGuMs)

setExpectedDisposeOf

public void setExpectedDisposeOf(int expectedDisposeOf)

setExpectedLostGuM

public void setExpectedLostGuM(int expectedLostGuM)

requestGums

public void requestGums(RequestSpec requestSpec)
                 throws java.rmi.RemoteException
Description copied from interface: Gump
Requests grid machines according to the specification contained in a RequestSpec. This event must be broadcasted to the entire Ourgrid community (that is, all know peers).

Specified by:
requestGums in interface Gump
Parameters:
requestSpec - specification of the request
Throws:
java.rmi.RemoteException - if some RMI error occurs during the method invocation.

finishRequestGums

public void finishRequestGums(long requestID)
                       throws java.rmi.RemoteException
Description copied from interface: Gump
Informs the provider that it must stop providing grid machines for the consumer who made a given request. This event must be broadcasted to the entire Ourgrid community (that is, all know peers).

Specified by:
finishRequestGums in interface Gump
Parameters:
requestID - the unique ID that represents the request that needs no more grid machines.
Throws:
java.rmi.RemoteException - if some RMI error occurs during the method invocation.

disposeGum

public void disposeGum(long requestID,
                       GumID gumID)
                throws java.rmi.RemoteException
Description copied from interface: Gump
Informs the provider that a given grid machine is not needed anymore. Thus, the grid machine can be rescheduled to other requests. The same machine may scheduled to the same consumer in the future, for the same request in case it needs machines again or for a completely new request. If it is required that the given request no longer receives the grid machine being disposed, the unwantedGum(long, org.ourgrid.common.id.GumID) call should be used.

This event must be forwarded to the gum owner, only.

Specified by:
disposeGum in interface Gump
Parameters:
requestID - the unique ID that represents the request that wants to dispose the grid machine.
gumID - identification of the grid machine
Throws:
java.rmi.RemoteException - if some RMI error occurs during the method invocation.
See Also:
Gump.unwantedGum(long, GumID)

lostGum

public void lostGum(long requestId,
                    GumID gumID)
             throws java.rmi.RemoteException
Throws:
java.rmi.RemoteException

verify

public void verify()

pauseRequestGums

public void pauseRequestGums(long requestID)
                      throws java.rmi.RemoteException
Description copied from interface: Gump
Suspends a request for gums. This event must be broadcasted to the entire Ourgrid community (that is, all know peers).

Specified by:
pauseRequestGums in interface Gump
Parameters:
requestID - the identification of the request that will be suspended.
Throws:
java.rmi.RemoteException - if some RMI error occurs during the method invocation.

resumeRequestGums

public void resumeRequestGums(long requestID)
                       throws java.rmi.RemoteException
Description copied from interface: Gump
Resumes a request for gums. This event must be broadcasted to the entire Ourgrid community (that is, all know peers).

Specified by:
resumeRequestGums in interface Gump
Parameters:
requestID - the identification of the request that will be resumed.
Throws:
java.rmi.RemoteException - if some RMI error occurs during the method invocation.

getObjectID

public ObjectID getObjectID()
                     throws java.rmi.RemoteException
Description copied from interface: Gump
Returns the identification object related to this GridMachineProvider.

Specified by:
getObjectID in interface Gump
Returns:
the provider identification.
Throws:
java.rmi.RemoteException - if some RMI error occurs during the method invocation.

unwantedGum

public void unwantedGum(long requestID,
                        GumID gumID)
                 throws java.rmi.RemoteException
Description copied from interface: Gump
Informs the provider that a given grid machine is not needed anymore. Thus, the grid machine can be rescheduled to other requests. Different from the disposeGum(long, org.ourgrid.common.id.GumID), when a Peer receives this call it will no longer deliver this machines to the same request.

This event must be forwarded to the gum owner, only.

Specified by:
unwantedGum in interface Gump
Parameters:
requestID - the unique ID that represents the request which no longer wants this grid machine.
gumID - identification of the grid machine
Throws:
java.rmi.RemoteException - if some RMI error occurs during the method invocation.
See Also:
Gump.disposeGum(long, GumID)