83 |
|
PeerHandler dstPeer = (PeerHandler) peers.get(0); |
84 |
|
_station.sendAgent(this, dstPeer); |
85 |
|
} |
86 |
– |
say("No peers to move to...staying here."); |
86 |
|
} |
87 |
|
} |
88 |
|
|
91 |
|
public void onArrival(Station station) { |
92 |
|
_transmissionCount++; |
93 |
|
_station = station; |
94 |
+ |
_running = true; |
95 |
|
say("Just arrived at - " + _station.getName()); |
96 |
|
} |
97 |
|
|
115 |
|
* Used to shutdown this thread |
116 |
|
*/ |
117 |
|
public void shutdown() { |
118 |
+ |
say("shutting down"); |
119 |
|
_station = null; |
120 |
|
_running = false; |
121 |
|
} |
122 |
|
|
123 |
|
//*** OTHER PUBLIC METHODS *** |
124 |
< |
|
124 |
> |
|
125 |
|
//---PRIVATE/PROTECTED METHODS--- |
126 |
+ |
|
127 |
+ |
/** |
128 |
+ |
* Overridden for debugging purposes |
129 |
+ |
* to see when an instance of this class |
130 |
+ |
* is destroyed |
131 |
+ |
*/ |
132 |
+ |
protected void finalize() throws Throwable { |
133 |
+ |
say("dead - just been gc'd"); |
134 |
+ |
} |
135 |
|
|
136 |
|
//---ACCESSOR/MUTATOR METHODS--- |
137 |
|
|