[jboss-cvs] JBossAS SVN: r70091 - in projects/microcontainer/trunk/aop-mc-int/src: main/org/jboss/aop/microcontainer/beans/xml and 10 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Feb 26 06:59:04 EST 2008


Author: kabir.khan at jboss.com
Date: 2008-02-26 06:59:03 -0500 (Tue, 26 Feb 2008)
New Revision: 70091

Added:
   projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/AOPDeployment.java
   projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/AdviceOrInterceptorData.java
   projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/AfterAdviceData.java
   projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/BeforeAdviceData.java
   projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/CFlowCalled.java
   projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/CFlowNotCalled.java
   projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/FinallyAdviceData.java
   projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/InterceptorBeanMetaDataFactory.java
   projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/InterceptorRefData.java
   projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/ThrowingAdviceData.java
   projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/TypeDefBeanMetaDataFactory.java
   projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans/test/AspectSimpleJaxbAopTestCase.xml
   projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans/test/AspectSimpleJaxbDeploymentTestCase.xml
   projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/
   projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/
   projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_AopAspectAndBean.xml
   projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_AopAspectWithDefaultNameAndScope.xml
   projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_AopAspectWithDependency.xml
   projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_AopAspectWithFactory.xml
   projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_AopAspectWithManagerBean.xml
   projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_AopAspectWithManagerProperty.xml
   projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_AopAspectWithNameAndDefaultScope.xml
   projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_AopAspectWithNameAndScope.xml
   projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_AopBind.xml
   projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_AopInterceptorWithDependency.xml
   projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_AopStack.xml
   projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_AopTypeDef.xml
   projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_DeploymentAspectAndBean.xml
   projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_DeploymentAspectWithDefaultNameAndScope.xml
   projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_DeploymentAspectWithDependency.xml
   projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_DeploymentAspectWithFactory.xml
   projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_DeploymentAspectWithManagerBean.xml
   projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_DeploymentAspectWithManagerProperty.xml
   projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_DeploymentAspectWithNameAndDefaultScope.xml
   projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_DeploymentAspectWithNameAndScope.xml
   projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_DeploymentBind.xml
   projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_DeploymentInterceptorWithDependency.xml
   projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_DeploymentStack.xml
   projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_DeploymentTypeDef.xml
   projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/aop/junit/ForceJAXBAOPMicrocontainerTest.java
   projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/aop/junit/JAXBDeployer.java
   projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/aop/junit/JBossXBTestDelegate.java
   projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans/test/AspectSimpleJaxbAopTestCase.java
   projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans/test/AspectSimpleJaxbDeploymentTestCase.java
   projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/jaxb/
   projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/jaxb/test/
   projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase.java
Modified:
   projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/AdviceData.java
   projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/ArrayBindBeanMetaDataFactory.java
   projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/AspectBeanMetaDataFactory.java
   projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/AspectManagerAwareBeanMetaDataFactory.java
   projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/BaseInterceptorData.java
   projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/BeanMetaDataUtil.java
   projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/BindBeanMetaDataFactory.java
   projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/CFlowStackBeanMetaDataFactory.java
   projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/PrecedenceBeanMetaDataFactory.java
   projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/StackBeanMetaDataFactory.java
   projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/StackRefData.java
   projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/xml/AOPBeansSchemaInitializer.java
   projects/microcontainer/trunk/aop-mc-int/src/resources/main/schema/aop-beans_1_0.xsd
Log:
[JBAOP-468] Commit what has been done so far

Added: projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/AOPDeployment.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/AOPDeployment.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/AOPDeployment.java	2008-02-26 11:59:03 UTC (rev 70091)
@@ -0,0 +1,76 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors. 
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/ 
+package org.jboss.aop.microcontainer.beans.beanmetadatafactory;
+
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlAnyElement;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElements;
+import javax.xml.bind.annotation.XmlNsForm;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+import org.jboss.beans.metadata.plugins.AbstractBeanMetaData;
+import org.jboss.beans.metadata.plugins.AbstractLazyMetaData;
+import org.jboss.beans.metadata.plugins.factory.GenericBeanFactoryMetaData2;
+import org.jboss.beans.metadata.spi.BeanMetaDataFactory;
+import org.jboss.kernel.plugins.deployment.AbstractKernelDeployment;
+import org.jboss.managed.api.annotation.ManagementObject;
+import org.jboss.managed.api.annotation.ManagementProperties;
+import org.jboss.xb.annotations.JBossXmlSchema;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+ at ManagementObject(properties = ManagementProperties.EXPLICIT) // TODO - explicitly add props we want to manage 
+ at JBossXmlSchema(namespace="urn:jboss:aop-beans:1.0", elementFormDefault=XmlNsForm.QUALIFIED)
+ at XmlRootElement(name="aop")
+ at XmlType(propOrder={"annotations", "classLoader", "beanFactories", "create", "start", "stop", "destroy", "aliases"})
+public class AOPDeployment extends AbstractKernelDeployment
+{
+   private static final long serialVersionUID = 1L;
+   
+   
+   @XmlElements
+   ({
+      @XmlElement(name="bean", type=AbstractBeanMetaData.class),
+      @XmlElement(name="bean", namespace="urn:jboss:bean-deployer:2.0", type=AbstractBeanMetaData.class),
+      @XmlElement(name="beanfactory", type=GenericBeanFactoryMetaData2.class),
+      @XmlElement(name="beanfactory", namespace="urn:jboss:bean-deployer:2.0", type=GenericBeanFactoryMetaData2.class),
+      @XmlElement(name="lazy", type=AbstractLazyMetaData.class),
+      @XmlElement(name="lazy", namespace="urn:jboss:bean-deployer:2.0", type=AbstractLazyMetaData.class),
+      @XmlElement(name="aspect", type=AspectBeanMetaDataFactory.class),
+      @XmlElement(name="interceptor", type=InterceptorBeanMetaDataFactory.class),
+      @XmlElement(name="bind", type=BindBeanMetaDataFactory.class),
+      @XmlElement(name="stack", type=StackBeanMetaDataFactory.class),
+      @XmlElement(name="typedef", type=TypeDefBeanMetaDataFactory.class),
+      @XmlElement(name="cflow-stack", type=CFlowStackBeanMetaDataFactory.class)
+   })
+   @XmlAnyElement
+   public void setBeanFactories(List<BeanMetaDataFactory> beanFactories)
+   {
+      super.setBeanFactories(beanFactories);
+   }
+}

Modified: projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/AdviceData.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/AdviceData.java	2008-02-26 11:49:46 UTC (rev 70090)
+++ projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/AdviceData.java	2008-02-26 11:59:03 UTC (rev 70091)
@@ -21,17 +21,16 @@
 */ 
 package org.jboss.aop.microcontainer.beans.beanmetadatafactory;
 
-import org.jboss.aop.advice.AdviceType;
-import org.jboss.aop.microcontainer.beans.InterceptorEntry;
+import javax.xml.bind.annotation.XmlAttribute;
 
+
 /**
  * 
  * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
  * @version $Revision: 1.1 $
  */
-public class AdviceData extends BaseInterceptorData
+public class AdviceData extends AdviceOrInterceptorData
 {
-   AdviceType type = AdviceType.AROUND;
    String adviceMethod;
    
    public String getAdviceMethod()
@@ -39,24 +38,9 @@
       return adviceMethod;
    }
 
+   @XmlAttribute(name="name")
    public void setAdviceMethod(String method)
    {
       this.adviceMethod = method;
    }
-
-   public AdviceType getType()
-   {
-      return type;
-   }
-
-   public void setType(AdviceType type)
-   {
-      this.type = type;
-   }
-
-   @Override
-   public String getBeanClassName()
-   {
-      return InterceptorEntry.class.getName();
-   }
 }
\ No newline at end of file

Added: projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/AdviceOrInterceptorData.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/AdviceOrInterceptorData.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/AdviceOrInterceptorData.java	2008-02-26 11:59:03 UTC (rev 70091)
@@ -0,0 +1,69 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors. 
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/ 
+package org.jboss.aop.microcontainer.beans.beanmetadatafactory;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlTransient;
+
+import org.jboss.aop.advice.AdviceType;
+import org.jboss.aop.microcontainer.beans.InterceptorEntry;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public abstract class AdviceOrInterceptorData extends BaseInterceptorData
+{
+
+   AdviceType type = AdviceType.AROUND;
+
+   @XmlAttribute(name = "aspect")
+   public void setRefName(String name)
+   {
+      super.setRefName(name);
+   }
+
+   public AdviceType getType()
+   {
+      return type;
+   }
+
+   @XmlTransient
+   public void setType(AdviceType type)
+   {
+      this.type = type;
+   }
+
+   @Override
+   public String getBeanClassName()
+   {
+      return InterceptorEntry.class.getName();
+   }
+
+   public String getAdviceMethod()
+   {
+      return null;
+   }
+
+
+}

Added: projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/AfterAdviceData.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/AfterAdviceData.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/AfterAdviceData.java	2008-02-26 11:59:03 UTC (rev 70091)
@@ -0,0 +1,37 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors. 
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/ 
+package org.jboss.aop.microcontainer.beans.beanmetadatafactory;
+
+import org.jboss.aop.advice.AdviceType;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class AfterAdviceData extends AdviceData
+{
+   public AfterAdviceData()
+   {
+      setType(AdviceType.AFTER);
+   }
+}

Modified: projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/ArrayBindBeanMetaDataFactory.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/ArrayBindBeanMetaDataFactory.java	2008-02-26 11:49:46 UTC (rev 70090)
+++ projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/ArrayBindBeanMetaDataFactory.java	2008-02-26 11:59:03 UTC (rev 70091)
@@ -93,15 +93,15 @@
             BeanMetaDataUtil.DependencyBuilder builder = new BeanMetaDataUtil.DependencyBuilder(bmd, "binding", name).setState("Instantiated");
             BeanMetaDataUtil.setDependencyProperty(builder);
             
