1 19 20 package org.netbeans.modules.j2ee.ejbjar; 21 22 import java.util.HashMap ; 23 import org.netbeans.modules.j2ee.api.ejbjar.*; 24 import org.netbeans.modules.j2ee.spi.ejbjar.*; 25 import org.openide.filesystems.FileObject; 26 27 32 public class CustomProviderCar implements CarProvider { 33 34 private HashMap cache = new HashMap (); 35 36 public CustomProviderCar () { 37 } 38 39 public Car findCar (FileObject file) { 40 if (file.getExt ().equals ("bar")) { 41 Car em = (Car) cache.get (file.getParent ()); 42 if (em == null) { 43 em = CarFactory.createCar (new EM (file.getParent (), EjbProjectConstants.J2EE_14_LEVEL)); 44 cache.put (file.getParent (), em); 45 } 46 return em; 47 } 48 return null; 49 } 50 51 private class EM implements CarImplementation { 52 FileObject root; 53 String ver; 54 55 public EM (FileObject root, String ver) { 56 this.root = root; 57 this.ver = ver; 58 } 59 60 public String getJ2eePlatformVersion () { 61 return ver; 62 } 63 64 public FileObject getDeploymentDescriptor () { 65 return root.getFileObject ("conf/application-client.xml"); 66 } 67 68 public FileObject getMetaInf () { 69 return null; 70 } 71 72 public FileObject[] getJavaSources() { 73 return null; 74 } 75 } 76 } 77 | Popular Tags |