1 11 package org.eclipse.osgi.framework.internal.core; 12 13 import java.net.URL ; 14 import java.util.Enumeration ; 15 import org.eclipse.osgi.framework.util.KeyedHashSet; 16 17 23 public class NullPackageSource extends PackageSource { 24 static KeyedHashSet sources; 25 private NullPackageSource(String name) { 26 super(name); 27 } 28 29 public SingleSourcePackage[] getSuppliers() { 30 return null; 31 } 32 33 public boolean isNullSource() { 34 return true; 35 } 36 37 public String toString() { 38 return id + " -> null"; } 40 41 public Class loadClass(String name) { 42 return null; 43 } 44 45 public URL getResource(String name) { 46 return null; 47 } 48 49 public Enumeration getResources(String name) { 50 return null; 51 } 52 53 public static synchronized NullPackageSource getNullPackageSource(String name) { 54 if (sources == null) 55 sources = new KeyedHashSet(); 56 NullPackageSource result = (NullPackageSource) sources.getByKey(name); 57 if (result != null) 58 return result; 59 result = new NullPackageSource(name); 60 sources.add(result); 61 return result; 62 } 63 } 64 | Popular Tags |