|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.9.0) E52944-01 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
oracle.jdeveloper.java.provider.BaseFileProvider
oracle.jdeveloper.java.provider.CachedFileProvider
public abstract class CachedFileProvider
The CachedFileProvider is an abstract starting point for an implementation of the JavaFileProvider interface that adds cache support to the BaseFileProvider.
| Nested Class Summary | |
|---|---|
protected class |
CachedFileProvider.SourceFileTrackerThe SourceFileTracker just listens to SourceFile instances that we create/cache, expiring them from our cache when they get modified outside of a transaction. |
| Nested classes/interfaces inherited from class oracle.jdeveloper.java.provider.BaseFileProvider |
|---|
BaseFileProvider.BaseClass, BaseFileProvider.BasePackage |
| Field Summary | |
|---|---|
protected java.util.Map<java.lang.String,JavaType> |
_arrayCacheMapOur cache of array types. |
protected java.lang.Object |
_cacheLockOur cache lock for synchronization |
protected int |
_cacheRefCountThe ref count of cache use calls. |
protected java.util.Map<java.lang.String,JavaClass> |
_classCacheMapOur cache of class instances. |
protected java.util.Map<java.net.URL,JavaFile> |
_classFileCacheMapOur cache of *.class JavaFile instances. |
protected java.lang.ClassLoader |
_defaultClassLoaderThe (cached) default class loader instance. |
protected long |
_lastCacheFlushedTime |
protected java.lang.ClassLoader |
_nullClassLoaderThe (cached) null-parent class loader instance. |
protected java.util.Map<java.lang.String,JavaPackage> |
_packageCacheMapOur cache of packages. |
protected java.util.Map<java.net.URL,SourceFile> |
_sourceFileCacheMapOur cache of *.java JavaFile instances. |
protected static JavaClass |
CLASS_NOT_FOUNDMarker for class not found in the class cache |
| Fields inherited from class oracle.jdeveloper.java.provider.BaseFileProvider |
|---|
context |
| Fields inherited from interface oracle.jdeveloper.java.provider.ProviderConstants |
|---|
CLASS_TYPE, EMPTY_COLLECTION, SOURCE_TYPE, UNKNOWN_TYPE |
| Constructor Summary | |
|---|---|
CachedFileProvider(ProviderContext environment, java.lang.String scopeDescription) |
|
| Method Summary | |
|---|---|
void |
beginCacheUse()Instructs the data provider to enable the cache support. |
protected void |
clearAllData()Instructs this data provider to clear all cached data, and stop all trackers. |
protected void |
clearArrayCache()Utility routine to clean out our package cache. |
protected void |
clearClassCache()Utility routine to clean out our class caches. |
protected void |
clearClassFileCache()Utility routine to clean out our class file caches. |
protected void |
clearClassLoader()Internal method to allow clearing of the class loader (for example, in case a subclass changes the class locator instance.) |
protected void |
clearCompiledInfo()Utility routine to clear all compiled info. |
protected void |
clearPackageCache()Utility routine to clean out our package cache. |
protected void |
clearSourceFileCache()Utility routine to clean out our source file caches. |
SourceFile |
createSourceFile(java.net.URL url)Creates a new SourceFile for the given Java source URL (*.java). |
void |
endCacheUse()Instructs the data provider to release the cache support. |
protected void |
expireAllSourceFiles()Utility routine to expire all SourceFile instances that we have cached currently. |
void |
flushCache()Instructs the data provider to force a cache flush. |
protected void |
flushFoundCache()Instructs the data provider to flush the resolution part of the cache (i.e., the found or not found) part of the cache. |
protected JavaType |
getArrayTypeImpl(java.lang.String typeKey, JavaType component, int dimensions)Fetch the array type represented by the given type and dimensions. |
protected JavaClass |
getClassExactImpl(java.lang.String fqOuterClassName)Utility routine to try to locate the given outer class. |
protected JavaClass |
getClassExactImplInterruptibly(java.lang.String fqOuterClassName)Utility routine to try to locate the given outer class. |
protected JavaFile |
getClassFileImpl(java.net.URL classURL)Fetch the JavaFile for the given Java class URL (*.class). |
java.lang.ClassLoader |
getClassLoader()Fetch a ClassLoader instance that can load classes based on the same class locator as this file provider instance. |
java.lang.ClassLoader |
getClassLoader(java.lang.ClassLoader parentLoader)Fetch a ClassLoader instance that can load classes based on the same class locator as this file provider instance. |
protected BaseFileProvider.BasePackage |
getPackageImpl(java.lang.String fqName)Fetch the JavaPackage instance for the given package. |
java.lang.String |
getScopeDescription() |
protected SourceFile |
getSourceFileImpl(java.net.URL sourceURL)Fetch the SourceFile for the given Java source URL (*.java). |
long |
lastCacheFlushed() |
protected SourceFile |
lookupCachedSourceFile(java.net.URL sourceURL)Utility routine which looks up the cached SourceFile entry in our cache map, which uses SoftReference values. |
protected void |
notifyOfChange(java.net.URL url)Called by the ProviderEnvironment when a change has happened to an URL that we were tracking. |
protected void |
removeCachedSourceFile(java.net.URL sourceURL)Deprecated. use removeCachedSourceFile( URL, SourceFile ) instead |
protected void |
removeCachedSourceFile(java.net.URL sourceURL, SourceFile sourceFile)Utility routine which removes the cached SourceFile from our cache map, but ONLY if the SourceFile is actually mapped to the URL. |
protected void |
storeCachedSourceFile(java.net.URL sourceURL, SourceFile sourceFile)Utility routine which stores the given sourcefile into our cache using SoftReferences. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final java.lang.Object _cacheLock
protected java.lang.ClassLoader _nullClassLoader
protected java.lang.ClassLoader _defaultClassLoader
protected long _lastCacheFlushedTime
protected java.util.Map<java.lang.String,JavaPackage> _packageCacheMap
protected java.util.Map<java.net.URL,SourceFile> _sourceFileCacheMap
protected java.util.Map<java.lang.String,JavaType> _arrayCacheMap
protected java.util.Map<java.lang.String,JavaClass> _classCacheMap
protected java.util.Map<java.net.URL,JavaFile> _classFileCacheMap
protected static final JavaClass CLASS_NOT_FOUND
protected int _cacheRefCount
| Constructor Detail |
|---|
public CachedFileProvider(ProviderContext environment,
java.lang.String scopeDescription)
| Method Detail |
|---|
public java.lang.ClassLoader getClassLoader(java.lang.ClassLoader parentLoader)
Only one null-parent class loader will be created per cached file provider. For non-null parent loaders, this always creates a new instance.
parentLoader - The ClassLoader to use as the parent. May be null.public java.lang.ClassLoader getClassLoader()
protected void clearClassLoader()
public SourceFile createSourceFile(java.net.URL url)
throws java.io.IOException,
java.lang.IllegalArgumentException
BaseFileProvidercreateSourceFile in interface JavaFileProvidercreateSourceFile in class BaseFileProviderurl - the source URL to create a new Java file forjava.io.IOException - if the new file cannot be createdjava.lang.IllegalArgumentException - if the URL is not recognized as a Java source fileprotected SourceFile getSourceFileImpl(java.net.URL sourceURL)
getSourceFileImpl in class BaseFileProvidersourceURL - the source URL to get the SourceFile forpublic void beginCacheUse()
endCacheUse() when finished to ensure that the cache can be freed when it is no longer needed.beginCacheUse in interface CacheSupportpublic void endCacheUse()
endCacheUse in interface CacheSupportpublic long lastCacheFlushed()
public void flushCache()
flushCache in interface CacheSupportprotected void flushFoundCache()
protected void clearAllData()
protected JavaFile getClassFileImpl(java.net.URL classURL)
getClassFileImpl in class BaseFileProviderclassURL - the class URL to get the Java file forprotected void clearClassFileCache()
protected SourceFile lookupCachedSourceFile(java.net.URL sourceURL)
@Deprecated
protected void removeCachedSourceFile(java.net.URL sourceURL)
protected void removeCachedSourceFile(java.net.URL sourceURL,
SourceFile sourceFile)
protected void storeCachedSourceFile(java.net.URL sourceURL,
SourceFile sourceFile)
protected void expireAllSourceFiles()
protected void clearSourceFileCache()
protected void clearCompiledInfo()
protected void notifyOfChange(java.net.URL url)
BaseFileProvidernotifyOfChange in class BaseFileProviderprotected JavaClass getClassExactImpl(java.lang.String fqOuterClassName)
getClassExactImpl in class BaseFileProviderfqOuterClassName - the name of the fully-qualified outer class name we are searching for
protected JavaClass getClassExactImplInterruptibly(java.lang.String fqOuterClassName)
throws java.lang.InterruptedException
getClassExactImplInterruptibly in class BaseFileProviderfqOuterClassName - the name of the fully-qualified outer class name we are searching forjava.lang.InterruptedException - if the search was interruptedprotected void clearClassCache()
protected JavaType getArrayTypeImpl(java.lang.String typeKey,
JavaType component,
int dimensions)
getArrayTypeImpl in class BaseFileProvidertypeKey - the qualified name of the type followed by the '[]'s for the dimensioncomponent - the java typedimensions - the array dimensionprotected void clearArrayCache()
protected BaseFileProvider.BasePackage getPackageImpl(java.lang.String fqName)
getPackageImpl in class BaseFileProviderprotected void clearPackageCache()
public java.lang.String getScopeDescription()
|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.9.0) E52944-01 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||