Re: Can I assign a ServiceID myself?

John McClain <[email protected]> Sat, 17 Jan 2009 21:55:44 -0500
Newsgroups gmane.comp.java.sun.jini
Message-ID <[email protected]>
Bryan Thompson wrote:
> Hello,
> 
> I am using a non-persistent reggie.  I have been waiting to be
> discovered and then taking the assigned ServiceID.  However, I am
> wondering if I can assign a random ServiceID myself. 

yes you can (I don't have the source handy, but I think the contributed 
services work this way now)

> This would be an
> advantage to me in an integration context where I would like to register
> the ServiceID somewhere else before the service is actually started.
> Can I generate my own using UUID.randomUUID(), convert it into a
> ServiceID, and then call the alternate JoinManager ctor that accepts a
> pre-assigned ServiceID?
> 
> It's all UUIDs.  Does it make a difference who assigns it?

no, just make sure you use a good algorithm to pick the UUID 
(UUID.randomUUID is fine, there is also a UuidFactory class in the 
net.jini.id package, also many OS have uuidgen commands)

> Does it make a different if I am using persistent reggie?

It doesn't make a difference

Hope this helps

--------------------------------------------------------------------------
Getting Started:     http://www.jini.org/wiki/Category:Getting_Started
Community Web Site:  http://jini.org
jini-users Archive:  http://archives.java.sun.com/archives/jini-users.html
Unsubscribing:       email "signoff JINI-USERS"  to [email protected]