FileDocCategorySizeDatePackage
JBossClassPoolFactory32.javaAPI DocJBoss 4.2.12742Fri Jul 13 21:02:24 BST 2007org.jboss.aop.deployment

JBossClassPoolFactory32

public class JBossClassPoolFactory32 extends Object implements ScopedClassPoolFactory
Comment
author
Bill Burke
version
$Revision: 57186 $

Fields Summary
protected File
tmpClassesDir
Constructors Summary
public JBossClassPoolFactory32(File tmpClassesDir)

      this.tmpClassesDir = tmpClassesDir;

   
Methods Summary
public javassist.scopedpool.ScopedClassPoolcreate(java.lang.ClassLoader cl, javassist.ClassPool src, javassist.scopedpool.ScopedClassPoolRepository repository)

      try
      {
         File tempdir = createTempDir(cl);
         return new JBossClassPool32(cl, src, repository, tempdir);
      }
      catch (IOException e)
      {
         throw new RuntimeException(e);
      }
   
public javassist.scopedpool.ScopedClassPoolcreate(javassist.ClassPool src, javassist.scopedpool.ScopedClassPoolRepository repository)

      return new JBossClassPool32(src, repository);
   
public java.io.FilecreateTempDir(java.lang.ClassLoader cl)

      if (!(cl instanceof UnifiedClassLoader)) return null;
      File tempdir = File.createTempFile("ucl", "", tmpClassesDir);
      tempdir.delete();
      tempdir.mkdir();
      tempdir.deleteOnExit();
      UnifiedClassLoader ucl = (UnifiedClassLoader) cl;
      URL tmpURL = tempdir.toURL();
      URL tmpCP = new URL(tmpURL, "?dynamic=true");
      // we may be shutting down.
      if (ucl.getLoaderRepository() != null) ucl.addURL(tmpCP);
      return tempdir;