Bespoke services: network/rmi/registry
Gary and I were recently prototyping an application that uses Java RMI, and so I ended up searching around to see if anyone has done a service conversion for
rmiregistry(1) is the daemon that lets RMI clients find the available remote objects being served by various virtual machines on a given system.) Turns out no one has (or no one’s published it), which means it’s time to rev up the convert-o-tron.
Since we’re still developing our application and it’s likely we’ll change a definition or two, and since we need to restart the registry to cause the remote objects, we’re going to make our prototype service restart automatically if we restart the registry. That means our prototype service has a dependency on
network/rmi/registry with specific
restart_on behaviour, meaning that its service description has a fragment like the following:
<!-- As an RMI server application, we expect to be able to register our RMI classes with the registry server. --> <dependency name='rmi-registry' grouping='require_all' restart_on='restart' type='service'> <service_fmri value='svc:/network/rmi/registry' /> </dependency>
Inject that fragment into your various RMI servers’ descriptions (or the equivalent property group into the repository) and you’ll save a bit of time on application reinitializations.
So, if you’re interested, please feel free to take a copy of
network/rmi/registry; comments and corrections welcome.