public final class ESWorkspaceProviderImpl extends Object implements ESWorkspaceProvider, ESCommitObserver, ESUpdateObserver, ESShareObserver, ESCheckoutObserver, ESDisposable
INSTANCE| Constructor and Description |
|---|
ESWorkspaceProviderImpl()
Default constructor.
|
ESWorkspaceProviderImpl(String id)
Constructor that creates an instance with a specific ID.
|
| Modifier and Type | Method and Description |
|---|---|
void |
checkoutDone(ESLocalProject project)
Called on checkout.
|
void |
commitCompleted(ESLocalProject project,
ESPrimaryVersionSpec newRevision,
org.eclipse.core.runtime.IProgressMonitor monitor)
Called after the commit is completed.
|
void |
dispose()
Marker method for classes that need to perform clean-up tasks.
|
void |
flushCommandStack()
Flushes the command stack.
|
AdminConnectionManager |
getAdminConnectionManager()
Get the admin connection manager.
|
ConnectionManager |
getConnectionManager()
Get the connection manager.
|
org.eclipse.emf.edit.domain.EditingDomain |
getEditingDomain()
Retrieve the editing domain.
|
static ESWorkspaceProviderImpl |
getInstance()
This method retrieves the instance of ESWorkspaceProviderImpl associated with this thread.
|
static ESWorkspaceProviderImpl |
getInstance(String workspaceProviderId)
This method retrieves the workspace provider instance associated with the given ID.
|
Workspace |
getInternalWorkspace()
Returns the internal workspace.
|
String |
getName() |
static ObserverBus |
getObserverBus()
Returns the
ObserverBus. |
static ProjectSpace |
getProjectSpace(org.eclipse.emf.ecore.EObject modelElement)
Retrieve the project space for a model element.
|
static ProjectSpace |
getProjectSpace(Project project)
Retrieve the project space for a project.
|
SessionManager |
getSessionManager()
Returns the
SessionManager. |
ESWorkspaceImpl |
getWorkspace()
Get the current workspace.
|
static void |
init()
Initialize the Workspace Manager.
|
static Runnable |
initRunnable(Runnable runnable)
This method is used by
ScopedWorkspaceThreadPoolExecutor which acts as a customized threadpool. |
boolean |
inspectChanges(ESLocalProject project,
ESChangePackage changePackage,
org.eclipse.core.runtime.IProgressMonitor monitor)
Called before the commit proceeds.
|
boolean |
inspectChanges(ESLocalProject project,
List<ESChangePackage> changePackages,
org.eclipse.core.runtime.IProgressMonitor monitor)
Called to notify the observer about the changes that will be merged into the project space.
|
boolean |
isDisposed()
Whether the current workspace is disposed.
|
void |
load()
(Re-)Initializes the workspace.
|
static void |
removeInstance(String token)
removes a workspace that is no longer needed, this also removes the
threadlocal reference to the workspace from the calling thread.
|
void |
setAdminConnectionManager(AdminConnectionManager adminConnectionManager)
Set the admin connection manager.
|
void |
setConnectionManager(ConnectionManager manager)
Set the connectionmanager.
|
void |
setEditingDomain(org.eclipse.emf.edit.domain.EditingDomain editingDomain)
Sets the EditingDomain.
|
void |
setName(String name) |
void |
setSessionProvider(ESAbstractSessionProvider sessionProvider)
Allows the user to set the
ESAbstractSessionProvider to use. |
void |
shareDone(ESLocalProject localProject)
Called when the share of the passed
ESLocalProject completed successfully. |
void |
updateCompleted(ESLocalProject project,
org.eclipse.core.runtime.IProgressMonitor monitor)
Called after the changes have been applied to the project and the update is completed.
|
public ESWorkspaceProviderImpl()
public ESWorkspaceProviderImpl(String id)
id - the workspace identifier for the instancepublic static Runnable initRunnable(Runnable runnable)
ScopedWorkspaceThreadPoolExecutor which acts as a customized threadpool.
When behavior is run in a
ScopedWorkspaceThreadPoolExecutor, the pool
first ensures that the thread local ESWorkspaceProviderImpl is taken from the thread that called for
behavior to be run in the threadpool, and then set as the
threadlocal instance for the thread running in the behavior in the threadpool.public String getName()
public void setName(String name)
name - the name to setpublic static ESWorkspaceProviderImpl getInstance()
public static ESWorkspaceProviderImpl getInstance(String workspaceProviderId)
workspaceProviderId - the workspace identifier, usually a session idpublic static void removeInstance(String token)
token - public static void init()
public org.eclipse.emf.edit.domain.EditingDomain getEditingDomain()
public void setEditingDomain(org.eclipse.emf.edit.domain.EditingDomain editingDomain)
editingDomain - new domain.public void dispose()
dispose in interface ESDisposableESDisposable.dispose()public boolean isDisposed()
true if the current workspace is disposed, false otherwisepublic void load()
public void flushCommandStack()
public AdminConnectionManager getAdminConnectionManager()
public void setAdminConnectionManager(AdminConnectionManager adminConnectionManager)
adminConnectionManager - the new AdminConnectionManager to be setpublic static ProjectSpace getProjectSpace(org.eclipse.emf.ecore.EObject modelElement)
modelElement - the model elementpublic static ProjectSpace getProjectSpace(Project project)
project - the projectpublic static ObserverBus getObserverBus()
ObserverBus.public SessionManager getSessionManager()
SessionManager.public ESWorkspaceImpl getWorkspace()
getWorkspace in interface ESWorkspaceProviderpublic Workspace getInternalWorkspace()
public ConnectionManager getConnectionManager()
public void setConnectionManager(ConnectionManager manager)
manager - connection manager.public void setSessionProvider(ESAbstractSessionProvider sessionProvider)
ESAbstractSessionProvider to use.setSessionProvider in interface ESWorkspaceProvidersessionProvider - the ESAbstractSessionProvider to useESWorkspaceProvider.setSessionProvider(ESAbstractSessionProvider)public void checkoutDone(ESLocalProject project)
checkoutDone in interface ESCheckoutObserverproject - the checked out projectESCheckoutObserver.checkoutDone(org.eclipse.emf.emfstore.client.ESLocalProject)public void shareDone(ESLocalProject localProject)
ESLocalProject completed successfully.shareDone in interface ESShareObserverlocalProject - the local project that has been sharedESShareObserver.shareDone(org.eclipse.emf.emfstore.client.ESLocalProject)public boolean inspectChanges(ESLocalProject project, List<ESChangePackage> changePackages, org.eclipse.core.runtime.IProgressMonitor monitor)
inspectChanges in interface ESUpdateObserverproject - the ESLocalProject that should be updatedchangePackages - a list of ESChangePackages containing the update changesmonitor - an IProgressMonitor instance that may be used by clients to inform
about progressfalse if the observer wants to cancel the update, true otherwiseESUpdateObserver.inspectChanges(org.eclipse.emf.emfstore.client.ESLocalProject,
java.util.List, org.eclipse.core.runtime.IProgressMonitor)public void updateCompleted(ESLocalProject project, org.eclipse.core.runtime.IProgressMonitor monitor)
updateCompleted in interface ESUpdateObserverproject - the ESLocalProject whose update has been completedmonitor - an IProgressMonitor instance that may be used by clients to inform
about progressESUpdateObserver.updateCompleted(org.eclipse.emf.emfstore.client.ESLocalProject,
org.eclipse.core.runtime.IProgressMonitor)public boolean inspectChanges(ESLocalProject project, ESChangePackage changePackage, org.eclipse.core.runtime.IProgressMonitor monitor)
inspectChanges in interface ESCommitObserverproject - the project the commit occurs onchangePackage - the ESChangePackagemonitor - an IProgressMonitor instance that may be used by clients to inform
about progressESCommitObserver.inspectChanges(org.eclipse.emf.emfstore.client.ESLocalProject,
org.eclipse.emf.emfstore.server.model.ESChangePackage, org.eclipse.core.runtime.IProgressMonitor)public void commitCompleted(ESLocalProject project, ESPrimaryVersionSpec newRevision, org.eclipse.core.runtime.IProgressMonitor monitor)
commitCompleted in interface ESCommitObserverproject - the project on which the commit has completednewRevision - the new revision that was created by the commitmonitor - an IProgressMonitor instance that may be used by clients to inform
about progressESCommitObserver.commitCompleted(org.eclipse.emf.emfstore.client.ESLocalProject,
org.eclipse.emf.emfstore.server.model.versionspec.ESPrimaryVersionSpec,
org.eclipse.core.runtime.IProgressMonitor)Copyright © 2017. All rights reserved.