Execute works on getAddedCollection but not getChangedCollection
Aaron Helsinger
ahelsing at bbn.com
Fri Feb 2 09:04:52 EST 2007
James Livingood wrote:
>
> Hello Aaron and Todd,
>
>
>
> If the other plugin doesn’t run publishChange(), is there still a way
> to detect changes to the objects?
>
If no one calls publishChange, then no one knows that the object has
changed. The purpose of the publishChange call is to notify plugins that
something has changed -- which causes them to wake up, and their execute
method to be called. This is also what puts the object on the
ChangedCollection.
If you do not call publishChange, then the object will not be on the
ChangedCollection -- and if it is old, it also wont be on the
AddedCollection. So your plugin wouldnt see it. Additionally,
Subscriptions are how your plugin knows that it has work to do and
should run. So if no one calls publishChange on the object, then your
plugin's subscriptions will think there is nothing new for your plugin
to do, so the plugin wont even run!
Even if your plugin were periodically running anyway (a different
subscription, or an Alarm),
the only way in this case to tell that the object has changed would be
to compare it with some previous memory of what the object looked like.
Correct Cougaar behavior is to call publishChange on any object
previously publishAdded to the Blackboard when you change it.
The full Java file that you sent doesnt look at the ChangedCollection,
so I assume this is a previous version.
Aaron
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://cougaar.org/pipermail/cougaar-developers/attachments/20070202/989ed7e0/attachment.html
More information about the Cougaar-developers
mailing list