On 6/26/06, cr22rc <[EMAIL PROTECTED]> wrote:
Hi Jim, The recent check in of the launcher pom.xml has a comment that no tuscany jars should be referenced. The goal is to have the launcher not corrupt the application code with tuscany runtime.
Sorry if it caused confusion, I was in there and thinking about it so decided to add the comment to remind us.
My thinking was the launcher could reference these classes at compile time, but at runtime they should all be loaded from another classloader with a separate path that contained the tuscany jars.. It would create a new application classloader to load the application that had only the application jars in it's path. When launcher was created at runtime it would not have the tuscany jars (other than the launcher itself) in it's path. Would that work? ... Maybe Jeremy has a better way to go about this?
The problem with a compile-time dependency is that typically all the classes need to be available in the same classloader. For example, if MainLauncher imported something from spi, when the code executed the VM would attempt to load the spi class from the classloader that defined MainLauncher; if it couldn't find it, you would get a NoClassDefFoundError. The only solution I know to avoid this is for the launcher code to reference the runtime via reflection. So things would mostly work as you said above. The launcher would create new classloaders for the runtime and the application code to avoid the classpath contamination. It would then locate the default bootstrapper (say using the JAR service mechanism) and invoke it refectively to boot the runtime. Once the runtime was up, it would then invoke the application, for example, by reflectively invoking the main() method as it does now, or by invoking some well-known service as you had suggested elsewhere. [[ of course this is just the launcher; we still have the option of the application code booting the runtime itself using something like TuscanyRuntime ]] -- Jeremy --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
