Skip to content

Commit

Permalink
TEIIDDES-1757 changed extension plugin loading of built-in meds
Browse files Browse the repository at this point in the history
  • Loading branch information
mdrillin committed Jun 11, 2013
1 parent 65b9194 commit 1c3fb1f
Showing 1 changed file with 13 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ private void loadExtensibleMetamodelUriClassnameMap() {
/*
* Load the Built In MEDS (which are contributed from extension point) into the Registry.
*/
private void loadBuiltInMeds() {
private void loadBuiltInMeds() throws Exception {
final String EXT_PT = PLUGIN_ID + ".modelExtensionProvider"; //$NON-NLS-1$
final String PATH = "path"; //$NON-NLS-1$
final String CLASS_NAME = "className"; //$NON-NLS-1$
Expand Down Expand Up @@ -299,37 +299,24 @@ private void loadBuiltInMeds() {
continue;
}

ISafeRunnable runnable = new ISafeRunnable() {
/**
* {@inheritDoc}
*
* @see org.eclipse.core.runtime.ISafeRunnable#handleException(java.lang.Throwable)
*/
@Override
public void handleException( Throwable e ) {
Util.log(IStatus.ERROR, e, NLS.bind(Messages.errorProcessingDefinitionFile, path, pluginId));
}

/**
* {@inheritDoc}
*
* @see org.eclipse.core.runtime.ISafeRunnable#run()
*/
@Override
public void run() throws Exception {
ModelExtensionDefinition definition = getRegistry().addDefinition(new FileInputStream(defnFile),
(ModelExtensionAssistant)assistant);
definition.markAsBuiltIn();
}
};

SafeRunner.run(runnable);
ModelExtensionDefinition definition;
try {
definition = getRegistry().addDefinition(new FileInputStream(defnFile),(ModelExtensionAssistant)assistant);
} catch (Exception ex) {
Util.log(IStatus.ERROR, ex, NLS.bind(Messages.errorProcessingDefinitionFile, path, pluginId));
throw ex;
}
if(definition!=null) {
definition.markAsBuiltIn();
}

} catch (Exception e) {
Util.log(IStatus.ERROR, e, NLS.bind(Messages.errorProcessingModelExtension, pluginId));
}
}
} catch (Exception e) {
Util.log(IStatus.ERROR, e, NLS.bind(Messages.errorProcessingExtensionPoint, EXT_PT));
throw e;
}
}

Expand Down

0 comments on commit 1c3fb1f

Please sign in to comment.