/*
 * JBoss, Home of Professional Open Source
 *
 * Distributable under LGPL license.
 * See terms of license at gnu.org.
 */
package org.jboss.deployment.spi.beans;

import javax.enterprise.deploy.model.DDBean;
import javax.enterprise.deploy.model.DDBeanRoot;
import javax.enterprise.deploy.model.DeployableObject;
import javax.enterprise.deploy.spi.DConfigBean;
import javax.enterprise.deploy.spi.DConfigBeanRoot;
import javax.enterprise.deploy.spi.exceptions.ConfigurationException;

/**
 * A simple war dconfigbeanroot implementation
 * @author Rob Stryker
 * @version $Revision: 1.5 $
 */
public class JBossWebConfigBeanRoot
   extends JBossConfigBeanProxy implements DConfigBeanRoot
{
   public static void main(String args[])
   {
      System.out.println("test");
   }

   public JBossWebConfigBeanRoot(DDBeanRoot root)
   {
      JBossWebConfigBean bean = new JBossWebConfigBean(root, this);
      DeployableObject deployment = root.getDeployableObject();
      setBean(bean, deployment);
   }

   public DConfigBean getDConfigBean(DDBeanRoot arg0)
   {
      // get the filename for this bean and send along a configbean for that type.
      return null;
   }


   private class JBossWebConfigBean extends AbstractJBossConfigBean
   {
      public JBossWebConfigBean(DDBean bean, DConfigBeanRoot root)
      {
         super(bean, root, null);
      }

      public DConfigBean getDConfigBean(DDBean bean) throws ConfigurationException
      {
         // get a child bean
         return null;
      }

      /**
       * Called from the abstract super constructor
       */
      protected ConfigBeanXPaths buildXPathList()
      {
         ConfigBeanXPaths pathRoot = new ConfigBeanXPaths("", null);
         ConfigBeanXPaths contextRoot = new ConfigBeanXPaths("context-root", pathRoot);
         return pathRoot;
      }
   }


}
