|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.emf.emfstore.internal.client.model.ESWorkspaceProviderImpl
public final class ESWorkspaceProviderImpl
Controller for workspaces. Different threads can have a different instances associated with them. This is useful in the situation common where the client is a webserver, and different user sessions have different threads associated with them.
Field Summary |
---|
Fields inherited from interface org.eclipse.emf.emfstore.client.ESWorkspaceProvider |
---|
INSTANCE |
Constructor Summary | |
---|---|
ESWorkspaceProviderImpl()
Default constructor. |
|
ESWorkspaceProviderImpl(String id)
Constructor that creates an instance with a specific ID. |
Method Summary | |
---|---|
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. |
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. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ESWorkspaceProviderImpl()
public ESWorkspaceProviderImpl(String id)
id
- the workspace identifier for the instanceMethod Detail |
---|
public 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.
runnable
- the Runnable
to be executed in the context of the current workspace
Runnable
that accordingly sets the workspacepublic 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 id
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 ESDisposable
ESDisposable.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 element
public static ProjectSpace getProjectSpace(Project project)
project
- the project
public static ObserverBus getObserverBus()
ObserverBus
.
public SessionManager getSessionManager()
SessionManager
.
public ESWorkspaceImpl getWorkspace()
getWorkspace
in interface ESWorkspaceProvider
public Workspace getInternalWorkspace()
public ConnectionManager getConnectionManager()
public void setConnectionManager(ConnectionManager manager)
manager
- connection manager.public void setSessionProvider(ESAbstractSessionProvider sessionProvider)
ESAbstractSessionProvider
to use.
setSessionProvider
in interface ESWorkspaceProvider
sessionProvider
- the ESAbstractSessionProvider
to useESWorkspaceProvider.setSessionProvider(ESAbstractSessionProvider)
public void checkoutDone(ESLocalProject project)
checkoutDone
in interface ESCheckoutObserver
project
- the checked out projectESCheckoutObserver.checkoutDone(org.eclipse.emf.emfstore.client.ESLocalProject)
public void shareDone(ESLocalProject localProject)
ESLocalProject
completed successfully.
shareDone
in interface ESShareObserver
localProject
- 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 ESUpdateObserver
project
- the ESLocalProject
that should be updatedchangePackages
- a list of ESChangePackage
s containing the update changesmonitor
- an IProgressMonitor
instance that may be used by clients to inform
about progress
false
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 ESUpdateObserver
project
- 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 ESCommitObserver
project
- the project the commit occurs onchangePackage
- the ESChangePackage
monitor
- an IProgressMonitor
instance that may be used by clients to inform
about progress
ESCommitObserver.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 ESCommitObserver
project
- 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)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |