GridSim 5.0 beta

gridsim.index
Class AbstractGIS

Object
  extended by Thread
      extended by Sim_entity
          extended by GridSimCore
              extended by AbstractGIS
All Implemented Interfaces:
Cloneable, Runnable
Direct Known Subclasses:
RegionalGIS, RegionalGISWithFailure

public abstract class AbstractGIS
extends GridSimCore

AbstractGIS is an abstract class which aims to provide skeletons for its chid classes to implement the required base functionalities of a regional GridInformationService (GIS).

Since:
GridSim Toolkit 3.2
Author:
Anthony Sulistio
Invariant:
$none

Nested Class Summary
 
Nested classes/interfaces inherited from class Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
static int GIS_INQUIRY_RESOURCE_AR_LIST
          Denotes an inquiry regarding to a list of local resources, which supports advanced reservation.
static int GIS_INQUIRY_RESOURCE_AR_RESULT
          Denotes a result regarding to a list of local resources, which supports advanced reservation.
static int GIS_INQUIRY_RESOURCE_LIST
          Denotes an inquiry regarding to a list of local resources.
static int GIS_INQUIRY_RESOURCE_RESULT
          Denotes a result regarding to a list of local resources.
static int INQUIRY_GLOBAL_RESOURCE_AR_LIST
          Denotes a list of resources, which support advanced reservation, that are listed in other regional GIS entities.
static int INQUIRY_GLOBAL_RESOURCE_LIST
          Denotes a list of resources that are listed in other regional GIS entities.
static int INQUIRY_LOCAL_RESOURCE_AR_LIST
          Denotes a list of resources, that only support advance reservation, that are listed in this regional GIS entity.
static int INQUIRY_LOCAL_RESOURCE_LIST
          Denotes a list of all resources, including the ones that can support advance reservation, that are listed in this regional GIS entity.
static int INQUIRY_REGIONAL_GIS
          Denotes a list of regional GIS IDs, including this entity ID.
static int NOTIFY_GIS_RESOURCE_FAILURE
          Denotes an inquiry regarding to a resource failure.
static int REGISTER_REGIONAL_GIS
          Registers this regional GIS to the GridInformationService or system GIS.
static int REGISTER_RESOURCE
          Denotes a grid resource to be registered to this regional GIS entity.
static int REGISTER_RESOURCE_AR
          Denotes a grid resource, that can support advance reservation, to be registered to this regional GIS entity.
protected  int systemGIS_
          System GIS or GridInformationService entity ID.
 
Fields inherited from class GridSimCore
input, NETWORK_TYPE, output
 
Fields inherited from class Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
protected AbstractGIS(String name, Link link)
          Creates a new regional GIS entity
 
Method Summary
 void body()
          Handles incoming requests to this entity, DO NOT OVERRIDE this method.
protected  boolean notifySystemGIS(Sim_event ev, int tag)
          Notify GridInformationService or system GIS about a specific request as defined in the tag name.
NOTE: ev.get_data() should contain an Integer object
protected abstract  void processEndSimulation()
          Informs the registered entities regarding to the end of a simulation.
protected abstract  void processGISResourceARList(Sim_event ev)
          Process an incoming request from other GIS entities about getting a list of resource IDs supporting Advanced Reservation, that are registered to this regional GIS entity.
protected abstract  void processGISResourceARResult(Sim_event ev)
          Process an incoming delivery from other GIS entities about their resource list supporting Advanced Reservation.
protected abstract  void processGISResourceList(Sim_event ev)
          Process an incoming request from other GIS entities about getting a list of resource IDs, that are registered to this regional GIS entity.
protected abstract  void processGISResourceResult(Sim_event ev)
          Process an incoming delivery from other GIS entities about their resource list.
protected abstract  void processGlobalResourceARList(Sim_event ev)
          Process an incoming request from users about getting a list of resource IDs supporting Advanced Reservation, that are registered in other regional GIS entities.
protected abstract  void processGlobalResourceList(Sim_event ev)
          Process an incoming request from users about getting a list of resource IDs, that are registered in other regional GIS entities.
protected abstract  void processInquiryRegionalGIS(Sim_event ev)
          Process an incoming request about getting a list of regional GIS IDs (including this entity ID), that are registered to the GridInformationService or system GIS.
protected abstract  void processOtherEvent(Sim_event ev)
          Process an incoming request that uses a user-defined tag.
protected abstract  void processRegisterResource(Sim_event ev)
          Process a registration request from a resource entity to this regional GIS entity.
protected abstract  void processRegisterResourceAR(Sim_event ev)
          Process a registration request from a resource entity supporting Advanced Reservation to this regional GIS entity.
protected abstract  void processResourceARList(Sim_event ev)
          Process an incoming request from users about getting a list of resource IDs supporting Advanced Reservation, that are registered to this regional GIS entity.
protected abstract  void processResourceList(Sim_event ev)
          Process an incoming request from users about getting a list of resource IDs, that are registered to this regional GIS entity.
protected abstract  void registerOtherEntity()
          Registers other information to GridInformationService or system GIS.
 
Methods inherited from class GridSimCore
finalizeGridSimulation, getLink, getPingResult, isNetworked, ping, ping, ping, ping, pingBlockingCall, pingBlockingCall, pingBlockingCall, pingBlockingCall, send, send, send, send, send, send, setBackgroundTraffic, setBackgroundTraffic, terminateIOEntities
 
Methods inherited from class Sim_entity
add_generator, add_param, add_port, clone, get_id, get_name, get_port, get_port, get_stat, run, send_on, set_invisible, set_stat, sim_cancel, sim_completed, sim_current, sim_get_next, sim_get_next, sim_hold_for, sim_hold, sim_pause_for, sim_pause_for, sim_pause_until, sim_pause_until, sim_pause, sim_process_for, sim_process_for, sim_process_until, sim_process_until, sim_process, sim_putback, sim_schedule, sim_schedule, sim_schedule, sim_schedule, sim_schedule, sim_schedule, sim_select, sim_trace, sim_wait_for, sim_wait_for, sim_wait_for, sim_wait, sim_waiting, sim_waiting
 
Methods inherited from class Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

systemGIS_

protected int systemGIS_
System GIS or GridInformationService entity ID.


REGISTER_REGIONAL_GIS

public static final int REGISTER_REGIONAL_GIS
Registers this regional GIS to the GridInformationService or system GIS. This tag should be called from Regional GIS to the system GIS.

See Also:
Constant Field Values

REGISTER_RESOURCE

public static final int REGISTER_RESOURCE
Denotes a grid resource to be registered to this regional GIS entity. This tag is similar to GridSimTags.REGISTER_RESOURCE. This tag should be called from Regional GIS to the system GIS.

See Also:
Constant Field Values

REGISTER_RESOURCE_AR

public static final int REGISTER_RESOURCE_AR
Denotes a grid resource, that can support advance reservation, to be registered to this regional GIS entity. This tag is similar to GridSimTags.REGISTER_RESOURCE_AR. This tag should be called from Regional GIS to the system GIS.

See Also:
Constant Field Values

INQUIRY_LOCAL_RESOURCE_LIST

public static final int INQUIRY_LOCAL_RESOURCE_LIST
Denotes a list of all resources, including the ones that can support advance reservation, that are listed in this regional GIS entity. This tag is similar to GridSimTags.RESOURCE_LIST. This tag should be called from a user to Regional GIS.

See Also:
Constant Field Values

INQUIRY_LOCAL_RESOURCE_AR_LIST

public static final int INQUIRY_LOCAL_RESOURCE_AR_LIST
Denotes a list of resources, that only support advance reservation, that are listed in this regional GIS entity. This tag is similar to GridSimTags.RESOURCE_AR_LIST. This tag should be called from a user to Regional GIS.

See Also:
Constant Field Values

INQUIRY_GLOBAL_RESOURCE_LIST

public static final int INQUIRY_GLOBAL_RESOURCE_LIST
Denotes a list of resources that are listed in other regional GIS entities. This tag should be called from a user to Regional GIS.

See Also:
Constant Field Values

INQUIRY_GLOBAL_RESOURCE_AR_LIST

public static final int INQUIRY_GLOBAL_RESOURCE_AR_LIST
Denotes a list of resources, which support advanced reservation, that are listed in other regional GIS entities. This tag should be called from a user to Regional GIS.

See Also:
Constant Field Values

INQUIRY_REGIONAL_GIS

public static final int INQUIRY_REGIONAL_GIS
Denotes a list of regional GIS IDs, including this entity ID. This tag should be called from a user to Regional GIS.

See Also:
Constant Field Values

GIS_INQUIRY_RESOURCE_LIST

public static final int GIS_INQUIRY_RESOURCE_LIST
Denotes an inquiry regarding to a list of local resources. This tag should be called from a Regional GIS to another.

See Also:
Constant Field Values

GIS_INQUIRY_RESOURCE_RESULT

public static final int GIS_INQUIRY_RESOURCE_RESULT
Denotes a result regarding to a list of local resources. This tag should be called from a Regional GIS to a sender Regional GIS.

See Also:
Constant Field Values

GIS_INQUIRY_RESOURCE_AR_LIST

public static final int GIS_INQUIRY_RESOURCE_AR_LIST
Denotes an inquiry regarding to a list of local resources, which supports advanced reservation. This tag should be called from a Regional GIS to another.

See Also:
Constant Field Values

GIS_INQUIRY_RESOURCE_AR_RESULT

public static final int GIS_INQUIRY_RESOURCE_AR_RESULT
Denotes a result regarding to a list of local resources, which supports advanced reservation. This tag should be called from a Regional GIS to a sender Regional GIS.

See Also:
Constant Field Values

NOTIFY_GIS_RESOURCE_FAILURE

public static final int NOTIFY_GIS_RESOURCE_FAILURE
Denotes an inquiry regarding to a resource failure. The user sends this tag to the GIS to update its list of resources.

See Also:
Constant Field Values
Constructor Detail

AbstractGIS

protected AbstractGIS(String name,
                      Link link)
               throws Exception
Creates a new regional GIS entity

