Lightweight Bartering Grid

lbg.peer.core.rms
Class ResourceLocator

java.lang.Object
  extended by lbg.peer.core.rms.ResourceLocator

public class ResourceLocator
extends java.lang.Object

A ResourceLocator tracks Task -> Resource mappings so as to locate the Resource running a given Task.

Author:
Cyril Briquet

Nested Class Summary
static class ResourceLocator.ResourceLocatorKey
          Helper class of ResourceLocator.
 
Constructor Summary
ResourceLocator(Peer managed_peer)
           
 
Method Summary
 ResourceHandle locateAndCheckBusyLocalResource(Task t)
          Locates a Busy Local Resource running target Task (guaranteed to be non-null).
 ResourceHandle locateAndCheckBusySupplyingResource(Task t)
          Locates a Busy Supplying Resource running target Task (guaranteed to be non-null).
 ResourceHandle locateBusyLocalResource(Task t)
          Locates a Busy Local Resource running target Task (may be null).
 ResourceHandle locateBusySupplyingResource(Task t)
          Locates a Busy Supplying Resource running target Task (may be null).
 java.lang.String toString()
           
 void trackBusyLocalResource(Task t, ResourceHandle rh)
           
 void trackBusySupplyingResource(Task t, ResourceHandle rh)
           
 void untrackBusyLocalResource(Task t)
           
 void untrackBusySupplyingResource(Task t)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ResourceLocator

public ResourceLocator(Peer managed_peer)
                throws GridException
Throws:
GridException
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

trackBusyLocalResource

public void trackBusyLocalResource(Task t,
                                   ResourceHandle rh)
                            throws GridException
Throws:
GridException

trackBusySupplyingResource

public void trackBusySupplyingResource(Task t,
                                       ResourceHandle rh)
                                throws GridException
Throws:
GridException

untrackBusyLocalResource

public void untrackBusyLocalResource(Task t)
                              throws GridException
Throws:
GridException

untrackBusySupplyingResource

public void untrackBusySupplyingResource(Task t)
                                  throws GridException
Throws:
GridException

locateBusyLocalResource

public ResourceHandle locateBusyLocalResource(Task t)
                                       throws GridException
Locates a Busy Local Resource running target Task (may be null).

Parameters:
t - target Task
Returns:
Busy Local Resource running target Task, or null if there no such Resource can be found
Throws:
GridException - if a parameter is illegal

locateBusySupplyingResource

public ResourceHandle locateBusySupplyingResource(Task t)
                                           throws GridException
Locates a Busy Supplying Resource running target Task (may be null).

Parameters:
t - target Task
Returns:
Busy Supplying Resource running target Task, or null if there no such Resource can be found
Throws:
GridException - if a parameter is illegal

locateAndCheckBusyLocalResource

public ResourceHandle locateAndCheckBusyLocalResource(Task t)
                                               throws GridException
Locates a Busy Local Resource running target Task (guaranteed to be non-null).

Parameters:
t - target Task
Returns:
Busy Local Resource running target Task (guaranteed to be non-null)
Throws:
GridException - if a parameter is illegal or if no such Resource may be found

locateAndCheckBusySupplyingResource

public ResourceHandle locateAndCheckBusySupplyingResource(Task t)
                                                   throws GridException
Locates a Busy Supplying Resource running target Task (guaranteed to be non-null).

Parameters:
t - target Task
Returns:
Busy Supplying Resource running target Task (guaranteed to be non-null)
Throws:
GridException - if a parameter is illegal or if no such Resource may be found

Lightweight Bartering Grid

Copyright (c) 2005-2008, Cyril Briquet, parts Xavier Dalem.