Re: Entries, ServiceTemplates, and JavaSpaces
Dan Creswell <[email protected]>
| Newsgroups | gmane.comp.java.sun.javaspaces |
|---|---|
| Message-ID | <[email protected]> |
Jeff Ramsdale wrote: >>What prompted the thoughts of changing to a JavaSpace? This >>could be important to solving the problem the "right" way.... > > > We wanted to have agents working jobs distributed from a master > process after which they would be returned to the master. Seemed like > the usual use-case for JavaSpaces. > Kind of except, obviously, you have this suitability thing going on. Okay, so the question is, does the job processing take sufficiently long that a remote call is not really the way to go? Or perhaps you want to do some kind of queue'ing or maybe you want to simplify the logic/number of threads in the master or something else???? Basically, we need to figure out if this is genuinely something you need a JavaSpace for or whether a straight remote call is good enough. If a JavaSpace is needed for some reason, I'd be tempted to do something like this (not completely thought through just trying to put up a straw man to refine): (1) Have your agents advertise a proxy as usual with all the Entry attributes. (2) Have a couple of methods on the proxy - one to return a unique id for that agent and the other to return a reference to a JavaSpace. (3) Submit a job to the agent's preferred JavaSpace with the appropriate unique id on it plus some kind of Job ID. (4) Agent, at startup, finds a JavaSpace (could be just a random lookup or something more predictable/fixed), then register's it's proxy. (5) Master can wait on the JavaSpace with an appropriate template (based on the Job ID from (3)) to catch the result. This would seem to fit the bill as you can still select an appropriate agent and then dispatch a job to it but use a JavaSpace to ease co-ordination woes. As I say, I'd only do this were there a convincing case for using a JavaSpace. So there you go, a starting point, time for some refinement. Best, Dan. =========================================================================== To unsubscribe, send email to [email protected] and include in the body of the message "signoff JAVASPACES-USERS". For general help, send email to [email protected] and include in the body of the message "help". To view past JAVASPACES-USERS postings, please see: http://archives.java.sun.com/archives/javaspaces-users.html JDC members can download the JavaSpaces(tm) Technology from: http://developer.java.sun.com/developer/products/jini/