1 11 12 package org.eclipse.osgi.baseadaptor.loader; 13 14 import java.security.ProtectionDomain ; 15 import org.eclipse.osgi.baseadaptor.bundlefile.BundleFile; 16 import org.eclipse.osgi.framework.util.KeyedElement; 17 import org.eclipse.osgi.framework.util.KeyedHashSet; 18 19 26 public class ClasspathEntry { 27 private BundleFile bundlefile; 28 private ProtectionDomain domain; 29 private KeyedHashSet userObjects = null; 30 31 36 public ClasspathEntry(BundleFile bundlefile, ProtectionDomain domain) { 37 this.bundlefile = bundlefile; 38 this.domain = domain; 39 } 40 41 45 public BundleFile getBundleFile() { 46 return bundlefile; 47 } 48 49 53 public ProtectionDomain getDomain() { 54 return domain; 55 } 56 57 62 public Object getUserObject(Object key) { 63 if (userObjects == null) 64 return null; 65 synchronized (userObjects) { 66 return userObjects.getByKey(key); 67 } 68 } 69 70 74 public synchronized void addUserObject(KeyedElement userObject) { 75 if (userObjects == null) 76 userObjects = new KeyedHashSet(5, false); 77 synchronized (userObjects) { 78 userObjects.add(userObject); 79 } 80 } 81 } 82 | Popular Tags |