org.ourgrid.peer.manager.gummanager
Class EBGumManagerImpl

java.lang.Object
  extended by org.ourgrid.peer.manager.gummanager.EBGumManagerImpl
Direct Known Subclasses:
FakeEBGumManagerImpl

public class EBGumManagerImpl
extends java.lang.Object

A EBGumManagerImpl controls GuMs that can be used by the peer. Dealing with local GuMs, it is notified about states change at a GridMachine that it knows and also notifies the EBPeerManager. When dealing with received GuMs from another peer, it will create a Proxy and hold information about its state. This is done by methods that create and remove proxies. When the Grid Machine is lost, EBGumManagerImpl MUST receive an invalidate call so it will remove the proxy.


Field Summary
protected  java.util.Map<GumID,GumProxy> gumProxies
          A Map of gums associating a gum name with a gumProxy.
 
Constructor Summary
EBGumManagerImpl(EBPeerManager peerManager, EBPeerManagerFacade peerManagerFacade)
          Default constructor of the EBGumManagerImpl.
 
Method Summary
 GumProxy createAndSetProxy(EBGum ebGuM, long requestID)
          Sets the proxy associated to the given EBGum.
protected  java.util.Collection<GumSpec> getGumSpecs()
           
 java.util.Collection<GumSpec> getOfflineGums()
           
 java.util.Collection<GumSpec> getOnlineGums()
           
 java.util.Collection<GumSpec> getOwnerGums()
           
 java.util.Map<GumID,GumProxy> getProxies()
           
 void invalidate(GumID gumID)
          Invalidates the proxy related to the given EBGridMachine.
 void notifyGumStateChange(GumID gumID, GumStatus gumState)
           
 GumProxy removeProxy(GumID gumID)
           
 void setGums(java.util.Collection<GumSpec> gumSpecList)
          Sets the collection of gums to be managed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

gumProxies

protected java.util.Map<GumID,GumProxy> gumProxies
A Map of gums associating a gum name with a gumProxy.

Constructor Detail

EBGumManagerImpl

public EBGumManagerImpl(EBPeerManager peerManager,
                        EBPeerManagerFacade peerManagerFacade)
Default constructor of the EBGumManagerImpl.

Method Detail

notifyGumStateChange

public void notifyGumStateChange(GumID gumID,
                                 GumStatus gumState)

setGums

public void setGums(java.util.Collection<GumSpec> gumSpecList)
Sets the collection of gums to be managed.

Parameters:
gumSpecList - A collection of GuMSpecs that represents the gums to be managedgumManagerEntries.

createAndSetProxy

public GumProxy createAndSetProxy(EBGum ebGuM,
                                  long requestID)
                           throws java.rmi.RemoteException
Sets the proxy associated to the given EBGum.

Parameters:
requestID -
Returns:
The proxy that was just set.
Throws:
java.rmi.RemoteException - Was not possible create this proxy due to a communication failure with the received Gum.

invalidate

public void invalidate(GumID gumID)
Invalidates the proxy related to the given EBGridMachine.

Parameters:
gumID - EBGridMachine which the related proxy must be invalidated

removeProxy

public GumProxy removeProxy(GumID gumID)

getProxies

public java.util.Map<GumID,GumProxy> getProxies()

getOfflineGums

public java.util.Collection<GumSpec> getOfflineGums()

getOnlineGums

public java.util.Collection<GumSpec> getOnlineGums()

getOwnerGums

public java.util.Collection<GumSpec> getOwnerGums()

getGumSpecs

protected java.util.Collection<GumSpec> getGumSpecs()