Re: maxEntries in contents()

Dan Creswell <[email protected]>
Newsgroups gmane.comp.java.sun.javaspaces
Message-ID <[email protected]>
As the JavaDoc says:

"the maximum number of entries to remove from the set via MatchSet.next
calls".

Which means you can expect to get at most the specified number of
Entry's from next() (you might actually get fewer than that).

This parameter allows you to reduce your exposure to issues of memory
consumption where a MatchSet becomes too large to maintain on a client
or in the space back-end itself.

If you want all available Entry's you'd pass in Long.MAX_VALUE.

Hope that helps,

Dan.

Stefan Schulz wrote:
> Hi,
>
> maybe a simple question (don't byte a newbee): what exactly does the
> parameter maxEntries in the JavaSpace05 method contents() mean? Are
> there some constants like for leases to set maxEntries to specific
> values (e.g. UNLIMITED)?
> The API is quite unclear to me in this point, especially, as next()
> always only returns/removes one element. So, is it the number of entries
> I allow to be retrieved by next()? Where would this be used?
>
> Thanks,
> Stefan
>
> ===========================================================================
> 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/
>

===========================================================================
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.