Execute works on getAddedCollection but not getChangedCollection
Aaron Helsinger
ahelsing at bbn.com
Thu Feb 1 08:46:59 EST 2007
The Added collection will only ever have an object _once_.
In particular:
When someone calls publishAdd (foo)
then anyone with a matching subscription will see 'foo' on their Added
Collection the next time that they execute -- and only then. After that,
it is no longer on the added collection.
The Changed collected will contain an object any time the object was
changed -- but again, only once per change.
So
plugin a calls publishChange(foo)
plugin B is woken up and the execute() method runs
If plugin B looks, it will see 'foo' on the Changed Collection.
when plugin B finishes its execute, the Changed list is cleared out.
So --- make sure that you are looking each time.
Also, you could try looking at the /tasks servlet or the History servlet
to look for your objects to make sure that they are there and changing
when you expect them to.
Or you could try looking at the subscription itself, not just the
added/changed lists, to see what objects are in your collection -- if
you dont care whether it just was added or changed, then just do
hypothesisSub.iterator()
Aaron Helsinger
BBN
James Livingood wrote:
> Hello all,
>
>
> I’ve subscribed to the object I want:
>
> HypothesisSub = (IncrementalSubscription)
> getBlackboardService().subscribe(HYPOTHESIS_PRED);
>
>
>
> And in my execute() I have:
>
> for (Iterator i = HypothesisSub.getAddedCollection().iterator();
> i.hasNext();) {
>
> // grabs all the information and puts it into MS SQL.
>
> }
>
> for (Iterator i = HypothesisSub.getChangedCollection().iterator();
> i.hasNext();) {
>
> // grab all the data AGAIN and put it into MS SQL
>
> }
>
>
>
> Why does the getAddedCollection run when the plugin is first started
> up, but the getChangedCollection does not run when objects that I've
> subscribed to change/new ones are added/etc?
>
>
>
>
>
> Thanks for any hints, information, things to check, etc.
>
> James
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Cougaar-developers mailing list
> Cougaar-developers at cougaar.org
> http://cougaar.org/mailman/listinfo/cougaar-developers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://cougaar.org/pipermail/cougaar-developers/attachments/20070201/b0b63892/attachment.html
More information about the Cougaar-developers
mailing list