org.ourgrid.common.gump
Class BrokerAccessImpl

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.BrokerAccessImpl
All Implemented Interfaces:
java.io.Serializable, java.rmi.Remote, Gump

public class BrokerAccessImpl
extends OurgridUnicastRemoteObject
implements Gump

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Constructor Summary
BrokerAccessImpl(ObjectID brokerAccessID, EBPeerManagerFacade peerFacade)
          Default constructor.
BrokerAccessImpl(ObjectID brokerAccessID, EBPeerManagerFacade ebPeerManagerFacade, MGSecureClientSocketFactory secureClientSocketFactory, MGSecureServerSocketFactory secureServerSocketFactory, int securePort)
          Constructor with security options.
 
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 shutdown()
           
 void unwantedGum(long requestID, GumID gumID)
          Informs the provider that a given grid machine is not needed anymore.
 
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
equals, getRef, hashCode, toString, toStub
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BrokerAccessImpl

public BrokerAccessImpl(ObjectID brokerAccessID,
                        EBPeerManagerFacade peerFacade)
                 throws java.rmi.RemoteException
Default constructor.

Parameters:
brokerAccessID - ID used to identify this broker access.
peerFacade - Facade used to communicate with peer module.
Throws:
java.rmi.RemoteException

BrokerAccessImpl

public BrokerAccessImpl(ObjectID brokerAccessID,
                        EBPeerManagerFacade ebPeerManagerFacade,
                        MGSecureClientSocketFactory secureClientSocketFactory,
                        MGSecureServerSocketFactory secureServerSocketFactory,
                        int securePort)
                 throws java.rmi.RemoteException
Constructor with security options.

Parameters:
brokerAccessID - ID used to identify this broker access.
ebPeerManagerFacade - Facade used to communicate with peer module.
secureClientSocketFactory - The SecureClientSocketFactory.
secureServerSocketFactory - The SecureServerSocketFactory.
securePort - The port where the secure services will be bound.
Throws:
java.rmi.RemoteException
Method Detail

requestGums

public void requestGums(RequestSpec requestSpec)
                 throws java.rmi.RemoteException,
                        RequestAlreadyExistsException
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.
RequestAlreadyExistsException - another request with the same ID already exists
See Also:
Gump.requestGums(RequestSpec)

finishRequestGums

public void finishRequestGums(long requestID)
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.
See Also:
Gump.finishRequestGums(long)

disposeGum

public void disposeGum(long requestID,
                       GumID gumID)
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
See Also:
Gump.disposeGum(long, GumID)

pauseRequestGums

public void pauseRequestGums(long requestID)
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.
See Also:
Gump.pauseRequestGums(long)

resumeRequestGums

public void resumeRequestGums(long requestID)
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.
See Also:
Gump.resumeRequestGums(long)

getObjectID

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

Specified by:
getObjectID in interface Gump
Returns:
the provider identification.
See Also:
Gump.getObjectID()

shutdown

public void shutdown()

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.unwantedGum(long, org.ourgrid.common.id.GumID)