Re: Can I assign a ServiceID myself?

Bryan Thompson <[email protected]> Sun, 18 Jan 2009 05:34:56 -0600
Newsgroups gmane.comp.java.sun.jini
Message-ID <[email protected]>
Great.  That will simplify things for me.  Thanks, -bryan=20

> -----Original Message-----
> From: [email protected] [mailto:[email protected]]=20
> Sent: Saturday, January 17, 2009 9:56 PM
> To: Bryan Thompson
> Cc: [email protected]
> Subject: Re: Can I assign a ServiceID myself?
>=20
> Bryan Thompson wrote:
> > Hello,
> >=20
> > I am using a non-persistent reggie.  I have been waiting to be=20
> > discovered and then taking the assigned ServiceID.  However, I am=20
> > wondering if I can assign a random ServiceID myself.
>=20
> yes you can (I don't have the source handy, but I think the=20
> contributed services work this way now)
>=20
> > This would be an
> > advantage to me in an integration context where I would like to=20
> > register the ServiceID somewhere else before the service is=20
> actually started.
> > Can I generate my own using UUID.randomUUID(), convert it into a=20
> > ServiceID, and then call the alternate JoinManager ctor=20
> that accepts a=20
> > pre-assigned ServiceID?
> >=20
> > It's all UUIDs.  Does it make a difference who assigns it?
>=20
> no, just make sure you use a good algorithm to pick the UUID=20
> (UUID.randomUUID is fine, there is also a UuidFactory class=20
> in the net.jini.id package, also many OS have uuidgen commands)
>=20
> > Does it make a different if I am using persistent reggie?
>=20
> It doesn't make a difference
>=20
> Hope this helps
>=20

--------------------------------------------------------------------------
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]