-            if (interceptor instanceof AdviceData)
+            if (interceptor instanceof AdviceOrInterceptorData)
             {
                BeanMetaDataUtil.DependencyBuilder db = new BeanMetaDataUtil.DependencyBuilder(bmd, "aspect", interceptor.getRefName()); 
                BeanMetaDataUtil.setDependencyProperty(db);
-               if (((AdviceData)interceptor).getAdviceMethod() != null)
+               if (((AdviceOrInterceptorData)interceptor).getAdviceMethod() != null)
                {
-                  BeanMetaDataUtil.setSimpleProperty(bmd, "aspectMethod", ((AdviceData)interceptor).getAdviceMethod());
+                  BeanMetaDataUtil.setSimpleProperty(bmd, "aspectMethod", ((AdviceOrInterceptorData)interceptor).getAdviceMethod());
                }
-               BeanMetaDataUtil.setSimpleProperty(bmd, "type", ((AdviceData)interceptor).getType());
+               BeanMetaDataUtil.setSimpleProperty(bmd, "type", ((AdviceOrInterceptorData)interceptor).getType());
             }
             else
             {

Modified: projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/AspectBeanMetaDataFactory.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/AspectBeanMetaDataFactory.java	2008-02-26 11:49:46 UTC (rev 70090)
+++ projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/AspectBeanMetaDataFactory.java	2008-02-26 11:59:03 UTC (rev 70091)
@@ -25,6 +25,10 @@
 import java.util.Iterator;
 import java.util.List;
 
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlNsForm;
+import javax.xml.bind.annotation.XmlRootElement;
+
 import org.jboss.aop.microcontainer.beans.Aspect;
 import org.jboss.beans.metadata.plugins.AbstractBeanMetaData;
 import org.jboss.beans.metadata.plugins.AbstractDependencyValueMetaData;
@@ -37,6 +41,7 @@
 import org.jboss.beans.metadata.spi.InstallMetaData;
 import org.jboss.beans.metadata.spi.MetaDataVisitorNode;
 import org.jboss.beans.metadata.spi.ParameterMetaData;
+import org.jboss.xb.annotations.JBossXmlSchema;
 
 /**
  * AspectBeanMetaDataFactory.
@@ -44,6 +49,8 @@
  * @author <a href="adrian at jboss.com">Adrian Brock</a>
  * @version $Revision: 61194 $
  */
+ at JBossXmlSchema(namespace="urn:jboss:aop-beans:1.0", elementFormDefault=XmlNsForm.QUALIFIED)
+ at XmlRootElement(name="aspect")
 public class AspectBeanMetaDataFactory extends AspectManagerAwareBeanMetaDataFactory
    implements BeanMetaDataFactory
 {
@@ -52,12 +59,23 @@
    private String scope = "PER_VM";
 
    private String factory;
+
+   String aspectName;
    
+   boolean initialisedName;
+   
+   @XmlAttribute
    public void setScope(String scope)
    {
       this.scope = scope;
    }
-
+   
+   public String getScope()
+   {
+      return scope;
+   }
+   
+   @XmlAttribute
    public void setFactory(String clazz)
    {
       this.factory = clazz;
@@ -69,7 +87,13 @@
       super.setBeanClass(clazz);
    }
    
+   public String getFactory()
+   {
+      return factory;
+   }
+   
    @Override
+   @XmlAttribute(name="class")
    public void setBeanClass(String bean)
    {
       if (factory != null)
@@ -89,11 +113,14 @@
          this.name = super.getBeanClass();
       }
       
-      String aspectName = this.name;
       //Add the bean factory
-      this.name = "Factory$" + name;
+      if (!initialisedName)
+      {
+         aspectName = this.name;
+         this.name = "Factory$" + name;
+         initialisedName = true;
+      }
       result.add(this);
-      //TODO dependencies and properties for aspect/interceptor
       
       //Add the Aspect
       AbstractBeanMetaData aspect = new AbstractBeanMetaData();

Modified: projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/AspectManagerAwareBeanMetaDataFactory.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/AspectManagerAwareBeanMetaDataFactory.java	2008-02-26 11:49:46 UTC (rev 70090)
+++ projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/AspectManagerAwareBeanMetaDataFactory.java	2008-02-26 11:59:03 UTC (rev 70091)
@@ -21,6 +21,8 @@
 */ 
 package org.jboss.aop.microcontainer.beans.beanmetadatafactory;
 
+import javax.xml.bind.annotation.XmlAttribute;
+
 import org.jboss.beans.metadata.plugins.factory.GenericBeanFactoryMetaData;
 /**
  * 
@@ -33,15 +35,25 @@
 
    protected BeanMetaDataUtil util = new BeanMetaDataUtil();
 
+   @XmlAttribute(name="manager-bean")
    public void setManagerBean(String managerBean)
    {
       util.setManagerBean(managerBean);
    }
+   
+   public String getManagerBean()
+   {
+      return util.getManagerBean();
+   }
 
+   @XmlAttribute(name="manager-property")
    public void setManagerProperty(String aspectManagerProperty)
    {
       util.setManagerProperty(aspectManagerProperty);
    }
-
-
+   
+   public String getManagerProperty()
+   {
+      return util.getManagerProperty();
+   }
 }

Modified: projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/BaseInterceptorData.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/BaseInterceptorData.java	2008-02-26 11:49:46 UTC (rev 70090)
+++ projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/BaseInterceptorData.java	2008-02-26 11:59:03 UTC (rev 70091)
@@ -21,6 +21,8 @@
 */
 package org.jboss.aop.microcontainer.beans.beanmetadatafactory;
 
+import javax.xml.bind.annotation.XmlAttribute;
+
 /**
  * 
  * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
@@ -41,6 +43,7 @@
       return refName;
    }
 
+   @XmlAttribute(name="name")
    public void setRefName(String name)
    {
       this.refName = name;

Modified: projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/BeanMetaDataUtil.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/BeanMetaDataUtil.java	2008-02-26 11:49:46 UTC (rev 70090)
+++ projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/BeanMetaDataUtil.java	2008-02-26 11:59:03 UTC (rev 70091)
@@ -49,7 +49,7 @@
    protected String managerProperty;
 
 
-   public String getManager()
+   public String getManagerBean()
    {
       return managerBean;
    }
@@ -78,22 +78,7 @@
    {
       bean.addProperty(new AbstractPropertyMetaData(propertyName, value));
    }
-
-//   public static void setDependencyProperty(AbstractBeanMetaData bean, String propertyName, Object dependencyBean)
-//   {
-//      setDependencyProperty(bean, propertyName, dependencyBean, null, null);
-//   }
-
-//   public static void setDependencyProperty(AbstractBeanMetaData bean, String propertyName, Object dependencyBean, String state)
-//   {
-//      setDependencyProperty(bean, propertyName, dependencyBean, propertyName, state);
-//   }
-
-//   public static void setDependencyProperty(AbstractBeanMetaData bean, String propertyName, Object dependencyBean, String dependencyProperty, String state)
-//   {
-//   }
    
-   
    public static void setDependencyProperty(DependencyBuilder builder)
    {
       AbstractDependencyValueMetaData advmd = new AbstractDependencyValueMetaData(builder.getDependencyBean(), builder.getDependencyProperty());

Added: projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/BeforeAdviceData.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/BeforeAdviceData.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/BeforeAdviceData.java	2008-02-26 11:59:03 UTC (rev 70091)
@@ -0,0 +1,37 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors. 
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/ 
+package org.jboss.aop.microcontainer.beans.beanmetadatafactory;
+
+import org.jboss.aop.advice.AdviceType;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class BeforeAdviceData extends AdviceData
+{
+   public BeforeAdviceData()
+   {
+      setType(AdviceType.BEFORE);
+   }
+}

Modified: projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/BindBeanMetaDataFactory.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/BindBeanMetaDataFactory.java	2008-02-26 11:49:46 UTC (rev 70090)
+++ projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/BindBeanMetaDataFactory.java	2008-02-26 11:59:03 UTC (rev 70091)
@@ -24,18 +24,27 @@
 import java.util.ArrayList;
 import java.util.List;
 
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElements;
+import javax.xml.bind.annotation.XmlNsForm;
+import javax.xml.bind.annotation.XmlRootElement;
+
 import org.jboss.aop.microcontainer.beans.AspectBinding;
 import org.jboss.beans.metadata.plugins.AbstractBeanMetaData;
 import org.jboss.beans.metadata.plugins.AbstractInjectionValueMetaData;
 import org.jboss.beans.metadata.plugins.AbstractListMetaData;
 import org.jboss.beans.metadata.spi.BeanMetaData;
 import org.jboss.util.id.GUID;
+import org.jboss.xb.annotations.JBossXmlSchema;
 
 /**
  * 
  * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
  * @version $Revision: 1.1 $
  */
+ at JBossXmlSchema(namespace="urn:jboss:aop-beans:1.0", elementFormDefault=XmlNsForm.QUALIFIED)
+ at XmlRootElement(name="bind")
 public class BindBeanMetaDataFactory extends AspectManagerAwareBeanMetaDataFactory
 {
    private static final long serialVersionUID = 1L;
@@ -48,12 +57,14 @@
       //Meeded to satisfy validation in BeanFactoryHandler.endElement()
       setBeanClass("IGNORED");
    }
-   
+
+   @XmlAttribute
    public void setPointcut(String pointcut)
    {
       this.pointcut = pointcut;
    }
    
+   @XmlAttribute
    public void setCflow(String cflow)
    {
       this.cflow = cflow;
@@ -96,15 +107,15 @@
             BeanMetaDataUtil.DependencyBuilder builder = new BeanMetaDataUtil.DependencyBuilder(bmd, "binding", name).setState("Instantiated");
             BeanMetaDataUtil.setDependencyProperty(builder);
             
-            if (interceptor instanceof AdviceData)
+            if (interceptor instanceof AdviceOrInterceptorData)
             {
                BeanMetaDataUtil.DependencyBuilder db = new BeanMetaDataUtil.DependencyBuilder(bmd, "aspect", interceptor.getRefName()); 
                BeanMetaDataUtil.setDependencyProperty(db);
-               if (((AdviceData)interceptor).getAdviceMethod() != null)
+               if (((AdviceOrInterceptorData)interceptor).getAdviceMethod() != null)
                {
-                  BeanMetaDataUtil.setSimpleProperty(bmd, "aspectMethod", ((AdviceData)interceptor).getAdviceMethod());
+                  BeanMetaDataUtil.setSimpleProperty(bmd, "aspectMethod", ((AdviceOrInterceptorData)interceptor).getAdviceMethod());
                }
-               BeanMetaDataUtil.setSimpleProperty(bmd, "type", ((AdviceData)interceptor).getType());
+               BeanMetaDataUtil.setSimpleProperty(bmd, "type", ((AdviceOrInterceptorData)interceptor).getType());
             }
             else
             {
@@ -124,4 +135,28 @@
    {
       interceptors.add(interceptorData);
    }
+
+   
+   @XmlElements
+   ({
+      @XmlElement(name="advice", type=AdviceData.class),
+      @XmlElement(name="around", type=AdviceData.class),
+      @XmlElement(name="before", type=BeforeAdviceData.class),
+      @XmlElement(name="after", type=AfterAdviceData.class),
+      @XmlElement(name="throwing", type=ThrowingAdviceData.class),
+      @XmlElement(name="finally", type=FinallyAdviceData.class),
+      @XmlElement(name="interceptor-ref", type=InterceptorRefData.class),
+      @XmlElement(name="stack-ref", type=StackRefData.class)
+   })
+   public List<BaseInterceptorData> getInterceptors()
+   {
+      return interceptors;
+   }
+
+   public void setInterceptors(List<BaseInterceptorData> interceptors)
+   {
+      this.interceptors = interceptors;
+   }
+   
+   
 }

Added: projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/CFlowCalled.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/CFlowCalled.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/CFlowCalled.java	2008-02-26 11:59:03 UTC (rev 70091)
@@ -0,0 +1,50 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors. 
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/ 
+package org.jboss.aop.microcontainer.beans.beanmetadatafactory;
+
+import javax.xml.bind.annotation.XmlAttribute;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class CFlowCalled
+{
+   String expr;
+
+   public String getExpr()
+   {
+      return expr;
+   }
+
+   @XmlAttribute
+   public void setExpr(String expr)
+   {
+      this.expr = expr;
+   }
+   
+   public boolean getCalled()
+   {
+      return true;
+   }
+}

Added: projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/CFlowNotCalled.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/CFlowNotCalled.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/CFlowNotCalled.java	2008-02-26 11:59:03 UTC (rev 70091)
@@ -0,0 +1,36 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors. 
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/ 
+package org.jboss.aop.microcontainer.beans.beanmetadatafactory;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class CFlowNotCalled
+{
+   public boolean getCalled()
+   {
+      return false;
+   }
+
+}

Modified: projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/CFlowStackBeanMetaDataFactory.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/CFlowStackBeanMetaDataFactory.java	2008-02-26 11:49:46 UTC (rev 70090)
+++ projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/CFlowStackBeanMetaDataFactory.java	2008-02-26 11:59:03 UTC (rev 70091)
@@ -24,12 +24,18 @@
 import java.util.ArrayList;
 import java.util.List;
 
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElements;
+import javax.xml.bind.annotation.XmlNsForm;
+import javax.xml.bind.annotation.XmlRootElement;
+
 import org.jboss.aop.microcontainer.beans.CFlowStack;
 import org.jboss.beans.metadata.plugins.AbstractBeanMetaData;
 import org.jboss.beans.metadata.plugins.AbstractInjectionValueMetaData;
 import org.jboss.beans.metadata.plugins.AbstractListMetaData;
 import org.jboss.beans.metadata.spi.BeanMetaData;
 import org.jboss.beans.metadata.spi.BeanMetaDataFactory;
+import org.jboss.xb.annotations.JBossXmlSchema;
 
 /**
  * AspectBeanMetaDataFactory.
@@ -37,11 +43,16 @@
  * @author <a href="adrian at jboss.com">Adrian Brock</a>
  * @version $Revision: 61194 $
  */
+ at JBossXmlSchema(namespace="urn:jboss:aop-beans:1.0", elementFormDefault=XmlNsForm.QUALIFIED)
+ at XmlRootElement(name="cflow")
 public class CFlowStackBeanMetaDataFactory extends AspectManagerAwareBeanMetaDataFactory
    implements BeanMetaDataFactory
 {
    private static final long serialVersionUID = 1L;
+   /** For use when using the old handlers */
    private ArrayList<AbstractBeanMetaData> entries = new ArrayList<AbstractBeanMetaData>();
+   
+   private List<CFlowCalled> calledEntries = new ArrayList<CFlowCalled>();
 
    public CFlowStackBeanMetaDataFactory()
    {
@@ -64,13 +75,27 @@
       lmd.setType(ArrayList.class.getName());
       BeanMetaDataUtil.setSimpleProperty(cflowStack, "entries", lmd);
       int i = 0;
-      for (AbstractBeanMetaData entry : entries)
+      if (entries != null)
       {
-         String entryName = cflowStack.getName() + "$" + i++;
-         entry.setName(entryName);
-         lmd.add(new AbstractInjectionValueMetaData(entryName));
-         result.add(entry);
+         for (AbstractBeanMetaData entry : entries)
+         {
+            String entryName = cflowStack.getName() + "$" + i++;
+            entry.setName(entryName);
+            lmd.add(new AbstractInjectionValueMetaData(entryName));
+            result.add(entry);
+         }
       }
+      if (calledEntries != null)
+      {
+         for (CFlowCalled called : calledEntries)
+         {
+            AbstractBeanMetaData bmd = new AbstractBeanMetaData();
+            String entryName = cflowStack.getName() + "$" + i++;
+            bmd.setName(name);
+            BeanMetaDataUtil.setSimpleProperty(bmd, "called", called);
+            lmd.add(new AbstractInjectionValueMetaData(entryName));
+         }
+      }
 
       return result;
    }
@@ -79,4 +104,19 @@
    {
       entries.add(entry);
    }
+
+   public List<CFlowCalled> getCalledEntries()
+   {
+      return calledEntries;
+   }
+
+   @XmlElements({
+      @XmlElement(name="called", type=CFlowCalled.class),
+      @XmlElement(name="not-called", type=CFlowNotCalled.class)
+   })
+   public void setCalledEntries(List<CFlowCalled> calledEntries)
+   {
+      this.calledEntries = calledEntries;
+   }
+   
 }

Added: projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/FinallyAdviceData.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/FinallyAdviceData.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/FinallyAdviceData.java	2008-02-26 11:59:03 UTC (rev 70091)
@@ -0,0 +1,37 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors. 
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/ 
+package org.jboss.aop.microcontainer.beans.beanmetadatafactory;
+
+import org.jboss.aop.advice.AdviceType;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class FinallyAdviceData extends AdviceData
+{
+   public FinallyAdviceData()
+   {
+      setType(AdviceType.FINALLY);
+   }
+}

Added: projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/InterceptorBeanMetaDataFactory.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/InterceptorBeanMetaDataFactory.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/InterceptorBeanMetaDataFactory.java	2008-02-26 11:59:03 UTC (rev 70091)
@@ -0,0 +1,39 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors. 
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/ 
+package org.jboss.aop.microcontainer.beans.beanmetadatafactory;
+
+import javax.xml.bind.annotation.XmlNsForm;
+import javax.xml.bind.annotation.XmlRootElement;
+
+import org.jboss.xb.annotations.JBossXmlSchema;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+ at JBossXmlSchema(namespace="urn:jboss:aop-beans:1.0", elementFormDefault=XmlNsForm.QUALIFIED)
+ at XmlRootElement(name="interceptor")
+public class InterceptorBeanMetaDataFactory extends AspectBeanMetaDataFactory
+{
+   private static final long serialVersionUID = 1L;
+}

Added: projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/InterceptorRefData.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/InterceptorRefData.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/InterceptorRefData.java	2008-02-26 11:59:03 UTC (rev 70091)
@@ -0,0 +1,45 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors. 
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/ 
+package org.jboss.aop.microcontainer.beans.beanmetadatafactory;
+
+import javax.xml.bind.annotation.XmlAttribute;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class InterceptorRefData extends AdviceOrInterceptorData
+{
+   public InterceptorRefData()
+   {
+      // FIXME InterceptorRefData constructor
+      super();
+   }
+
+   @XmlAttribute(name="name")
+   public void setRefName(String name)
+   {
+      super.refName = name;
+   }
+
+}

Modified: projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/PrecedenceBeanMetaDataFactory.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/PrecedenceBeanMetaDataFactory.java	2008-02-26 11:49:46 UTC (rev 70090)
+++ projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/PrecedenceBeanMetaDataFactory.java	2008-02-26 11:59:03 UTC (rev 70091)
@@ -75,9 +75,9 @@
          AbstractBeanMetaData entryBean = new AbstractBeanMetaData(PrecedenceDefEntry.class.getName());
          entryBean.setName(entryName);
          BeanMetaDataUtil.setSimpleProperty(entryBean, "aspectName", entry.getRefName());
-         if (entry instanceof AdviceData)
+         if (entry instanceof AdviceOrInterceptorData)
          {
-            BeanMetaDataUtil.setSimpleProperty(entryBean, "aspectMethod", ((AdviceData)entry).getAdviceMethod());
+            BeanMetaDataUtil.setSimpleProperty(entryBean, "aspectMethod", ((AdviceOrInterceptorData)entry).getAdviceMethod());
          }
          lmd.add(new AbstractInjectionValueMetaData(entryName));
          result.add(entryBean);

Modified: projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/StackBeanMetaDataFactory.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/StackBeanMetaDataFactory.java	2008-02-26 11:49:46 UTC (rev 70090)
+++ projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/StackBeanMetaDataFactory.java	2008-02-26 11:59:03 UTC (rev 70091)
@@ -24,17 +24,25 @@
 import java.util.ArrayList;
 import java.util.List;
 
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElements;
+import javax.xml.bind.annotation.XmlNsForm;
+import javax.xml.bind.annotation.XmlRootElement;
+
 import org.jboss.aop.microcontainer.beans.Stack;
 import org.jboss.beans.metadata.plugins.AbstractBeanMetaData;
 import org.jboss.beans.metadata.plugins.AbstractInjectionValueMetaData;
 import org.jboss.beans.metadata.plugins.AbstractListMetaData;
 import org.jboss.beans.metadata.spi.BeanMetaData;
+import org.jboss.xb.annotations.JBossXmlSchema;
 
 /**
  * 
  * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
  * @version $Revision: 1.1 $
  */
+ at JBossXmlSchema(namespace="urn:jboss:aop-beans:1.0", elementFormDefault=XmlNsForm.QUALIFIED)
+ at XmlRootElement(name="stack")
 public class StackBeanMetaDataFactory extends AspectManagerAwareBeanMetaDataFactory
 {
    private static final long serialVersionUID = 1L;
@@ -72,15 +80,15 @@
             util.setAspectManagerProperty(bmd, "manager");
             BeanMetaDataUtil.setSimpleProperty(bmd, "forStack", Boolean.TRUE);
             
-            if (interceptor instanceof AdviceData)
+            if (interceptor instanceof AdviceOrInterceptorData)
             {
                BeanMetaDataUtil.DependencyBuilder db = new BeanMetaDataUtil.DependencyBuilder(bmd, "aspect", interceptor.getRefName());
                BeanMetaDataUtil.setDependencyProperty(db);
-               if (((AdviceData)interceptor).getAdviceMethod() != null)
+               if (((AdviceOrInterceptorData)interceptor).getAdviceMethod() != null)
                {
-                  BeanMetaDataUtil.setSimpleProperty(bmd, "aspectMethod", ((AdviceData)interceptor).getAdviceMethod());
+                  BeanMetaDataUtil.setSimpleProperty(bmd, "aspectMethod", ((AdviceOrInterceptorData)interceptor).getAdviceMethod());
                }
-               BeanMetaDataUtil.setSimpleProperty(bmd, "type", ((AdviceData)interceptor).getType());
+               BeanMetaDataUtil.setSimpleProperty(bmd, "type", ((AdviceOrInterceptorData)interceptor).getType());
                
             }
             else
@@ -102,4 +110,25 @@
       interceptors.add(interceptorData);
    }
 
+   @XmlElements
+   ({
+      @XmlElement(name="advice", type=AdviceData.class),
+      @XmlElement(name="around", type=AdviceData.class),
+      @XmlElement(name="before", type=BeforeAdviceData.class),
+      @XmlElement(name="after", type=AfterAdviceData.class),
+      @XmlElement(name="throwing", type=ThrowingAdviceData.class),
+      @XmlElement(name="finally", type=FinallyAdviceData.class),
+      @XmlElement(name="interceptor-ref", type=InterceptorRefData.class),
+      @XmlElement(name="stack-ref", type=StackRefData.class)
+   })
+   public List<BaseInterceptorData> getInterceptors()
+   {
+      return interceptors;
+   }
+
+   public void setInterceptors(List<BaseInterceptorData> interceptors)
+   {
+      this.interceptors = interceptors;
+   }
+   
 }

Modified: projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/StackRefData.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/StackRefData.java	2008-02-26 11:49:46 UTC (rev 70090)
+++ projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/StackRefData.java	2008-02-26 11:59:03 UTC (rev 70091)
@@ -35,5 +35,4 @@
    {
       return StackEntry.class.getName();
    }
-   
 }
\ No newline at end of file

Added: projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/ThrowingAdviceData.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/ThrowingAdviceData.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/ThrowingAdviceData.java	2008-02-26 11:59:03 UTC (rev 70091)
@@ -0,0 +1,37 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors. 
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/ 
+package org.jboss.aop.microcontainer.beans.beanmetadatafactory;
+
+import org.jboss.aop.advice.AdviceType;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class ThrowingAdviceData extends AdviceData
+{
+   public ThrowingAdviceData()
+   {
+      setType(AdviceType.THROWING);
+   }
+}

Added: projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/TypeDefBeanMetaDataFactory.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/TypeDefBeanMetaDataFactory.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/beanmetadatafactory/TypeDefBeanMetaDataFactory.java	2008-02-26 11:59:03 UTC (rev 70091)
@@ -0,0 +1,78 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors. 
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/ 
+package org.jboss.aop.microcontainer.beans.beanmetadatafactory;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlNsForm;
+import javax.xml.bind.annotation.XmlRootElement;
+
+import org.jboss.aop.microcontainer.beans.TypeDef;
+import org.jboss.beans.metadata.plugins.AbstractBeanMetaData;
+import org.jboss.beans.metadata.spi.BeanMetaData;
+import org.jboss.xb.annotations.JBossXmlSchema;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+ at JBossXmlSchema(namespace="urn:jboss:aop-beans:1.0", elementFormDefault=XmlNsForm.QUALIFIED)
+ at XmlRootElement(name="typedef")
+public class TypeDefBeanMetaDataFactory extends AspectManagerAwareBeanMetaDataFactory
+{
+   private static final long serialVersionUID = 1L;
+   private String expr;
+
+   public String getExpr()
+   {
+      return expr;
+   }
+
+   @XmlAttribute
+   public void setExpr(String expr)
+   {
+      this.expr = expr;
+   }
+
+   @Override
+   public List<BeanMetaData> getBeans()
+   {
+      ArrayList<BeanMetaData> beans = new ArrayList<BeanMetaData>();
+      
+      AbstractBeanMetaData typedef = new AbstractBeanMetaData();
+
+      typedef.setName(getName());
+      typedef.setBean(TypeDef.class.getName());
+      BeanMetaDataUtil.setSimpleProperty(typedef, "name", getName());
+      BeanMetaDataUtil.setSimpleProperty(typedef, "expr", expr);
+      
+      util.setAspectManagerProperty(typedef, "manager");
+      
+      beans.add(typedef);
+      
+      return beans;
+   }
+   
+}

Modified: projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/xml/AOPBeansSchemaInitializer.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/xml/AOPBeansSchemaInitializer.java	2008-02-26 11:49:46 UTC (rev 70090)
+++ projects/microcontainer/trunk/aop-mc-int/src/main/org/jboss/aop/microcontainer/beans/xml/AOPBeansSchemaInitializer.java	2008-02-26 11:59:03 UTC (rev 70091)
@@ -35,6 +35,7 @@
 import org.jboss.aop.microcontainer.beans.Prepare;
 import org.jboss.aop.microcontainer.beans.TypeDef;
 import org.jboss.aop.microcontainer.beans.beanmetadatafactory.AdviceData;
+import org.jboss.aop.microcontainer.beans.beanmetadatafactory.AdviceOrInterceptorData;
 import org.jboss.aop.microcontainer.beans.beanmetadatafactory.ArrayBindBeanMetaDataFactory;
 import org.jboss.aop.microcontainer.beans.beanmetadatafactory.AspectBeanMetaDataFactory;
 import org.jboss.aop.microcontainer.beans.beanmetadatafactory.BeanMetaDataUtil;
@@ -929,7 +930,7 @@
       public void attributes(Object o, QName elementName, ElementBinding element, Attributes attrs, NamespaceContext nsCtx)
       {
          super.attributes(o, elementName, element, attrs, nsCtx);
-         AdviceData advice = (AdviceData)o;
+         AdviceOrInterceptorData advice = (AdviceOrInterceptorData)o;
          advice.setType(AdviceType.BEFORE);
       }
    }
