示例#1
0
    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;
    }
示例#2
0
 /**
  * @jmx:managed-operation description=""
  * @jmx:managed-operation-parameter name="url" position="0" description=""
  */
 public void addURL (String url) throws MalformedURLException {
     addURL (new URL (url));
 }