Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.2.0)

E17493-03


oracle.ide.file
Class ProjectCache

java.lang.Object
  extended by oracle.ide.file.ProjectCache

Direct Known Subclasses:
JavaProjectCache

public class ProjectCache
extends java.lang.Object

Caches project properties. Once the cache is populated, it is no longer necessary to load project files to get the project properties. Loading a project file requires file I/O and XML parsing, which is very expensive. The cache is especially useful for operations that need to access the properties of a large number of projects at once.

Since:
11.1.2

Constructor Summary
protected ProjectCache(Workspace workspace)
           

 

Method Summary
 void close()
          Close this cache.
 Path getContentPath(Project project)
          Get the project content path.
 Path getContentPath(Project project, java.lang.String contentSetKey)
          Get the project content path for a specific content set.
 java.util.Collection<Project> getDirectDependencies(Project project)
          Get the projects that a project directly depends on.
 java.util.Collection<Project> getDownstreamDependencies(Project project)
          Get the downstream dependencies of a project.
static ProjectCache getInstance(Workspace workspace)
          Get the project cache for an application workspace.
protected  LibraryPaths getLibraryPaths(Project project, java.lang.String key)
          Get library paths from the cache.
protected  java.util.List<LibraryPaths> getLibraryPathsList(Project project, java.lang.String key)
          Get a list of library paths from the cache.
protected  java.util.logging.Logger getLogger()
          Get the logger used to log messages related to the cache.
protected  Path getPath(Project project, java.lang.String key)
          Get a path from the cache.
 java.lang.String[] getTechnologyScopeKeys(Project project)
          Get the technology scope keys used by a project.
 java.util.Collection<Project> getTransitiveDependencies(Project project)
          Get the transitive closure of the projects a project depends on.
static void invalidate(java.util.Collection<Project> projects)
          Invalidate the project cache for a set of projects.
static void invalidate(Project project)
          Invalidate the project cache for a specific project.
static void invalidate(Workspace workspace)
          Invalidate the project cache for an application workspace.
static void invalidateLibraries()
          Invalidate the project cache due to library changes.
protected  Project loadProject(Project project)
          Gets the project in order to load it.
protected  void putLibraryPaths(Project project, java.lang.String key, LibraryPaths libraryPaths)
          Put library paths into the cache.
protected  void putLibraryPathsList(Project project, java.lang.String key, java.util.List<LibraryPaths> libraryPathsList)
          Put a list of library paths into the cache.
protected  void putPath(Project project, java.lang.String key, Path path)
          Put a path in the cache.

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

ProjectCache

protected ProjectCache(Workspace workspace)

Method Detail

getInstance

public static ProjectCache getInstance(Workspace workspace)
Get the project cache for an application workspace. The caller is responsible for calling close() on the cache instance when the cache is no longer in use.
Parameters:
workspace - the workspace
Returns:
the project cache

invalidate

public static void invalidate(Workspace workspace)
Invalidate the project cache for an application workspace. This invalidates the cache for all projects in the workspace.
Parameters:
workspace - the workspace

invalidate

public static void invalidate(java.util.Collection<Project> projects)
Invalidate the project cache for a set of projects.
Parameters:
projects - the projects

invalidate

public static void invalidate(Project project)
Invalidate the project cache for a specific project.
Parameters:
project - the project

invalidateLibraries

public static void invalidateLibraries()
Invalidate the project cache due to library changes.

close

public void close()
Close this cache. The cache must not be used again after this method is called.

getContentPath

public Path getContentPath(Project project)
Get the project content path.
Parameters:
project - the project
Returns:
the project content path
See Also:
ProjectContent.getAllContents()

getContentPath

public Path getContentPath(Project project,
                           java.lang.String contentSetKey)
Get the project content path for a specific content set.
Parameters:
project - the project
contentSetKey - the content set key
Returns:
the project content path
See Also:
ProjectContent.getContentSet(java.lang.String)

getDirectDependencies

public java.util.Collection<Project> getDirectDependencies(Project project)
Get the projects that a project directly depends on.
Parameters:
project - the project
Returns:
the direct dependencies of the project

getTransitiveDependencies

public java.util.Collection<Project> getTransitiveDependencies(Project project)
                                                        throws java.lang.InterruptedException
Get the transitive closure of the projects a project depends on.
Parameters:
project - the project
Returns:
the transitive dependencies of a project
Throws:
java.lang.InterruptedException - if the calling thread is interrupted

getDownstreamDependencies

public java.util.Collection<Project> getDownstreamDependencies(Project project)
                                                        throws java.lang.InterruptedException
Get the downstream dependencies of a project. This is the set of projects that depend directly on the project.
Parameters:
project - the project
Returns:
the downstream dependencies
Throws:
java.lang.InterruptedException - if the calling thread is interrupted

getTechnologyScopeKeys

public java.lang.String[] getTechnologyScopeKeys(Project project)
Get the technology scope keys used by a project.
Parameters:
project - the project
Returns:
the technology scope keys

getPath

protected Path getPath(Project project,
                       java.lang.String key)
Get a path from the cache.
Parameters:
project - the project the path was cached for
key - the path key
Returns:
the cached path, or null if the path is not cached

putPath

protected void putPath(Project project,
                       java.lang.String key,
                       Path path)
Put a path in the cache.
Parameters:
project - the project the path is being cached for
key - the path key
path - the path to be cached

getLibraryPaths

protected LibraryPaths getLibraryPaths(Project project,
                                       java.lang.String key)
Get library paths from the cache.
Parameters:
project - the project the library paths were cached for
key - the library paths key
Returns:
the cached library paths, or null if the library paths are not in the cache

putLibraryPaths

protected void putLibraryPaths(Project project,
                               java.lang.String key,
                               LibraryPaths libraryPaths)
Put library paths into the cache.
Parameters:
project - the project the library paths are being cached for
key - the library paths key
libraryPaths - the library paths

getLibraryPathsList

protected java.util.List<LibraryPaths> getLibraryPathsList(Project project,
                                                           java.lang.String key)
Get a list of library paths from the cache.
Parameters:
project - the project the library paths list was cached for
key - the library paths list key
Returns:
the cached library paths, or null if the library paths list is not cached

putLibraryPathsList

protected void putLibraryPathsList(Project project,
                                   java.lang.String key,
                                   java.util.List<LibraryPaths> libraryPathsList)
Put a list of library paths into the cache.
Parameters:
project - the project the library paths list is being cached for
key - the library paths list key
libraryPathsList - the library paths list

loadProject

protected Project loadProject(Project project)
Gets the project in order to load it. All access to the project which would load the project should go through this method. This makes it easy to track project loading through the logger or by putting a breakpoint in this method. This should be called when there is a cache miss, making it necessary to load the project in order to populate the cache.
Returns:
the project

getLogger

protected java.util.logging.Logger getLogger()
Get the logger used to log messages related to the cache.
Returns:
the logger

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.2.0)

E17493-03


Copyright © 1997, 2012, Oracle. All rights reserved.