1 23 package com.sun.enterprise.deployment.annotation.impl; 24 25 import java.io.File ; 26 import java.io.FileFilter ; 27 import java.io.IOException ; 28 import java.lang.reflect.Array ; 29 import java.lang.reflect.Method ; 30 import java.net.URL ; 31 import java.net.URLClassLoader ; 32 import java.util.Iterator ; 33 import java.util.Set ; 34 import java.util.logging.Level ; 35 36 import com.sun.enterprise.deployment.EjbBundleDescriptor; 37 import com.sun.enterprise.deployment.EjbDescriptor; 38 import com.sun.enterprise.deployment.EjbSessionDescriptor; 39 import com.sun.enterprise.deployment.EjbMessageBeanDescriptor; 40 import com.sun.enterprise.deployment.EjbInterceptor; 41 42 47 public class EjbJarScanner extends ModuleScanner { 48 public EjbJarScanner(File archiveFile, EjbBundleDescriptor desc) 49 throws IOException { 50 this(archiveFile, desc, null); 51 } 52 53 58 public EjbJarScanner(File archiveFile, EjbBundleDescriptor desc, 59 ClassLoader classLoader) throws IOException { 60 if (AnnotationUtils.getLogger().isLoggable(Level.FINE)) { 61 AnnotationUtils.getLogger().fine("archiveFile is " + archiveFile); 62 AnnotationUtils.getLogger().fine("classLoader is " + classLoader); 63 } 64 this.archiveFile = archiveFile; 65 this.classLoader = classLoader; 66 if (archiveFile.isDirectory()) { 67 addScanDirectory(archiveFile); 68 69 for (Iterator ejbs = desc.getEjbs().iterator(); ejbs.hasNext();) { 73 EjbDescriptor ejbDesc = (EjbDescriptor)ejbs.next(); 74 if (ejbDesc instanceof EjbSessionDescriptor || 75 ejbDesc instanceof EjbMessageBeanDescriptor) { 76 addScanClassName(ejbDesc.getEjbClassName()); 77 } 78 } 79 80 for (Iterator interceptors = desc.getInterceptors().iterator(); 81 interceptors.hasNext();) { 82 EjbInterceptor interceptor = 83 (EjbInterceptor)interceptors.next(); 84 addScanClassName(interceptor.getInterceptorClassName()); 85 } 86 87 } 89 } 90 } 91 | Popular Tags |