@@ -942,7 +943,7 @@
       public void attributes(Object o, QName elementName, ElementBinding element, Attributes attrs, NamespaceContext nsCtx)
       {
          super.attributes(o, elementName, element, attrs, nsCtx);
-         AdviceData advice = (AdviceData)o;
+         AdviceOrInterceptorData advice = (AdviceOrInterceptorData)o;
          advice.setType(AdviceType.AFTER);
       }
    }
@@ -955,7 +956,7 @@
       public void attributes(Object o, QName elementName, ElementBinding element, Attributes attrs, NamespaceContext nsCtx)
       {
          super.attributes(o, elementName, element, attrs, nsCtx);
-         AdviceData advice = (AdviceData)o;
+         AdviceOrInterceptorData advice = (AdviceOrInterceptorData)o;
          advice.setType(AdviceType.THROWING);
       }
    }
@@ -968,7 +969,7 @@
       public void attributes(Object o, QName elementName, ElementBinding element, Attributes attrs, NamespaceContext nsCtx)
       {
          super.attributes(o, elementName, element, attrs, nsCtx);
-         AdviceData advice = (AdviceData)o;
+         AdviceOrInterceptorData advice = (AdviceOrInterceptorData)o;
          advice.setType(AdviceType.FINALLY);
       }
    }

