|
From: <sul...@us...> - 2008-09-29 10:29:47
|
Revision: 248
http://gridsim.svn.sourceforge.net/gridsim/?rev=248&view=rev
Author: sulistio
Date: 2008-09-29 10:29:42 +0000 (Mon, 29 Sep 2008)
Log Message:
-----------
add a new protected method called sendInitialEvent() such that its child classes can send events before receiving incoming events.
Modified Paths:
--------------
trunk/source/gridsim/net/Router.java
Modified: trunk/source/gridsim/net/Router.java
===================================================================
--- trunk/source/gridsim/net/Router.java 2008-09-29 10:27:42 UTC (rev 247)
+++ trunk/source/gridsim/net/Router.java 2008-09-29 10:29:42 UTC (rev 248)
@@ -259,6 +259,7 @@
// methods to be overriden by children classes
advertiseHosts();
registerOtherEntity();
+ sendInitialEvent();
// Process incoming events
Sim_event ev = new Sim_event();
@@ -311,13 +312,14 @@
protected abstract void processEvent(Sim_event ev);
/**
- * Overrides this method when making a type of router.
- * This method is called by {@link #body()} to register other type to
+ * Overrides this method when making a new type of router.
+ * This method is called by the {@link #body()} method
+ * to register to other type of the
* {@link gridsim.GridInformationService} entity. In doing so, you
- * need to create a new child class extending from
- * {@link gridsim.GridInformationService}.
+ * need to create a new child class extending from the
+ * {@link gridsim.GridInformationService} class.
* <br>
- * <b>NOTE:</b> You do not need to override {@link #body()} method, if
+ * <b>NOTE:</b> You do not need to override the {@link #body()} method, if
* you use this method.
*
* @pre $none
@@ -327,6 +329,20 @@
protected void registerOtherEntity() {
// ... empty
}
+
+ /**
+ * Overrides this method when sending initial event(s) to itself or others
+ * <b>BEFORE</b> receiving incoming events from other entities.
+ * <br>
+ * <b>NOTE:</b> You do not need to override the {@link #body()} method, if
+ * you use this method.
+ *
+ * @pre $none
+ * @post $none
+ */
+ protected void sendInitialEvent() {
+ // ... empty
+ }
/**
* Writes a debug information to a file.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|