diff options
author | khussey | 2007-07-04 17:20:18 +0000 |
---|---|---|
committer | khussey | 2007-07-04 17:20:18 +0000 |
commit | 90b4a3c0dae3a16abb7ba31c057e90343e00f773 (patch) | |
tree | db717c3d38fe1ec7b36588ec64bc2a9d85cf8ecb /plugins/org.eclipse.uml2.common | |
parent | 1c92e90566a454d21467ee4eaa4ca25792f02c03 (diff) | |
download | org.eclipse.uml2-90b4a3c0dae3a16abb7ba31c057e90343e00f773.tar.gz org.eclipse.uml2-90b4a3c0dae3a16abb7ba31c057e90343e00f773.tar.xz org.eclipse.uml2-90b4a3c0dae3a16abb7ba31c057e90343e00f773.zip |
[195417] Allowing plug-in to be specified as part of system property for cache adapter class.
Diffstat (limited to 'plugins/org.eclipse.uml2.common')
-rw-r--r-- | plugins/org.eclipse.uml2.common/src/org/eclipse/uml2/common/util/CacheAdapter.java | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/plugins/org.eclipse.uml2.common/src/org/eclipse/uml2/common/util/CacheAdapter.java b/plugins/org.eclipse.uml2.common/src/org/eclipse/uml2/common/util/CacheAdapter.java index fd71bc65e..d5b94a9b3 100644 --- a/plugins/org.eclipse.uml2.common/src/org/eclipse/uml2/common/util/CacheAdapter.java +++ b/plugins/org.eclipse.uml2.common/src/org/eclipse/uml2/common/util/CacheAdapter.java @@ -8,7 +8,7 @@ * Contributors: * IBM - initial API and implementation * - * $Id: CacheAdapter.java,v 1.16 2007/02/08 14:39:47 khussey Exp $ + * $Id: CacheAdapter.java,v 1.17 2007/07/04 17:20:18 khussey Exp $ */ package org.eclipse.uml2.common.util; @@ -21,6 +21,7 @@ import java.util.Map; import java.util.Set; import java.util.WeakHashMap; +import org.eclipse.emf.common.CommonPlugin; import org.eclipse.emf.common.notify.Adapter; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.notify.Notifier; @@ -120,7 +121,15 @@ public class CacheAdapter if (!UML2Util.isEmpty(property)) { try { - return (CacheAdapter) Class.forName(property).newInstance(); + int index = property.indexOf(':'); + + if (index != -1) { + return (CacheAdapter) CommonPlugin.loadClass( + property.substring(0, index), + property.substring(index + 1)).newInstance(); + } else { + return (CacheAdapter) Class.forName(property).newInstance(); + } } catch (Exception e) { // ignore } |