Modified: projects/microcontainer/trunk/aop-mc-int/src/resources/main/schema/aop-beans_1_0.xsd
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/main/schema/aop-beans_1_0.xsd	2008-02-26 11:49:46 UTC (rev 70090)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/main/schema/aop-beans_1_0.xsd	2008-02-26 11:59:03 UTC (rev 70091)
@@ -21,6 +21,49 @@
       </xsd:documentation>
    </xsd:annotation>
 
+   <xsd:element name="aop" type="aopType">
+      <xsd:annotation>
+         <xsd:documentation>
+           <![CDATA[
+           A domain
+           ]]>
+         </xsd:documentation>
+      </xsd:annotation>
+   </xsd:element>
+
+   <xsd:complexType name="aopType">
+      <xsd:annotation>
+         <xsd:documentation>
+           <![CDATA[
+           aspects or interceptors
+           ]]>
+         </xsd:documentation>
+      </xsd:annotation>
+      <xsd:choice minOccurs="0" maxOccurs="unbounded">
+	      <xsd:element name="domain" type="domainType" minOccurs="0" maxOccurs="unbounded"/>
+	      <xsd:element name="interceptor" type="aspectOrInterceptorType" minOccurs="0" maxOccurs="unbounded"/>
+	      <xsd:element name="aspect" type="aspectOrInterceptorType" minOccurs="0" maxOccurs="unbounded"/>
+	      <xsd:element name="bind" type="bindType" minOccurs="0" maxOccurs="unbounded"/>
+	      <xsd:element name="stack" type="stackType" minOccurs="0" maxOccurs="unbounded"/>
+	      <xsd:element name="typedef" type="typedefType" minOccurs="0" maxOccurs="unbounded"/>
+	      <xsd:element name="cflow-stack" type="cflowStackType" minOccurs="0" maxOccurs="unbounded"/>
+	      <xsd:element name="dynamic-cflow" type="dynamicCflowStackType" minOccurs="0" maxOccurs="unbounded"/>
+	      <xsd:element name="prepare" type="prepareType" minOccurs="0" maxOccurs="unbounded"/>
+	      <xsd:element name="pointcut" type="pointcutType" minOccurs="0" maxOccurs="unbounded"/>
+	      <xsd:element name="annotation-introduction" type="annotationIntroductionType" minOccurs="0" maxOccurs="unbounded"/>
+	      <xsd:element name="annotation" type="annotationType" minOccurs="0" maxOccurs="unbounded"/>
+	      <xsd:element name="precedence" type="precedenceType" minOccurs="0" maxOccurs="unbounded"/>
+	      <xsd:element name="introduction" type="introductionType" minOccurs="0" maxOccurs="unbounded"/>
+	      <xsd:element name="arrayreplacement" type="arrayreplacementType" minOccurs="0" maxOccurs="unbounded"/>
+	      <xsd:element name="arraybind" type="arraybindType" minOccurs="0" maxOccurs="unbounded"/>
+         <xsd:any namespace="##other" processContents="strict" minOccurs="0">
+            <xsd:annotation>
+               <xsd:documentation>An extension value</xsd:documentation>
+            </xsd:annotation>
+         </xsd:any>
+      </xsd:choice>
+   </xsd:complexType>
+
 	<xsd:element name="domain" type="domainType">
       <xsd:annotation>
          <xsd:documentation>

Added: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans/test/AspectSimpleJaxbAopTestCase.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans/test/AspectSimpleJaxbAopTestCase.xml	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans/test/AspectSimpleJaxbAopTestCase.xml	2008-02-26 11:59:03 UTC (rev 70091)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<aop xmlns="urn:jboss:aop-beans:1.0">
+
+   <bean xmlns="urn:jboss:bean-deployer:2.0" name="AspectManager" class="org.jboss.aop.AspectManager">
+      <constructor xmlns="urn:jboss:bean-deployer:2.0" factoryClass="org.jboss.aop.AspectManager" factoryMethod="instance"/>
+   </bean>
+
+   <aspect class="org.jboss.test.microcontainer.beans.TestAspect">
+   </aspect>
+
+   <bind pointcut="execution(* org.jboss.test.microcontainer.beans.POJO->*(..))">
+      <advice aspect="org.jboss.test.microcontainer.beans.TestAspect" name="advice"/>
+   </bind>
+	
+   <bean xmlns="urn:jboss:bean-deployer:2.0" name="Bean" class="org.jboss.test.microcontainer.beans.POJO"/>
+   
+</aop>

Added: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans/test/AspectSimpleJaxbDeploymentTestCase.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans/test/AspectSimpleJaxbDeploymentTestCase.xml	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/beans/test/AspectSimpleJaxbDeploymentTestCase.xml	2008-02-26 11:59:03 UTC (rev 70091)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+   <bean name="AspectManager" class="org.jboss.aop.AspectManager">
+      <constructor factoryClass="org.jboss.aop.AspectManager" factoryMethod="instance"/>
+   </bean>
+
+   <aspect xmlns="urn:jboss:aop-beans:1.0" class="org.jboss.test.microcontainer.beans.TestAspect">
+   </aspect>
+
+   <bind xmlns="urn:jboss:aop-beans:1.0" pointcut="execution(* org.jboss.test.microcontainer.beans.POJO->*(..))">
+      <advice aspect="org.jboss.test.microcontainer.beans.TestAspect" name="advice"/>
+   </bind>
+	
+   <bean name="Bean" class="org.jboss.test.microcontainer.beans.POJO"/>
+   
+</deployment>

Added: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_AopAspectAndBean.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_AopAspectAndBean.xml	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_AopAspectAndBean.xml	2008-02-26 11:59:03 UTC (rev 70091)
@@ -0,0 +1,6 @@
+<aop xmlns="urn:jboss:aop-beans:1.0">
+   <aspect name="aspect" class="org.jboss.test.microcontainer.beans.TestAspect"/>
+   <bean name="bean1" class="Bean1"/>
+   <bean xmlns="urn:jboss:bean-deployer:2.0" name="bean2" class="Bean2"/>
+   <bean:bean xmlns:bean="urn:jboss:bean-deployer:2.0" name="bean3" class="Bean3"/>
+</aop>
\ No newline at end of file

