Dali Provisional API
Release 3.2

org.eclipse.jpt.jpa.core
Interface JpaProjectManager

All Superinterfaces:
Model
All Known Subinterfaces:
JpaProject.Manager

public interface JpaProjectManager
extends Model

The JPA project manager holds all the JPA projects in an Eclipse workspace and provides support for executing long-running commands that modify the context model.

Retrieve a JPA project manager from a {#link JpaWorkspace JPA workspace}.

Not intended to be implemented by clients.

Provisional API: This interface is part of an interim API that is still under development and expected to change significantly before reaching stability. It is available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.

Since:
2.3

Field Summary
static String FACETED_PROJECT_FRAMEWORK_SETTINGS_FILE_NAME
          The name of the JPA faceted project framework settings file.
static String JPA_PROJECTS_COLLECTION
           
 
Method Summary
 void addJavaEventListenerFlag(org.eclipse.jpt.common.utility.reference.BooleanReference flag)
          Add a flag that will be used to determine whether the manager's JDT java event listener is active: If all the flags are true, the java listener is active.
 void execute(Command batchCommand)
          Suspend the current thread until the specified command is executed, configuring the JPA project manager appropriately so all events, JPA project updates, etc.
 void execute(Command command, ExtendedCommandExecutor threadLocalModifySharedDocumentCommandExecutor)
          Suspend the current thread until the specified command is executed, configuring the JPA project manager appropriately so all events, JPA project updates, etc.
 Iterable<JpaProject> getJpaProjects()
          Return the JPA project manager's JPA projects.
 int getJpaProjectsSize()
          The size returned here corresponds to the collection returned by getJpaProjects().
 JpaWorkspace getJpaWorkspace()
          Return the JPA project manager's JPA workspace.
 void removeJavaEventListenerFlag(org.eclipse.jpt.common.utility.reference.BooleanReference flag)
          Remove the specified flag.
 Iterable<JpaProject> waitToGetJpaProjects()
          Return the JPA project manager's JPA projects.
 
Methods inherited from interface org.eclipse.jpt.common.utility.model.Model
addChangeListener, addCollectionChangeListener, addListChangeListener, addPropertyChangeListener, addStateChangeListener, removeChangeListener, removeCollectionChangeListener, removeListChangeListener, removePropertyChangeListener, removeStateChangeListener
 

Field Detail

JPA_PROJECTS_COLLECTION

static final String JPA_PROJECTS_COLLECTION
See Also:
Constant Field Values

FACETED_PROJECT_FRAMEWORK_SETTINGS_FILE_NAME

static final String FACETED_PROJECT_FRAMEWORK_SETTINGS_FILE_NAME
The name of the JPA faceted project framework settings file. Listen for changes to this file to determine when the JPA facet is added to or removed from a "faceted" project.

See Also:
ProjectTools.hasFacet(org.eclipse.core.resources.IProject, org.eclipse.wst.common.project.facet.core.IProjectFacet), JpaProject.FACET
Method Detail

getJpaWorkspace

JpaWorkspace getJpaWorkspace()
Return the JPA project manager's JPA workspace.


waitToGetJpaProjects

Iterable<JpaProject> waitToGetJpaProjects()
                                          throws InterruptedException
Return the JPA project manager's JPA projects. This is a potentially long-running query (note the InterruptedException) as it will wait for any unbuilt JPA projects to be built or re-built.

Throws:
InterruptedException
See Also:
getJpaProjects()

getJpaProjects

Iterable<JpaProject> getJpaProjects()
Return the JPA project manager's JPA projects. The returned collection will not include any unbuilt or currently re-building JPA projects; but the client can listen for the appropriate events to be notified as JPA projects are added and/or removed from the collection.

See Also:
Model.addCollectionChangeListener(String, org.eclipse.jpt.common.utility.model.listener.CollectionChangeListener), JPA_PROJECTS_COLLECTION, waitToGetJpaProjects()

getJpaProjectsSize

int getJpaProjectsSize()
The size returned here corresponds to the collection returned by getJpaProjects().


execute

void execute(Command batchCommand)
             throws InterruptedException
Suspend the current thread until the specified command is executed, configuring the JPA project manager appropriately so all events, JPA project updates, etc. are handled synchronously. The assumption is this method will be called when either the workspace is "headless" (non-UI) or none of the change events are fired from anywhere but the UI thread (e.g. Java Reconciler fires change events in a background thread).

Throws:
InterruptedException
See Also:
execute(Command, ExtendedCommandExecutor)

execute

void execute(Command command,
             ExtendedCommandExecutor threadLocalModifySharedDocumentCommandExecutor)
             throws InterruptedException
Suspend the current thread until the specified command is executed, configuring the JPA project manager appropriately so all events, JPA project updates, etc. are handled synchronously. The assumption is this method will be called from within a job that may execute on a non-UI thread, necessitating a command executor that will modify on the UI thread any documents that are currently open in the UI.

Throws:
InterruptedException

addJavaEventListenerFlag

void addJavaEventListenerFlag(org.eclipse.jpt.common.utility.reference.BooleanReference flag)
Add a flag that will be used to determine whether the manager's JDT java event listener is active: This flag provides a way for clients to modify the context model directly without worrying about collisions caused by asynchronous JDT events.

See Also:
execute(Command, ExtendedCommandExecutor)

removeJavaEventListenerFlag

void removeJavaEventListenerFlag(org.eclipse.jpt.common.utility.reference.BooleanReference flag)
Remove the specified flag.

See Also:
addJavaEventListenerFlag(BooleanReference)

Dali Provisional API
Release 3.2

Copyright (c) 2012 Oracle. All rights reserved.