public QClassLoader scan (boolean forceNewClassLoader) throws InstanceAlreadyExistsException, InstanceNotFoundException, NotCompliantMBeanException, MalformedURLException, MBeanRegistrationException { if ((!isModified () && !forceNewClassLoader) || !libDir.canRead()) return this; QClassLoader loader; if (server.isRegistered (loaderName)) { server.unregisterMBean (loaderName); loader = new QClassLoader (server, libDir, loaderName, getParent()); } else loader = this; File file[] = libDir.listFiles (this); for (int i=0; i<file.length; i++) { try { loader.addURL (file[i].toURL ()); } catch (MalformedURLException e) { e.printStackTrace (); } } loader.lastModified = libDir.lastModified (); server.registerMBean (loader, loaderName); return loader; }
/** * @jmx:managed-operation description="" * @jmx:managed-operation-parameter name="url" position="0" description="" */ public void addURL (String url) throws MalformedURLException { addURL (new URL (url)); }