1 11 package org.eclipse.core.internal.registry; 12 13 import java.lang.ref.SoftReference ; 14 import org.eclipse.core.runtime.IConfigurationElement; 15 16 public class FlushableExtension extends Extension { 17 18 public FlushableExtension() { 19 super(); 20 } 21 22 public IConfigurationElement[] getConfigurationElements() { 23 synchronized (this) { 24 if (!fullyLoaded) { 25 fullyLoaded = true; 26 RegistryCacheReader reader = getRegistry().getCacheReader(); 27 if (reader != null) 28 elements = new SoftReference (reader.loadConfigurationElements(this, subElementsCacheOffset)); 29 } 30 if (elements == null) 31 elements = new IConfigurationElement[0]; 32 33 if (((SoftReference ) elements).get() == null) { 34 RegistryCacheReader reader = getRegistry().getCacheReader(); 35 if (reader != null) 36 elements = new SoftReference (reader.loadConfigurationElements(this, subElementsCacheOffset)); 37 } 38 } 39 return (IConfigurationElement[]) ((SoftReference ) elements).get(); 40 } 41 42 public void setSubElements(IConfigurationElement[] value) { 43 elements = new SoftReference (value); 44 } 45 } | Popular Tags |