1 23 24 package com.sun.enterprise.deployment.annotation.factory; 25 26 import java.io.File ; 27 import java.io.FileFilter ; 28 import java.io.FileInputStream ; 29 import java.io.IOException ; 30 import java.util.jar.Attributes ; 31 import java.util.jar.Manifest ; 32 33 import javax.enterprise.deploy.shared.ModuleType ; 34 35 import com.sun.enterprise.deployment.annotation.impl.AppClientScanner; 36 import com.sun.enterprise.deployment.annotation.impl.EjbJarScanner; 37 import com.sun.enterprise.deployment.annotation.impl.WarScanner; 38 import com.sun.enterprise.deployment.annotation.Scanner; 39 import com.sun.enterprise.deployment.ApplicationClientDescriptor; 40 import com.sun.enterprise.deployment.archivist.Archivist; 41 import com.sun.enterprise.deployment.BundleDescriptor; 42 import com.sun.enterprise.deployment.deploy.shared.AbstractArchive; 43 import com.sun.enterprise.deployment.WebBundleDescriptor; 44 import com.sun.enterprise.deployment.EjbBundleDescriptor; 45 46 51 public class ScannerFactory { 52 private ScannerFactory() { 53 } 54 55 public static Scanner createScanner(BundleDescriptor bundleDesc, 56 Archivist archivist, AbstractArchive abstractArchive, 57 ClassLoader classLoader) throws IOException { 58 Scanner scanner = null; 59 File f = new File (abstractArchive.getArchiveUri()); 60 61 if (ModuleType.EJB.equals(archivist.getModuleType())) { 62 scanner = new EjbJarScanner(f, (EjbBundleDescriptor)bundleDesc, 63 classLoader); 64 } else if (ModuleType.WAR.equals(archivist.getModuleType())) { 65 scanner = new WarScanner(f, (WebBundleDescriptor)bundleDesc, 66 classLoader); 67 } else if (ModuleType.CAR.equals(archivist.getModuleType())) { 68 ApplicationClientDescriptor appClientDesc = 69 (ApplicationClientDescriptor)bundleDesc; 70 71 scanner = new AppClientScanner(f, appClientDesc, classLoader); 72 } 73 74 return scanner; 75 } 76 } 77 | Popular Tags |