0 Replies Latest reply on Aug 29, 2004 2:45 AM by Raja

    Introspect EAR file to find contents

    Raja Master

      JBoss Version: 3.2.2RC4
      OS: Redhat 9
      JDK Version: 1.4.2

      Im trying to introspect a EAR file using JMX at runtime and find the components(jars, wars and sars) that make up the ear file. Is there a possible way to do this?
      Looks like the EAR Objectname has a "modules" attribute that displays only the web components and sar components. Tracing back through the source, the Defaultmanagedobjectfactorymap has mappings that exclude JARDeployer. The factoryMap(in DefaultManagedObjectFactoryMap) that it uses to get the <j2eecomponent>modulefactory has bindings for all types of services except the JARDeployer Service. There is also this piece of code that looks like i can use to add JarDeployers.

      if (factory == null)
      {
       Iterator iter = patternFactoryMap.keySet().iterator();
       while (iter.next())
       {
       ObjectName pattern = (ObjectName) iter.next();
       if (ObjectNameMatch.match(pattern, sendName))
       {
       factory = (ManagedObjectFactory) patternFactoryMap.get(pattern);
       }
       if (factory == null)
       {
       log.debug(.....);
       }
      }
      

      But unfortunately the patternFactoryMap by default is empty. Is there a way (through configuration) by which i can put in a value for the jardeployer pattern to be matched here so that a JArModuleFactory can add my jar module to the J2EEApplication thus showing up all the modules that make up my EAR?

      Or is there an alternative way to do this? My other option would be to use some scripting language to get the components that make up my Archive but i was just wondering if there is some information exposed through JMX

      Thanks in advance for any help/tips
      Raja