Package org.jboss.classloading.spi

Examples of org.jboss.classloading.spi.DomainClassLoader


      String stringName = (String) name;
      String slashName = stringName.replace('.', '/');
      List pkgs = (List) pkgToCLs.get(slashName);
      if (pkgs != null)
      {
         DomainClassLoader cl = (DomainClassLoader) pkgs.get(0);
         return new AbstractKernelRegistryEntry(name, cl.getPackage(stringName));
      }
     
      if (parent != null && parent instanceof KernelRegistryPlugin)
      {
         KernelRegistryPlugin factory = (KernelRegistryPlugin) parent;
View Full Code Here


      if (classLoaders == null)
         return null;
     
      for (ListIterator i = classLoaders.listIterator(); i.hasNext();)
      {
         DomainClassLoader cl = (DomainClassLoader) i.next();
         try
         {
            Class clazz = cl.loadClassLocally(name, resolve);
            if (trace)
               log.trace(this.toShortString() + " loaded " + clazz + " from classloader " + cl);
            cachedClasses.put(name, clazz);
            return clazz;
         }
View Full Code Here

      if (classLoaders == null)
         return null;
     
      for (ListIterator i = classLoaders.listIterator(); i.hasNext();)
      {
         DomainClassLoader cl = (DomainClassLoader) i.next();
         URL url = cl.loadResourceLocally(name);
         if (url != null)
         {
            if (trace)
               log.trace(this.toShortString() + " loaded resource " + url + " from classloader " + cl);
            cachedResources.put(name, url);
View Full Code Here

/*      */   public void getResources(String name, DomainClassLoader cl, List urls)
/*      */   {
/*  348 */     Iterator iter = this.classLoaders.iterator();
/*  349 */     while (iter.hasNext() == true)
/*      */     {
/*  351 */       DomainClassLoader nextCL = (DomainClassLoader)iter.next();
/*  352 */       if ((nextCL instanceof DomainClassLoader))
/*      */       {
/*  354 */         DomainClassLoader ucl = nextCL;
/*      */         try
/*      */         {
/*  357 */           Enumeration resURLs = ucl.findResourcesLocally(name);
/*  358 */           while (resURLs.hasMoreElements())
/*      */           {
/*  360 */             Object res = resURLs.nextElement();
/*  361 */             urls.add(res);
/*      */           }
View Full Code Here

/*      */   private URL getResourceFromClassLoader(String name, DomainClassLoader cl)
/*      */   {
/*  401 */     URL resource = null;
/*  402 */     if ((cl instanceof DomainClassLoader))
/*      */     {
/*  404 */       DomainClassLoader ucl = cl;
/*  405 */       resource = ucl.loadResourceLocally(name);
/*  406 */       cacheLoadedResource(name, resource, cl);
/*      */     }
/*  408 */     return resource;
/*      */   }
View Full Code Here

/*      */     }
/*      */
/*  445 */     URL url = null;
/*  446 */     while (i.hasNext() == true)
/*      */     {
/*  448 */       DomainClassLoader classloader = (DomainClassLoader)i.next();
/*  449 */       if (classloader.equals(cl))
/*      */       {
/*      */         continue;
/*      */       }
/*      */
/*  454 */       if ((classloader instanceof DomainClassLoader))
/*      */       {
/*  456 */         url = classloader.loadResourceLocally(name);
/*  457 */         if (url != null)
/*      */         {
/*  459 */           cacheLoadedResource(name, url, classloader);
/*  460 */           cacheGlobalResource(name, url, classloader);
/*  461 */           break;
View Full Code Here

/*  514 */     for (Iterator iter = tmp.iterator(); iter.hasNext(); )
/*      */     {
/*  516 */       Object obj = iter.next();
/*  517 */       if ((obj instanceof DomainClassLoader))
/*      */       {
/*  519 */         DomainClassLoader cl = (DomainClassLoader)obj;
/*  520 */         URL[] urls = cl.getClasspath();
/*  521 */         int length = urls != null ? urls.length : 0;
/*  522 */         for (int u = 0; u < length; u++)
/*      */         {
/*  524 */           URL path = urls[u];
/*  525 */           classpath.add(path);
View Full Code Here

/*      */
/*      */   public Class loadClass(String className)
/*      */     throws ClassNotFoundException
/*      */   {
/*  597 */     ClassLoader scl = Thread.currentThread().getContextClassLoader();
/*  598 */     DomainClassLoader ucl = null;
/*  599 */     if (this.classLoaders.size() > 0)
/*  600 */       ucl = (DomainClassLoader)this.classLoaders.iterator().next();
/*      */     try
/*      */     {
/*  603 */       if (ucl != null) {
View Full Code Here

/*  662 */     addDomainClassLoader((DomainClassLoaderUCLImpl)loader);
/*      */   }
/*      */
/*      */   public boolean addClassLoaderURL(DomainClassLoader cl, URL url)
/*      */   {
/*  667 */     DomainClassLoader ucl = cl;
/*  668 */     boolean added = false;
/*  669 */     synchronized (this.classLoaders)
/*      */     {
/*  672 */       String query = url.getQuery();
/*  673 */       if (query != null)
View Full Code Here

/*      */   }
/*      */
/*      */   public void removeClassLoader(DomainClassLoader loader)
/*      */   {
/*  758 */     ArrayList removeNotifications = new ArrayList();
/*  759 */     DomainClassLoader cl = loader;
/*      */     Iterator i;
/*  760 */     synchronized (this.classLoaders)
/*      */     {
/*  762 */       if (!(loader instanceof DomainClassLoader))
/*      */       {
/*  764 */         cl = (DomainClassLoader)this.nonUCLClassLoader.remove(loader);
/*      */       }
/*  766 */       if ((cl instanceof DomainClassLoader))
/*      */       {
/*  768 */         DomainClassLoader ucl = cl;
/*  769 */         if (getTranslator() != null)
/*  770 */           getTranslator().unregisterClassLoader(ucl);
/*  771 */         URL[] urls = ucl.getClasspath();
/*  772 */         for (int u = 0; u < urls.length; u++)
/*  773 */           this.classLoaderURLs.remove(urls[u]);
/*      */       }
/*  775 */       boolean dynamic = this.dynamicClassLoaders.remove(cl);
/*  776 */       boolean removed = this.classLoaders.remove(cl);
View Full Code Here

TOP

Related Classes of org.jboss.classloading.spi.DomainClassLoader

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.