Skip to main content

[glassfish~svn:62354] Slight enhancement in ConfigModularityUtils.

  • From: kalali@...
  • To: commits@...
  • Subject: [glassfish~svn:62354] Slight enhancement in ConfigModularityUtils.
  • Date: Tue, 16 Jul 2013 10:50:11 +0000

Project:    glassfish
Repository: svn
Revision:   62354
Author:     kalali
Date:       2013-07-16 10:50:05 UTC
Link:       

Log Message:
------------
Slight enhancement in ConfigModularityUtils.


Revisions:
----------
62354


Modified Paths:
---------------
trunk/main/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/modularity/ConfigModularityUtils.java


Diffs:
------
Index: 
trunk/main/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/modularity/ConfigModularityUtils.java
===================================================================
--- 
trunk/main/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/modularity/ConfigModularityUtils.java
   (revision 62353)
+++ 
trunk/main/nucleus/admin/config-api/src/main/java/com/sun/enterprise/config/modularity/ConfigModularityUtils.java
   (revision 62354)
@@ -74,6 +74,7 @@
 import org.jvnet.hk2.config.ConfigParser;
 import org.jvnet.hk2.config.ConfigSupport;
 import org.jvnet.hk2.config.ConfigView;
+import org.jvnet.hk2.config.Configured;
 import org.jvnet.hk2.config.Dom;
 import org.jvnet.hk2.config.DomDocument;
 import org.jvnet.hk2.config.DuckTyped;
@@ -121,8 +122,9 @@
     @Inject
     private StartupContext context;
 
-    private boolean ignorePersisting=false;
-    private boolean isCommandInvocation=false;
+    private boolean ignorePersisting = false;
+    private boolean isCommandInvocation = false;
+
     public <U extends ConfigBeanProxy> URL getConfigurationFileUrl(Class<U> 
configBeanClass, String baseFileName, String runtimeType) {
         //TODO can be optimized a little by checking the default file...
         String fileName = runtimeType + "-" + baseFileName;
@@ -505,7 +507,7 @@
     }
 
     public synchronized <T extends ConfigBeanProxy> void 
applyCustomTokens(final ConfigBeanDefaultValue configBeanDefaultValue,
-                                                              T 
finalConfigBean, ConfigBeanProxy parent)
+                                                                           T 
finalConfigBean, ConfigBeanProxy parent)
             throws TransactionFailure, PropertyVetoException {
         //go up in the parents tree till meet someone 
ImplementingSystemProperty
         //then that is the freaking parent, get it and set the 
SystemProperty :D
@@ -954,4 +956,20 @@
     public void setCommandInvocation(boolean commandInvocation) {
         isCommandInvocation = commandInvocation;
     }
+
+    public List<Class> getInstalledExtensions(Class extensionType) {
+        List<Class> extensions = new ArrayList();
+        List<Class> cbeans = getAnnotatedConfigBeans(Configured.class);
+
+        for (Class c : cbeans) {
+            try {
+                if (c.asSubclass(extensionType) != null && c != 
extensionType) {
+                    extensions.add(c);
+                }
+            } catch (ClassCastException e) {
+                continue;
+            }
+        }
+        return extensions;
+    }
 }





[glassfish~svn:62354] Slight enhancement in ConfigModularityUtils.

kalali 07/16/2013
 
 
Close
loading
Please Confirm
Close