Re: Multiple JavaSpaces

Dan Creswell <[email protected]>
Newsgroups gmane.comp.java.sun.javaspaces,gmane.spam.detected
Message-ID <[email protected]>
I don't understand - ServiceItem instances _include the attributes_
including Name attributes and as your ServiceLocator returns
ServiceItem's all you should need to do is check the appropriate field
of each ServiceItem.

Are you saying the ServiceItem[] returned contains empty attributes
fields or haven't you checked?

Dan.

Jay Ricky Villarante wrote:
> yes we're able to do that. what we can't do is that if we already have a
> list of javaspaces taken from a multicast discovery, we cant retrieve
> the name attribute of these spaces anymore.
>
> this is a snippet of what we're doing:
>
> private JavaSpace[] allSpaces;
>
> ServiceItem[] tempServiceHolder = (ServiceItem[])
> ServiceLocator.getService(JavaSpace.class,waitTime,10);
>
> allSpaces = new JavaSpace[tempServiceHolder.length];
>
> for (int i=0;i<allSpaces.length; i++) {
>     allSpaces[i] = (JavaSpace) tempServiceHolder[i].service;
> }
>
> now, what we need to do is to retrieve the name attributes of the spaces
> in the allSpaces array so we can list it in a list box or something so
> that the client can choose from them where s/he wants to read/write etc..
>
> 2006/2/26, Dan Creswell <[email protected]
> <mailto:[email protected]>>:
>
>     Normally, you'd pass the name that you require in as part of the lookup.
>       Is there some reason this isn't appropriate in this situation?
>
>     Note that if you use ServiceDiscoveryManager, many of the lookup methods
>     return a ServiceItem which includes any Name attributes.
>
>     Dan.
>
>     Jay Ricky Villarante wrote:
>      > We're able to retrieve multiple javaspaces via multicast. What we
>     need is a
>      > way to retrieve these spaces' name attributes so that the client
>     can choose
>      > the space he/she needs.
>      >
>      > Please help.
>      > Thanks!
>      >
>      >
>      > Jay
>      >
>      >
>     ===========================================================================
>      > To unsubscribe, send email to [email protected]
>     <mailto:[email protected]> and include in the body
>      > of the message "signoff JAVASPACES-USERS".  For general help,
>     send email to
>      > [email protected] <mailto:[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
>      >
>
>

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