Simple Question about execute()
Matt Abrams
abramsm at gmail.com
Mon Jan 15 13:26:58 EST 2007
James -
Your iterator is on the "added" collection. An subscription will
invoke the execute method of your plugin when the objects that match
your predicate are added, changed, or removed. If you'd like to
process changed objects as well as added objects then you should have
another snippet of code like:
> for (Iterator i = HypothesisSub.getChangedCollection().iterator();
> i.hasNext();) {
Matt
On Jan 15, 2007, at 1:21 PM, James Livingood wrote:
> Hello all,
>
>
>
> I am new to Cougaar development and am having trouble with a plugin
> I created. My plugin simply monitors objects on the blackboard and
> puts them into a Microsoft SQL database.
>
>
>
> 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();) {
>
>
>
> which grabs all the information and puts it into MS SQL.
>
>
>
> I get information in my MS SQL when I first subscribe, but not when
> objects on the blackboard change. Doesn’t execute() run every time
> an object (that I have a subscription to) change? If not, what do I
> have to do?
>
>
>
>
>
> Thanks for any information!
>
>
>
>
>
> 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/20070115/f499f624/attachment.html
More information about the Cougaar-developers
mailing list