GridSim 5.0 beta

gridsim
Class GridSimShutdown

Object
  extended by Thread
      extended by Sim_entity
          extended by GridSimCore
              extended by GridSimShutdown
All Implemented Interfaces:
Cloneable, Runnable

public class GridSimShutdown
extends GridSimCore

GridSimShutdown waits for termination of all GridSim user entities to determine the end of simulation.

This class will be created by GridSim upon initialization of the simulation, i.e. done via GridSim.init() method. Hence, do not need to worry about creating an object of this class.

This class signals the user-defined report-writer entity to interact with the GridStatistics entity to generate a report. Finally, it signals the end of simulation to GridInformationService (GIS) entity.

Since:
GridSim Toolkit 1.0
Author:
Manzur Murshed and Rajkumar Buyya
See Also:
GridSim.init(int, Calendar, boolean), GridSim.init(int, Calendar, boolean, String[], String[], String)
Invariant:
$none

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
GridSimShutdown(String name, int numUser)
          Allocates a new GridSimShutdown object.
GridSimShutdown(String name, int numUser, String reportWriterName)
          Allocates a new GridSimShutdown object.
 
Method Summary
 void body()
          The main method that shuts down resources and Grid Information Service (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
 

Constructor Detail

GridSimShutdown

public GridSimShutdown(String name,
                       int numUser,
                       String reportWriterName)
                throws Exception
Allocates a new GridSimShutdown object.

The total number of grid user entity plays an important role to determine whether all resources should be shut down or not. If one or more users are still not finish, then the resources will not be shut down. Therefore, it is important to give a correct number of total grid user entity. Otherwise, GridSim program will hang or encounter a weird behaviour.

Parameters:
name - the name to be associated with this entity (as required by Sim_entity class from simjava package)
numUser - total number of grid user entity
reportWriterName - a ReportWriter entity name. This entity can be found inside a gridbroker package.
Throws:
Exception - This happens when creating this entity before initializing GridSim package or this entity name is null or empty
See Also:
GridSim.init(int, Calendar, boolean, String[], String[], String), GridSim.init(int, Calendar, boolean), Sim_entity
Pre Condition:
name != null, numUser >= 0
Post Condition:
$none

GridSimShutdown

public GridSimShutdown(String name,
                       int numUser)
                throws Exception
Allocates a new GridSimShutdown object.

The total number of grid user entity plays an important role to determine whether all resources should be shut down or not. If one or more users are still not finish, then the resources will not be shut down. Therefore, it is important to give a correct number of total grid user entity. Otherwise, GridSim program will hang or encounter a weird behaviour.

Parameters:
name - the name to be associated with this entity (as required by Sim_entity class from simjava package)
numUser - total number of grid user entity
Throws:
Exception - This happens when creating this entity before initializing GridSim package or this entity name is null or empty
See Also:
GridSim.init(int, Calendar, boolean, String[], String[], String), GridSim.init(int, Calendar, boolean), Sim_entity
Pre Condition:
name != null, numUser >= 0
Post Condition:
$none
Method Detail

body

public void body()
The main method that shuts down resources and Grid Information Service (GIS). In addition, this method writes down a report at the end of a simulation based on reportWriterName defined in the Constructor.
NOTE: This method shuts down grid resources and GIS entities AFTER all grid users have been shut down. Therefore, the number of grid users given in the Constructor must be correct. Otherwise, GridSim package hangs forever or it does not terminate properly.

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

GridSim 5.0 beta

The University of Melbourne, Australia, 2009