Author: scabanovich
Date: 2011-06-30 13:54:44 -0400 (Thu, 30 Jun 2011)
New Revision: 32502
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/extension/CDIExtensionManager.java
Log:
JBIDE-9087
https://issues.jboss.org/browse/JBIDE-9087
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/extension/CDIExtensionManager.java
===================================================================
---
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/extension/CDIExtensionManager.java 2011-06-30
15:47:37 UTC (rev 32501)
+++
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/extension/CDIExtensionManager.java 2011-06-30
17:54:44 UTC (rev 32502)
@@ -34,6 +34,7 @@
* Mapping of jar path to CDI extensions declared in it.
*/
Map<String, Set<String>> runtimes = new HashMap<String,
Set<String>>();
+ Set<String> allRuntimes = new HashSet<String>();
/**
* Mapping of extension ids (class names) to instances.
@@ -54,6 +55,10 @@
this.n = n;
}
+ public boolean isCDIExtensionAvailable(String runtimeClassName) {
+ return allRuntimes.contains(runtimeClassName);
+ }
+
public void pathRemoved(String path) {
Set<String> rs = runtimes.remove(path);
if(rs == null) return;
@@ -82,6 +87,7 @@
}
private void addRuntime(String runtime) {
+ allRuntimes.add(runtime);
CDIExtensionFactory factory = CDIExtensionFactory.getInstance();
Set<String> clss = factory.getExtensionClassesByRuntime(runtime);
if(clss != null) {
@@ -105,6 +111,7 @@
}
private void deleteRuntime(String runtime) {
+ allRuntimes.remove(runtime);
Set<String> clss =
CDIExtensionFactory.getInstance().getExtensionClassesByRuntime(runtime);
if(clss != null) {
for (String cls: clss) {