YPService simple example

Todd Wright twright at bbn.com
Thu Aug 9 19:35:25 EDT 2007


Einhuf wrote:
> Thank you, I don´t need this complex example. I wrote a little 
> framework, where I use message passing by the blackboard and it works 
> well. The only thing what I had to consider was: If you call the 
> blackboard from a different thread some error occurs like ("calling 
> blabla from external transaction - or something like that). Because some 
> agents should provide user input I used user interfaces and they run on 
> a different thread than cougaar. Now I´m using this for each message 
> passing:
> 
> blackboard.openTransaction();
> blackboard.publishAdd(message);
> blackboard.closeTransaction();

Yes.

Another option is to put the message on a queue and have the "execute()" 
method publish the object.  This is illustrated in the PingSender 
plugin's use of a "TodoSubscription" to handle alarm callbacks:
http://cougaar.org/cgi-bin/viewcvs.cgi/ping/src/org/cougaar/demo/ping/PingSender.java?annotate=1.2&cvsroot=tutorials#128

A TodoSubscription is similar to a Swing "invokeLater", as noted in the 
Javadoc:
http://cougaar.cougaar.org/software/latest/javadoc/core/doc/api/org/cougaar/core/blackboard/TodoSubscription.html

> 
> What I really would still need is a simpler example of the DF 
> (YPService). I don´t know what the structure/schema is of the owl-s 
> files, if I had to produce the wsdl by myself or if they are even 
> necessary and many other open questions, where I am not sure if things 
> are needed or if they come from another feature the pizza example wants 
> to show. My version don´t run and no meaningful (to me) error message is 
> produced.

I don't know anything about how UDDI/OWL/WSDL/etc is used by the pizza 
demo, yp, or servicediscovery.  As Aaron notes, you'd have to look at 
the documentation provided by the above modules.

> 
> I would like to have a really simple example or step by step tutorial to 
> see what components are required and which not. The pizza example 
> includes features I don´t need, but I cannot follow all steps. But it 
> seems like there are no simple, single (not a whole usecase with many 
> features shown) examples for the basic features.

I agree that the pizza example is not a simple example.  For better or 
worse, it exercises all the UltraLog-developed code in one big, 
integrated example.

I agree that a more narrowly-focused yellow pages example would be very 
useful, whether that example uses the current "yp + servicediscovery" 
code or instead uses more primitive UDDI/OWL libraries.

> Because I have pressure 
> of time I can´t spend more time on the YP. I have to simulate an easy 
> own broker by a simple lookup agent. But if anybody has some code, where 
> I can get some hints to understand it better, please send it to me.

I think writing your own lookup agent will be the easiest solution.  You 
can send the directory "register" and "lookup" requests and responses 
via blackboard relays.  Your "lookup" agent's plugin's "execute()" 
method can implement a simple directory map.  If necessary, you can 
later replace this simple implementation with more powerful UDDI/OWL/etc 
code, as found on Google.

The existing "yp + servicediscovery" code might be a good long-term 
option, but unless somebody can help you to get it working then I 
suggest you avoid it.

Todd



More information about the Cougaar-developers mailing list