Re: Order of Delivery

Dan Creswell <[email protected]>
Newsgroups gmane.comp.java.sun.javaspaces
Message-ID <[email protected]>
Stephen Holly wrote:
> All,
>
> Does anyone know the order to which the JavaSpace serves up its entry's??
>

It's implementation dependent.

I'd recommend you read the JavaSpaces specification as it goes quite a
long way in making this clear.  In particular you should read the
sections on operation ordering and matching behaviour (under the
discussion of the read method).  There are further statements made in
the transactions section.


> For example, if the javaspace finds multiple matches for a clients 'take'
> request, which does it deliver?? After doing some testing I think it might
> be Last In First Out, or may be the one with the longest lease time
> available.
>

Maybe - again, depends on the implementation.  Outrigger is roughly FIFO
whilst Blitz (my implementation) will favour what's currently in cache
(typically recently touched Entry's which just have been written or
recently considered for matching etc).  I don't know about GigaSpaces.

Blitz provides options for enforcing FIFO ordering of Entry's (I think
GigaSpaces does too) but this is not required by the spec and is a
non-standard feature - i.e. you're playing with lock-in.

The non lock-in solution is to use one of the many queue'ing patterns
which just uses standard JavaSpaces operations to achieve the
appropriate form of ordering required by an application.

> Also, do you think it would be a good enhancement if the Entry class held
> the lease time available in a data member?? I have a system where on error
> the client writes back the entry to the space. It would be good if on
> writing it back, you could leve it as if the client had not touched it
> (with the same lease time). I know I could easily implement it myself but
> I think it is probibly a common situation, and therefore warrants being
> there as standard. However maybe I have missed some functionality as I am
> new to Jini.
>

I don't think this is a necessary enhancement because:

You could achieve this by having the client do it's take under a
transaction.  On error, you'd abort the transaction, on success you'd
commit.

Guess I'm saying you missed something but I may have mis-interpreted
your requirement (which may prevent you using transactions for some reason).

Hope that helps,

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/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.