Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.tapestry5.ioc.internal.services
Class ClassFactoryClassPool

    java.lang.Object
      javassist.ClassPool
          org.apache.tapestry5.ioc.internal.services.ClassFactoryClassPool

    public class ClassFactoryClassPool

extends javassist.ClassPool

Used to ensure that `ClassPool.appendClassPath(javassist.ClassPath)` is invoked within a synchronized lock, and also handles tricky class loading issues (caused by the creation of classes, and class loaders, at runtime).

Field Summary

Fields inherited from class javassist.ClassPool
`childFirstLookup, classes, doPruning, parent, releaseUnmodifiedClassFile, source`

Constructor Summary
`ClassFactoryClassPool(java.lang.ClassLoader contextClassLoader)`

Method Summary
`void` | `addClassLoaderIfNeeded(java.lang.ClassLoader loader)` Convienience method for adding to the ClassPath for a particular class loader.
`java.lang.Class` | `importClass(java.lang.Class clazz)` Returns the nearest super-class of the provided class that can be converted to a `CtClass`.
`java.lang.Class` | `toClass(javassist.CtClass ct, java.lang.ClassLoader loader, java.security.ProtectionDomain domain)` Overriden to remove a deadlock producing synchronized block.

Methods inherited from class javassist.ClassPool
`appendClassPath, appendClassPath, appendPathList, appendSystemPath, cacheCtClass, clearImportedPackages, createCtClass, find, get, get, get0, getAndRename, getCached, getClassLoader, getCtClass, getDefault, getImportedPackages, getMethod, getOrNull, importPackage, insertClassPath, insertClassPath, lookupCflow, makeClass, makeClass, makeClass, makeClass, makeClassIfNew, makeInterface, makeInterface, recordInvalidClassName, removeCached, removeClassPath, toClass, toClass, toString`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### ClassFactoryClassPool

    public ClassFactoryClassPool(java.lang.ClassLoader contextClassLoader)

Method Detail

### importClass

    public java.lang.Class importClass(java.lang.Class clazz)

  Returns the nearest super-class of the provided class that can be converted to a `CtClass`. This is used to filter out Hibernate-style proxies (created as subclasses of oridnary classes). This will automatically add the class' classLoader to the pool's class path.

  Parameters:
    `clazz` - class to import
  Returns:
    clazz, or a super-class of clazz

### addClassLoaderIfNeeded

    public void addClassLoaderIfNeeded(java.lang.ClassLoader loader)

  Convienience method for adding to the ClassPath for a particular class loader.

  Parameters:
    `loader` - the class loader to add (derived from a loaded class, and may be null for some system classes)

### toClass

    public java.lang.Class toClass(javassist.CtClass ct,
                                   java.lang.ClassLoader loader,
                                   java.security.ProtectionDomain domain)
                            throws javassist.CannotCompileException

  Overriden to remove a deadlock producing synchronized block. We expect that the defineClass() methods will have been marked as accessible statically (by this class), so there's no need to set them accessible again.

  Overrides:
    `toClass` in class `javassist.ClassPool`
  Throws:
    `javassist.CannotCompileException`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2003-2012 The Apache Software Foundation.