Skip to content

Commit

Permalink
Bug 466617 - Extension points do not work
Browse files Browse the repository at this point in the history
Fixed org.eclipse.emf.emfstore.client.workspaceInitObserver extension
point, also fixed typo

Change-Id: I35efa0ea646a556ec8bbfd3d861888c224e6d718
  • Loading branch information
edgarmueller committed May 28, 2015
1 parent 6fc7b2e commit eee3696
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@
* @author jfaltermeier
*/
public final class ESWorkspaceProviderImpl implements ESWorkspaceProvider, ESCommitObserver, ESUpdateObserver,
ESShareObserver, ESCheckoutObserver, ESDisposable {
ESShareObserver, ESCheckoutObserver, ESDisposable {

private static final String WORKSPACE_INIT_EXT_POINT_ID = "org.eclipse.emf.emfstore.client.workspaceInitObserver"; //$NON-NLS-1$

/**
* This thread local variable stores the ESWorkspaceProviderImpl associated with this thread.
Expand All @@ -90,8 +92,7 @@ public final class ESWorkspaceProviderImpl implements ESWorkspaceProvider, ESCom
* threads associated with them. When new threads are started this this threadlocal variable
* is inherited by the newly created thread.
*/
private static final ThreadLocal<ESWorkspaceProviderImpl> WS_THREAD_LOCAL =
new InheritableThreadLocal<ESWorkspaceProviderImpl>();
private static final ThreadLocal<ESWorkspaceProviderImpl> WS_THREAD_LOCAL = new InheritableThreadLocal<ESWorkspaceProviderImpl>();

private static final String DEFAULT_WORKSPACE_ID = "default"; //$NON-NLS-1$

Expand Down Expand Up @@ -173,8 +174,7 @@ public void setName(String name) {
*/
public static ESWorkspaceProviderImpl getInstance() {
if (WS_THREAD_LOCAL.get() == null) {
if (defaultInstance == null)
{
if (defaultInstance == null) {
try {
defaultInstance = new ESWorkspaceProviderImpl(DEFAULT_WORKSPACE_ID);
defaultInstance.initialize();
Expand Down Expand Up @@ -515,12 +515,13 @@ void initialize() {
* Notifies all {@link ESWorkspaceInitObserver} that the workspace initialization is complete.
*/
void notifyPostWorkspaceInitiators() {
for (final ESExtensionElement element : new ESExtensionPoint("org.eclipse.emf.emfstore.client.notify.postinit", //$NON-NLS-1$
true).getExtensionElements()) {
final List<ESExtensionElement> extensionElements = new ESExtensionPoint(WORKSPACE_INIT_EXT_POINT_ID, true)
.getExtensionElements();
for (final ESExtensionElement element : extensionElements) {
try {
element.getClass("class", ESWorkspaceInitObserver.class).workspaceInitComplete( //$NON-NLS-1$
currentWorkspace
.toAPI());
element
.getClass("class", ESWorkspaceInitObserver.class) //$NON-NLS-1$
.workspaceInitComplete(currentWorkspace.toAPI());
} catch (final ESExtensionPointException e) {
WorkspaceUtil.logException(e.getMessage(), e);
}
Expand Down Expand Up @@ -601,7 +602,8 @@ protected void doRun() {
} catch (final IOException e) {
WorkspaceUtil.logException(
Messages.ESWorkspaceProviderImpl_Create_Workspace_Failed
+ Configuration.getFileInfo().getWorkspaceDirectory(), e);
+ Configuration.getFileInfo().getWorkspaceDirectory(),
e);
}
return workspace;
}
Expand Down Expand Up @@ -697,7 +699,8 @@ public void shareDone(ESLocalProject localProject) {
* @see org.eclipse.emf.emfstore.client.observer.ESUpdateObserver#inspectChanges(org.eclipse.emf.emfstore.client.ESLocalProject,
* java.util.List, org.eclipse.core.runtime.IProgressMonitor)
*/
public boolean inspectChanges(ESLocalProject project, List<ESChangePackage> changePackages, IProgressMonitor monitor) {
public boolean inspectChanges(ESLocalProject project, List<ESChangePackage> changePackages,
IProgressMonitor monitor) {
return true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ private WorkspaceLocator() {

}

private static final Map<String, ESWorkspaceProviderImpl> WORKSPACE_PROVIDER_MAP =
new LinkedHashMap<String, ESWorkspaceProviderImpl>();
private static final Map<String, ESWorkspaceProviderImpl> WORKSPACE_PROVIDER_MAP = new LinkedHashMap<String, ESWorkspaceProviderImpl>();

/**
* Creates a workspace and associates it with the given ID.
Expand Down Expand Up @@ -65,7 +64,7 @@ private static ESWorkspaceProviderImpl createWorkspace(String workspaceProviderI
}

/**
* Checks whether a workspace provier exists for the given identifier.
* Checks whether a workspace provider exists for the given identifier.
*
* @param workspaceProviderId
* the workspace provider identifier
Expand Down

0 comments on commit eee3696

Please sign in to comment.