|
GridSim 5.0 beta | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object Thread Sim_entity GridSimCore GridInformationService
public class GridInformationService
A Grid Information Service (GIS) is an entity that provides grid
resource registration, indexing and discovery services. The Grid resources
tell their readiness to process Gridlets by registering themselves with
this entity, done via GridResource.body()
method.
In addition, GIS is now responsible for notifying all the registered
entities, such as GridResource and network entities for shutting down
at the end of a simulation.
GridSimShutdown
entity is not responsible anymore to
simplify the overall design, hence coding effort.
Other entities such as the resource broker can contact this class for resource discovery service, which returns a list of registered resource IDs. In summary, it acts like a yellow page service.
This class will be created by GridSim upon initialization of the simulation,
i.e. done via GridSim.init(int, Calendar, boolean)
method.
Hence, do not need to worry about creating an object of this class.
Since GridSim version 3.0, you can create your own GIS entity based on your requirements. Here are the steps needed (see example/Example09 directory for more details):
processOtherEvent(Sim_event)
method if you want
to register other tags apart from GridSimTags
.
GridSim.init(int, Calendar, boolean, boolean)
with
gis parameter is set to false.
GridSim.setGIS(GridInformationService)
method
before running or starting the simulation.
body()
method because
this method calls processOtherEvent(Sim_event)
for new tags.
Since GridSim version 3.2, this entity is referred as
system GIS. If you want to have multiple GIS entities or a regional
GIS entity linked as part of a network topology, then you should look at
AbstractGIS
entity (see examples/RegionalGIS
directory for more details).
Therefore, the roles of this system GIS in the overall simulation are:
GridSimTags
,
GridSimShutdown
,
GridSim.init(int, Calendar, boolean)
,
GridSim.init(int, Calendar, boolean, boolean)
,
GridSim.init(int, Calendar, boolean, String[], String[], String)
,
GridSim.setGIS(GridInformationService)
,
GridResource.body()
Nested Class Summary |
---|
Nested classes/interfaces inherited from class Thread |
---|
Thread.State, Thread.UncaughtExceptionHandler |
Field Summary |
---|
Fields inherited from class GridSimCore |
---|
input, NETWORK_TYPE, output |
Fields inherited from class Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
GridInformationService(String name,
double baud_rate)
Allocates a new GridInformationService object with networked I/O ports |
Method Summary | |
---|---|
void |
body()
A method that gets one event at a time, and serves it based on its request. |
LinkedList |
getAdvReservList()
Gets the list of GridResource IDs that only support Advanced Reservation. |
LinkedList |
getList()
Gets the list of all GridResource IDs, including resources that support Advance Reservation. |
boolean |
isResourceExist(int id)
Checks whether the given GridResource ID exists or not |
boolean |
isResourceExist(Integer id)
Checks whether the given GridResource ID exists or not |
protected void |
processEndSimulation()
Notifies the registered entities about the end of simulation. |
protected void |
processOtherEvent(Sim_event ev)
This method needs to override by a child class for processing other events. |
boolean |
resourceSupportAR(int id)
Checks whether a given resource ID supports Advanced Reservations or not |
boolean |
resourceSupportAR(Integer id)
Checks whether a given resource ID supports Advanced Reservations or not |
protected void |
signalShutdown(Collection list)
Sends a signal to all entity IDs mentioned in the given list. |
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 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 |
Constructor Detail |
---|
public GridInformationService(String name, double baud_rate) throws Exception
name
- the name to be associated with this entity (as
required by Sim_entity class from simjava package)baud_rate
- communication speed
Exception
- This happens when creating this entity before
initializing GridSim package or this entity name is
null or emptyGridSim.init(int, Calendar, boolean)
,
GridSim.init(int, Calendar, boolean, String[], String[],
String)
,
Sim_entity
Method Detail |
---|
public void body()
To process other tags apart from the above, you need to override
processOtherEvent(Sim_event)
method. You do not need to
override this method.
body
in class Sim_entity
public LinkedList getList()
public LinkedList getAdvReservList()
public boolean resourceSupportAR(Integer id)
id
- a resource ID
public boolean resourceSupportAR(int id)
id
- a resource ID
public boolean isResourceExist(int id)
id
- a GridResource id
public boolean isResourceExist(Integer id)
id
- a GridResource id
protected void processOtherEvent(Sim_event ev)
body()
method.
ev
- a Sim_event objectbody()
protected void processEndSimulation()
protected void signalShutdown(Collection list)
list
- LinkedList storing entity IDs
|
GridSim 5.0 beta | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |