User: starksm 
  Date: 02/04/04 00:22:29

  Modified:    catalina/src/main/org/jboss/web/catalina Tag: Branch_2_4
                        ConfigHandler.java EmbeddedCatalinaServiceSX.java
                        EmbeddedCatalinaServiceSXMBean.java
                        Log4jLogger.java
  Added:       catalina/src/main/org/jboss/web/catalina Tag: Branch_2_4
                        EmbeddedCatalina.java EngineCreateAction.java
                        LoggedXmlMapper.java
  Log:
  Drop the default engine and connector setup via JMX attributes and
  simply configure using the XmlMapper and a subset of the server.xml
  DTD as an embedded configuration within the EmbeddedCatalinaServiceSX config.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.2   +140 -61   
contrib/catalina/src/main/org/jboss/web/catalina/ConfigHandler.java
  
  Index: ConfigHandler.java
  ===================================================================
  RCS file: 
/cvsroot/jboss/contrib/catalina/src/main/org/jboss/web/catalina/ConfigHandler.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- ConfigHandler.java        12 Nov 2001 19:21:18 -0000      1.1.2.1
  +++ ConfigHandler.java        4 Apr 2002 08:22:28 -0000       1.1.2.2
  @@ -1,80 +1,159 @@
  +/*
  + * JBoss, the OpenSource WebOS
  + *
  + * Distributable under LGPL license.
  + * See terms of license at gnu.org.
  + */
   package org.jboss.web.catalina;
   
  -import java.io.ByteArrayInputStream;
  -import java.io.InputStream;
  +import java.util.Stack;
  +import javax.xml.transform.Transformer;
  +import javax.xml.transform.TransformerException;
  +import javax.xml.transform.TransformerFactory;
  +import javax.xml.transform.dom.DOMSource;
  +import javax.xml.transform.sax.SAXResult;
  +
   import org.w3c.dom.Element;
   
  +import org.apache.catalina.startup.Embedded;
  +import org.apache.catalina.util.xml.SaxContext;
   import org.apache.catalina.util.xml.XmlAction;
  -import org.apache.catalina.util.xml.XmlMapper;
  +
  +import org.jboss.logging.Logger;
   
   /** This is a step toward supporting elements of the catalina server.xml config
    as child elements of the jboss.jcml mbean/config extended configuration element.
  -
  - * @author  [EMAIL PROTECTED]
  - * @version $Revision: 1.1.2.1 $
  + 
  +@author [EMAIL PROTECTED]
  +@author [EMAIL PROTECTED]
  +@version $Revision: 1.1.2.2 $
    */
   public class ConfigHandler
   {
  -
  +   private Logger log;
  +   
      /** Creates new ConfigHandler */
  -    public ConfigHandler()
  -    {
  -    }
  +   public ConfigHandler(Logger log)
  +   {
  +      this.log = log;
  +   }
   
  -    /** Handle the Connector configuration elements.
  +   /** Handle the Connector configuration elements.
       @param config, the mbean/config jboss.jcml element
       @param root, the object to which the Connectors will be added using
  -       addConnector
  +    addConnector
       @param debug, a flag indicating if the XmlMapper debug level should be set
       */
  -    public void applyHostConfig(Element config, Object root, boolean debug)
  +   public void applyHostConfig(Element config, Embedded embedded, boolean debug)
         throws Exception
  -    {
  -       if( config == null )
  -          return;
  -
  -       // Create an XmlMapper utility
  -        XmlMapper mapper = new XmlMapper();
  -        if (debug)
  -            mapper.setDebug(999);
  -        mapper.setValidating(false);
  -        // Establish the mapping rules for Connectors
  -        mapper.addRule("Connector", mapper.objectCreate
  -                       ("org.apache.catalina.connector.http.HttpConnector",
  -                        "className"));
  -        mapper.addRule("Connector", mapper.setProperties());
  -        mapper.addRule("Connector", mapper.addChild
  -                       ("addConnector", "org.apache.catalina.Connector"));
  -        mapper.addRule("Connector/Factory", mapper.objectCreate
  -                       ("org.apache.catalina.net.DefaultServerSocketFactory",
  -                        "className"));
  -        mapper.addRule("Connector/Factory",
  -                       mapper.setProperties());
  -        mapper.addRule("Connector/Factory", mapper.addChild
  -                       ("setFactory",
  -                        "org.apache.catalina.net.ServerSocketFactory"));
  -        mapper.addRule("Server/Service/Connector/Listener", mapper.objectCreate
  -                       (null, "className"));
  -        mapper.addRule("Server/Service/Connector/Listener",
  -                       mapper.setProperties());
  -        mapper.addRule("Server/Service/Connector/Listener", mapper.addChild
  -                       ("addLifecycleListener",
  -                        "org.apache.catalina.LifecycleListener"));
  -
  -        InputStream is = createElementStream(config);
  -        mapper.readXml(is, root);
  -    }
  -
  -    /** This is hacky as it depends on the Element.toString() which is
  -     not documented as returning the complete xml document text, but
  -     appears to to work. I can't believe there isn't a standard way to
  -     reparse a document from a given DOM node or to at least generate
  -     a text file!
  -     */
  -    private InputStream createElementStream(Element config)
  -    {
  -       String xmlFrag = config.toString();
  -       byte[] bytes = xmlFrag.getBytes();
  -       return new ByteArrayInputStream(bytes);
  -    }
  +   {
  +      if( config == null )
  +         return;
  +
  +      // Create an XmlMapper utility
  +      LoggedXmlMapper mapper = new LoggedXmlMapper(log);
  +      if (debug)
  +         mapper.setDebug(999);
  +      mapper.setValidating(false);
  +
  +      mapper.addRule("Server/Service", mapper.objectCreate
  +         ("org.apache.catalina.core.StandardService", "className"));
  +      mapper.addRule("Server/Service", mapper.setProperties());
  +      mapper.addRule("Server/Service", mapper.addChild
  +         ("addService", "org.apache.catalina.Service"));
  +
  +      // Setup the mapping rules for Connectors
  +      mapper.addRule("Service/Connector", mapper.objectCreate
  +         ("org.apache.catalina.connector.http.HttpConnector", "className"));
  +      mapper.addRule("Service/Connector", mapper.setProperties());
  +      mapper.addRule("Service/Connector", mapper.addChild
  +         ("addConnector", "org.apache.catalina.Connector"));
  +      mapper.addRule("Service/Connector/Factory", mapper.objectCreate
  +         ("org.apache.catalina.net.DefaultServerSocketFactory", "className"));
  +      mapper.addRule("Service/Connector/Factory",
  +      mapper.setProperties());
  +      mapper.addRule("Service/Connector/Factory", mapper.addChild
  +         ("setFactory", "org.apache.catalina.net.ServerSocketFactory"));
  +
  +      // Setup the mapping rules for Engines
  +      mapper.addRule("Service/Engine", new 
EngineCreateAction("org.apache.catalina.core.StandardEngine",
  +         "className"));
  +      mapper.addRule("Service/Engine", mapper.setProperties());
  +      mapper.addRule("Service/Engine", mapper.addChild
  +         ("addEngine", "org.apache.catalina.Engine"));
  +
  +      // Setup the mapping rules for Engine virtual hosts
  +      mapper.addRule("Service/Engine/Host",
  +      mapper.objectCreate("org.apache.catalina.core.StandardHost", "className"));
  +      mapper.addRule("Service/Engine/Host", mapper.setProperties());
  +      mapper.addRule("Service/Engine/Host",  mapper.addChild("addChild", 
"org.apache.catalina.Container"));
  +      mapper.addRule("Service/Engine/Host/Alias", 
mapper.methodSetter("addAlias",0));
  +
  +      // Setup the mapping rules common to both Engine and Host
  +      String engineOrHost[] = {"Service/Engine", "Service/Engine/Host"};
  +      for(int i=0;i<engineOrHost.length;i++)
  +      {
  +         String prefix=engineOrHost[i];
  +         // Logger rules
  +         mapper.addRule(prefix+"/Logger",
  +            mapper.objectCreate("org.jboss.web.catalina.Log4jLogger", "className"));
  +         mapper.addRule(prefix+"/Logger", mapper.setProperties());
  +         mapper.addRule(prefix+"/Logger", 
mapper.setParent("setContainer","org.apache.catalina.Container"));
  +         mapper.addRule(prefix+"/Logger", mapper.addChild("setLogger", 
"org.apache.catalina.Logger"));
  +
  +         // DefaultContext rules
  +         mapper.addRule(prefix+"/DefaultContext",
  +            mapper.objectCreate("org.apache.catalina.core.DefaultContext", 
"className"));
  +         mapper.addRule(prefix+"/DefaultContext", mapper.setProperties());
  +         mapper.addRule(prefix+"/DefaultContext",
  +            mapper.setParent("setParent", "org.apache.catalina.Container"));
  +         mapper.addRule(prefix+"/DefaultContext",
  +            mapper.addChild("addDefaultContext", 
"org.apache.catalina.core.DefaultContext"));
  +         // add container default context various listeners
  +         mapper.addRule(prefix + "/DefaultContext/WrapperLifecycle",
  +            mapper.methodSetter("addWrapperLifecycle", 0));
  +         mapper.addRule(prefix + "/DefaultContext/InstanceListener",
  +            mapper.methodSetter("addInstanceListener", 0));
  +         mapper.addRule(prefix + "/DefaultContext/WrapperListener",
  +            mapper.methodSetter("addWrapperListener", 0));
  +
  +         // add container valve
  +         mapper.addRule(prefix+"/Valve", mapper.objectCreate(null, "className"));
  +         mapper.addRule(prefix+"/Valve", mapper.setProperties());
  +         mapper.addRule(prefix+"/Valve",
  +            mapper.setParent("setContainer", "org.apache.catalina.Container"));
  +         mapper.addRule(prefix+"/Valve",
  +            mapper.addChild("addValve", "org.apache.catalina.Valve"));
  +      }
  +
  +      // Add the Listener rules to Engine, Engine/Host, and Connector
  +      String lifeCycling[] = {"Service/Engine", "Service/Engine/Host", 
"Service/Connector"};
  +      for(int i = 0; i < lifeCycling.length; i ++)
  +      {
  +         String prefix = lifeCycling[i];
  +         mapper.addRule(prefix + "/Listener", mapper.objectCreate(null, 
"className"));
  +         mapper.addRule(prefix + "/Listener", mapper.setProperties());
  +         mapper.addRule(prefix + "/Listener", 
mapper.addChild("addLifecycleListener",
  +            "org.apache.catalina.LifecycleListener"));
  +      }
  +
  +      /* Push the Embedded onto the config object stack and transform the DOM
  +       Config element into a SAX event stream so that the XmlMapper parses the
  +       configuration
  +      */
  +      Stack st = mapper.getObjectStack();
  +      st.push(embedded);
  +      try
  +      {
  +         TransformerFactory tFactory = TransformerFactory.newInstance();
  +         Transformer transformer = tFactory.newTransformer();
  +         transformer.transform(new DOMSource(config), new SAXResult(mapper));
  +      }
  +      catch(TransformerException e)
  +      {
  +         Throwable t = e.getException();
  +         throw e;
  +      }
  +   }
  +
   }
  
  
  
  1.2.2.6   +25 -216   
contrib/catalina/src/main/org/jboss/web/catalina/EmbeddedCatalinaServiceSX.java
  
  Index: EmbeddedCatalinaServiceSX.java
  ===================================================================
  RCS file: 
/cvsroot/jboss/contrib/catalina/src/main/org/jboss/web/catalina/EmbeddedCatalinaServiceSX.java,v
  retrieving revision 1.2.2.5
  retrieving revision 1.2.2.6
  diff -u -r1.2.2.5 -r1.2.2.6
  --- EmbeddedCatalinaServiceSX.java    8 Dec 2001 20:23:01 -0000       1.2.2.5
  +++ EmbeddedCatalinaServiceSX.java    4 Apr 2002 08:22:28 -0000       1.2.2.6
  @@ -1,5 +1,5 @@
   /*
  - * JBoss, the OpenSource EJB server
  + * JBoss, the OpenSource WebOS
    *
    * Distributable under LGPL license.
    * See terms of license at gnu.org.
  @@ -30,6 +30,7 @@
   import org.xml.sax.InputSource;
   
   import org.jboss.deployment.DeploymentException;
  +import org.jboss.metadata.WebMetaData;
   import org.jboss.security.SecurityDomain;
   import org.jboss.web.AbstractWebContainer;
   import org.jboss.web.AbstractWebContainer.WebDescriptorParser;
  @@ -38,7 +39,6 @@
   import org.jboss.web.catalina.security.SSLServerSocketFactory;
   
   import org.apache.log4j.Category;
  -import org.apache.log4j.Priority;
   import org.apache.catalina.Connector;
   import org.apache.catalina.Container;
   import org.apache.catalina.Context;
  @@ -53,12 +53,7 @@
   import org.apache.catalina.Realm;
   import org.apache.catalina.Valve;
   import org.apache.catalina.authenticator.AuthenticatorBase;
  -import org.apache.catalina.connector.http.HttpConnector;
  -import org.apache.catalina.connector.warp.WarpConnector;
  -import org.apache.catalina.connector.warp.WarpHost;
  -import org.apache.catalina.connector.warp.WarpEngine;
   import org.apache.catalina.core.StandardContext;
  -import org.apache.catalina.loader.WebappClassLoader;
   import org.apache.catalina.startup.Embedded;
   
   /** An implementation of the AbstractWebContainer for the Jakarta Tomcat
  @@ -69,7 +64,7 @@
    @see org.apache.catalina.startup.Embedded
    
    @author [EMAIL PROTECTED]
  - @version $Revision: 1.2.2.5 $
  + @version $Revision: 1.2.2.6 $
    */
   public class EmbeddedCatalinaServiceSX extends AbstractWebContainer implements 
EmbeddedCatalinaServiceSXMBean
   {
  @@ -77,28 +72,11 @@
      public static final String NAME = "EmbeddedCatalinaSX";
   
      /** The embedded instance used to configure catalina */
  -   private Embedded catalina;
  -   /** The catalina host container */
  -   private Host catalinaHost;
  +   private EmbeddedCatalina catalina;
      /** The catalina debug level */
      private int debugLevel;
  -   /** The port the web server listens on */
  -   private int port = 8080;
  -   /** The interface to bind to. This is useful for multi-homed hosts
  -      that want control over which interfaces accept connections. */
  -   private InetAddress bindAddress;
  -   /** The accept count for this Connector. */
  -   private int acceptCount = 10;
  -   /** The "enable DNS lookups" flag. */
  -   private boolean enableLookups = false;
  -   /** The minimum number of processors to start at initialization time. */
  -   protected int minProcessors = 5;
  -   /**The maximum number of processors allowed, or <0 for unlimited. */
  -   private int maxProcessors = 20;
      /** The JNDI name of the SecurityDomain implementation binding */
      private String securityDomain;
  -   /** The type of connector that Tomcat will run (HTTP or WARP) */
  -   private String connectorType = "http";
      /** Any extended configuration information specified via a config
       element in the mbean definition.
       */
  @@ -113,83 +91,6 @@
         return NAME;
      }
   
  -   public void setPort(int port)
  -   {
  -      this.port = port;
  -   }
  -   public int getPort()
  -   {
  -      return port;
  -   }
  -
  -   public String getBindAddress()
  -   {
  -      String address = "0.0.0.0";
  -      if( bindAddress != null )
  -         address = bindAddress.getHostAddress();
  -      return address;
  -   }
  -   public void setBindAddress(String host) throws UnknownHostException
  -   {
  -      if( host == null || host.length() == 0 )
  -         bindAddress = null;
  -      else
  -         bindAddress = InetAddress.getByName(host);
  -   }
  -
  -   public String getConnectorType()
  -   {
  -      return this.connectorType;
  -   }
  -
  -   public void setConnectorType(String type)
  -   {
  -      type = type.toLowerCase();
  -      if( type.equals("http") == false && type.equals("warp") == false )
  -      {
  -         String msg= "Invalid connector type: "+connectorType
  -            + " must be one of, http warp";
  -         throw new IllegalArgumentException(msg);
  -      }
  -      this.connectorType = type;
  -   }
  -
  -   public int getMinProcessors()
  -   {
  -      return this.minProcessors;
  -   }
  -   public void setMinProcessors(int minProcessors)
  -   {
  -      this.minProcessors = minProcessors;
  -   }
  -
  -   public int getMaxProcessors()
  -   {
  -      return this.maxProcessors;
  -   }
  -   public void setMaxProcessors(int maxProcessors)
  -   {
  -      this.maxProcessors = maxProcessors;
  -   }
  -
  -    public int getAcceptCount()
  -    {
  -       return this.acceptCount;
  -    }
  -    public void setAcceptCount(int acceptCount)
  -    {
  -       this.acceptCount = acceptCount;
  -    }
  -
  -    public boolean getEnableLookups()
  -    {
  -       return enableLookups;
  -    }
  -    public void setEnableLookups(boolean enableLookups)
  -    {
  -       this.enableLookups = enableLookups;
  -    }
  -
       public String getSecurityDomain()
       {
          return this.securityDomain;
  @@ -210,7 +111,7 @@
   
      public void startService() throws Exception
      {
  -      log.info("Starting " + NAME + "....");
  +      log.info("Starting...");
   
         // Start create the embeded catalina container but don't let it overwrite the 
thread class loader
         URLClassLoader cl = (URLClassLoader) 
Thread.currentThread().getContextClassLoader();
  @@ -267,21 +168,16 @@
   
      /** Perform the tomcat specific deployment steps.
       */
  -   protected WebApplication performDeploy(String ctxPath, String warUrl,
  +   protected void performDeploy(WebApplication appInfo, String warUrl,
         WebDescriptorParser webAppParser) throws Exception
      {
  -      if( ctxPath.equals("/") )
  -      {
  -       log.info("Changing root context path from '/' to ''");
  -       ctxPath = "";
  -      }
  +      WebMetaData metaData = appInfo.getMetaData();
  +      String ctxPath = metaData.getContextRoot();
         log.info("deploy, ctxPath="+ctxPath+", warUrl="+warUrl);
  -      ClassLoader ctxClassLoader = Thread.currentThread().getContextClassLoader();
   
         URL url = new URL(warUrl);
  -      WebApplication appInfo = createWebContext(ctxPath, url, webAppParser);
  +      createWebContext(appInfo, url, webAppParser);
         log.debug("Initialized: "+appInfo);
  -      return appInfo;
      }
   
      /** Perform the tomcat specific deployment steps.
  @@ -298,7 +194,7 @@
            throw new DeploymentException("URL " + warUrl + " is not deployed");
   
         String ctxPath = context.getPath();
  -      Deployer deployer = (Deployer) catalinaHost;
  +      Deployer deployer = (Deployer) context.getParent();
         deployer.remove(ctxPath);
      }
   
  @@ -310,100 +206,30 @@
      {
         Logger jbossLog = new Log4jLogger(this.log);
         Realm jbossRealm = new JBossSecurityMgrRealm();
  -      catalina = new Embedded(jbossLog, jbossRealm);
  +      catalina = new EmbeddedCatalina(jbossLog, jbossRealm);
         catalina.setDebug(debugLevel);
         catalina.setUseNaming(false);
   
  -      // Setup the primary engine and connector
  -      if( connectorType.equals("http") )
  -         initHttpConnector(parent, jbossLog, jbossRealm);
  -      else if( connectorType.equals("warp") )
  -         initWarpConnector(parent, jbossLog, jbossRealm);
  -      else
  -         throw new IllegalStateException("No valid connectorType");
  -
         // Apply any extended configuration
  -      ConfigHandler handler = new ConfigHandler();
  +      ConfigHandler handler = new ConfigHandler(log);
         handler.applyHostConfig(extendedConfig, catalina, debugLevel > 0);
      }
   
  -   private void initHttpConnector(ClassLoader parent, Logger jbossLog, Realm 
jbossRealm)
  -      throws IOException, NamingException
  -   {
  -      log.info("Building Http engine and connector");
  -      String hostname = "localhost";
  -      if( bindAddress != null )
  -         hostname = bindAddress.getHostName();
  -      // Create the engine
  -      Engine engine = catalina.createEngine();
  -      engine.setDefaultHost(hostname);
  -      engine.setParentClassLoader(parent);
  -      // Create a host for the root context
  -      catalinaHost = catalina.createHost(hostname, "");
  -      engine.addChild(catalinaHost);
  -
  -      // Install the engine
  -      catalina.addEngine(engine);
  -
  -      // Create the warp connector and set its properties
  -      HttpConnector connector = (HttpConnector) 
catalina.createConnector(bindAddress, port, false);
  -      connector.setAcceptCount(acceptCount);
  -      connector.setMinProcessors(minProcessors);
  -      connector.setMaxProcessors(maxProcessors);
  -      connector.setEnableLookups(enableLookups);
  -      // Enable a secure connector if a security domain was specified
  -      if( securityDomain != null )
  -      {
  -         connector.setScheme("https");
  -         connector.setSecure(true);
  -         InitialContext iniCtx = new InitialContext();
  -         SecurityDomain domain = (SecurityDomain) iniCtx.lookup(securityDomain);
  -         connector.setFactory(new SSLServerSocketFactory(domain));
  -      }
  -      catalina.addConnector(connector);
  -   }
  -   private void initWarpConnector(ClassLoader parent, Logger jbossLog, Realm 
jbossRealm)
  -   {
  -      log.info("Building Warp engine and connector");
  -      String hostname = "localhost";
  -      if( bindAddress != null )
  -         hostname = bindAddress.getHostName();
  -      // Create the engine
  -      WarpEngine warpEngine = new WarpEngine();
  -      warpEngine.setDebug(debugLevel);
  -      warpEngine.setLogger(jbossLog);
  -      warpEngine.setRealm(jbossRealm);
  -      warpEngine.setDefaultHost(hostname);
  -      warpEngine.setParentClassLoader(parent);
  -      // Create a host for the root context      
  -      WarpHost warpHost = new WarpHost();
  -      warpHost.setAppBase("");
  -      warpHost.setName(hostname);
  -      warpHost.setDebug(debugLevel);
  -      warpEngine.addChild(warpHost);
  -
  -      // Install the engine
  -      catalina.addEngine(warpEngine);
  -
  -      // Create the warp connector and set its properties
  -      WarpConnector warpConnector = new WarpConnector();
  -      warpConnector.setAcceptCount(acceptCount);
  -      warpConnector.setEnableLookups(enableLookups);
  -      warpConnector.setPort(port);
  -      if (bindAddress != null)
  -         warpConnector.setAddress(hostname);
  -      catalina.addConnector(warpConnector);
  -      catalinaHost = warpHost;
  -   }
  -
  -   private WebApplication createWebContext(String ctxPath, URL warUrl,
  -      final WebDescriptorParser webAppParser) throws IOException
  +   private void createWebContext(final WebApplication appInfo, URL warUrl,
  +      final WebDescriptorParser webAppParser) throws Exception
      {
         ClassLoader loader = Thread.currentThread().getContextClassLoader();
  -      final WebApplication appInfo = new WebApplication(warUrl.getPath(), warUrl, 
loader);
  +      WebMetaData metaData = appInfo.getMetaData();
  +      String ctxPath = metaData.getContextRoot();
  +      appInfo.setName(warUrl.getPath());
  +      appInfo.setClassLoader(loader);
  +      appInfo.setURL(warUrl);
         final StandardContext context = (StandardContext) 
catalina.createContext(ctxPath, warUrl.getFile());
         context.setParentClassLoader(loader);
   
  +      String hostName = metaData.getVirtualHost();
  +      Host virtualHost = catalina.findHost(hostName);
  +
         /* We need to establish the JNDI ENC prior to the start of the web container
          so that init on startup servlets are able to interact with their ENC. We
          hook into the context lifecycle events to be notified of the start of the
  @@ -425,8 +251,7 @@
         // A debug level of 1 is rather verbose so only enable debugging if trace 
priority is active
         if( debugLevel <= 1 )
            context.setDebug(0);
  -      catalinaHost.addChild(context);
  -      return appInfo;
  +      virtualHost.addChild(context);
      }
   
      /** Build the web application ENC.
  @@ -464,27 +289,11 @@
                  }
               }
   
  -            // Apply any extended configuration to the context
  -
  -            // Get the web-app.xml and jboss-web.xml deployment descriptors 
  -            DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
  -            DocumentBuilder parser = factory.newDocumentBuilder();
  -            parser.setEntityResolver(new LocalResolver());
  -            Document webDoc = parser.parse(stream);
  -            Element web = webDoc.getDocumentElement();
  -            Element jbossWeb = null;
  -            stream = servletCtx.getResourceAsStream("/WEB-INF/jboss-web.xml");
  -            if( stream != null )
  -            {
  -                Document jbossWebDoc = parser.parse(stream);
  -                jbossWeb = jbossWebDoc.getDocumentElement();
  -            }
               // Setup the wep app JNDI java:comp/env namespace
               ClassLoader scl = context.getLoader().getClassLoader();
  -            webAppParser.parseWebAppDescriptors(scl, web, jbossWeb);
  +            WebMetaData metaData = appInfo.getMetaData();
  +            webAppParser.parseWebAppDescriptors(scl, metaData);
               // Create a web application info object
  -            appInfo.setWebApp(web);
  -            appInfo.setJbossWeb(jbossWeb);
               appInfo.setAppData(context);
           }
           catch(Exception e)
  
  
  
  1.1.2.5   +2 -77     
contrib/catalina/src/main/org/jboss/web/catalina/EmbeddedCatalinaServiceSXMBean.java
  
  Index: EmbeddedCatalinaServiceSXMBean.java
  ===================================================================
  RCS file: 
/cvsroot/jboss/contrib/catalina/src/main/org/jboss/web/catalina/EmbeddedCatalinaServiceSXMBean.java,v
  retrieving revision 1.1.2.4
  retrieving revision 1.1.2.5
  diff -u -r1.1.2.4 -r1.1.2.5
  --- EmbeddedCatalinaServiceSXMBean.java       8 Dec 2001 20:23:01 -0000       1.1.2.4
  +++ EmbeddedCatalinaServiceSXMBean.java       4 Apr 2002 08:22:28 -0000       1.1.2.5
  @@ -1,10 +1,9 @@
   /*
  - * JBoss, the OpenSource EJB server
  + * JBoss, the OpenSource WebOS
    *
    * Distributable under LGPL license.
    * See terms of license at gnu.org.
    */
  -
   package org.jboss.web.catalina;
   
   import java.net.UnknownHostException;
  @@ -16,71 +15,10 @@
   /** Management interface for the embedded Catalina service.
    *
    * @author [EMAIL PROTECTED]
  - * @version $Revision: 1.1.2.4 $
  + * @version $Revision: 1.1.2.5 $
    */
   public interface EmbeddedCatalinaServiceSXMBean extends AbstractWebContainerMBean
   {
  -   /** Set the Catalina listening port.
  -    @param part, the listening port, 0 == Anonymous.
  -    */
  -   public void setPort(int port);
  -   /** Get the Catalina listening port.
  -    @return the Catalina listening port, 0 == Anonymous.
  -    */
  -   public int getPort();
  -
  -   /** Get the specific address Catalina listens on.t
  -    @return the interface name or IP address the EmbeddedCatalinaServiceSX binds to.
  -    */
  -   public String getBindAddress();
  -   /** Set the specific address Catalina listens on.  This can be used on
  -    a multi-homed host for a ServerSocket that will only accept connect requests
  -    to one of its addresses.
  -    @param host, the interface name or IP address to bind. If host is null, or
  -    has zero length, connections on any/all local addresses will be allowed.
  -    */
  -   public void setBindAddress(String host) throws UnknownHostException;
  -
  -   /**@return the accept count for this Connector.
  -    */
  -   public int getAcceptCount();
  -   /**
  -    * Set the accept count for this Connector.
  -    *
  -    * @param count The new accept count
  -    */
  -   public void setAcceptCount(int count);
  -
  -   /**
  -    * Return the minimum number of processors to start at initialization.
  -    */
  -   public int getMinProcessors();
  -   /**
  -    * Set the minimum number of processors to start at initialization.
  -    *
  -    * @param minProcessors The new minimum processors
  -    */
  -   public void setMinProcessors(int minProcessors);
  -
  -   /**
  -    * Return the maximum number of processors allowed, or <0 for unlimited.
  -    */
  -   public int getMaxProcessors();
  -   /**
  -    * Set the maximum number of processors allowed, or <0 for unlimited.
  -    *
  -    * @param maxProcessors The new maximum processors
  -    */
  -   public void setMaxProcessors(int maxProcessors);
  -
  -   /** @return the "enable DNS lookups" flag.
  -    */
  -   public boolean getEnableLookups();
  -   /** Set the "enable DNS lookups" flag.
  -    *
  -    * @param enableLookups The "enable DNS lookups" flag value
  -    */
  -   public void setEnableLookups(boolean enableLookups);
   
      /** @return the JNDI name of the SecurityDomain instance to
       use with JSSE.
  @@ -92,19 +30,6 @@
       instance to use with JSSE.
       */
      public void setSecurityDomain(String securityDomain);
  -
  -   /** Get the type of the primary connector. Currently only http
  -    and warp are supported.
  -    @return http or warp
  -    */
  -   public String getConnectorType();
  -   /** Set the type of the primary connector. Currently only http
  -    and warp are supported. Additional connectors may be set through
  -    the config child element of the MBean configuration.
  -
  -    @param type, must be one of http or warp
  -    */
  -   public void setConnectorType(String type);
   
      /** Override the AbstractWebContainerMBean to provide support for extended
       configuration using constructs from the standard server.xml to configure
  
  
  
  1.1.2.2   +13 -4     
contrib/catalina/src/main/org/jboss/web/catalina/Log4jLogger.java
  
  Index: Log4jLogger.java
  ===================================================================
  RCS file: 
/cvsroot/jboss/contrib/catalina/src/main/org/jboss/web/catalina/Log4jLogger.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- Log4jLogger.java  20 Nov 2001 09:54:19 -0000      1.1.2.1
  +++ Log4jLogger.java  4 Apr 2002 08:22:28 -0000       1.1.2.2
  @@ -16,11 +16,11 @@
   
   import org.jboss.logging.Logger;
   
  -/** An adaptor from the org.apache.catalina.Logger to the log4j based loggin
  +/** An adaptor from the org.apache.catalina.Logger to the log4j based logging
    used by JBoss.
    *
    * @author  [EMAIL PROTECTED]
  - * @version $Revision: 1.1.2.1 $
  + * @version $Revision: 1.1.2.2 $
    */
   public class Log4jLogger implements org.apache.catalina.Logger
   {
  @@ -29,14 +29,23 @@
      /** The property change support for this component. */
      protected PropertyChangeSupport support = new PropertyChangeSupport(this);
      /** The log4j Category */
  -   Logger log;
  +   protected Logger log;
      /** The verbosity level for above which log messages may be filtered.  */
      protected int verbosity = ERROR;
      
  -   /** Creates new Log4jLogger */
  +   public Log4jLogger()
  +   {
  +   }
      public Log4jLogger(Logger log)
      {
         this.log = log;
  +   }
  +
  +   /** Allow the log category to be set from the config category attribute
  +    */
  +   public void setCategory(String category)
  +   {
  +      log = Logger.getLogger(category);
      }
   
      /**
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.1   +138 -0    
contrib/catalina/src/main/org/jboss/web/catalina/Attic/EmbeddedCatalina.java
  
  
  
  
  1.1.2.1   +80 -0     
contrib/catalina/src/main/org/jboss/web/catalina/Attic/EngineCreateAction.java
  
  
  
  
  1.1.2.1   +111 -0    
contrib/catalina/src/main/org/jboss/web/catalina/Attic/LoggedXmlMapper.java
  
  
  
  

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to