}
protected void deployExtension(String name, URL url) {
// FIXME for now, assume this class's ClassLoader is the Tuscany system classloader
// FIXME we should really use the one associated with the parent composite
CompositeClassLoader extensionCL = new CompositeClassLoader(getClass().getClassLoader());
// see if the URL points to a composite JAR by looking for a default SCDL file inside it
URL scdlLocation;
try {
scdlLocation = new URL("jar:" + url.toExternalForm() + "!/META-INF/sca/default.scdl");
} catch (MalformedURLException e) {
// the form of the jar: URL should be correct given url.toExternalForm() worked
throw new AssertionError();
}
try {
scdlLocation.openStream().close();
// we connected to the SCDL so let's add the JAR file to the classloader
extensionCL.addURL(url);
} catch (IOException e) {
// assume that the URL we were given is not a JAR file so just use the supplied resource
scdlLocation = url;
}