org.ourgrid.common.gump
Class RemoteFakeGumpClient

java.lang.Object
  extended by java.rmi.server.RemoteObject
      extended by java.rmi.server.RemoteServer
          extended by java.rmi.server.UnicastRemoteObject
              extended by org.ourgrid.common.rmi.OurgridUnicastRemoteObject
                  extended by org.ourgrid.common.gump.RemoteFakeGumpClient
All Implemented Interfaces:
java.io.Serializable, java.rmi.Remote, GumpClient

public class RemoteFakeGumpClient
extends OurgridUnicastRemoteObject
implements GumpClient

See Also:
Serialized Form

Field Summary
protected  int expectedHereIsGuM
           
protected  int hereIsGuMCount
           
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Constructor Summary
RemoteFakeGumpClient(ObjectID objectid)
           
RemoteFakeGumpClient(ObjectID objectid, java.util.concurrent.CountDownLatch verficationCountDownLatch)
           
RemoteFakeGumpClient(java.lang.String objectIdUrl)
           
 
Method Summary
 boolean equals(java.lang.Object o)
           
 java.util.List<GumResponseEntry> getGumResponseList()
           
 ObjectID getObjectID()
          Returns the Identification object related to this GumpClient.
 java.util.concurrent.CountDownLatch getVerficationCountDownLatch()
           
 void hereIsGum(GumResponseEntry gumResponseEntry)
           Delivers a grid machine (Gum) to this consumer.
 void setExpectedHereIsGum(int expectedHereIsGuM, java.lang.Object... args)
           
 java.lang.String toString()
           
 void verify()
           
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, unexportObject
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
getRef, hashCode, toStub
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

expectedHereIsGuM

protected int expectedHereIsGuM

hereIsGuMCount

protected int hereIsGuMCount
Constructor Detail

RemoteFakeGumpClient

public RemoteFakeGumpClient(java.lang.String objectIdUrl)
                     throws java.rmi.RemoteException
Throws:
java.rmi.RemoteException

RemoteFakeGumpClient

public RemoteFakeGumpClient(ObjectID objectid)
                     throws java.rmi.RemoteException
Throws:
java.rmi.RemoteException

RemoteFakeGumpClient

public RemoteFakeGumpClient(ObjectID objectid,
                            java.util.concurrent.CountDownLatch verficationCountDownLatch)
                     throws java.rmi.RemoteException
Throws:
java.rmi.RemoteException
Method Detail

setExpectedHereIsGum

public void setExpectedHereIsGum(int expectedHereIsGuM,
                                 java.lang.Object... args)

hereIsGum

public void hereIsGum(GumResponseEntry gumResponseEntry)
               throws java.rmi.RemoteException
Description copied from interface: GumpClient

Delivers a grid machine (Gum) to this consumer. The grid machine satisfies the requirements of a specific request made by this consumer. The respective request is informed through a requestID which travels inside the parameter of type GumResponseEntry, which also contains a reference to the Gum, a gum specification (GumSpec) and a ID of the grid machine provider.

The grid machine availability has no guarantees. It may become unavailable due to failures or to the provider's will. For example, the provider may decide to schedule the grid machine to another consumer.

Also, it is expected that the consumer releases the Gum when it does not need it anymore. To do this the consumer must invoke the method Gump.finishRequestGums() .

Specified by:
hereIsGum in interface GumpClient
Parameters:
gumResponseEntry - an object containing the information about the delivery. It contains a reference to the Gum, a gum specification (GumSpec) and a ID of the grid machine provider.
Throws:
java.rmi.RemoteException - if some RMI error occurs during the method invocation.

getVerficationCountDownLatch

public java.util.concurrent.CountDownLatch getVerficationCountDownLatch()

verify

public void verify()

getObjectID

public ObjectID getObjectID()
Description copied from interface: GumpClient
Returns the Identification object related to this GumpClient.

Specified by:
getObjectID in interface GumpClient
Returns:
the consumer identification.

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.rmi.server.RemoteObject

toString

public java.lang.String toString()
Overrides:
toString in class java.rmi.server.RemoteObject

getGumResponseList

public java.util.List<GumResponseEntry> getGumResponseList()