org.ourgrid.common.gump
Interface Gump

All Superinterfaces:
java.rmi.Remote
All Known Subinterfaces:
RemoteAccess
All Known Implementing Classes:
BindableMockGumpWrapper, BrokerAccessImpl, FakeGump, RemoteAccessImpl

public interface Gump
extends java.rmi.Remote

This interface represents a grid machine provider. It provides grid machines to consumers. The consumers that will receive the grid machines in the form of Gum instances, must implement the GumpClient interface. The consumers will receive Gums asynchronously through invocations of the GumpClient.hereIsGum() method.

There are no guarantee that the provider will return any grid machine at all. They will be provided accordingly to the availability and prioritizing policies of the Gump implementation. Moreover, the Gums provided may become unavailable at any time.

The request for Gums should work in the following way: When a consumer need grid machines it will invoke the method Gump#requestGums. The request will be registered at this provider and should receive Gums, if available. If a request is satisfied (i.e. it's got all the machines it's asked), the consumer should invoke the Gump#pauseRequest method, to tell the consumer it need no more Gums. If a machine currently allocated to a satisfied request is lost, the consumer will invoke the Gump#resumeRequest method. This will tell the provider that the request need machines again. When a request should be finished (i.e. the job is finished) the consumer should invoke the Gump#finishRequestGums at the provider. The provider will then take all the machines in use from the consumer, and clean the information about the request.

The methods Gump#requestGums, Gump#pauseRequest, Gump#resumeRequest and Gump#finishRequestGums must result in a broadcast to the entire Ourgrid community (i.e. all know peers).

This interface is part of the core interfaces of the OurGrid project, along with Gum and GumpClient. They define a general way of getting access to and use machines on a grid, abstracting differences on doing so.


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 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 unwantedGum(long requestID, GumID gumID)
          Informs the provider that a given grid machine is not needed anymore.
 

Method Detail

requestGums

void requestGums(RequestSpec requestSpec)
                 throws java.rmi.RemoteException,
                        RequestAlreadyExistsException
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).

Parameters:
requestSpec - specification of the request
Throws:
java.rmi.RemoteException - if some RMI error occurs during the method invocation.
RequestAlreadyExistsException - another request with the same ID already exists

finishRequestGums

void finishRequestGums(long requestID)
                       throws java.rmi.RemoteException
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).

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.

pauseRequestGums

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

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

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

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

disposeGum

void disposeGum(long requestID,
                GumID gumID)
                throws java.rmi.RemoteException
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.

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:
unwantedGum(long, GumID)

unwantedGum

void unwantedGum(long requestID,
                 GumID gumID)
                 throws java.rmi.RemoteException
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.

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:
disposeGum(long, GumID)

getObjectID

ObjectID getObjectID()
                     throws java.rmi.RemoteException
Returns the identification object related to this GridMachineProvider.

Returns:
the provider identification.
Throws:
java.rmi.RemoteException - if some RMI error occurs during the method invocation.