geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject cvs commit: incubator-geronimo/modules/core/src/test/org/apache/geronimo/xml/deployment AbstractLoaderUtilTest.java
Date Mon, 05 Jan 2004 17:44:30 GMT
djencks     2004/01/05 09:44:30

  Modified:    modules/core/src/conf boot-service.xml
               modules/core/src/java/org/apache/geronimo/xml/deployment
                        LoaderUtil.java LocalEntityResolver.java
                        StorerUtil.java
               modules/core/src/test/org/apache/geronimo/xml/deployment
                        AbstractLoaderUtilTest.java
  Log:
  Reverse dependencies between Loader/StorerUtil and LocalEntityResolver
  
  Revision  Changes    Path
  1.26      +7 -1      incubator-geronimo/modules/core/src/conf/boot-service.xml
  
  Index: boot-service.xml
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/core/src/conf/boot-service.xml,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- boot-service.xml	2 Jan 2004 23:32:38 -0000	1.25
  +++ boot-service.xml	5 Jan 2004 17:44:30 -0000	1.26
  @@ -38,6 +38,12 @@
   
       </mbean>
   
  +    <mbean descriptor="org.apache.geronimo.xml.deployment.LoaderUtil"
  +        name="geronimo.xml:role=LoaderUtil"/>
  +
  +    <mbean descriptor="org.apache.geronimo.xml.deployment.StorerUtil"
  +        name="geronimo.xml:role=StorerUtil"/>
  +
       <!-- Log4j Logging Service -->
       <!--
       <mbean code="org.apache.geronimo.core.logging.log4j.Log4jService" name="geronimo.core:role=Logging">
  
  
  
  1.13      +17 -2     incubator-geronimo/modules/core/src/java/org/apache/geronimo/xml/deployment/LoaderUtil.java
  
  Index: LoaderUtil.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/core/src/java/org/apache/geronimo/xml/deployment/LoaderUtil.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- LoaderUtil.java	5 Jan 2004 00:05:35 -0000	1.12
  +++ LoaderUtil.java	5 Jan 2004 17:44:30 -0000	1.13
  @@ -63,6 +63,8 @@
   import javax.xml.parsers.DocumentBuilder;
   import javax.xml.parsers.DocumentBuilderFactory;
   import javax.xml.parsers.ParserConfigurationException;
  +import javax.management.ObjectName;
  +import javax.management.MalformedObjectNameException;
   
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
  @@ -77,6 +79,8 @@
   import org.xml.sax.EntityResolver;
   
   import org.apache.xerces.parsers.DOMParser;
  +import org.apache.geronimo.kernel.service.GeronimoMBeanInfo;
  +import org.apache.geronimo.kernel.service.GeronimoMBeanEndpoint;
   
   /**
    * Holds utility methods for parsing a DOM tree.
  @@ -89,7 +93,18 @@
   
       private static EntityResolver entityResolver;
   
  -    public static void setEntityResolver(EntityResolver entityResolver) {
  +    public static GeronimoMBeanInfo getGeronimoMBeanInfo() throws MalformedObjectNameException
{
  +        GeronimoMBeanInfo mBeanInfo = new GeronimoMBeanInfo();
  +        mBeanInfo.setTargetClass(LoaderUtil.class);
  +        mBeanInfo.addEndpoint(new GeronimoMBeanEndpoint("EntityResolver", EntityResolver.class,
ObjectName.getInstance("geronimo.xml:role=EntityResolver"), true));
  +        return mBeanInfo;
  +    }
  +
  +    public EntityResolver getEntityResolver() {
  +        return entityResolver;
  +    }
  +
  +    public void setEntityResolver(EntityResolver entityResolver) {
           LoaderUtil.entityResolver = entityResolver;
       }
   
  
  
  
  1.8       +1 -3      incubator-geronimo/modules/core/src/java/org/apache/geronimo/xml/deployment/LocalEntityResolver.java
  
  Index: LocalEntityResolver.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/core/src/java/org/apache/geronimo/xml/deployment/LocalEntityResolver.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- LocalEntityResolver.java	5 Jan 2004 00:05:35 -0000	1.7
  +++ LocalEntityResolver.java	5 Jan 2004 17:44:30 -0000	1.8
  @@ -168,8 +168,6 @@
           setLocalRepository(localRepository);
           setFailOnUnresolvable(failOnUnresolvable);
           setCatalogFile(catalogFile);
  -        LoaderUtil.setEntityResolver(this);
  -        StorerUtil.setEntityResolver(this);
       }
   
       /**
  
  
  
  1.3       +21 -4     incubator-geronimo/modules/core/src/java/org/apache/geronimo/xml/deployment/StorerUtil.java
  
  Index: StorerUtil.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/core/src/java/org/apache/geronimo/xml/deployment/StorerUtil.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- StorerUtil.java	2 Jan 2004 23:32:38 -0000	1.2
  +++ StorerUtil.java	5 Jan 2004 17:44:30 -0000	1.3
  @@ -67,12 +67,16 @@
   import javax.xml.parsers.DocumentBuilderFactory;
   import javax.xml.parsers.DocumentBuilder;
   import javax.xml.parsers.ParserConfigurationException;
  +import javax.management.MalformedObjectNameException;
  +import javax.management.ObjectName;
   
   import org.w3c.dom.Element;
   import org.w3c.dom.Document;
   import org.w3c.dom.NodeList;
   import org.w3c.dom.Node;
   import org.xml.sax.EntityResolver;
  +import org.apache.geronimo.kernel.service.GeronimoMBeanInfo;
  +import org.apache.geronimo.kernel.service.GeronimoMBeanEndpoint;
   
   /**
    * Holds utility methods for writing to a DOM tree
  @@ -80,8 +84,24 @@
    * @version $Revision$ $Date$
    */
   public class StorerUtil {
  +
       private static EntityResolver entityResolver;
   
  +    public static GeronimoMBeanInfo getGeronimoMBeanInfo() throws MalformedObjectNameException
{
  +        GeronimoMBeanInfo mBeanInfo = new GeronimoMBeanInfo();
  +        mBeanInfo.setTargetClass(StorerUtil.class);
  +        mBeanInfo.addEndpoint(new GeronimoMBeanEndpoint("EntityResolver", EntityResolver.class,
ObjectName.getInstance("geronimo.xml:role=EntityResolver"), true));
  +        return mBeanInfo;
  +    }
  +
  +    public EntityResolver getEntityResolver() {
  +        return entityResolver;
  +    }
  +
  +    public void setEntityResolver(EntityResolver entityResolver) {
  +        StorerUtil.entityResolver = entityResolver;
  +    }
  +
       /**
        * Creates a new child of the specified element, adds it as a child, and
        * returns it.
  @@ -245,7 +265,4 @@
           setText(child, value);
       }
   
  -    public static void setEntityResolver(LocalEntityResolver entityResolver) {
  -        StorerUtil.entityResolver = entityResolver;
  -    }
   }
  
  
  
  1.3       +5 -3      incubator-geronimo/modules/core/src/test/org/apache/geronimo/xml/deployment/AbstractLoaderUtilTest.java
  
  Index: AbstractLoaderUtilTest.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/core/src/test/org/apache/geronimo/xml/deployment/AbstractLoaderUtilTest.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- AbstractLoaderUtilTest.java	5 Jan 2004 00:05:36 -0000	1.2
  +++ AbstractLoaderUtilTest.java	5 Jan 2004 17:44:30 -0000	1.3
  @@ -76,6 +76,8 @@
   
       protected void setUp(String catalogFile, String docDirectory) {
           resolver = new LocalEntityResolver(catalogFile, docDirectory, true);
  +        new LoaderUtil().setEntityResolver(resolver);
  +        new StorerUtil().setEntityResolver(resolver);
       }
   
       /**
  @@ -83,8 +85,8 @@
        */
       protected void tearDown() throws Exception {
           resolver = null;
  -        LoaderUtil.setEntityResolver(null);
  -        StorerUtil.setEntityResolver(null);
  +        new LoaderUtil().setEntityResolver(null);
  +        new StorerUtil().setEntityResolver(null);
       }
   
   }
  
  
  

Mime
View raw message