Added: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_AopAspectWithDefaultNameAndScope.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_AopAspectWithDefaultNameAndScope.xml	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_AopAspectWithDefaultNameAndScope.xml	2008-02-26 11:59:03 UTC (rev 70091)
@@ -0,0 +1,3 @@
+<aop xmlns="urn:jboss:aop-beans:1.0">
+   <aspect class="org.jboss.test.microcontainer.beans.TestAspect"/>
+</aop>
\ No newline at end of file

Added: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_AopAspectWithDependency.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_AopAspectWithDependency.xml	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_AopAspectWithDependency.xml	2008-02-26 11:59:03 UTC (rev 70091)
@@ -0,0 +1,5 @@
+<aop xmlns="urn:jboss:aop-beans:1.0">
+   <aspect name="withdependency" class="org.jboss.test.microcontainer.beans.TestAspectWithDependency">
+      <property name="dependency"><inject bean="Dependency"/></property>
+   </aspect>   
+</aop>
\ No newline at end of file

Added: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_AopAspectWithFactory.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_AopAspectWithFactory.xml	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_AopAspectWithFactory.xml	2008-02-26 11:59:03 UTC (rev 70091)
@@ -0,0 +1,3 @@
+<aop xmlns="urn:jboss:aop-beans:1.0">
+   <aspect name="withfactory" factory="org.jboss.test.microcontainer.beans.TestAspect"/>
+</aop>
\ No newline at end of file

Added: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_AopAspectWithManagerBean.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_AopAspectWithManagerBean.xml	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_AopAspectWithManagerBean.xml	2008-02-26 11:59:03 UTC (rev 70091)
@@ -0,0 +1,3 @@
+<aop xmlns="urn:jboss:aop-beans:1.0">
+   <aspect name="withmanagerbean" class="org.jboss.test.microcontainer.beans.TestAspect" manager-bean="CustomManager"/>
+</aop>
\ No newline at end of file

Added: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_AopAspectWithManagerProperty.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_AopAspectWithManagerProperty.xml	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_AopAspectWithManagerProperty.xml	2008-02-26 11:59:03 UTC (rev 70091)
@@ -0,0 +1,3 @@
+<aop xmlns="urn:jboss:aop-beans:1.0">
+   <aspect name="withmanagerproperty" class="org.jboss.test.microcontainer.beans.TestAspect" manager-bean="CustomManager" manager-property="property"/>
+</aop>
\ No newline at end of file

Added: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_AopAspectWithNameAndDefaultScope.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_AopAspectWithNameAndDefaultScope.xml	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_AopAspectWithNameAndDefaultScope.xml	2008-02-26 11:59:03 UTC (rev 70091)
@@ -0,0 +1,3 @@
+<aop xmlns="urn:jboss:aop-beans:1.0">
+   <aspect name="named" class="org.jboss.test.microcontainer.beans.TestAspect"/>
+</aop>
\ No newline at end of file

Added: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_AopAspectWithNameAndScope.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_AopAspectWithNameAndScope.xml	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_AopAspectWithNameAndScope.xml	2008-02-26 11:59:03 UTC (rev 70091)
@@ -0,0 +1,3 @@
+<aop xmlns="urn:jboss:aop-beans:1.0">
+   <aspect name="withscope" class="org.jboss.test.microcontainer.beans.TestAspect" scope="PER_INSTANCE"/>
+</aop>
\ No newline at end of file

Added: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_AopBind.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_AopBind.xml	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_AopBind.xml	2008-02-26 11:59:03 UTC (rev 70091)
@@ -0,0 +1,12 @@
+<aop xmlns="urn:jboss:aop-beans:1.0">
+   <bind name="binding" pointcut="all(Blah)" cflow="hello" manager-bean="ManagerBean" manager-property="ManagerProperty">
+      <stack-ref name="TestStack"/>
+      <advice name="advice" aspect="AdviceAspect"/>
+      <around name="around" aspect="AroundAspect"/>
+      <before name="before" aspect="BeforeAspect"/>
+      <after name="after" aspect="AfterAspect"/>
+      <throwing name="throwing" aspect="ThrowingAspect"/>
+      <finally name="finally" aspect="FinallyAspect"/>
+      <interceptor-ref name="Interceptor"/>
+   </bind>   
+</aop>
\ No newline at end of file

Added: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_AopInterceptorWithDependency.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_AopInterceptorWithDependency.xml	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_AopInterceptorWithDependency.xml	2008-02-26 11:59:03 UTC (rev 70091)
@@ -0,0 +1,5 @@
+<aop xmlns="urn:jboss:aop-beans:1.0">
+   <interceptor name="withdependency" class="org.jboss.test.microcontainer.beans.TestInterceptorWithDependency">
+      <property name="dependency"><inject bean="Dependency"/></property>
+   </interceptor>   
+</aop>
\ No newline at end of file

Added: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_AopStack.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_AopStack.xml	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_AopStack.xml	2008-02-26 11:59:03 UTC (rev 70091)
@@ -0,0 +1,12 @@
+<aop xmlns="urn:jboss:aop-beans:1.0">
+   <stack name="TestStack" manager-bean="ManagerBean" manager-property="ManagerProperty">
+      <stack-ref name="TestStack"/>
+      <advice name="advice" aspect="AdviceAspect"/>
+      <around name="around" aspect="AroundAspect"/>
+      <before name="before" aspect="BeforeAspect"/>
+      <after name="after" aspect="AfterAspect"/>
+      <throwing name="throwing" aspect="ThrowingAspect"/>
+      <finally name="finally" aspect="FinallyAspect"/>
+      <interceptor-ref name="Interceptor"/>
+   </stack>   
+</aop>
\ No newline at end of file

Added: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_AopTypeDef.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_AopTypeDef.xml	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_AopTypeDef.xml	2008-02-26 11:59:03 UTC (rev 70091)
@@ -0,0 +1,3 @@
+<aop xmlns="urn:jboss:aop-beans:1.0">
+   <typedef name="TypeDef" expr="class(org.jboss.test.microcontainer.beans.POJO)" manager-bean="ManagerBean" manager-property="ManagerProperty"/>
+</aop>
\ No newline at end of file

Added: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_DeploymentAspectAndBean.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_DeploymentAspectAndBean.xml	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_DeploymentAspectAndBean.xml	2008-02-26 11:59:03 UTC (rev 70091)
@@ -0,0 +1,6 @@
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+   <aspect xmlns="urn:jboss:aop-beans:1.0" name="aspect" class="org.jboss.test.microcontainer.beans.TestAspect"/>
+   <bean name="bean1" class="Bean1"/>
+   <bean name="bean2" class="Bean2"/>
+   <bean name="bean3" class="Bean3"/>
+</deployment>
\ No newline at end of file

Added: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_DeploymentAspectWithDefaultNameAndScope.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_DeploymentAspectWithDefaultNameAndScope.xml	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_DeploymentAspectWithDefaultNameAndScope.xml	2008-02-26 11:59:03 UTC (rev 70091)
@@ -0,0 +1,3 @@
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+   <aspect xmlns="urn:jboss:aop-beans:1.0" class="org.jboss.test.microcontainer.beans.TestAspect"/>
+</deployment>
\ No newline at end of file

Added: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_DeploymentAspectWithDependency.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_DeploymentAspectWithDependency.xml	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_DeploymentAspectWithDependency.xml	2008-02-26 11:59:03 UTC (rev 70091)
@@ -0,0 +1,5 @@
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+   <aspect xmlns="urn:jboss:aop-beans:1.0" name="withdependency" class="org.jboss.test.microcontainer.beans.TestAspectWithDependency">
+      <property name="dependency"><inject bean="Dependency"/></property>
+   </aspect>   
+</deployment>
\ No newline at end of file

Added: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_DeploymentAspectWithFactory.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_DeploymentAspectWithFactory.xml	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_DeploymentAspectWithFactory.xml	2008-02-26 11:59:03 UTC (rev 70091)
@@ -0,0 +1,3 @@
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+   <aspect xmlns="urn:jboss:aop-beans:1.0" name="withfactory" factory="org.jboss.test.microcontainer.beans.TestAspect"/>
+</deployment>
\ No newline at end of file

Added: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_DeploymentAspectWithManagerBean.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_DeploymentAspectWithManagerBean.xml	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_DeploymentAspectWithManagerBean.xml	2008-02-26 11:59:03 UTC (rev 70091)
@@ -0,0 +1,3 @@
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+   <aspect xmlns="urn:jboss:aop-beans:1.0" name="withmanagerbean" class="org.jboss.test.microcontainer.beans.TestAspect" manager-bean="CustomManager"/>
+</deployment>
\ No newline at end of file

Added: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_DeploymentAspectWithManagerProperty.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_DeploymentAspectWithManagerProperty.xml	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_DeploymentAspectWithManagerProperty.xml	2008-02-26 11:59:03 UTC (rev 70091)
@@ -0,0 +1,3 @@
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+   <aspect xmlns="urn:jboss:aop-beans:1.0" name="withmanagerproperty" class="org.jboss.test.microcontainer.beans.TestAspect" manager-bean="CustomManager" manager-property="property"/>
+</deployment>
\ No newline at end of file

Added: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_DeploymentAspectWithNameAndDefaultScope.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_DeploymentAspectWithNameAndDefaultScope.xml	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_DeploymentAspectWithNameAndDefaultScope.xml	2008-02-26 11:59:03 UTC (rev 70091)
@@ -0,0 +1,3 @@
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+   <aspect xmlns="urn:jboss:aop-beans:1.0" name="named" class="org.jboss.test.microcontainer.beans.TestAspect"/>
+</deployment>
\ No newline at end of file

Added: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_DeploymentAspectWithNameAndScope.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_DeploymentAspectWithNameAndScope.xml	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_DeploymentAspectWithNameAndScope.xml	2008-02-26 11:59:03 UTC (rev 70091)
@@ -0,0 +1,3 @@
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+   <aspect xmlns="urn:jboss:aop-beans:1.0" name="withscope" class="org.jboss.test.microcontainer.beans.TestAspect" scope="PER_INSTANCE"/>
+</deployment>
\ No newline at end of file

Added: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_DeploymentBind.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_DeploymentBind.xml	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_DeploymentBind.xml	2008-02-26 11:59:03 UTC (rev 70091)
@@ -0,0 +1,12 @@
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+   <bind xmlns="urn:jboss:aop-beans:1.0" name="binding" pointcut="all(Blah)"  cflow="hello" manager-bean="ManagerBean" manager-property="ManagerProperty">
+      <stack-ref name="TestStack"/>
+      <advice name="advice" aspect="AdviceAspect"/>
+      <around name="around" aspect="AroundAspect"/>
+      <before name="before" aspect="BeforeAspect"/>
+      <after name="after" aspect="AfterAspect"/>
+      <throwing name="throwing" aspect="ThrowingAspect"/>
+      <finally name="finally" aspect="FinallyAspect"/>
+      <interceptor-ref name="Interceptor"/>
+   </bind>   
+</deployment>
\ No newline at end of file