Parameters:
name - this regional GIS name
link - a network link to this entity
Throws:
Exception - This happens when creating this entity before initializing GridSim package or this entity name is null or empty
Pre Condition:
name != null, link != null
Post Condition:
$none
Method Detail

body

public void body()
Handles incoming requests to this entity, DO NOT OVERRIDE this method. Implement the abstract methods instead.

Overrides:
body in class Sim_entity
Pre Condition:
$none
Post Condition:
$none

processGlobalResourceARList

protected abstract void processGlobalResourceARList(Sim_event ev)
Process an incoming request from users about getting a list of resource IDs supporting Advanced Reservation, that are registered in other regional GIS entities.

Parameters:
ev - a Sim_event object (or an incoming event or request)
Pre Condition:
ev != null
Post Condition:
$none

processGlobalResourceList

protected abstract void processGlobalResourceList(Sim_event ev)
Process an incoming request from users about getting a list of resource IDs, that are registered in other regional GIS entities.

Parameters:
ev - a Sim_event object (or an incoming event or request)
Pre Condition:
ev != null
Post Condition:
$none

processResourceList

protected abstract void processResourceList(Sim_event ev)
Process an incoming request from users about getting a list of resource IDs, that are registered to this regional GIS entity.

Parameters:
ev - a Sim_event object (or an incoming event or request)
Pre Condition:
ev != null
Post Condition:
$none

processResourceARList

protected abstract void processResourceARList(Sim_event ev)
Process an incoming request from users about getting a list of resource IDs supporting Advanced Reservation, that are registered to this regional GIS entity.

Parameters:
ev - a Sim_event object (or an incoming event or request)
Pre Condition:
ev != null
Post Condition:
$none

processGISResourceList

protected abstract void processGISResourceList(Sim_event ev)
Process an incoming request from other GIS entities about getting a list of resource IDs, that are registered to this regional GIS entity.

Parameters:
ev - a Sim_event object (or an incoming event or request)
Pre Condition:
ev != null
Post Condition:
$none

processGISResourceARList

protected abstract void processGISResourceARList(Sim_event ev)
Process an incoming request from other GIS entities about getting a list of resource IDs supporting Advanced Reservation, that are registered to this regional GIS entity.

Parameters:
ev - a Sim_event object (or an incoming event or request)
Pre Condition:
ev != null
Post Condition:
$none

processGISResourceResult

protected abstract void processGISResourceResult(Sim_event ev)
Process an incoming delivery from other GIS entities about their resource list.
NOTE: ev.get_data() should contain List containing resource IDs (in Integer object).

Parameters:
ev - a Sim_event object (or an incoming event or request)
Pre Condition:
ev != null
Post Condition:
$none

processGISResourceARResult

protected abstract void processGISResourceARResult(Sim_event ev)
Process an incoming delivery from other GIS entities about their resource list supporting Advanced Reservation.
NOTE: ev.get_data() should contain List containing resource IDs (in Integer object).

Parameters:
ev - a Sim_event object (or an incoming event or request)
Pre Condition:
ev != null
Post Condition:
$none

processRegisterResourceAR

protected abstract void processRegisterResourceAR(Sim_event ev)
Process a registration request from a resource entity supporting Advanced Reservation to this regional GIS entity.
NOTE: ev.get_data() should contain an Integer object representing the resource ID.

Parameters:
ev - a Sim_event object (or a registration request)
Pre Condition:
ev != null
Post Condition:
$none

processRegisterResource

protected abstract void processRegisterResource(Sim_event ev)
Process a registration request from a resource entity to this regional GIS entity.
NOTE: ev.get_data() should contain an Integer object representing the resource ID.

Parameters:
ev - a Sim_event object (or a registration request)
Pre Condition:
ev != null
Post Condition:
$none

processInquiryRegionalGIS

protected abstract void processInquiryRegionalGIS(Sim_event ev)
Process an incoming request about getting a list of regional GIS IDs (including this entity ID), that are registered to the GridInformationService or system GIS.

Parameters:
ev - a Sim_event object (or an incoming event or request)
Pre Condition:
ev != null
Post Condition:
$none

processOtherEvent

protected abstract void processOtherEvent(Sim_event ev)
Process an incoming request that uses a user-defined tag. This method is useful for creating a new regional GIS entity.

Parameters:
ev - a Sim_event object (or an incoming event or request)
Pre Condition:
ev != null
Post Condition:
$none

registerOtherEntity

protected abstract void registerOtherEntity()
Registers other information to GridInformationService or system GIS.

Pre Condition:
$none
Post Condition:
$none

processEndSimulation

protected abstract void processEndSimulation()
Informs the registered entities regarding to the end of a simulation.

Pre Condition:
$none
Post Condition:
$none

notifySystemGIS

protected boolean notifySystemGIS(Sim_event ev,
                                  int tag)
Notify GridInformationService or system GIS about a specific request as defined in the tag name.
NOTE: ev.get_data() should contain an Integer object

Parameters:
ev - a Sim_event object (or requests to be sent to system GIS)
tag - a tag name or type of request
Returns:
true if a request has been sent, false otherwise
Pre Condition:
ev != null
Post Condition:
$none

GridSim 5.0 beta

The University of Melbourne, Australia, 2009