Re: Two Services trying to load a System library in same JVM
Gregg Wonderly <[email protected]> Tue, 8 Jul 2008 11:41:04 -0500
| Newsgroups | gmane.comp.java.sun.jini |
|---|---|
| Message-ID | <[email protected]> |
Francisco Albasini MourĂ£o wrote: > Thanx for the reply Gregg. > Yes. I'm using com.sun.jini.start to start the services. > This application is launching other services that are not MonitorService's. In fact, it could be launched without any MonitorService instance. > Building a new start.jar with things specific for it would make me loose modularity: 1) MonitorService would only run with this specific new start.jar 2) start.jar always used as a common package to start the services is now replaced for a specific jar to run MonitorServices.. > > Although, if there is no alternative... The JVM provides no ability to do anything with System.loadLibrary from multiple class loaders. So, you have to find a way to load it from a single class loader, that all service instances can see. Another way would be to virtualize access to the serial ports by creating a single service instance that is a monitor for access to the ports. Then, have your other services instances (MonitorService) use that service to access the ports. Then, everything is a "service" inside of com.sun.jini.start. To some degree, it seems like only a single service needed. You could send out a "smart proxy" to the client for access to a specific port. Gregg Wonderly -------------------------------------------------------------------------- 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]