Package org.jboss.classpool.spi

Examples of org.jboss.classpool.spi.AbstractClassPool


   public void wrap(CtClass clazz, Collection<org.jboss.aop.MethodInfo> methodInfos) throws Exception
   {
      for (org.jboss.aop.MethodInfo methodInfo : methodInfos)
      {
         Method method = methodInfo.getMethod();
         AbstractClassPool classPool = (AbstractClassPool) clazz.getClassPool();
         Class<?>[] parameterTypes = method.getParameterTypes();
         CtClass[] javassistParameterTypes = new CtClass[parameterTypes.length];
         for (int i = 0; i < parameterTypes.length; i++)
         {
            classPool.getLocally(parameterTypes[i].getName());
         }
         if (method.getName().indexOf("access$") >= 0)
         {
            continue;
         }
View Full Code Here


   public void unwrap(CtClass clazz, Collection<org.jboss.aop.MethodInfo> methodInfos) throws Exception
   {
      for (org.jboss.aop.MethodInfo methodInfo : methodInfos)
      {
         Method method = methodInfo.getMethod();
         AbstractClassPool classPool = (AbstractClassPool) clazz.getClassPool();
         Class<?>[] parameterTypes = method.getParameterTypes();
         CtClass[] javassistParameterTypes = new CtClass[parameterTypes.length];
         for (int i = 0; i < parameterTypes.length; i++)
         {
            javassistParameterTypes[i] = classPool.getLocally(parameterTypes[i].getName());
         }
         CtMethod javassistWMethod = clazz.getDeclaredMethod(method.getName(), javassistParameterTypes);
         if (wrapper.isNotPrepared(javassistWMethod, WrapperTransformer.SINGLE_TRANSFORMATION_INDEX))
         {
            continue;
View Full Code Here

         ArrayList<ClassPool> noAnnotationURLClassLoaderPools = null;
                
         ClassPoolRepository classPoolRepository = ClassPoolRepository.getInstance();
         for(ClassPool classPool: classPoolRepository.getRegisteredCLs().values())
         {
            AbstractClassPool candidate = (AbstractClassPool)classPool;
            if (candidate.isUnloadedClassLoader())
            {
               classPoolRepository.unregisterClassLoader(candidate.getClassLoader());
               continue;
            }
           
            if (candidate.getClassLoader() instanceof RealClassLoader)
            {
               //Sometimes the ClassLoader is a proxy for MBeanProxyExt?!
               RealClassLoader bcl = (RealClassLoader)candidate.getClassLoader();
               URL foundUrl = bcl.getResourceLocally(resourceName);
               if (foundUrl != null)
               {
                  if (url.equals(foundUrl))
                  {
                     if (trace)
                     {
                        logger.trace("getCorrectPoolForResource() Candidate classloader " + bcl + " has local resource " + foundUrl);
                     }
                     return candidate;
                  }
               }
            }
            //FIXME Remove once we have the JBoss 5 version of pool
            else if (isInstanceOfNoAnnotationURLClassLoader(candidate.getClassLoader()))
            {
               if (noAnnotationURLClassLoaderPools == null)
               {
                  noAnnotationURLClassLoaderPools = new ArrayList<ClassPool>();
               }
View Full Code Here

  
   public AbstractClassPool create(ClassLoader cl, ClassPool src, ScopedClassPoolRepository repository)
   {     
      ClassPool parent = getCreateParentClassPools(cl, src, repository);

      AbstractClassPool pool = null;
     
      if (cl instanceof RealClassLoader)
      {
         Module module = registry.getModule(cl);
         if (module != null && module.getDeterminedParentDomainName() != null)
         {
            //It is scoped
            ClassLoaderSystem sys = registry.getSystem();
            ClassLoaderDomain domain = sys.getDomain(module.getDeterminedDomainName());
            boolean parentFirst = module.isJ2seClassLoadingCompliance();
            ClassPool parentDomainPool = getParentUnitClassPool(cl);
            pool = new ScopedJBoss5ClassPool(cl, parent, parentDomainPool, repository, getTempURL(module), parentFirst, domain);
         }
         else
         {
            pool =  new JBoss5ClassPool(cl, parent, repository, getTempURL(module));
         }
      }
     
      if (pool == null)
      {
         pool = new AbstractClassPool(cl, parent, repository);
      }
      log.debug("Created pool " + pool + " for loader " + cl);
     
      return pool;
   }
View Full Code Here

            //It is scoped
            return new ScopedJBossClassPool(cl, parent, repository, tempdir, tmpCP);
         }
         return new JBossClassPool(cl, parent, repository, tempdir, tmpCP);
      }
      return new AbstractClassPool(cl, parent, repository);
   }
View Full Code Here

         //FIXME This needs revisiting/removing once the
         ArrayList<AbstractClassPool> noAnnotationURLClassLoaderPools = null;
         String resource = url.toString();
         for(ClassPool pool : classPoolRepository.getRegisteredCLs().values())
         {
            AbstractClassPool candidate = (AbstractClassPool)pool;
            if (candidate.isUnloadedClassLoader())
            {
               classPoolRepository.unregisterClassLoader(candidate.getClassLoader());
               continue;
            }
           
            if (candidate.getClassLoader() instanceof RepositoryClassLoader)
            {
               //Sometimes the ClassLoader is a proxy for MBeanProxyExt?!
               RepositoryClassLoader rcl = (RepositoryClassLoader)candidate.getClassLoader();
               URL[] urls = rcl.getClasspath();
              
               for (int i = 0 ; i < urls.length ; i++)
               {
                  if (resource.indexOf(urls[i].getFile()) >= 0)
                  {
                     return candidate;
                  }
               }
            }
            //FIXME Remove once we have the JBoss 5 version of pool
            else if (isInstanceOfNoAnnotationURLClassLoader(candidate.getClassLoader()))
            {
               if (noAnnotationURLClassLoaderPools == null)
               {
                  noAnnotationURLClassLoaderPools = new ArrayList<AbstractClassPool>();
               }
View Full Code Here

         ArrayList<ClassPool> noAnnotationURLClassLoaderPools = null;
                
         ClassPoolRepository classPoolRepository = ClassPoolRepository.getInstance();
         for(ClassPool classPool: classPoolRepository.getRegisteredCLs().values())
         {
            AbstractClassPool candidate = (AbstractClassPool)classPool;
            if (candidate.isUnloadedClassLoader())
            {
               classPoolRepository.unregisterClassLoader(candidate.getClassLoader());
               continue;
            }
           
            if (candidate.getClassLoader() instanceof RealClassLoader)
            {
               //Sometimes the ClassLoader is a proxy for MBeanProxyExt?!
               RealClassLoader bcl = (RealClassLoader)candidate.getClassLoader();
               URL foundUrl = bcl.getResourceLocally(resourceName);
               if (foundUrl != null)
               {
                  if (url.equals(foundUrl))
                  {
                     if (trace)
                     {
                        logger.trace("getCorrectPoolForResource() Candidate classloader " + bcl + " has local resource " + foundUrl);
                     }
                     return candidate;
                  }
               }
            }
            //FIXME Remove once we have the JBoss 5 version of pool
            else if (isInstanceOfNoAnnotationURLClassLoader(candidate.getClassLoader()))
            {
               if (noAnnotationURLClassLoaderPools == null)
               {
                  noAnnotationURLClassLoaderPools = new ArrayList<ClassPool>();
               }
View Full Code Here

  
   public AbstractClassPool create(ClassLoader cl, ClassPool src, ScopedClassPoolRepository repository)
   {     
      ClassPool parent = getCreateParentClassPools(cl, src, repository);

      AbstractClassPool pool = null;
     
      if (cl instanceof RealClassLoader)
      {
         Module module = registry.getModule(cl);
         if (module != null && module.getDeterminedParentDomainName() != null)
         {
            //It is scoped
            ClassLoaderSystem sys = registry.getSystem();
            ClassLoaderDomain domain = sys.getDomain(module.getDeterminedDomainName());
            boolean parentFirst = module.isJ2seClassLoadingCompliance();
            ClassPool parentDomainPool = getParentUnitClassPool(cl);
            pool = new ScopedJBoss5ClassPool(cl, parent, parentDomainPool, repository, getTempURL(module), parentFirst, domain);
         }
         else
         {
            pool =  new JBoss5ClassPool(cl, parent, repository, getTempURL(module));
         }
      }
     
      if (pool == null)
      {
         pool = new AbstractClassPool(cl, parent, repository);
      }
      log.debug("Created pool " + pool + " for loader " + cl);
     
      return pool;
   }
View Full Code Here

   public void wrap(CtClass clazz, Collection<org.jboss.aop.MethodInfo> methodInfos) throws Exception
   {
      for (org.jboss.aop.MethodInfo methodInfo : methodInfos)
      {
         Method method = methodInfo.getMethod();
         AbstractClassPool classPool = (AbstractClassPool) clazz.getClassPool();
         Class<?>[] parameterTypes = method.getParameterTypes();
         CtClass[] javassistParameterTypes = new CtClass[parameterTypes.length];
         for (int i = 0; i < parameterTypes.length; i++)
         {
            classPool.getLocally(parameterTypes[i].getName());
         }
         if (method.getName().indexOf("access$") >= 0)
         {
            continue;
         }
View Full Code Here

   public void unwrap(CtClass clazz, Collection<org.jboss.aop.MethodInfo> methodInfos) throws Exception
   {
      for (org.jboss.aop.MethodInfo methodInfo : methodInfos)
      {
         Method method = methodInfo.getMethod();
         AbstractClassPool classPool = (AbstractClassPool) clazz.getClassPool();
         Class<?>[] parameterTypes = method.getParameterTypes();
         CtClass[] javassistParameterTypes = new CtClass[parameterTypes.length];
         for (int i = 0; i < parameterTypes.length; i++)
         {
            javassistParameterTypes[i] = classPool.getLocally(parameterTypes[i].getName());
         }
         CtMethod javassistWMethod = clazz.getDeclaredMethod(method.getName(), javassistParameterTypes);
         if (wrapper.isNotPrepared(javassistWMethod, WrapperTransformer.SINGLE_TRANSFORMATION_INDEX))
         {
            continue;
View Full Code Here

TOP

Related Classes of org.jboss.classpool.spi.AbstractClassPool

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.