Added: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_DeploymentInterceptorWithDependency.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_DeploymentInterceptorWithDependency.xml	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_DeploymentInterceptorWithDependency.xml	2008-02-26 11:59:03 UTC (rev 70091)
@@ -0,0 +1,5 @@
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+   <interceptor xmlns="urn:jboss:aop-beans:1.0" name="withdependency" class="org.jboss.test.microcontainer.beans.TestInterceptorWithDependency">
+      <property name="dependency"><inject bean="Dependency"/></property>
+   </interceptor>   
+</deployment>
\ No newline at end of file

Added: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_DeploymentStack.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_DeploymentStack.xml	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_DeploymentStack.xml	2008-02-26 11:59:03 UTC (rev 70091)
@@ -0,0 +1,12 @@
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+   <stack xmlns="urn:jboss:aop-beans:1.0" name="TestStack" manager-bean="ManagerBean" manager-property="ManagerProperty">
+      <stack-ref name="TestStack"/>
+      <advice name="advice" aspect="AdviceAspect"/>
+      <around name="around" aspect="AroundAspect"/>
+      <before name="before" aspect="BeforeAspect"/>
+      <after name="after" aspect="AfterAspect"/>
+      <throwing name="throwing" aspect="ThrowingAspect"/>
+      <finally name="finally" aspect="FinallyAspect"/>
+      <interceptor-ref name="Interceptor"/>
+   </stack>   
+</deployment>
\ No newline at end of file

Added: projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_DeploymentTypeDef.xml
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_DeploymentTypeDef.xml	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/resources/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase_DeploymentTypeDef.xml	2008-02-26 11:59:03 UTC (rev 70091)
@@ -0,0 +1,3 @@
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+   <typedef xmlns="urn:jboss:aop-beans:1.0" name="TypeDef" expr="class(org.jboss.test.microcontainer.beans.POJO)" manager-bean="ManagerBean" manager-property="ManagerProperty"/>
+</deployment>
\ No newline at end of file

Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/aop/junit/ForceJAXBAOPMicrocontainerTest.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/aop/junit/ForceJAXBAOPMicrocontainerTest.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/aop/junit/ForceJAXBAOPMicrocontainerTest.java	2008-02-26 11:59:03 UTC (rev 70091)
@@ -0,0 +1,52 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors. 
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/ 
+package org.jboss.test.aop.junit;
+
+import java.net.URL;
+
+import org.jboss.kernel.spi.deployment.KernelDeployment;
+import org.jboss.test.AbstractTestDelegate;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class ForceJAXBAOPMicrocontainerTest extends AOPMicrocontainerTest
+{
+   public ForceJAXBAOPMicrocontainerTest(String name)
+   {
+      super(name);
+   }
+
+   public static AbstractTestDelegate getDelegate(Class<?> clazz) throws Exception
+   {
+      AOPMicrocontainerTestDelegate delegate = (AOPMicrocontainerTestDelegate)AOPMicrocontainerTest.getDelegate(clazz);
+      delegate.useJaxbDeployer = true;
+      return delegate;
+   }
+
+   protected KernelDeployment unmarshal(final URL url) throws Exception 
+   {
+      return ((AOPMicrocontainerTestDelegate)getDelegate()).unmarshal(url);
+   }
+}

Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/aop/junit/JAXBDeployer.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/aop/junit/JAXBDeployer.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/aop/junit/JAXBDeployer.java	2008-02-26 11:59:03 UTC (rev 70091)
@@ -0,0 +1,141 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors. 
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/ 
+package org.jboss.test.aop.junit;
+
+import java.net.URL;
+
+import org.jboss.aop.microcontainer.beans.beanmetadatafactory.AOPDeployment;
+import org.jboss.dependency.spi.ControllerMode;
+import org.jboss.javabean.plugins.jaxb.JavaBean;
+import org.jboss.kernel.Kernel;
+import org.jboss.kernel.plugins.deployment.AbstractKernelDeployment;
+import org.jboss.kernel.plugins.deployment.xml.BasicXMLDeployer;
+import org.jboss.kernel.spi.deployment.KernelDeployment;
+import org.jboss.logging.Logger;
+import org.jboss.test.xb.builder.TestSchemaResolver;
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBinding;
+import org.jboss.xb.builder.JBossXBBuilder;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class JAXBDeployer extends BasicXMLDeployer
+{
+   /** The log */
+   private static final Logger log = Logger.getLogger(BasicXMLDeployer.class);
+   
+   JBossXBTestDelegate jbossXbTestDelegate;
+
+   public JAXBDeployer(Kernel kernel, ControllerMode mode, Class<?> clazz)
+   {
+      super(kernel, mode);
+      setupJaxbDelegate(clazz);
+   }
+
+   public JAXBDeployer(Kernel kernel, Class<?> clazz)
+   {
+      super(kernel);
+      setupJaxbDelegate(clazz);
+   }
+
+   private void setupJaxbDelegate(Class<?> clazz)
+   {
+      try
+      {
+         jbossXbTestDelegate = new JBossXBTestDelegate(clazz);
+         jbossXbTestDelegate.setUp();
+      }
+      catch (Exception e)
+      {
+         throw new RuntimeException(e);
+      }
+   }
+   
+   public KernelDeployment unmarshal(final URL url) throws Exception
+   {
+      TestSchemaResolver resolver = setupResolver();
+      
+      KernelDeployment deployment = (KernelDeployment)jbossXbTestDelegate.unmarshal(url.toString(), resolver);
+      
+      deployment.setName(url.toString());
+
+      return deployment;
+   }
+   
+   private TestSchemaResolver setupResolver()
+   {
+      TestSchemaResolver resolver = new TestSchemaResolver();
+      
+      addSchemaBinding(resolver, AbstractKernelDeployment.class);
+      addSchemaBinding(resolver, AOPDeployment.class);
+      addSchemaBinding(resolver, JavaBean.class);
+      
+      return resolver;
+   }
+
+   private SchemaBinding addSchemaBinding(TestSchemaResolver resolver, Class<?> clazz)
+   {
+      SchemaBinding binding = JBossXBBuilder.build(clazz);
+      resolver.addSchemaBinding(binding);
+      return binding;
+   }
+   /**
+    * Deploy a url
+    * 
+    * @param url the url to deploy
+    * @return the kernel deployment
+    * @throws Throwable for any error
+    */
+   public KernelDeployment deploy(final URL url) throws Throwable
+   {
+      final boolean trace = log.isTraceEnabled();
+
+      if (url == null)
+         throw new IllegalArgumentException("Null url");
+
+      if (trace)
+         log.trace("Parsing " + url);
+
+      long start = System.currentTimeMillis();
+
+      KernelDeployment deployment = unmarshal(url);
+      
+      if (trace)
+      {
+         long now = System.currentTimeMillis();
+         log.trace("Parsing " + url + " took " + (now-start) + " milliseconds");
+      }
+
+      deploy(deployment);
+
+      if (trace)
+      {
+         long now = System.currentTimeMillis();
+         log.trace("Deploying " + url + " took " + (now-start) + " milliseconds");
+      }
+
+      return deployment;
+   }
+
+}

Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/aop/junit/JBossXBTestDelegate.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/aop/junit/JBossXBTestDelegate.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/aop/junit/JBossXBTestDelegate.java	2008-02-26 11:59:03 UTC (rev 70091)
@@ -0,0 +1,72 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors. 
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/ 
+package org.jboss.test.aop.junit;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Method;
+
+import org.jboss.xb.binding.sunday.unmarshalling.SchemaBindingResolver;
+
+/**
+ * FIXME Temporary workaround since I cannot see the JBossXBTestDelegate 
+ * from container-test project with maven
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+class JBossXBTestDelegate
+{
+   Class<?> clazz;
+   Object delegate;
+   Method unmarshal;
+   
+   JBossXBTestDelegate(Class<?> clazz)
+   {
+      this.clazz = clazz;
+   }
+   
+   void setUp()
+   {
+      try
+      {
+         Class<?> delegate = Class.forName("org.jboss.test.xb.builder.JBossXBTestDelegate");
+         Constructor<?> ctor = delegate.getDeclaredConstructor(Class.class);
+         this.delegate = ctor.newInstance(clazz);
+         
+         Method setUp = delegate.getMethod("setUp");
+         setUp.invoke(this.delegate);
+
+         Class<?> resolver = Class.forName("org.jboss.xb.binding.sunday.unmarshalling.SchemaBindingResolver");
+         this.unmarshal = delegate.getMethod("unmarshal", String.class, resolver); 
+      }
+      catch (Exception e)
+      {
+         // AutoGenerated
+         throw new RuntimeException(e);
+      }
+   }
+
+   public Object unmarshal(String url, SchemaBindingResolver resolver) throws Exception
+   {
+      return unmarshal.invoke(delegate, url, resolver);
+   }
+}

Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans/test/AspectSimpleJaxbAopTestCase.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans/test/AspectSimpleJaxbAopTestCase.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans/test/AspectSimpleJaxbAopTestCase.java	2008-02-26 11:59:03 UTC (rev 70091)
@@ -0,0 +1,52 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.microcontainer.beans.test;
+
+import junit.framework.Test;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class AspectSimpleJaxbAopTestCase extends AspectSimpleTest
+{
+   public static Test suite()
+   {
+      System.setProperty("jboss.mc.jaxb", "true");
+      return suite(AspectSimpleJaxbAopTestCase.class);
+   }
+
+   @Override
+   protected void setUp() throws Exception
+   {
+      enableTrace("org.jboss.xb.builder");
+      super.setUp();
+   }
+
+
+
+   public AspectSimpleJaxbAopTestCase(String test)
+   {
+      super(test);
+   }
+}

Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans/test/AspectSimpleJaxbDeploymentTestCase.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans/test/AspectSimpleJaxbDeploymentTestCase.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/beans/test/AspectSimpleJaxbDeploymentTestCase.java	2008-02-26 11:59:03 UTC (rev 70091)
@@ -0,0 +1,45 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors. 
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/ 
+package org.jboss.test.microcontainer.beans.test;
+
+import junit.framework.Test;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class AspectSimpleJaxbDeploymentTestCase extends AspectSimpleTest
+{
+
+   public static Test suite()
+   {
+      System.setProperty("jboss.mc.jaxb", "true");
+      return suite(AspectSimpleJaxbDeploymentTestCase.class);
+   }
+
+   public AspectSimpleJaxbDeploymentTestCase(String name)
+   {
+      super(name);
+   }
+
+}

Added: projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase.java
===================================================================
--- projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase.java	                        (rev 0)
+++ projects/microcontainer/trunk/aop-mc-int/src/tests/org/jboss/test/microcontainer/jaxb/test/JAXBAnnotationSanityTestCase.java	2008-02-26 11:59:03 UTC (rev 70091)
@@ -0,0 +1,485 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors. 
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/ 
+package org.jboss.test.microcontainer.jaxb.test;
+
+import java.net.URL;
+import java.util.List;
+import java.util.Set;
+
+import junit.framework.Test;
+
+import org.jboss.aop.advice.AdviceType;
+import org.jboss.aop.microcontainer.beans.Aspect;
+import org.jboss.aop.microcontainer.beans.AspectBinding;
+import org.jboss.aop.microcontainer.beans.InterceptorEntry;
+import org.jboss.aop.microcontainer.beans.Stack;
+import org.jboss.aop.microcontainer.beans.StackEntry;
+import org.jboss.aop.microcontainer.beans.TypeDef;
+import org.jboss.beans.metadata.plugins.AbstractDependencyValueMetaData;
+import org.jboss.beans.metadata.plugins.AbstractPropertyMetaData;
+import org.jboss.beans.metadata.plugins.AbstractValueMetaData;
+import org.jboss.beans.metadata.plugins.factory.GenericBeanFactory;
+import org.jboss.beans.metadata.spi.BeanMetaData;
+import org.jboss.beans.metadata.spi.PropertyMetaData;
+import org.jboss.kernel.spi.deployment.KernelDeployment;
+import org.jboss.test.aop.junit.ForceJAXBAOPMicrocontainerTest;
+import org.jboss.test.microcontainer.beans.TestAspect;
+import org.jboss.test.microcontainer.beans.TestAspectWithDependency;
+import org.jboss.test.microcontainer.beans.TestInterceptorWithDependency;
+
+/**
+ * 
+ * @author <a href="kabir.khan at jboss.com">Kabir Khan</a>
+ * @version $Revision: 1.1 $
+ */
+public class JAXBAnnotationSanityTestCase  extends ForceJAXBAOPMicrocontainerTest
+{
+   public static Test suite()
+   {
+      return suite(JAXBAnnotationSanityTestCase.class);
+   }
+   
+   public JAXBAnnotationSanityTestCase(String name)
+   {
+      super(name);
+   }
+
+   @Override
+   protected void setUp() throws Exception
+   {
+      super.setUp();
+      enableTrace("org.jboss.xb.builder");
+   }
+
+   public void testAopAspectWithDefaultNameAndScope() throws Exception
+   {
+      checkAspectWithDefaultNameAndScope("JAXBAnnotationSanityTestCase_AopAspectWithDefaultNameAndScope.xml");
+   }
+   
+   public void testDeploymentAspectWithDefaultNameAndScope() throws Exception
+   {
+      checkAspectWithDefaultNameAndScope("JAXBAnnotationSanityTestCase_DeploymentAspectWithDefaultNameAndScope.xml");
+   }
+   
+   private void checkAspectWithDefaultNameAndScope(String name) throws Exception
+   {
+      List<BeanMetaData> beans = unmarshal(name, 2);
+      // <aspect class="org.jboss.test.microcontainer.beans.TestAspect"/> 
+      checkAspect(beans, TestAspect.class.getName(), TestAspect.class, null, "PER_VM", null, null);
+   }
+   
+   public void testAopAspectWithNameAndDefaultScope() throws Exception
+   {
+      checkAspectWithNameAndDefaultScope("JAXBAnnotationSanityTestCase_AopAspectWithNameAndDefaultScope.xml");
+   }
+
+   public void testDeploymentAspectWithNameAndDefaultScope() throws Exception
+   {
+      checkAspectWithNameAndDefaultScope("JAXBAnnotationSanityTestCase_DeploymentAspectWithNameAndDefaultScope.xml");
+   }
+
+   private void checkAspectWithNameAndDefaultScope(String name) throws Exception
+   {
+      List<BeanMetaData> beans = unmarshal(name, 2);
+      // <aspect name="named" class="org.jboss.test.microcontainer.beans.TestAspect"/> 
+      checkAspect(beans, "named", TestAspect.class, null, "PER_VM", null, null);
+   }
+
+   public void testAopAspectWithNameAndScope() throws Exception
+   {
+      checkAspectWithNameAndScope("JAXBAnnotationSanityTestCase_AopAspectWithNameAndScope.xml");
+   }
+
+   public void testDeploymentAspectWithNameAndScope() throws Exception
+   {
+      checkAspectWithNameAndScope("JAXBAnnotationSanityTestCase_DeploymentAspectWithNameAndScope.xml");
+   }
+
+   private void checkAspectWithNameAndScope(String name) throws Exception
+   {
+      List<BeanMetaData> beans = unmarshal(name, 2);
+      // <aspect name="withscope" class="org.jboss.test.microcontainer.beans.TestAspect" scope="PER_INSTANCE"/>
+      checkAspect(beans, "withscope", TestAspect.class, null, "PER_INSTANCE", null, null);
+   }
+
+   public void testAopAspectWithFactory() throws Exception
+   {
+      checkAspectWithFactory("JAXBAnnotationSanityTestCase_AopAspectWithFactory.xml");
+   }   
+   
+   public void testDeploymentAspectWithFactory() throws Exception
+   {
+      checkAspectWithFactory("JAXBAnnotationSanityTestCase_DeploymentAspectWithFactory.xml");
+   }   
+   
+   private void checkAspectWithFactory(String name) throws Exception
+   {
+      List<BeanMetaData> beans = unmarshal(name, 2);
+      // <aspect name="withfactory" factory="org.jboss.test.microcontainer.beans.TestAspect"/>
+      checkAspect(beans, "withfactory", null, TestAspect.class, "PER_VM", null, null);
+   }   
+   
+   public void testAopAspectWithManagerBean() throws Exception
+   {
+      checkAspectWithManagerBean("JAXBAnnotationSanityTestCase_AopAspectWithManagerBean.xml");
+   }
+   
+   public void testDeploymentAspectWithManagerBean() throws Exception
+   {
+      checkAspectWithManagerBean("JAXBAnnotationSanityTestCase_DeploymentAspectWithManagerBean.xml");
+   }
+   
+   private void checkAspectWithManagerBean(String name) throws Exception
+   {
+      List<BeanMetaData> beans = unmarshal(name, 2);
+      // <aspect name="withmanagerbean" class="org.jboss.test.microcontainer.beans.TestAspect" manager-bean="CustomManager"/> - 2 beans
+      checkAspect(beans, "withmanagerbean", TestAspect.class, null, "PER_VM", "CustomManager", null);
+   }
+   
+   public void testAopAspectWithManagerProperty() throws Exception
+   {
+      checkAspectWithManagerProperty("JAXBAnnotationSanityTestCase_AopAspectWithManagerProperty.xml");
+   }
+   
+   public void testDeploymentAspectWithManagerProperty() throws Exception
+   {
+      checkAspectWithManagerProperty("JAXBAnnotationSanityTestCase_DeploymentAspectWithManagerProperty.xml");
+   }
+   
+   private void checkAspectWithManagerProperty(String name) throws Exception
+   {
+      List<BeanMetaData> beans = unmarshal(name, 2);
+      // <aspect name="withmanagerproperty" class="org.jboss.test.microcontainer.beans.TestAspect" manager-bean="CustomManager" manager-property="property"/>
+      checkAspect(beans, "withmanagerproperty", TestAspect.class, null, "PER_VM", "CustomManager", "property");
+   }
+   
+   public void testAopAspectWithDependency() throws Exception
+   {
+      checkAspectWithDependency("JAXBAnnotationSanityTestCase_AopAspectWithDependency.xml");
+   }
+
+   public void testDeploymentAspectWithDependency() throws Exception
+   {
+      checkAspectWithDependency("JAXBAnnotationSanityTestCase_DeploymentAspectWithDependency.xml");
+   }
+
+   private void checkAspectWithDependency(String name) throws Exception
+   {
+      List<BeanMetaData> beans = unmarshal(name, 2);
+      // <aop:aspect name="withdependency" class="org.jboss.test.microcontainer.beans.TestAspectWithDependency"> - 2 beans
+      //    <property name="dependency"><inject bean="Dependency"/></property>
+      // </aop:aspect>
+      checkAspect(beans, "withdependency", TestAspectWithDependency.class, null, "PER_VM", null, null);
+      checkDependency(beans, "Factory$withdependency", "dependency", "Dependency", null);
+   }
+
+   public void testAopInterceptorWithDependency() throws Exception
+   {
+      checkInterceptorWithDependency("JAXBAnnotationSanityTestCase_AopInterceptorWithDependency.xml");
+   }
+
+   public void testDeploymentInterceptorWithDependency() throws Exception
+   {
+      checkInterceptorWithDependency("JAXBAnnotationSanityTestCase_DeploymentInterceptorWithDependency.xml");
+   }
+
+   private void checkInterceptorWithDependency(String name) throws Exception
+   {
+      List<BeanMetaData> beans = unmarshal(name, 2);
+      // <aop:Interceptor name="withdependency" class="org.jboss.test.microcontainer.beans.TestInterceptorWithDependency"> - 2 beans
+      //    <property name="dependency"><inject bean="Dependency"/></property>
+      // </aop:Interceptor>
+      checkAspect(beans, "withdependency", TestInterceptorWithDependency.class, null, "PER_VM", null, null);
+      checkDependency(beans, "Factory$withdependency", "dependency", "Dependency", null);
+   }
+
+   public void testAopAspectAndBean() throws Exception
+   {
+      checkAspectAndBean("JAXBAnnotationSanityTestCase_AopAspectAndBean.xml");
+   }
+
+   public void testDeploymentAspectAndBean() throws Exception
+   {
+      checkAspectAndBean("JAXBAnnotationSanityTestCase_DeploymentAspectAndBean.xml");
+   }
+
+   private void checkAspectAndBean(String name) throws Exception
+   {
+      List<BeanMetaData> beans = unmarshal(name, 5);
+      // <aspect xmlns="urn:jboss:aop-beans:1.0" name="aspect" class="org.jboss.test.microcontainer.beans.TestAspect"/>
+      // <bean name="bean1" class="Bean1"/>
+      // <bean name="bean2" class="Bean2"/>
+      // <bean name="bean3" class="Bean3"/>
+      checkAspect(beans, "aspect", TestAspect.class, null, "PER_VM", null, null);
+      checkBeanByName(beans, "bean1", "Bean1");
+      checkBeanByName(beans, "bean2", "Bean2");
+      checkBeanByName(beans, "bean3", "Bean3");
+   }
+
+   public void testAopBind() throws Exception
+   {
+      checkBind("JAXBAnnotationSanityTestCase_AopBind.xml");
+   }
+
+   public void testDeploymentBind() throws Exception
+   {
+      checkBind("JAXBAnnotationSanityTestCase_DeploymentBind.xml");
+   }
+
+   private void checkBind(String name) throws Exception
+   {
+      List<BeanMetaData> beans = unmarshal(name, 9);
+
+      BeanMetaData bind = checkBeanByName(beans, "binding", AspectBinding.class.getName());
+      assertEquals("all(Blah)", getSimpleProperty(bind, "pointcut"));
+      assertEquals("hello", getSimpleProperty(bind, "cflow"));
+      checkDependency(bind, "manager", "ManagerBean", "ManagerProperty");
+      //TODO Check we have references to the interceptors/stacks
+      
+      BeanMetaData stackRef = checkBeanByName(beans, "binding$0", StackEntry.class.getName());
+      assertEquals("TestStack", getSimpleProperty(stackRef, "stack"));
+      checkDependency(stackRef, "binding", "binding", null);
+      
+      BeanMetaData adviceRef = checkBeanByName(beans, "binding$1", InterceptorEntry.class.getName());
+      assertEquals(AdviceType.AROUND, getSimpleProperty(adviceRef, "type"));
+      checkDependency(adviceRef, "aspect", "AdviceAspect", null);
+      assertEquals("advice", getSimpleProperty(adviceRef, "aspectMethod"));
+      
+      BeanMetaData aroundRef = checkBeanByName(beans, "binding$2", InterceptorEntry.class.getName());
+      assertEquals(AdviceType.AROUND, getSimpleProperty(aroundRef, "type"));
+      checkDependency(aroundRef, "aspect", "AroundAspect", null);
+      assertEquals("around", getSimpleProperty(aroundRef, "aspectMethod"));
+      
+      BeanMetaData beforeRef = checkBeanByName(beans, "binding$3", InterceptorEntry.class.getName());
+      assertEquals(AdviceType.BEFORE, getSimpleProperty(beforeRef, "type"));
+      checkDependency(beforeRef, "aspect", "BeforeAspect", null);
+      assertEquals("before", getSimpleProperty(beforeRef, "aspectMethod"));
+      
+      BeanMetaData afterRef = checkBeanByName(beans, "binding$4", InterceptorEntry.class.getName());
+      assertEquals(AdviceType.AFTER, getSimpleProperty(afterRef, "type"));
+      checkDependency(afterRef, "aspect", "AfterAspect", null);
+      assertEquals("after", getSimpleProperty(afterRef, "aspectMethod"));
+      
+      BeanMetaData throwingRef = checkBeanByName(beans, "binding$5", InterceptorEntry.class.getName());
+      assertEquals(AdviceType.THROWING, getSimpleProperty(throwingRef, "type"));
+      checkDependency(throwingRef, "aspect", "ThrowingAspect", null);
+      assertEquals("throwing", getSimpleProperty(throwingRef, "aspectMethod"));
+      
+      BeanMetaData finallyRef = checkBeanByName(beans, "binding$6", InterceptorEntry.class.getName());
+      assertEquals(AdviceType.FINALLY, getSimpleProperty(finallyRef, "type"));
+      checkDependency(finallyRef, "aspect", "FinallyAspect", null);
+      assertEquals("finally", getSimpleProperty(finallyRef, "aspectMethod"));
+      
+      BeanMetaData interceptorRef = checkBeanByName(beans, "binding$7", InterceptorEntry.class.getName());
+      assertEquals(AdviceType.AROUND, getSimpleProperty(interceptorRef, "type"));
+      checkDependency(interceptorRef, "aspect", "Interceptor", null);
+      assertEquals(null, getSimpleProperty(interceptorRef, "aspectMethod"));
+      
+   }
+
+   public void testAopStack() throws Exception
+   {
+      checkStack("JAXBAnnotationSanityTestCase_AopStack.xml");
+   }
+
+   public void testDeploymentStack() throws Exception
+   {
+      checkStack("JAXBAnnotationSanityTestCase_DeploymentStack.xml");
+   }
+
+   private void checkStack(String name) throws Exception
+   {
+      List<BeanMetaData> beans = unmarshal(name, 9);
+
+      BeanMetaData stack = checkBeanByName(beans, "TestStack", Stack.class.getName());
+      checkDependency(stack, "manager", "ManagerBean", "ManagerProperty");
+      //TODO Check we have references to the interceptors/stacks
+      
+      BeanMetaData stackRef = checkBeanByName(beans, "TestStack$0", StackEntry.class.getName());
+      assertEquals("TestStack", getSimpleProperty(stackRef, "stack"));
+      assertEquals(Boolean.TRUE, getSimpleProperty(stackRef, "forStack"));
+      
+      BeanMetaData adviceRef = checkBeanByName(beans, "TestStack$1", InterceptorEntry.class.getName());
+      assertEquals(AdviceType.AROUND, getSimpleProperty(adviceRef, "type"));
+      checkDependency(adviceRef, "aspect", "AdviceAspect", null);
+      assertEquals("advice", getSimpleProperty(adviceRef, "aspectMethod"));
+      
+      BeanMetaData aroundRef = checkBeanByName(beans, "TestStack$2", InterceptorEntry.class.getName());
+      assertEquals(AdviceType.AROUND, getSimpleProperty(aroundRef, "type"));
+      checkDependency(aroundRef, "aspect", "AroundAspect", null);
+      assertEquals("around", getSimpleProperty(aroundRef, "aspectMethod"));
+      
+      BeanMetaData beforeRef = checkBeanByName(beans, "TestStack$3", InterceptorEntry.class.getName());
+      assertEquals(AdviceType.BEFORE, getSimpleProperty(beforeRef, "type"));
+      checkDependency(beforeRef, "aspect", "BeforeAspect", null);
+      assertEquals("before", getSimpleProperty(beforeRef, "aspectMethod"));
+      
+      BeanMetaData afterRef = checkBeanByName(beans, "TestStack$4", InterceptorEntry.class.getName());
+      assertEquals(AdviceType.AFTER, getSimpleProperty(afterRef, "type"));
+      checkDependency(afterRef, "aspect", "AfterAspect", null);
+      assertEquals("after", getSimpleProperty(afterRef, "aspectMethod"));
+      
+      BeanMetaData throwingRef = checkBeanByName(beans, "TestStack$5", InterceptorEntry.class.getName());
+      assertEquals(AdviceType.THROWING, getSimpleProperty(throwingRef, "type"));
+      checkDependency(throwingRef, "aspect", "ThrowingAspect", null);
+      assertEquals("throwing", getSimpleProperty(throwingRef, "aspectMethod"));
+      
+      BeanMetaData finallyRef = checkBeanByName(beans, "TestStack$6", InterceptorEntry.class.getName());
+      assertEquals(AdviceType.FINALLY, getSimpleProperty(finallyRef, "type"));
+      checkDependency(finallyRef, "aspect", "FinallyAspect", null);
+      assertEquals("finally", getSimpleProperty(finallyRef, "aspectMethod"));
+      
+      BeanMetaData interceptorRef = checkBeanByName(beans, "TestStack$7", InterceptorEntry.class.getName());
+      assertEquals(AdviceType.AROUND, getSimpleProperty(interceptorRef, "type"));
+      checkDependency(interceptorRef, "aspect", "Interceptor", null);
+      assertEquals(null, getSimpleProperty(interceptorRef, "aspectMethod"));
+      
+   }
+
+   public void testAopTypeDef() throws Exception
+   {
+      checkTypeDef("JAXBAnnotationSanityTestCase_AopTypeDef.xml");
+   }
+
+   public void testDeploymentTypeDef() throws Exception
+   {
+      checkTypeDef("JAXBAnnotationSanityTestCase_DeploymentTypeDef.xml");
+   }
+
+   private void checkTypeDef(String name) throws Exception
+   {
+      List<BeanMetaData> beans = unmarshal(name, 1);
+
+      BeanMetaData typedef = checkBeanByName(beans, "TypeDef", TypeDef.class.getName());
+      assertEquals("class(org.jboss.test.microcontainer.beans.POJO)", getSimpleProperty(typedef, "expr"));
+      checkDependency(typedef, "manager", "ManagerBean", "ManagerProperty");
+      //TODO Check we have references to the interceptors/stacks
+   }
+
+   private void checkAspect(List<BeanMetaData> beans, String name, Class<?> aspectClass, Class<?> factoryClass, String scope, String managerBean, String managerProperty)
+   {
+      if (aspectClass == null && factoryClass == null)
+      {
+         throw new RuntimeException("Must have either aspectClass or factoryClass");
+      }
+      BeanMetaData aspect = checkBeanByName(beans, name, Aspect.class.getName());
+      assertEquals(scope, getSimpleProperty(aspect, "scope"));
+      Boolean isfactory = factoryClass != null ? Boolean.TRUE : null;
+      assertEquals(isfactory, getSimpleProperty(aspect, "factory"));
+
+      
+      BeanMetaData beanfactory = getBeanByName(beans, "Factory$" + name);
+      assertEquals(GenericBeanFactory.class.getName(), beanfactory.getBean());
+     
+      String aspectClassName = aspectClass == null ? factoryClass.getName() : aspectClass.getName();
+      assertEquals(aspectClassName, getSimpleProperty(beanfactory, "bean"));
+
+      if (managerBean != null || managerProperty != null)
+      {
+         checkDependency(aspect, "manager", managerBean, managerProperty);
+      }
+   }
+   
+   private BeanMetaData checkBeanByName(List<BeanMetaData> beans, String name, String classname)
+   {
+      BeanMetaData bean = getBeanByName(beans, name);
+      assertEquals(classname, bean.getBean());
+      return bean;
+   }
+   
+   private BeanMetaData getBeanByName(List<BeanMetaData> beans, String name)
+   {
+      for (BeanMetaData bean : beans)
+      {
+         assertNotNull(bean.getName(), bean + " has no name");
+         if (bean.getName().equals(name))
+         {
+            return bean;
+         }
+      }
+      
+      fail("No bean found with name '" + name + "'");
+      return null;
+   }
+   
+   private Object getSimpleProperty(BeanMetaData bean, String name)
+   {
+      Set<PropertyMetaData> pmd = bean.getProperties();
+      for (PropertyMetaData data : pmd)
+      {
+         if (data instanceof AbstractPropertyMetaData)
+         {
+            AbstractPropertyMetaData apmd = (AbstractPropertyMetaData)data;
+            if (name.equals(apmd.getName()))
+            {
+               AbstractValueMetaData avmd = (AbstractValueMetaData)apmd.getValue();
+               return avmd.getUnderlyingValue();
+            }
+            
+         }
+      }
+      return null;
+   }
+   
+   private void checkDependency(List<BeanMetaData> beans, String beanName, String name, String value, String property)
+   {
+      BeanMetaData bean = getBeanByName(beans, beanName);
+      checkDependency(bean, name, value, property);
+   }
+   
+   private void checkDependency(BeanMetaData bean, String name, String value, String property)
+   {
+      AbstractDependencyValueMetaData dependency = getDependencyProperty(bean, name);
+      assertNotNull(dependency);
+      assertEquals(value, dependency.getValue());
+      assertEquals(property, dependency.getProperty());
+   }
+   
+   private AbstractDependencyValueMetaData getDependencyProperty(BeanMetaData bean, String name)
+   {
+      Set<PropertyMetaData> pmd = bean.getProperties();
+      for (PropertyMetaData data : pmd)
+      {
+         if (data instanceof AbstractPropertyMetaData)
+         {
+            AbstractPropertyMetaData apmd = (AbstractPropertyMetaData)data;
+            if (name.equals(apmd.getName()))
+            {
+               return (AbstractDependencyValueMetaData)apmd.getValue();
+            }
+         }
+      }
+      return null;
+   }
+   
+   private List<BeanMetaData> unmarshal(String name, int expectedBeans) throws Exception
+   {
+      URL url = getClass().getResource(name);
+      assertNotNull(url);
+      KernelDeployment deployment = unmarshal(url);
+      List<BeanMetaData> beans = deployment.getBeans();
+      assertNotNull(beans);
+      assertEquals(expectedBeans, beans.size());
+      return beans;
+   }
+   
+}




More information about the jboss-cvs-commits mailing list